1 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
2 |
|
3 | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
4 |
|
5 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
6 |
|
7 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
8 |
|
9 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 | import AbstractSeries from './abstract-series';
|
32 | import BarSeries from './bar-series-canvas';
|
33 |
|
34 | var HorizontalBarSeriesCanvas = function (_AbstractSeries) {
|
35 | _inherits(HorizontalBarSeriesCanvas, _AbstractSeries);
|
36 |
|
37 | function HorizontalBarSeriesCanvas() {
|
38 | _classCallCheck(this, HorizontalBarSeriesCanvas);
|
39 |
|
40 | return _possibleConstructorReturn(this, (HorizontalBarSeriesCanvas.__proto__ || Object.getPrototypeOf(HorizontalBarSeriesCanvas)).apply(this, arguments));
|
41 | }
|
42 |
|
43 | _createClass(HorizontalBarSeriesCanvas, [{
|
44 | key: 'render',
|
45 | value: function render() {
|
46 | return null;
|
47 | }
|
48 | }], [{
|
49 | key: 'getParentConfig',
|
50 | value: function getParentConfig(attr) {
|
51 | var isDomainAdjustmentNeeded = attr === 'y';
|
52 | var zeroBaseValue = attr === 'x';
|
53 | return {
|
54 | isDomainAdjustmentNeeded: isDomainAdjustmentNeeded,
|
55 | zeroBaseValue: zeroBaseValue
|
56 | };
|
57 | }
|
58 | }, {
|
59 | key: 'renderLayer',
|
60 | value: function renderLayer(props, ctx) {
|
61 | BarSeries.renderLayer(_extends({}, props, {
|
62 | linePosAttr: 'y',
|
63 | valuePosAttr: 'x',
|
64 | lineSizeAttr: 'height',
|
65 | valueSizeAttr: 'width'
|
66 | }), ctx);
|
67 | }
|
68 | }, {
|
69 | key: 'requiresSVG',
|
70 | get: function get() {
|
71 | return false;
|
72 | }
|
73 | }, {
|
74 | key: 'isCanvas',
|
75 | get: function get() {
|
76 | return true;
|
77 | }
|
78 | }]);
|
79 |
|
80 | return HorizontalBarSeriesCanvas;
|
81 | }(AbstractSeries);
|
82 |
|
83 | HorizontalBarSeriesCanvas.displayName = 'HorizontalBarSeriesCanvas';
|
84 | HorizontalBarSeriesCanvas.propTypes = _extends({}, AbstractSeries.propTypes);
|
85 |
|
86 | export default HorizontalBarSeriesCanvas; |
\ | No newline at end of file |