@pie-lib/charting 4.5.12 → 4.5.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.json CHANGED
@@ -534,6 +534,21 @@
534
534
  "isTagged": true,
535
535
  "tag": "@pie-lib/charting@4.5.10"
536
536
  },
537
+ {
538
+ "type": "fix",
539
+ "scope": "charting",
540
+ "subject": "Displayed the entire rightmost category label when space available PD-531",
541
+ "merge": null,
542
+ "header": "fix(charting): Displayed the entire rightmost category label when space available PD-531",
543
+ "body": null,
544
+ "footer": null,
545
+ "notes": [],
546
+ "hash": "4c96415952e13e789f5b67cf99e6a17d957a06e7",
547
+ "gitTags": " (origin/fix/PD-531)",
548
+ "committerDate": "2021-09-10 14:19:05 +0300",
549
+ "isTagged": true,
550
+ "tag": "@pie-lib/charting@4.5.13"
551
+ },
537
552
  {
538
553
  "type": "fix",
539
554
  "scope": "charting",
package/CHANGELOG.md CHANGED
@@ -3,6 +3,36 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [4.5.15](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@4.5.14...@pie-lib/charting@4.5.15) (2022-05-10)
7
+
8
+ **Note:** Version bump only for package @pie-lib/charting
9
+
10
+
11
+
12
+
13
+
14
+ ## [4.5.14](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@4.5.13...@pie-lib/charting@4.5.14) (2022-03-21)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **charting:** Added custom modulo function to work with decimals PD-1645 ([70951ef](https://github.com/pie-framework/pie-lib/commit/70951ef055630f217094a42ec2d15282cf680c6b))
20
+
21
+
22
+
23
+
24
+
25
+ ## [4.5.13](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@4.5.12...@pie-lib/charting@4.5.13) (2021-09-10)
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * **charting:** Displayed the entire rightmost category label when space available PD-531 ([4c96415](https://github.com/pie-framework/pie-lib/commit/4c96415))
31
+
32
+
33
+
34
+
35
+
6
36
  ## [4.5.12](https://github.com/pie-framework/pie-lib/compare/@pie-lib/charting@4.5.11...@pie-lib/charting@4.5.12) (2021-09-08)
7
37
 
8
38
  **Note:** Version bump only for package @pie-lib/charting
package/lib/axes.js CHANGED
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
 
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
6
- exports["default"] = exports.RawChartAxes = exports.TickComponent = void 0;
8
+ exports["default"] = exports.TickComponent = exports.RawChartAxes = void 0;
7
9
 
8
10
  var _react = _interopRequireDefault(require("react"));
9
11
 
@@ -23,46 +25,50 @@ var _markLabel = _interopRequireDefault(require("./mark-label"));
23
25
 
24
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
25
27
 
26
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
28
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
29
+
30
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
27
31
 
28
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
32
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
29
33
 
30
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
34
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
31
35
 
32
- function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
36
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
33
37
 
34
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
38
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
35
39
 
36
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
40
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
37
41
 
38
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
42
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
39
43
 
40
44
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
41
45
 
42
46
  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); } }
43
47
 
44
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
48
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
45
49
 
46
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
50
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
47
51
 
48
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
52
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
53
+
54
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
55
+
56
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
49
57
 
50
58
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
51
59
 
52
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
60
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
53
61
 
54
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
62
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
55
63
 
56
64
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
57
65
 
58
- var TickComponent =
59
- /*#__PURE__*/
60
- function (_React$Component) {
66
+ var TickComponent = /*#__PURE__*/function (_React$Component) {
61
67
  _inherits(TickComponent, _React$Component);
62
68
 
63
- function TickComponent() {
64
- var _getPrototypeOf2;
69
+ var _super = _createSuper(TickComponent);
65
70
 
71
+ function TickComponent() {
66
72
  var _this;
67
73
 
68
74
  _classCallCheck(this, TickComponent);
@@ -71,14 +77,14 @@ function (_React$Component) {
71
77
  args[_key] = arguments[_key];
72
78
  }
73
79
 
74
- _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(TickComponent)).call.apply(_getPrototypeOf2, [this].concat(args)));
80
+ _this = _super.call.apply(_super, [this].concat(args));
75
81
 
76
82
  _defineProperty(_assertThisInitialized(_this), "changeCategory", function (index, newLabel) {
77
83
  var _this$props = _this.props,
78
84
  categories = _this$props.categories,
79
85
  onChangeCategory = _this$props.onChangeCategory;
80
86
  var category = categories[index];
81
- onChangeCategory(index, _objectSpread({}, category, {
87
+ onChangeCategory(index, _objectSpread(_objectSpread({}, category), {}, {
82
88
  label: newLabel
83
89
  }));
84
90
  });
@@ -137,7 +143,7 @@ function (_React$Component) {
137
143
  return lengthA > lengthB ? a : b;
138
144
  });
139
145
  var longestLabel = longestCategory && longestCategory.label || '';
140
- return _react["default"].createElement("g", null, _react["default"].createElement("foreignObject", {
146
+ return /*#__PURE__*/_react["default"].createElement("g", null, /*#__PURE__*/_react["default"].createElement("foreignObject", {
141
147
  x: bandWidth ? barX : x - barWidth / 2,
142
148
  y: 6,
143
149
  width: barWidth,
@@ -146,7 +152,7 @@ function (_React$Component) {
146
152
  pointerEvents: 'none',
147
153
  overflow: 'visible'
148
154
  }
149
- }, index === 0 && _react["default"].createElement("div", {
155
+ }, index === 0 && /*#__PURE__*/_react["default"].createElement("div", {
150
156
  id: "hiddenLabel",
151
157
  style: {
152
158
  position: 'absolute',
@@ -156,7 +162,7 @@ function (_React$Component) {
156
162
  maxWidth: barWidth,
157
163
  display: 'block'
158
164
  }
159
- }, longestLabel), _react["default"].createElement(_markLabel["default"], {
165
+ }, longestLabel), /*#__PURE__*/_react["default"].createElement(_markLabel["default"], {
160
166
  inputRef: function inputRef(r) {
161
167
  return _this2.input = r;
162
168
  },
@@ -169,14 +175,14 @@ function (_React$Component) {
169
175
  barWidth: barWidth,
170
176
  rotate: rotate,
171
177
  correctness: correctness
172
- })), deletable && !correctness && _react["default"].createElement("line", {
178
+ })), deletable && !correctness && /*#__PURE__*/_react["default"].createElement("line", {
173
179
  x1: x,
174
180
  y1: 0,
175
181
  x2: x,
176
182
  y2: y + 4 + top,
177
183
  className: classes.dottedLine,
178
184
  strokeDasharray: "4 2"
179
- }), deletable && !correctness && _react["default"].createElement("svg", {
185
+ }), deletable && !correctness && /*#__PURE__*/_react["default"].createElement("svg", {
180
186
  xmlns: "http://www.w3.org/2000/svg",
181
187
  x: x - 8,
182
188
  y: y + 10 + top,
@@ -186,7 +192,7 @@ function (_React$Component) {
186
192
  onClick: function onClick() {
187
193
  return _this2.deleteCategory(index);
188
194
  }
189
- }, _react["default"].createElement("path", {
195
+ }, /*#__PURE__*/_react["default"].createElement("path", {
190
196
  d: "M128 405.429C128 428.846 147.198 448 170.667 448h170.667C364.802 448 384 428.846 384 405.429V160H128v245.429zM416 96h-80l-26.785-32H202.786L176 96H96v32h320V96z"
191
197
  })));
192
198
  }
@@ -212,14 +218,12 @@ TickComponent.propTypes = {
212
218
  classes: _propTypes["default"].object
213
219
  };
214
220
 
215
- var RawChartAxes =
216
- /*#__PURE__*/
217
- function (_React$Component2) {
221
+ var RawChartAxes = /*#__PURE__*/function (_React$Component2) {
218
222
  _inherits(RawChartAxes, _React$Component2);
219
223
 
220
- function RawChartAxes() {
221
- var _getPrototypeOf3;
224
+ var _super2 = _createSuper(RawChartAxes);
222
225
 
226
+ function RawChartAxes() {
223
227
  var _this3;
224
228
 
225
229
  _classCallCheck(this, RawChartAxes);
@@ -228,7 +232,7 @@ function (_React$Component2) {
228
232
  args[_key2] = arguments[_key2];
229
233
  }
230
234
 
231
- _this3 = _possibleConstructorReturn(this, (_getPrototypeOf3 = _getPrototypeOf(RawChartAxes)).call.apply(_getPrototypeOf3, [this].concat(args)));
235
+ _this3 = _super2.call.apply(_super2, [this].concat(args));
232
236
 
233
237
  _defineProperty(_assertThisInitialized(_this3), "state", {
234
238
  height: 0
@@ -279,7 +283,7 @@ function (_React$Component2) {
279
283
  var bandWidth = xBand && typeof xBand.bandwidth === 'function' && xBand.bandwidth(); // for chartType "line", bandWidth will be 0, so we have to calculate it
280
284
 
281
285
  var barWidth = bandWidth || scale.x && scale.x(domain.max) / categories.length;
282
- var rowTickValues = (0, _utils.getTickValues)(_objectSpread({}, range, {
286
+ var rowTickValues = (0, _utils.getTickValues)(_objectSpread(_objectSpread({}, range), {}, {
283
287
  step: range.labelStep
284
288
  }));
285
289
  var fontSize = theme && theme.typography ? theme.typography.fontSize : 14;
@@ -308,10 +312,10 @@ function (_React$Component2) {
308
312
  y: props.y,
309
313
  formattedValue: props.formattedValue
310
314
  };
311
- return _react["default"].createElement(TickComponent, properties);
315
+ return /*#__PURE__*/_react["default"].createElement(TickComponent, properties);
312
316
  };
313
317
 
314
- return _react["default"].createElement(_react["default"].Fragment, null, leftAxis && _react["default"].createElement(_axis.AxisLeft, {
318
+ return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, leftAxis && /*#__PURE__*/_react["default"].createElement(_axis.AxisLeft, {
315
319
  scale: scale.y,
316
320
  className: axis,
317
321
  axisLineClassName: axisLine,
@@ -324,7 +328,7 @@ function (_React$Component2) {
324
328
  labelClassName: axisLabel,
325
329
  tickValues: rowTickValues,
326
330
  tickLabelProps: getTickLabelProps
327
- }), _react["default"].createElement(_axis.AxisBottom, {
331
+ }), /*#__PURE__*/_react["default"].createElement(_axis.AxisBottom, {
328
332
  axisLineClassName: axisLine,
329
333
  labelClassName: axisLabel,
330
334
  tickClassName: tick,
package/lib/axes.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/axes.jsx"],"names":["TickComponent","index","newLabel","props","categories","onChangeCategory","category","label","onChange","slice","classes","xBand","bandWidth","barWidth","rotate","top","graphProps","x","y","formattedValue","parseInt","split","deletable","editable","interactive","correctness","barX","longestCategory","reduce","a","b","lengthA","length","lengthB","longestLabel","pointerEvents","overflow","position","visibility","wordBreak","maxWidth","display","r","input","changeCategory","dottedLine","deleteCategory","React","Component","propTypes","PropTypes","array","func","number","object","string","RawChartAxes","height","document","getElementById","offsetHeight","setState","leftAxis","theme","axis","axisLine","tick","axisLabel","scale","range","domain","size","state","bottomScale","rangeRound","width","bandwidth","max","rowTickValues","step","labelStep","fontSize","typography","getTickLabelProps","value","dy","dx","toLocaleString","getTickComponent","properties","min","textAnchor","count","isRequired","types","GraphPropsType","bool","ChartAxes","fontFamily","body1","fill","color","secondary","stroke","primaryDark","strokeWidth","primaryLight","opacity","withTheme"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEaA,a;;;;;;;;;;;;;;;;;;qEACM,UAACC,KAAD,EAAQC,QAAR,EAAqB;AAAA,wBACK,MAAKC,KADV;AAAA,UAC5BC,UAD4B,eAC5BA,UAD4B;AAAA,UAChBC,gBADgB,eAChBA,gBADgB;AAEpC,UAAMC,QAAQ,GAAGF,UAAU,CAACH,KAAD,CAA3B;AAEAI,MAAAA,gBAAgB,CAACJ,KAAD,oBAAaK,QAAb;AAAuBC,QAAAA,KAAK,EAAEL;AAA9B,SAAhB;AACD,K;;qEAEgB,UAAAD,KAAK,EAAI;AAAA,yBACS,MAAKE,KADd;AAAA,UAChBC,UADgB,gBAChBA,UADgB;AAAA,UACJI,QADI,gBACJA,QADI;;AAGxB,UAAIP,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AAETjB,MAAAA,QAAQ,EAAElB,KAAK,CAACmB,UAAN,CAAiBD,QAFlB;AAGTmB,MAAAA,IAAI,EAAEC,gBAAMC,SAAN;AAHG,KADH;AAMRtC,IAAAA,IAAI,EAAE;AACJuC,MAAAA,MAAM,EAAEF,gBAAMG,WAAN,EADJ;AAEJC,MAAAA,WAAW,EAAE;AAFT,KANE;AAURxC,IAAAA,QAAQ,EAAE;AACRsC,MAAAA,MAAM,EAAEF,gBAAMG,WAAN,EADA;AAERC,MAAAA,WAAW,EAAE;AAFL,KAVF;AAcRvC,IAAAA,IAAI,EAAE;AACJ,kBAAY;AACVqC,QAAAA,MAAM,EAAEF,gBAAMG,WAAN,EADE;AAEVC,QAAAA,WAAW,EAAE;AAFH,OADR;AAKJL,MAAAA,IAAI,EAAEC,gBAAMG,WAAN,EALF;AAMJN,MAAAA,UAAU,EAAEnC,KAAK,CAACmB,UAAN,CAAiBiB,KAAjB,CAAuBD,UAN/B;AAOJjB,MAAAA,QAAQ,EAAElB,KAAK,CAACmB,UAAN,CAAiBD,QAPvB;AAQJU,MAAAA,UAAU,EAAE;AARR,KAdE;AAwBR9C,IAAAA,UAAU,EAAE;AACV0D,MAAAA,MAAM,EAAEF,gBAAMK,YAAN,EADE;AAEVC,MAAAA,OAAO,EAAE;AAFC;AAxBJ,GAAL;AAAA,CADW,EA8BhB;AAAEC,EAAAA,SAAS,EAAE;AAAb,CA9BgB,EA+BhBpD,YA/BgB,CAAlB;eAiCeyC,S","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport { types } from '@pie-lib/plot';\nimport { color } from '@pie-lib/render-ui';\nimport { AxisLeft, AxisBottom } from '@vx/axis';\nimport { bandKey, getTickValues, getRotateAngle } from './utils';\nimport MarkLabel from './mark-label';\n\nexport class TickComponent extends React.Component {\n changeCategory = (index, newLabel) => {\n const { categories, onChangeCategory } = this.props;\n const category = categories[index];\n\n onChangeCategory(index, { ...category, label: newLabel });\n };\n\n deleteCategory = index => {\n const { categories, onChange } = this.props;\n\n if (index >= 0 && categories[index]) {\n onChange([...categories.slice(0, index), ...categories.slice(index + 1)]);\n }\n };\n\n render() {\n const {\n classes,\n categories,\n xBand,\n bandWidth,\n barWidth,\n rotate,\n top,\n graphProps,\n x,\n y,\n formattedValue\n } = this.props;\n\n if (!formattedValue) {\n return null;\n }\n\n const index = parseInt(formattedValue.split('-')[0], 10);\n const category = categories[index];\n const { deletable, editable, interactive, label, correctness } = category || {};\n const barX = xBand(bandKey({ label }, index));\n const longestCategory = (categories || []).reduce((a, b) => {\n const lengthA = a && a.label ? a.label.length : 0;\n const lengthB = b && b.label ? b.label.length : 0;\n\n return lengthA > lengthB ? a : b;\n });\n\n const longestLabel = (longestCategory && longestCategory.label) || '';\n\n return (\n <g>\n <foreignObject\n x={bandWidth ? barX : x - barWidth / 2}\n y={6}\n width={barWidth}\n height={24}\n style={{ pointerEvents: 'none', overflow: 'visible' }}\n >\n {index === 0 && (\n <div\n id=\"hiddenLabel\"\n style={{\n position: 'absolute',\n visibility: 'hidden',\n wordBreak: 'break-word',\n overflow: 'visible',\n maxWidth: barWidth,\n display: 'block'\n }}\n >\n {longestLabel}\n </div>\n )}\n <MarkLabel\n inputRef={r => (this.input = r)}\n disabled={!(editable && interactive)}\n mark={category}\n graphProps={graphProps}\n onChange={newLabel => this.changeCategory(index, newLabel)}\n barWidth={barWidth}\n rotate={rotate}\n correctness={correctness}\n />\n </foreignObject>\n {deletable && !correctness && (\n <line\n x1={x}\n y1={0}\n x2={x}\n y2={y + 4 + top}\n className={classes.dottedLine}\n strokeDasharray=\"4 2\"\n />\n )}\n {deletable && !correctness && (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n x={x - 8}\n y={y + 10 + top}\n width={16}\n height={16}\n viewBox=\"0 0 512 512\"\n onClick={() => this.deleteCategory(index)}\n >\n <path d=\"M128 405.429C128 428.846 147.198 448 170.667 448h170.667C364.802 448 384 428.846 384 405.429V160H128v245.429zM416 96h-80l-26.785-32H202.786L176 96H96v32h320V96z\" />\n </svg>\n )}\n </g>\n );\n }\n}\n\nTickComponent.propTypes = {\n categories: PropTypes.array,\n xBand: PropTypes.func,\n bandWidth: PropTypes.number,\n barWidth: PropTypes.number,\n rotate: PropTypes.number,\n top: PropTypes.number,\n x: PropTypes.number,\n y: PropTypes.number,\n graphProps: PropTypes.object,\n formattedValue: PropTypes.string,\n onChangeCategory: PropTypes.func,\n onChange: PropTypes.func,\n classes: PropTypes.object\n};\n\nexport class RawChartAxes extends React.Component {\n static propTypes = {\n bottomScale: PropTypes.func,\n classes: PropTypes.object.isRequired,\n categories: PropTypes.array,\n graphProps: types.GraphPropsType.isRequired,\n xBand: PropTypes.func,\n leftAxis: PropTypes.bool,\n onChange: PropTypes.func,\n onChangeCategory: PropTypes.func,\n top: PropTypes.number,\n theme: PropTypes.object\n };\n\n state = { height: 0 };\n\n componentDidMount() {\n const height = document.getElementById('hiddenLabel')\n ? document.getElementById('hiddenLabel').offsetHeight\n : 0;\n\n this.setState({ height });\n }\n\n render() {\n const {\n classes,\n graphProps,\n xBand,\n leftAxis,\n onChange,\n onChangeCategory,\n categories = [],\n top,\n theme\n } = this.props;\n\n const { axis, axisLine, tick, axisLabel } = classes;\n const { scale = {}, range = {}, domain = {}, size = {} } = graphProps || {};\n const { height } = this.state;\n\n const bottomScale =\n xBand && typeof xBand.rangeRound === 'function' && xBand.rangeRound([0, size.width]);\n const bandWidth = xBand && typeof xBand.bandwidth === 'function' && xBand.bandwidth();\n // for chartType \"line\", bandWidth will be 0, so we have to calculate it\n const barWidth = bandWidth || (scale.x && scale.x(domain.max) / categories.length);\n\n const rowTickValues = getTickValues({ ...range, step: range.labelStep });\n const fontSize = theme && theme.typography ? theme.typography.fontSize : 14;\n const rotate = getRotateAngle(fontSize, height);\n\n const getTickLabelProps = value => ({\n dy: 4,\n dx: -10 - (value.toLocaleString().length || 1) * 5\n });\n\n const getTickComponent = props => {\n const properties = {\n classes,\n categories,\n xBand,\n bandWidth,\n barWidth,\n rotate,\n top,\n onChangeCategory,\n onChange,\n graphProps,\n x: props.x,\n y: props.y,\n formattedValue: props.formattedValue\n };\n\n return <TickComponent {...properties} />;\n };\n\n return (\n <React.Fragment>\n {leftAxis && (\n <AxisLeft\n scale={scale.y}\n className={axis}\n axisLineClassName={axisLine}\n tickLength={10}\n tickClassName={tick}\n tickFormat={value => value}\n label={range.label}\n labelClassName={axisLabel}\n tickValues={rowTickValues}\n tickLabelProps={getTickLabelProps}\n />\n )}\n <AxisBottom\n axisLineClassName={axisLine}\n labelClassName={axisLabel}\n tickClassName={tick}\n scale={bottomScale}\n label={domain.label}\n labelProps={{ y: 60 + top }}\n top={scale.y && scale.y(range.min)}\n textLabelProps={() => ({ textAnchor: 'middle' })}\n tickFormat={count => count}\n tickComponent={getTickComponent}\n />\n </React.Fragment>\n );\n }\n}\n\nconst ChartAxes = withStyles(\n theme => ({\n axisLabel: {\n fontFamily: theme.typography.body1.fontFamily,\n fontSize: theme.typography.fontSize,\n fill: color.secondary()\n },\n axis: {\n stroke: color.primaryDark(),\n strokeWidth: 2\n },\n axisLine: {\n stroke: color.primaryDark(),\n strokeWidth: 2\n },\n tick: {\n '& > line': {\n stroke: color.primaryDark(),\n strokeWidth: 2\n },\n fill: color.primaryDark(),\n fontFamily: theme.typography.body1.fontFamily,\n fontSize: theme.typography.fontSize,\n textAnchor: 'middle'\n },\n dottedLine: {\n stroke: color.primaryLight(),\n opacity: 0.2\n }\n }),\n { withTheme: true }\n)(RawChartAxes);\n\nexport default ChartAxes;\n"],"file":"axes.js"}
1
+ {"version":3,"sources":["../src/axes.jsx"],"names":["TickComponent","index","newLabel","props","categories","onChangeCategory","category","label","onChange","slice","classes","xBand","bandWidth","barWidth","rotate","top","graphProps","x","y","formattedValue","parseInt","split","deletable","editable","interactive","correctness","barX","longestCategory","reduce","a","b","lengthA","length","lengthB","longestLabel","pointerEvents","overflow","position","visibility","wordBreak","maxWidth","display","r","input","changeCategory","dottedLine","deleteCategory","React","Component","propTypes","PropTypes","array","func","number","object","string","RawChartAxes","height","document","getElementById","offsetHeight","setState","leftAxis","theme","axis","axisLine","tick","axisLabel","scale","range","domain","size","state","bottomScale","rangeRound","width","bandwidth","max","rowTickValues","step","labelStep","fontSize","typography","getTickLabelProps","value","dy","dx","toLocaleString","getTickComponent","properties","min","textAnchor","count","isRequired","types","GraphPropsType","bool","ChartAxes","fontFamily","body1","fill","color","secondary","stroke","primaryDark","strokeWidth","primaryLight","opacity","withTheme"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEaA,a;;;;;;;;;;;;;;;;qEACM,UAACC,KAAD,EAAQC,QAAR,EAAqB;AACpC,wBAAyC,MAAKC,KAA9C;AAAA,UAAQC,UAAR,eAAQA,UAAR;AAAA,UAAoBC,gBAApB,eAAoBA,gBAApB;AACA,UAAMC,QAAQ,GAAGF,UAAU,CAACH,KAAD,CAA3B;AAEAI,MAAAA,gBAAgB,CAACJ,KAAD,kCAAaK,QAAb;AAAuBC,QAAAA,KAAK,EAAEL;AAA9B,SAAhB;AACD,K;;qEAEgB,UAAAD,KAAK,EAAI;AACxB,yBAAiC,MAAKE,KAAtC;AAAA,UAAQC,UAAR,gBAAQA,UAAR;AAAA,UAAoBI,QAApB,gBAAoBA,QAApB;;AAEA,UAAIP,KAAK,IAAI,CAAT,IAAcG,UAAU,CAACH,KAAD,CAA5B,EAAqC;AACnCO,QAAAA,QAAQ,8BAAKJ,UAAU,CAACK,KAAX,CAAiB,CAAjB,EAAoBR,KAApB,CAAL,sBAAoCG,UAAU,CAACK,KAAX,CAAiBR,KAAK,GAAG,CAAzB,CAApC,GAAR;AACD;AACF,K;;;;;;;WAED,kBAAS;AAAA;;AACP,yBAYI,KAAKE,KAZT;AAAA,UACEO,OADF,gBACEA,OADF;AAAA,UAEEN,UAFF,gBAEEA,UAFF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AW,EAAE;AAFL,KAVF;AAcRvC,IAAAA,IAAI,EAAE;AACJ,kBAAY;AACVqC,QAAAA,MAAM,EAAEF,gBAAMG,WAAN,EADE;AAEVC,QAAAA,WAAW,EAAE;AAFH,OADR;AAKJL,MAAAA,IAAI,EAAEC,gBAAMG,WAAN,EALF;AAMJN,MAAAA,UAAU,EAAEnC,KAAK,CAACmB,UAAN,CAAiBiB,KAAjB,CAAuBD,UAN/B;AAOJjB,MAAAA,QAAQ,EAAElB,KAAK,CAACmB,UAAN,CAAiBD,QAPvB;AAQJU,MAAAA,UAAU,EAAE;AARR,KAdE;AAwBR9C,IAAAA,UAAU,EAAE;AACV0D,MAAAA,MAAM,EAAEF,gBAAMK,YAAN,EADE;AAEVC,MAAAA,OAAO,EAAE;AAFC;AAxBJ,GAAL;AAAA,CADW,EA8BhB;AAAEC,EAAAA,SAAS,EAAE;AAAb,CA9BgB,EA+BhBpD,YA/BgB,CAAlB;eAiCeyC,S","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport { types } from '@pie-lib/plot';\nimport { color } from '@pie-lib/render-ui';\nimport { AxisLeft, AxisBottom } from '@vx/axis';\nimport { bandKey, getTickValues, getRotateAngle } from './utils';\nimport MarkLabel from './mark-label';\n\nexport class TickComponent extends React.Component {\n changeCategory = (index, newLabel) => {\n const { categories, onChangeCategory } = this.props;\n const category = categories[index];\n\n onChangeCategory(index, { ...category, label: newLabel });\n };\n\n deleteCategory = index => {\n const { categories, onChange } = this.props;\n\n if (index >= 0 && categories[index]) {\n onChange([...categories.slice(0, index), ...categories.slice(index + 1)]);\n }\n };\n\n render() {\n const {\n classes,\n categories,\n xBand,\n bandWidth,\n barWidth,\n rotate,\n top,\n graphProps,\n x,\n y,\n formattedValue\n } = this.props;\n\n if (!formattedValue) {\n return null;\n }\n\n const index = parseInt(formattedValue.split('-')[0], 10);\n const category = categories[index];\n const { deletable, editable, interactive, label, correctness } = category || {};\n const barX = xBand(bandKey({ label }, index));\n const longestCategory = (categories || []).reduce((a, b) => {\n const lengthA = a && a.label ? a.label.length : 0;\n const lengthB = b && b.label ? b.label.length : 0;\n\n return lengthA > lengthB ? a : b;\n });\n\n const longestLabel = (longestCategory && longestCategory.label) || '';\n\n return (\n <g>\n <foreignObject\n x={bandWidth ? barX : x - barWidth / 2}\n y={6}\n width={barWidth}\n height={24}\n style={{ pointerEvents: 'none', overflow: 'visible' }}\n >\n {index === 0 && (\n <div\n id=\"hiddenLabel\"\n style={{\n position: 'absolute',\n visibility: 'hidden',\n wordBreak: 'break-word',\n overflow: 'visible',\n maxWidth: barWidth,\n display: 'block'\n }}\n >\n {longestLabel}\n </div>\n )}\n <MarkLabel\n inputRef={r => (this.input = r)}\n disabled={!(editable && interactive)}\n mark={category}\n graphProps={graphProps}\n onChange={newLabel => this.changeCategory(index, newLabel)}\n barWidth={barWidth}\n rotate={rotate}\n correctness={correctness}\n />\n </foreignObject>\n {deletable && !correctness && (\n <line\n x1={x}\n y1={0}\n x2={x}\n y2={y + 4 + top}\n className={classes.dottedLine}\n strokeDasharray=\"4 2\"\n />\n )}\n {deletable && !correctness && (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n x={x - 8}\n y={y + 10 + top}\n width={16}\n height={16}\n viewBox=\"0 0 512 512\"\n onClick={() => this.deleteCategory(index)}\n >\n <path d=\"M128 405.429C128 428.846 147.198 448 170.667 448h170.667C364.802 448 384 428.846 384 405.429V160H128v245.429zM416 96h-80l-26.785-32H202.786L176 96H96v32h320V96z\" />\n </svg>\n )}\n </g>\n );\n }\n}\n\nTickComponent.propTypes = {\n categories: PropTypes.array,\n xBand: PropTypes.func,\n bandWidth: PropTypes.number,\n barWidth: PropTypes.number,\n rotate: PropTypes.number,\n top: PropTypes.number,\n x: PropTypes.number,\n y: PropTypes.number,\n graphProps: PropTypes.object,\n formattedValue: PropTypes.string,\n onChangeCategory: PropTypes.func,\n onChange: PropTypes.func,\n classes: PropTypes.object\n};\n\nexport class RawChartAxes extends React.Component {\n static propTypes = {\n bottomScale: PropTypes.func,\n classes: PropTypes.object.isRequired,\n categories: PropTypes.array,\n graphProps: types.GraphPropsType.isRequired,\n xBand: PropTypes.func,\n leftAxis: PropTypes.bool,\n onChange: PropTypes.func,\n onChangeCategory: PropTypes.func,\n top: PropTypes.number,\n theme: PropTypes.object\n };\n\n state = { height: 0 };\n\n componentDidMount() {\n const height = document.getElementById('hiddenLabel')\n ? document.getElementById('hiddenLabel').offsetHeight\n : 0;\n\n this.setState({ height });\n }\n\n render() {\n const {\n classes,\n graphProps,\n xBand,\n leftAxis,\n onChange,\n onChangeCategory,\n categories = [],\n top,\n theme\n } = this.props;\n\n const { axis, axisLine, tick, axisLabel } = classes;\n const { scale = {}, range = {}, domain = {}, size = {} } = graphProps || {};\n const { height } = this.state;\n\n const bottomScale =\n xBand && typeof xBand.rangeRound === 'function' && xBand.rangeRound([0, size.width]);\n const bandWidth = xBand && typeof xBand.bandwidth === 'function' && xBand.bandwidth();\n // for chartType \"line\", bandWidth will be 0, so we have to calculate it\n const barWidth = bandWidth || (scale.x && scale.x(domain.max) / categories.length);\n\n const rowTickValues = getTickValues({ ...range, step: range.labelStep });\n const fontSize = theme && theme.typography ? theme.typography.fontSize : 14;\n const rotate = getRotateAngle(fontSize, height);\n\n const getTickLabelProps = value => ({\n dy: 4,\n dx: -10 - (value.toLocaleString().length || 1) * 5\n });\n\n const getTickComponent = props => {\n const properties = {\n classes,\n categories,\n xBand,\n bandWidth,\n barWidth,\n rotate,\n top,\n onChangeCategory,\n onChange,\n graphProps,\n x: props.x,\n y: props.y,\n formattedValue: props.formattedValue\n };\n\n return <TickComponent {...properties} />;\n };\n\n return (\n <React.Fragment>\n {leftAxis && (\n <AxisLeft\n scale={scale.y}\n className={axis}\n axisLineClassName={axisLine}\n tickLength={10}\n tickClassName={tick}\n tickFormat={value => value}\n label={range.label}\n labelClassName={axisLabel}\n tickValues={rowTickValues}\n tickLabelProps={getTickLabelProps}\n />\n )}\n <AxisBottom\n axisLineClassName={axisLine}\n labelClassName={axisLabel}\n tickClassName={tick}\n scale={bottomScale}\n label={domain.label}\n labelProps={{ y: 60 + top }}\n top={scale.y && scale.y(range.min)}\n textLabelProps={() => ({ textAnchor: 'middle' })}\n tickFormat={count => count}\n tickComponent={getTickComponent}\n />\n </React.Fragment>\n );\n }\n}\n\nconst ChartAxes = withStyles(\n theme => ({\n axisLabel: {\n fontFamily: theme.typography.body1.fontFamily,\n fontSize: theme.typography.fontSize,\n fill: color.secondary()\n },\n axis: {\n stroke: color.primaryDark(),\n strokeWidth: 2\n },\n axisLine: {\n stroke: color.primaryDark(),\n strokeWidth: 2\n },\n tick: {\n '& > line': {\n stroke: color.primaryDark(),\n strokeWidth: 2\n },\n fill: color.primaryDark(),\n fontFamily: theme.typography.body1.fontFamily,\n fontSize: theme.typography.fontSize,\n textAnchor: 'middle'\n },\n dottedLine: {\n stroke: color.primaryLight(),\n opacity: 0.2\n }\n }),\n { withTheme: true }\n)(RawChartAxes);\n\nexport default ChartAxes;\n"],"file":"axes.js"}
package/lib/bars/bar.js CHANGED
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
@@ -17,37 +19,39 @@ var _bars = _interopRequireDefault(require("./common/bars"));
17
19
 
18
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
21
 
20
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
21
-
22
22
  function _extends() { _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; }; return _extends.apply(this, arguments); }
23
23
 
24
24
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
25
25
 
26
26
  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); } }
27
27
 
28
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
28
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
29
29
 
30
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
30
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
31
31
 
32
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
32
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
33
33
 
34
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
34
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
35
35
 
36
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
36
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
37
37
 
38
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
38
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
39
+
40
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
41
+
42
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
39
43
 
40
44
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
41
45
 
42
- var Bar =
43
- /*#__PURE__*/
44
- function (_React$Component) {
46
+ var Bar = /*#__PURE__*/function (_React$Component) {
45
47
  _inherits(Bar, _React$Component);
46
48
 
49
+ var _super = _createSuper(Bar);
50
+
47
51
  function Bar() {
48
52
  _classCallCheck(this, Bar);
49
53
 
50
- return _possibleConstructorReturn(this, _getPrototypeOf(Bar).apply(this, arguments));
54
+ return _super.apply(this, arguments);
51
55
  }
52
56
 
53
57
  _createClass(Bar, [{
@@ -64,7 +68,7 @@ function (_React$Component) {
64
68
  size = _ref$size === void 0 ? {} : _ref$size;
65
69
 
66
70
  var xBand = (0, _utils.dataToXBand)(scale.x, data, size.width, 'bar');
67
- return _react["default"].createElement(_bars["default"], _extends({}, props, {
71
+ return /*#__PURE__*/_react["default"].createElement(_bars["default"], _extends({}, props, {
68
72
  xBand: xBand
69
73
  }));
70
74
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/bars/bar.js"],"names":["Bar","props","data","graphProps","scale","size","xBand","x","width","React","Component","PropTypes","array","onChange","func","types","GraphPropsType","isRequired","type","name"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;IAEaA,G;;;;;;;;;;;;;6BAOF;AACP,UAAMC,KAAK,GAAG,KAAKA,KAAnB;AADO,UAECC,IAFD,GAEsBD,KAFtB,CAECC,IAFD;AAAA,UAEOC,UAFP,GAEsBF,KAFtB,CAEOE,UAFP;;AAAA,iBAG2BA,UAAU,IAAI,EAHzC;AAAA,4BAGCC,KAHD;AAAA,UAGCA,KAHD,2BAGS,EAHT;AAAA,2BAGaC,IAHb;AAAA,UAGaA,IAHb,0BAGoB,EAHpB;;AAIP,UAAMC,KAAK,GAAG,wBAAYF,KAAK,CAACG,CAAlB,EAAqBL,IAArB,EAA2BG,IAAI,CAACG,KAAhC,EAAuC,KAAvC,CAAd;AAEA,aAAO,gCAAC,gBAAD,eAAUP,KAAV;AAAiB,QAAA,KAAK,EAAEK;AAAxB,SAAP;AACD;;;;EAdsBG,kBAAMC,S;;;;gBAAlBV,G,eACQ;AACjBE,EAAAA,IAAI,EAAES,sBAAUC,KADC;AAEjBC,EAAAA,QAAQ,EAAEF,sBAAUG,IAFH;AAGjBX,EAAAA,UAAU,EAAEY,YAAMC,cAAN,CAAqBC;AAHhB,C;;eAgBN;AAAA,SAAO;AACpBC,IAAAA,IAAI,EAAE,KADc;AAEpBR,IAAAA,SAAS,EAAEV,GAFS;AAGpBmB,IAAAA,IAAI,EAAE;AAHc,GAAP;AAAA,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { types } from '@pie-lib/plot';\nimport { dataToXBand } from '../utils';\nimport Bars from './common/bars';\n\nexport class Bar extends React.Component {\n static propTypes = {\n data: PropTypes.array,\n onChange: PropTypes.func,\n graphProps: types.GraphPropsType.isRequired\n };\n\n render() {\n const props = this.props;\n const { data, graphProps } = props;\n const { scale = {}, size = {} } = graphProps || {};\n const xBand = dataToXBand(scale.x, data, size.width, 'bar');\n\n return <Bars {...props} xBand={xBand} />;\n }\n}\n\nexport default () => ({\n type: 'bar',\n Component: Bar,\n name: 'Bar'\n});\n"],"file":"bar.js"}
1
+ {"version":3,"sources":["../../src/bars/bar.js"],"names":["Bar","props","data","graphProps","scale","size","xBand","x","width","React","Component","PropTypes","array","onChange","func","types","GraphPropsType","isRequired","type","name"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEaA,G;;;;;;;;;;;;;WAOX,kBAAS;AACP,UAAMC,KAAK,GAAG,KAAKA,KAAnB;AACA,UAAQC,IAAR,GAA6BD,KAA7B,CAAQC,IAAR;AAAA,UAAcC,UAAd,GAA6BF,KAA7B,CAAcE,UAAd;;AACA,iBAAkCA,UAAU,IAAI,EAAhD;AAAA,4BAAQC,KAAR;AAAA,UAAQA,KAAR,2BAAgB,EAAhB;AAAA,2BAAoBC,IAApB;AAAA,UAAoBA,IAApB,0BAA2B,EAA3B;;AACA,UAAMC,KAAK,GAAG,wBAAYF,KAAK,CAACG,CAAlB,EAAqBL,IAArB,EAA2BG,IAAI,CAACG,KAAhC,EAAuC,KAAvC,CAAd;AAEA,0BAAO,gCAAC,gBAAD,eAAUP,KAAV;AAAiB,QAAA,KAAK,EAAEK;AAAxB,SAAP;AACD;;;;EAdsBG,kBAAMC,S;;;;gBAAlBV,G,eACQ;AACjBE,EAAAA,IAAI,EAAES,sBAAUC,KADC;AAEjBC,EAAAA,QAAQ,EAAEF,sBAAUG,IAFH;AAGjBX,EAAAA,UAAU,EAAEY,YAAMC,cAAN,CAAqBC;AAHhB,C;;eAgBN;AAAA,SAAO;AACpBC,IAAAA,IAAI,EAAE,KADc;AAEpBR,IAAAA,SAAS,EAAEV,GAFS;AAGpBmB,IAAAA,IAAI,EAAE;AAHc,GAAP;AAAA,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { types } from '@pie-lib/plot';\nimport { dataToXBand } from '../utils';\nimport Bars from './common/bars';\n\nexport class Bar extends React.Component {\n static propTypes = {\n data: PropTypes.array,\n onChange: PropTypes.func,\n graphProps: types.GraphPropsType.isRequired\n };\n\n render() {\n const props = this.props;\n const { data, graphProps } = props;\n const { scale = {}, size = {} } = graphProps || {};\n const xBand = dataToXBand(scale.x, data, size.width, 'bar');\n\n return <Bars {...props} xBand={xBand} />;\n }\n}\n\nexport default () => ({\n type: 'bar',\n Component: Bar,\n name: 'Bar'\n});\n"],"file":"bar.js"}
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
 
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
6
- exports["default"] = exports.Bars = exports.RawBar = void 0;
8
+ exports["default"] = exports.RawBar = exports.Bars = void 0;
7
9
 
8
10
  var _react = _interopRequireDefault(require("react"));
9
11
 
@@ -25,43 +27,47 @@ var _utils = require("../../utils");
25
27
 
26
28
  var _dragHandle = _interopRequireWildcard(require("../../common/drag-handle"));
27
29
 
28
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
30
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
29
31
 
30
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
32
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
31
33
 
32
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
34
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
33
35
 
34
36
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
35
37
 
36
38
  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); } }
37
39
 
38
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
40
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
39
41
 
40
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
42
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
41
43
 
42
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
44
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
45
+
46
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
47
+
48
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
43
49
 
44
50
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
45
51
 
46
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
52
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
47
53
 
48
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
54
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
49
55
 
50
56
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
51
57
 
52
58
  var log = (0, _debug["default"])('pie-lib:chart:bars');
53
59
 
54
- var RawBar =
55
- /*#__PURE__*/
56
- function (_React$Component) {
60
+ var RawBar = /*#__PURE__*/function (_React$Component) {
57
61
  _inherits(RawBar, _React$Component);
58
62
 
63
+ var _super = _createSuper(RawBar);
64
+
59
65
  function RawBar(props) {
60
66
  var _this;
61
67
 
62
68
  _classCallCheck(this, RawBar);
63
69
 
64
- _this = _possibleConstructorReturn(this, _getPrototypeOf(RawBar).call(this, props));
70
+ _this = _super.call(this, props);
65
71
 
66
72
  _defineProperty(_assertThisInitialized(_this), "setDragValue", function (dragValue) {
67
73
  return _this.setState({
@@ -125,13 +131,13 @@ function (_React$Component) {
125
131
  var yy = range.max - rawY;
126
132
  log('label:', label, 'barX:', barX, 'v: ', v, 'barHeight:', barHeight, 'barWidth: ', barWidth);
127
133
  var Component = interactive ? _dragHandle["default"] : _dragHandle.DragHandle;
128
- return _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement(_shape.Bar, {
134
+ return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_shape.Bar, {
129
135
  x: barX,
130
136
  y: scale.y(yy),
131
137
  width: barWidth,
132
138
  height: barHeight,
133
139
  className: classes.bar
134
- }), _react["default"].createElement(Component, {
140
+ }), /*#__PURE__*/_react["default"].createElement(Component, {
135
141
  x: barX,
136
142
  y: v,
137
143
  interactive: interactive,
@@ -174,15 +180,15 @@ var Bar = (0, _index.withStyles)(function () {
174
180
  };
175
181
  })(RawBar);
176
182
 
177
- var Bars =
178
- /*#__PURE__*/
179
- function (_React$Component2) {
183
+ var Bars = /*#__PURE__*/function (_React$Component2) {
180
184
  _inherits(Bars, _React$Component2);
181
185
 
186
+ var _super2 = _createSuper(Bars);
187
+
182
188
  function Bars() {
183
189
  _classCallCheck(this, Bars);
184
190
 
185
- return _possibleConstructorReturn(this, _getPrototypeOf(Bars).apply(this, arguments));
191
+ return _super2.apply(this, arguments);
186
192
  }
187
193
 
188
194
  _createClass(Bars, [{
@@ -193,8 +199,8 @@ function (_React$Component2) {
193
199
  graphProps = _this$props3.graphProps,
194
200
  xBand = _this$props3.xBand,
195
201
  _onChangeCategory = _this$props3.onChangeCategory;
196
- return _react["default"].createElement(_group.Group, null, (data || []).map(function (d, index) {
197
- return _react["default"].createElement(Bar, {
202
+ return /*#__PURE__*/_react["default"].createElement(_group.Group, null, (data || []).map(function (d, index) {
203
+ return /*#__PURE__*/_react["default"].createElement(Bar, {
198
204
  value: d.value,
199
205
  interactive: d.interactive,
200
206
  label: d.label,