victory-bar 36.0.0 → 36.1.0

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.
@@ -11,56 +11,29 @@
11
11
  return /******/ (() => { // webpackBootstrap
12
12
  /******/ var __webpack_modules__ = ({
13
13
 
14
- /***/ "./bar.js":
15
- /*!****************!*\
16
- !*** ./bar.js ***!
17
- \****************/
14
+ /***/ "./bar-helper-methods.js":
15
+ /*!*******************************!*\
16
+ !*** ./bar-helper-methods.js ***!
17
+ \*******************************/
18
18
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
19
19
 
20
20
  "use strict";
21
21
  __webpack_require__.r(__webpack_exports__);
22
22
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
23
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
23
+ /* harmony export */ "getBarWidth": () => (/* binding */ getBarWidth),
24
+ /* harmony export */ "getCornerRadius": () => (/* binding */ getCornerRadius),
25
+ /* harmony export */ "getStyle": () => (/* binding */ getStyle)
24
26
  /* harmony export */ });
25
- /* harmony import */ var lodash_isNil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/isNil */ "../../../node_modules/lodash/isNil.js");
26
- /* harmony import */ var lodash_isNil__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_isNil__WEBPACK_IMPORTED_MODULE_0__);
27
- /* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/isPlainObject */ "../../../node_modules/lodash/isPlainObject.js");
28
- /* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_1__);
27
+ /* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/isPlainObject */ "../../../node_modules/lodash/isPlainObject.js");
28
+ /* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0__);
29
+ /* harmony import */ var lodash_isNil__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/isNil */ "../../../node_modules/lodash/isNil.js");
30
+ /* harmony import */ var lodash_isNil__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_isNil__WEBPACK_IMPORTED_MODULE_1__);
29
31
  /* harmony import */ var lodash_assign__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash/assign */ "../../../node_modules/lodash/assign.js");
30
32
  /* harmony import */ var lodash_assign__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_assign__WEBPACK_IMPORTED_MODULE_2__);
31
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "react");
32
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
33
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types */ "../../../node_modules/prop-types/index.js");
34
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__);
35
- /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/helpers.js");
36
- /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/common-props.js");
37
- /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-primitives/path.js");
38
- /* harmony import */ var _path_helper_methods__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./path-helper-methods */ "./path-helper-methods.js");
39
-
40
-
41
-
42
-
43
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
44
-
45
- 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; }
46
-
47
-
48
-
49
-
33
+ /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/helpers.js");
50
34
 
51
35
 
52
- var getBarPath = function (props, width, cornerRadius) {
53
- if (props.getPath) {
54
- return (0,_path_helper_methods__WEBPACK_IMPORTED_MODULE_5__.getCustomBarPath)(props, width);
55
- }
56
36
 
57
- return props.horizontal ? (0,_path_helper_methods__WEBPACK_IMPORTED_MODULE_5__.getHorizontalBarPath)(props, width, cornerRadius) : (0,_path_helper_methods__WEBPACK_IMPORTED_MODULE_5__.getVerticalBarPath)(props, width, cornerRadius);
58
- };
59
-
60
- var getPolarBarPath = function (props, cornerRadius) {
61
- // TODO Radial bars
62
- return (0,_path_helper_methods__WEBPACK_IMPORTED_MODULE_5__.getVerticalPolarBarPath)(props, cornerRadius);
63
- };
64
37
 
65
38
  var getBarWidth = function (barWidth, props) {
66
39
  var scale = props.scale,
@@ -69,7 +42,7 @@ var getBarWidth = function (barWidth, props) {
69
42
  style = props.style;
70
43
 
71
44
  if (barWidth) {
72
- return victory_core__WEBPACK_IMPORTED_MODULE_6__.evaluateProp(barWidth, props);
45
+ return victory_core__WEBPACK_IMPORTED_MODULE_3__.evaluateProp(barWidth, props);
73
46
  } else if (style.width) {
74
47
  return style.width;
75
48
  }
@@ -91,10 +64,10 @@ var getCornerRadiusFromObject = function (cornerRadius, props) {
91
64
  };
92
65
 
93
66
  var updateCornerRadius = function (corner, fallback) {
94
- if (!lodash_isNil__WEBPACK_IMPORTED_MODULE_0___default()(cornerRadius[corner])) {
95
- realCornerRadius[corner] = victory_core__WEBPACK_IMPORTED_MODULE_6__.evaluateProp(cornerRadius[corner], props);
96
- } else if (!lodash_isNil__WEBPACK_IMPORTED_MODULE_0___default()(cornerRadius[fallback])) {
97
- realCornerRadius[corner] = victory_core__WEBPACK_IMPORTED_MODULE_6__.evaluateProp(cornerRadius[fallback], props);
67
+ if (!lodash_isNil__WEBPACK_IMPORTED_MODULE_1___default()(cornerRadius[corner])) {
68
+ realCornerRadius[corner] = victory_core__WEBPACK_IMPORTED_MODULE_3__.evaluateProp(cornerRadius[corner], props);
69
+ } else if (!lodash_isNil__WEBPACK_IMPORTED_MODULE_1___default()(cornerRadius[fallback])) {
70
+ realCornerRadius[corner] = victory_core__WEBPACK_IMPORTED_MODULE_3__.evaluateProp(cornerRadius[fallback], props);
98
71
  }
99
72
  };
100
73
 
@@ -117,15 +90,14 @@ var getCornerRadius = function (cornerRadius, props) {
117
90
  return realCornerRadius;
118
91
  }
119
92
 
120
- if (lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_1___default()(cornerRadius)) {
93
+ if (lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default()(cornerRadius)) {
121
94
  return getCornerRadiusFromObject(cornerRadius, props);
122
95
  } else {
123
- realCornerRadius.topLeft = victory_core__WEBPACK_IMPORTED_MODULE_6__.evaluateProp(cornerRadius, props);
124
- realCornerRadius.topRight = victory_core__WEBPACK_IMPORTED_MODULE_6__.evaluateProp(cornerRadius, props);
96
+ realCornerRadius.topLeft = victory_core__WEBPACK_IMPORTED_MODULE_3__.evaluateProp(cornerRadius, props);
97
+ realCornerRadius.topRight = victory_core__WEBPACK_IMPORTED_MODULE_3__.evaluateProp(cornerRadius, props);
125
98
  return realCornerRadius;
126
99
  }
127
100
  };
128
-
129
101
  var getStyle = function () {
130
102
  var style = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
131
103
  var props = arguments.length > 1 ? arguments[1] : undefined;
@@ -139,9 +111,45 @@ var getStyle = function () {
139
111
  fill: "black",
140
112
  stroke: stroke
141
113
  };
142
- return victory_core__WEBPACK_IMPORTED_MODULE_6__.evaluateStyle(lodash_assign__WEBPACK_IMPORTED_MODULE_2___default()(baseStyle, style), props);
114
+ return victory_core__WEBPACK_IMPORTED_MODULE_3__.evaluateStyle(lodash_assign__WEBPACK_IMPORTED_MODULE_2___default()(baseStyle, style), props);
143
115
  };
144
116
 
117
+ /***/ }),
118
+
119
+ /***/ "./bar.js":
120
+ /*!****************!*\
121
+ !*** ./bar.js ***!
122
+ \****************/
123
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
124
+
125
+ "use strict";
126
+ __webpack_require__.r(__webpack_exports__);
127
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
128
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
129
+ /* harmony export */ });
130
+ /* harmony import */ var lodash_assign__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/assign */ "../../../node_modules/lodash/assign.js");
131
+ /* harmony import */ var lodash_assign__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_assign__WEBPACK_IMPORTED_MODULE_0__);
132
+ /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "../../../node_modules/prop-types/index.js");
133
+ /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__);
134
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
135
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
136
+ /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/helpers.js");
137
+ /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/common-props.js");
138
+ /* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-primitives/path.js");
139
+ /* harmony import */ var _bar_helper_methods__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./bar-helper-methods */ "./bar-helper-methods.js");
140
+ /* harmony import */ var _path_helper_methods__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./path-helper-methods */ "./path-helper-methods.js");
141
+
142
+
143
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
144
+
145
+ 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; }
146
+
147
+
148
+
149
+
150
+
151
+
152
+
145
153
  var evaluateProps = function (props) {
146
154
  /**
147
155
  * Potential evaluated props of following must be evaluated in this order:
@@ -155,19 +163,19 @@ var evaluateProps = function (props) {
155
163
  * `id`
156
164
  * `tabIndex`
157
165
  */
158
- var style = getStyle(props.style, props);
159
- var barWidth = getBarWidth(props.barWidth, lodash_assign__WEBPACK_IMPORTED_MODULE_2___default()({}, props, {
166
+ var style = (0,_bar_helper_methods__WEBPACK_IMPORTED_MODULE_3__.getStyle)(props.style, props);
167
+ var barWidth = (0,_bar_helper_methods__WEBPACK_IMPORTED_MODULE_3__.getBarWidth)(props.barWidth, lodash_assign__WEBPACK_IMPORTED_MODULE_0___default()({}, props, {
160
168
  style: style
161
169
  }));
162
- var cornerRadius = getCornerRadius(props.cornerRadius, lodash_assign__WEBPACK_IMPORTED_MODULE_2___default()({}, props, {
170
+ var cornerRadius = (0,_bar_helper_methods__WEBPACK_IMPORTED_MODULE_3__.getCornerRadius)(props.cornerRadius, lodash_assign__WEBPACK_IMPORTED_MODULE_0___default()({}, props, {
163
171
  style: style,
164
172
  barWidth: barWidth
165
173
  }));
166
- var ariaLabel = victory_core__WEBPACK_IMPORTED_MODULE_6__.evaluateProp(props.ariaLabel, props);
167
- var desc = victory_core__WEBPACK_IMPORTED_MODULE_6__.evaluateProp(props.desc, props);
168
- var id = victory_core__WEBPACK_IMPORTED_MODULE_6__.evaluateProp(props.id, props);
169
- var tabIndex = victory_core__WEBPACK_IMPORTED_MODULE_6__.evaluateProp(props.tabIndex, props);
170
- return lodash_assign__WEBPACK_IMPORTED_MODULE_2___default()({}, props, {
174
+ var ariaLabel = victory_core__WEBPACK_IMPORTED_MODULE_4__.evaluateProp(props.ariaLabel, props);
175
+ var desc = victory_core__WEBPACK_IMPORTED_MODULE_4__.evaluateProp(props.desc, props);
176
+ var id = victory_core__WEBPACK_IMPORTED_MODULE_4__.evaluateProp(props.id, props);
177
+ var tabIndex = victory_core__WEBPACK_IMPORTED_MODULE_4__.evaluateProp(props.tabIndex, props);
178
+ return lodash_assign__WEBPACK_IMPORTED_MODULE_0___default()({}, props, {
171
179
  ariaLabel: ariaLabel,
172
180
  style: style,
173
181
  barWidth: barWidth,
@@ -186,9 +194,9 @@ var Bar = function (props) {
186
194
  style = _props.style,
187
195
  barWidth = _props.barWidth,
188
196
  cornerRadius = _props.cornerRadius;
189
- var path = polar ? getPolarBarPath(props, cornerRadius) : getBarPath(props, barWidth, cornerRadius);
197
+ var path = polar ? (0,_path_helper_methods__WEBPACK_IMPORTED_MODULE_5__.getPolarBarPath)(props, cornerRadius) : (0,_path_helper_methods__WEBPACK_IMPORTED_MODULE_5__.getBarPath)(props, barWidth, cornerRadius);
190
198
  var defaultTransform = polar && origin ? "translate(".concat(origin.x, ", ").concat(origin.y, ")") : undefined;
191
- return react__WEBPACK_IMPORTED_MODULE_3___default().cloneElement(props.pathComponent, _objectSpread({}, props.events, {
199
+ return react__WEBPACK_IMPORTED_MODULE_2___default().cloneElement(props.pathComponent, _objectSpread({}, props.events, {
192
200
  "aria-label": props.ariaLabel,
193
201
  style: style,
194
202
  d: path,
@@ -203,30 +211,30 @@ var Bar = function (props) {
203
211
  }));
204
212
  };
205
213
 
206
- Bar.propTypes = _objectSpread({}, victory_core__WEBPACK_IMPORTED_MODULE_7__.primitiveProps, {
207
- alignment: prop_types__WEBPACK_IMPORTED_MODULE_4___default().oneOf(["start", "middle", "end"]),
208
- barRatio: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().number),
209
- barWidth: prop_types__WEBPACK_IMPORTED_MODULE_4___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_4___default().number), (prop_types__WEBPACK_IMPORTED_MODULE_4___default().func)]),
210
- cornerRadius: prop_types__WEBPACK_IMPORTED_MODULE_4___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_4___default().number), (prop_types__WEBPACK_IMPORTED_MODULE_4___default().func), prop_types__WEBPACK_IMPORTED_MODULE_4___default().shape({
211
- top: prop_types__WEBPACK_IMPORTED_MODULE_4___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_4___default().number), (prop_types__WEBPACK_IMPORTED_MODULE_4___default().func)]),
212
- topLeft: prop_types__WEBPACK_IMPORTED_MODULE_4___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_4___default().number), (prop_types__WEBPACK_IMPORTED_MODULE_4___default().func)]),
213
- topRight: prop_types__WEBPACK_IMPORTED_MODULE_4___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_4___default().number), (prop_types__WEBPACK_IMPORTED_MODULE_4___default().func)]),
214
- bottom: prop_types__WEBPACK_IMPORTED_MODULE_4___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_4___default().number), (prop_types__WEBPACK_IMPORTED_MODULE_4___default().func)]),
215
- bottomLeft: prop_types__WEBPACK_IMPORTED_MODULE_4___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_4___default().number), (prop_types__WEBPACK_IMPORTED_MODULE_4___default().func)]),
216
- bottomRight: prop_types__WEBPACK_IMPORTED_MODULE_4___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_4___default().number), (prop_types__WEBPACK_IMPORTED_MODULE_4___default().func)])
214
+ Bar.propTypes = _objectSpread({}, victory_core__WEBPACK_IMPORTED_MODULE_6__.primitiveProps, {
215
+ alignment: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOf(["start", "middle", "end"]),
216
+ barRatio: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number),
217
+ barWidth: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().number), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func)]),
218
+ cornerRadius: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().number), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func), prop_types__WEBPACK_IMPORTED_MODULE_1___default().shape({
219
+ top: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().number), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func)]),
220
+ topLeft: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().number), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func)]),
221
+ topRight: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().number), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func)]),
222
+ bottom: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().number), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func)]),
223
+ bottomLeft: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().number), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func)]),
224
+ bottomRight: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().number), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func)])
217
225
  })]),
218
- datum: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().object),
219
- getPath: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().func),
220
- horizontal: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().bool),
221
- pathComponent: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().element),
222
- width: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().number),
223
- x: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().number),
224
- y: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().number),
225
- y0: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().number)
226
+ datum: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().object),
227
+ getPath: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
228
+ horizontal: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
229
+ pathComponent: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().element),
230
+ width: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number),
231
+ x: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number),
232
+ y: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number),
233
+ y0: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number)
226
234
  });
227
235
  Bar.defaultProps = {
228
236
  defaultBarWidth: 8,
229
- pathComponent: react__WEBPACK_IMPORTED_MODULE_3___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_8__.default, null),
237
+ pathComponent: react__WEBPACK_IMPORTED_MODULE_2___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_7__.default, null),
230
238
  role: "presentation",
231
239
  shapeRendering: "auto"
232
240
  };
@@ -546,7 +554,9 @@ __webpack_require__.r(__webpack_exports__);
546
554
  /* harmony export */ "getCustomBarPath": () => (/* binding */ getCustomBarPath),
547
555
  /* harmony export */ "getVerticalBarPath": () => (/* binding */ getVerticalBarPath),
548
556
  /* harmony export */ "getHorizontalBarPath": () => (/* binding */ getHorizontalBarPath),
549
- /* harmony export */ "getVerticalPolarBarPath": () => (/* binding */ getVerticalPolarBarPath)
557
+ /* harmony export */ "getVerticalPolarBarPath": () => (/* binding */ getVerticalPolarBarPath),
558
+ /* harmony export */ "getBarPath": () => (/* binding */ getBarPath),
559
+ /* harmony export */ "getPolarBarPath": () => (/* binding */ getPolarBarPath)
550
560
  /* harmony export */ });
551
561
  /* harmony import */ var d3_shape__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3-shape */ "../../../node_modules/d3-shape/src/arc.js");
552
562
  /* harmony import */ var _geometry_helper_methods__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./geometry-helper-methods */ "./geometry-helper-methods.js");
@@ -1021,6 +1031,17 @@ var getVerticalPolarBarPath = function (props, cornerRadius) {
1021
1031
  }, "");
1022
1032
  return "".concat(path, " z");
1023
1033
  };
1034
+ var getBarPath = function (props, width, cornerRadius) {
1035
+ if (props.getPath) {
1036
+ return getCustomBarPath(props, width);
1037
+ }
1038
+
1039
+ return props.horizontal ? getHorizontalBarPath(props, width, cornerRadius) : getVerticalBarPath(props, width, cornerRadius);
1040
+ };
1041
+ var getPolarBarPath = function (props, cornerRadius) {
1042
+ // TODO Radial bars
1043
+ return getVerticalPolarBarPath(props, cornerRadius);
1044
+ };
1024
1045
 
1025
1046
  /***/ }),
1026
1047
 
@@ -1089,9 +1110,7 @@ var defaultData = [{
1089
1110
  y: 4
1090
1111
  }];
1091
1112
 
1092
- var VictoryBar =
1093
- /*#__PURE__*/
1094
- function (_React$Component) {
1113
+ var VictoryBar = /*#__PURE__*/function (_React$Component) {
1095
1114
  _inherits(VictoryBar, _React$Component);
1096
1115
 
1097
1116
  function VictoryBar() {
@@ -15057,9 +15076,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
15057
15076
 
15058
15077
 
15059
15078
 
15060
- var VictoryAnimation =
15061
- /*#__PURE__*/
15062
- function (_React$Component) {
15079
+ var VictoryAnimation = /*#__PURE__*/function (_React$Component) {
15063
15080
  _inherits(VictoryAnimation, _React$Component);
15064
15081
 
15065
15082
  function VictoryAnimation(props, context) {
@@ -15343,9 +15360,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
15343
15360
 
15344
15361
 
15345
15362
 
15346
- var VictoryContainer =
15347
- /*#__PURE__*/
15348
- function (_React$Component) {
15363
+ var VictoryContainer = /*#__PURE__*/function (_React$Component) {
15349
15364
  _inherits(VictoryContainer, _React$Component);
15350
15365
 
15351
15366
  function VictoryContainer(props) {
@@ -16291,9 +16306,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
16291
16306
 
16292
16307
 
16293
16308
 
16294
- var Portal =
16295
- /*#__PURE__*/
16296
- function (_React$Component) {
16309
+ var Portal = /*#__PURE__*/function (_React$Component) {
16297
16310
  _inherits(Portal, _React$Component);
16298
16311
 
16299
16312
  function Portal(props) {
@@ -16412,9 +16425,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
16412
16425
 
16413
16426
 
16414
16427
 
16415
- var VictoryPortal =
16416
- /*#__PURE__*/
16417
- function (_React$Component) {
16428
+ var VictoryPortal = /*#__PURE__*/function (_React$Component) {
16418
16429
  _inherits(VictoryPortal, _React$Component);
16419
16430
 
16420
16431
  function VictoryPortal() {
@@ -17306,9 +17317,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
17306
17317
 
17307
17318
 
17308
17319
 
17309
- var VictoryTransition =
17310
- /*#__PURE__*/
17311
- function (_React$Component) {
17320
+ var VictoryTransition = /*#__PURE__*/function (_React$Component) {
17312
17321
  _inherits(VictoryTransition, _React$Component);
17313
17322
 
17314
17323
  function VictoryTransition(props, context) {
@@ -17609,365 +17618,362 @@ var defaultComponents = [{
17609
17618
  name: "labels"
17610
17619
  }];
17611
17620
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (function (WrappedComponent, options) {
17612
- return (
17613
- /*#__PURE__*/
17614
- function (_WrappedComponent) {
17615
- _inherits(addEvents, _WrappedComponent);
17616
-
17617
- function addEvents(props) {
17618
- var _this;
17619
-
17620
- _classCallCheck(this, addEvents);
17621
+ return /*#__PURE__*/function (_WrappedComponent) {
17622
+ _inherits(addEvents, _WrappedComponent);
17621
17623
 
17622
- _this = _possibleConstructorReturn(this, (addEvents.__proto__ || Object.getPrototypeOf(addEvents)).call(this, props));
17623
- var getScopedEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getScopedEvents.bind(_assertThisInitialized(_this));
17624
- var boundGetEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getEvents.bind(_assertThisInitialized(_this));
17625
- _this.state = {};
17624
+ function addEvents(props) {
17625
+ var _this;
17626
17626
 
17627
- _this.getEvents = function (p, target, eventKey) {
17628
- return boundGetEvents(p, target, eventKey, getScopedEvents);
17629
- };
17627
+ _classCallCheck(this, addEvents);
17630
17628
 
17631
- _this.getEventState = _events__WEBPACK_IMPORTED_MODULE_11__.getEventState.bind(_assertThisInitialized(_this));
17629
+ _this = _possibleConstructorReturn(this, (addEvents.__proto__ || Object.getPrototypeOf(addEvents)).call(this, props));
17630
+ var getScopedEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getScopedEvents.bind(_assertThisInitialized(_this));
17631
+ var boundGetEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getEvents.bind(_assertThisInitialized(_this));
17632
+ _this.state = {};
17632
17633
 
17633
- var calculatedValues = _this.getCalculatedValues(props);
17634
+ _this.getEvents = function (p, target, eventKey) {
17635
+ return boundGetEvents(p, target, eventKey, getScopedEvents);
17636
+ };
17634
17637
 
17635
- _this.cacheValues(calculatedValues);
17638
+ _this.getEventState = _events__WEBPACK_IMPORTED_MODULE_11__.getEventState.bind(_assertThisInitialized(_this));
17636
17639
 
17637
- _this.externalMutations = _this.getExternalMutations(props);
17638
- _this.calculatedState = _this.getStateChanges(props);
17639
- _this.globalEvents = {};
17640
- _this.prevGlobalEventKeys = [];
17641
- _this.boundGlobalEvents = {};
17642
- return _this;
17643
- }
17640
+ var calculatedValues = _this.getCalculatedValues(props);
17644
17641
 
17645
- _createClass(addEvents, [{
17646
- key: "shouldComponentUpdate",
17647
- value: function shouldComponentUpdate(nextProps) {
17648
- var externalMutations = this.getExternalMutations(nextProps);
17649
- var animating = this.props.animating || this.props.animate;
17650
- var newMutation = !react_fast_compare__WEBPACK_IMPORTED_MODULE_10___default()(externalMutations, this.externalMutations);
17651
-
17652
- if (animating || newMutation) {
17653
- this.cacheValues(this.getCalculatedValues(nextProps));
17654
- this.externalMutations = externalMutations;
17655
- this.applyExternalMutations(nextProps, externalMutations);
17656
- return true;
17657
- }
17642
+ _this.cacheValues(calculatedValues);
17658
17643
 
17659
- var calculatedState = this.getStateChanges(nextProps);
17644
+ _this.externalMutations = _this.getExternalMutations(props);
17645
+ _this.calculatedState = _this.getStateChanges(props);
17646
+ _this.globalEvents = {};
17647
+ _this.prevGlobalEventKeys = [];
17648
+ _this.boundGlobalEvents = {};
17649
+ return _this;
17650
+ }
17660
17651
 
17661
- if (!react_fast_compare__WEBPACK_IMPORTED_MODULE_10___default()(this.calculatedState, calculatedState)) {
17662
- this.cacheValues(this.getCalculatedValues(nextProps));
17663
- return true;
17664
- }
17652
+ _createClass(addEvents, [{
17653
+ key: "shouldComponentUpdate",
17654
+ value: function shouldComponentUpdate(nextProps) {
17655
+ var externalMutations = this.getExternalMutations(nextProps);
17656
+ var animating = this.props.animating || this.props.animate;
17657
+ var newMutation = !react_fast_compare__WEBPACK_IMPORTED_MODULE_10___default()(externalMutations, this.externalMutations);
17658
+
17659
+ if (animating || newMutation) {
17660
+ this.cacheValues(this.getCalculatedValues(nextProps));
17661
+ this.externalMutations = externalMutations;
17662
+ this.applyExternalMutations(nextProps, externalMutations);
17663
+ return true;
17664
+ }
17665
17665
 
17666
- if (!react_fast_compare__WEBPACK_IMPORTED_MODULE_10___default()(this.props, nextProps)) {
17667
- this.cacheValues(this.getCalculatedValues(nextProps));
17668
- return true;
17669
- }
17666
+ var calculatedState = this.getStateChanges(nextProps);
17670
17667
 
17671
- return false;
17668
+ if (!react_fast_compare__WEBPACK_IMPORTED_MODULE_10___default()(this.calculatedState, calculatedState)) {
17669
+ this.cacheValues(this.getCalculatedValues(nextProps));
17670
+ return true;
17672
17671
  }
17673
- }, {
17674
- key: "componentDidMount",
17675
- value: function componentDidMount() {
17676
- var _this2 = this;
17677
17672
 
17678
- var globalEventKeys = lodash_keys__WEBPACK_IMPORTED_MODULE_6___default()(this.globalEvents);
17679
-
17680
- globalEventKeys.forEach(function (key) {
17681
- return _this2.addGlobalListener(key);
17682
- });
17683
- this.prevGlobalEventKeys = globalEventKeys;
17673
+ if (!react_fast_compare__WEBPACK_IMPORTED_MODULE_10___default()(this.props, nextProps)) {
17674
+ this.cacheValues(this.getCalculatedValues(nextProps));
17675
+ return true;
17684
17676
  }
17685
- }, {
17686
- key: "componentDidUpdate",
17687
- value: function componentDidUpdate(prevProps) {
17688
- var _this3 = this;
17689
17677
 
17690
- var calculatedState = this.getStateChanges(prevProps);
17691
- this.calculatedState = calculatedState;
17678
+ return false;
17679
+ }
17680
+ }, {
17681
+ key: "componentDidMount",
17682
+ value: function componentDidMount() {
17683
+ var _this2 = this;
17692
17684
 
17693
- var globalEventKeys = lodash_keys__WEBPACK_IMPORTED_MODULE_6___default()(this.globalEvents);
17685
+ var globalEventKeys = lodash_keys__WEBPACK_IMPORTED_MODULE_6___default()(this.globalEvents);
17694
17686
 
17695
- var removedGlobalEventKeys = lodash_difference__WEBPACK_IMPORTED_MODULE_0___default()(this.prevGlobalEventKeys, globalEventKeys);
17687
+ globalEventKeys.forEach(function (key) {
17688
+ return _this2.addGlobalListener(key);
17689
+ });
17690
+ this.prevGlobalEventKeys = globalEventKeys;
17691
+ }
17692
+ }, {
17693
+ key: "componentDidUpdate",
17694
+ value: function componentDidUpdate(prevProps) {
17695
+ var _this3 = this;
17696
17696
 
17697
- removedGlobalEventKeys.forEach(function (key) {
17698
- return _this3.removeGlobalListener(key);
17699
- });
17697
+ var calculatedState = this.getStateChanges(prevProps);
17698
+ this.calculatedState = calculatedState;
17700
17699
 
17701
- var addedGlobalEventKeys = lodash_difference__WEBPACK_IMPORTED_MODULE_0___default()(globalEventKeys, this.prevGlobalEventKeys);
17700
+ var globalEventKeys = lodash_keys__WEBPACK_IMPORTED_MODULE_6___default()(this.globalEvents);
17702
17701
 
17703
- addedGlobalEventKeys.forEach(function (key) {
17704
- return _this3.addGlobalListener(key);
17705
- });
17706
- this.prevGlobalEventKeys = globalEventKeys;
17707
- }
17708
- }, {
17709
- key: "componentWillUnmount",
17710
- value: function componentWillUnmount() {
17711
- var _this4 = this;
17702
+ var removedGlobalEventKeys = lodash_difference__WEBPACK_IMPORTED_MODULE_0___default()(this.prevGlobalEventKeys, globalEventKeys);
17712
17703
 
17713
- this.prevGlobalEventKeys.forEach(function (key) {
17714
- return _this4.removeGlobalListener(key);
17715
- });
17716
- }
17717
- }, {
17718
- key: "addGlobalListener",
17719
- value: function addGlobalListener(key) {
17720
- var _this5 = this;
17721
-
17722
- var boundListener = function (event) {
17723
- var listener = _this5.globalEvents[key];
17724
- return listener && listener(_events__WEBPACK_IMPORTED_MODULE_11__.emulateReactEvent(event));
17725
- };
17704
+ removedGlobalEventKeys.forEach(function (key) {
17705
+ return _this3.removeGlobalListener(key);
17706
+ });
17726
17707
 
17727
- this.boundGlobalEvents[key] = boundListener;
17728
- window.addEventListener(_events__WEBPACK_IMPORTED_MODULE_11__.getGlobalEventNameFromKey(key), boundListener);
17729
- }
17730
- }, {
17731
- key: "removeGlobalListener",
17732
- value: function removeGlobalListener(key) {
17733
- window.removeEventListener(_events__WEBPACK_IMPORTED_MODULE_11__.getGlobalEventNameFromKey(key), this.boundGlobalEvents[key]);
17734
- } // compile all state changes from own and parent state. Order doesn't matter, as any state
17735
- // state change should trigger a re-render
17736
-
17737
- }, {
17738
- key: "getStateChanges",
17739
- value: function getStateChanges(props) {
17740
- var _this6 = this;
17741
-
17742
- if (!this.hasEvents) {
17743
- return {};
17744
- }
17708
+ var addedGlobalEventKeys = lodash_difference__WEBPACK_IMPORTED_MODULE_0___default()(globalEventKeys, this.prevGlobalEventKeys);
17745
17709
 
17746
- var getState = function (key, type) {
17747
- var result = lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({}, _this6.getEventState(key, type), _this6.getSharedEventState(key, type));
17710
+ addedGlobalEventKeys.forEach(function (key) {
17711
+ return _this3.addGlobalListener(key);
17712
+ });
17713
+ this.prevGlobalEventKeys = globalEventKeys;
17714
+ }
17715
+ }, {
17716
+ key: "componentWillUnmount",
17717
+ value: function componentWillUnmount() {
17718
+ var _this4 = this;
17748
17719
 
17749
- return lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(result) ? undefined : result;
17750
- };
17720
+ this.prevGlobalEventKeys.forEach(function (key) {
17721
+ return _this4.removeGlobalListener(key);
17722
+ });
17723
+ }
17724
+ }, {
17725
+ key: "addGlobalListener",
17726
+ value: function addGlobalListener(key) {
17727
+ var _this5 = this;
17728
+
17729
+ var boundListener = function (event) {
17730
+ var listener = _this5.globalEvents[key];
17731
+ return listener && listener(_events__WEBPACK_IMPORTED_MODULE_11__.emulateReactEvent(event));
17732
+ };
17751
17733
 
17752
- options = options || {};
17753
- var components = options.components || defaultComponents;
17754
- var stateChanges = components.map(function (component) {
17755
- if (!props.standalone && component.name === "parent") {
17756
- // don't check for changes on parent props for non-standalone components
17757
- return undefined;
17758
- } else {
17759
- return component.index !== undefined ? getState(component.index, component.name) : _this6.dataKeys.map(function (key) {
17760
- return getState(key, component.name);
17761
- }).filter(Boolean);
17762
- }
17763
- }).filter(Boolean);
17764
- return stateChanges;
17765
- }
17766
- }, {
17767
- key: "applyExternalMutations",
17768
- value: function applyExternalMutations(props, externalMutations) {
17769
- if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(externalMutations)) {
17770
- var callbacks = props.externalEventMutations.reduce(function (memo, mutation) {
17771
- memo = lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(mutation.callback) ? memo.concat(mutation.callback) : memo;
17772
- return memo;
17773
- }, []);
17774
- var compiledCallbacks = callbacks.length ? function () {
17775
- callbacks.forEach(function (c) {
17776
- return c();
17777
- });
17778
- } : undefined;
17779
- this.setState(externalMutations, compiledCallbacks);
17780
- }
17734
+ this.boundGlobalEvents[key] = boundListener;
17735
+ window.addEventListener(_events__WEBPACK_IMPORTED_MODULE_11__.getGlobalEventNameFromKey(key), boundListener);
17736
+ }
17737
+ }, {
17738
+ key: "removeGlobalListener",
17739
+ value: function removeGlobalListener(key) {
17740
+ window.removeEventListener(_events__WEBPACK_IMPORTED_MODULE_11__.getGlobalEventNameFromKey(key), this.boundGlobalEvents[key]);
17741
+ } // compile all state changes from own and parent state. Order doesn't matter, as any state
17742
+ // state change should trigger a re-render
17743
+
17744
+ }, {
17745
+ key: "getStateChanges",
17746
+ value: function getStateChanges(props) {
17747
+ var _this6 = this;
17748
+
17749
+ if (!this.hasEvents) {
17750
+ return {};
17781
17751
  }
17782
- }, {
17783
- key: "getCalculatedValues",
17784
- value: function getCalculatedValues(props) {
17785
- var sharedEvents = props.sharedEvents;
17786
- var components = WrappedComponent.expectedComponents;
17787
- var componentEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getComponentEvents(props, components);
17788
- var getSharedEventState = sharedEvents && lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(sharedEvents.getEventState) ? sharedEvents.getEventState : function () {
17789
- return undefined;
17790
- };
17791
- var baseProps = this.getBaseProps(props, getSharedEventState);
17792
17752
 
17793
- var dataKeys = lodash_keys__WEBPACK_IMPORTED_MODULE_6___default()(baseProps).filter(function (key) {
17794
- return key !== "parent";
17795
- });
17753
+ var getState = function (key, type) {
17754
+ var result = lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({}, _this6.getEventState(key, type), _this6.getSharedEventState(key, type));
17796
17755
 
17797
- var hasEvents = props.events || props.sharedEvents || componentEvents;
17798
- var events = this.getAllEvents(props);
17799
- return {
17800
- componentEvents: componentEvents,
17801
- getSharedEventState: getSharedEventState,
17802
- baseProps: baseProps,
17803
- dataKeys: dataKeys,
17804
- hasEvents: hasEvents,
17805
- events: events
17806
- };
17807
- }
17808
- }, {
17809
- key: "getExternalMutations",
17810
- value: function getExternalMutations(props) {
17811
- var sharedEvents = props.sharedEvents,
17812
- externalEventMutations = props.externalEventMutations;
17813
- return lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(externalEventMutations) || sharedEvents ? undefined : _events__WEBPACK_IMPORTED_MODULE_11__.getExternalMutations(externalEventMutations, this.baseProps, this.state);
17814
- }
17815
- }, {
17816
- key: "cacheValues",
17817
- value: function cacheValues(obj) {
17818
- var _this7 = this;
17756
+ return lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(result) ? undefined : result;
17757
+ };
17819
17758
 
17820
- lodash_keys__WEBPACK_IMPORTED_MODULE_6___default()(obj).forEach(function (key) {
17821
- _this7[key] = obj[key];
17822
- });
17759
+ options = options || {};
17760
+ var components = options.components || defaultComponents;
17761
+ var stateChanges = components.map(function (component) {
17762
+ if (!props.standalone && component.name === "parent") {
17763
+ // don't check for changes on parent props for non-standalone components
17764
+ return undefined;
17765
+ } else {
17766
+ return component.index !== undefined ? getState(component.index, component.name) : _this6.dataKeys.map(function (key) {
17767
+ return getState(key, component.name);
17768
+ }).filter(Boolean);
17769
+ }
17770
+ }).filter(Boolean);
17771
+ return stateChanges;
17772
+ }
17773
+ }, {
17774
+ key: "applyExternalMutations",
17775
+ value: function applyExternalMutations(props, externalMutations) {
17776
+ if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(externalMutations)) {
17777
+ var callbacks = props.externalEventMutations.reduce(function (memo, mutation) {
17778
+ memo = lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(mutation.callback) ? memo.concat(mutation.callback) : memo;
17779
+ return memo;
17780
+ }, []);
17781
+ var compiledCallbacks = callbacks.length ? function () {
17782
+ callbacks.forEach(function (c) {
17783
+ return c();
17784
+ });
17785
+ } : undefined;
17786
+ this.setState(externalMutations, compiledCallbacks);
17823
17787
  }
17824
- }, {
17825
- key: "getBaseProps",
17826
- value: function getBaseProps(props, getSharedEventState) {
17827
- getSharedEventState = getSharedEventState || this.getSharedEventState;
17828
- var sharedParentState = getSharedEventState("parent", "parent");
17829
- var parentState = this.getEventState("parent", "parent");
17788
+ }
17789
+ }, {
17790
+ key: "getCalculatedValues",
17791
+ value: function getCalculatedValues(props) {
17792
+ var sharedEvents = props.sharedEvents;
17793
+ var components = WrappedComponent.expectedComponents;
17794
+ var componentEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getComponentEvents(props, components);
17795
+ var getSharedEventState = sharedEvents && lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(sharedEvents.getEventState) ? sharedEvents.getEventState : function () {
17796
+ return undefined;
17797
+ };
17798
+ var baseProps = this.getBaseProps(props, getSharedEventState);
17830
17799
 
17831
- var baseParentProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({}, parentState, sharedParentState);
17800
+ var dataKeys = lodash_keys__WEBPACK_IMPORTED_MODULE_6___default()(baseProps).filter(function (key) {
17801
+ return key !== "parent";
17802
+ });
17832
17803
 
17833
- var parentPropsList = baseParentProps.parentControlledProps;
17834
- var parentProps = parentPropsList ? lodash_pick__WEBPACK_IMPORTED_MODULE_4___default()(baseParentProps, parentPropsList) : {};
17804
+ var hasEvents = props.events || props.sharedEvents || componentEvents;
17805
+ var events = this.getAllEvents(props);
17806
+ return {
17807
+ componentEvents: componentEvents,
17808
+ getSharedEventState: getSharedEventState,
17809
+ baseProps: baseProps,
17810
+ dataKeys: dataKeys,
17811
+ hasEvents: hasEvents,
17812
+ events: events
17813
+ };
17814
+ }
17815
+ }, {
17816
+ key: "getExternalMutations",
17817
+ value: function getExternalMutations(props) {
17818
+ var sharedEvents = props.sharedEvents,
17819
+ externalEventMutations = props.externalEventMutations;
17820
+ return lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(externalEventMutations) || sharedEvents ? undefined : _events__WEBPACK_IMPORTED_MODULE_11__.getExternalMutations(externalEventMutations, this.baseProps, this.state);
17821
+ }
17822
+ }, {
17823
+ key: "cacheValues",
17824
+ value: function cacheValues(obj) {
17825
+ var _this7 = this;
17835
17826
 
17836
- var modifiedProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({}, parentProps, props);
17827
+ lodash_keys__WEBPACK_IMPORTED_MODULE_6___default()(obj).forEach(function (key) {
17828
+ _this7[key] = obj[key];
17829
+ });
17830
+ }
17831
+ }, {
17832
+ key: "getBaseProps",
17833
+ value: function getBaseProps(props, getSharedEventState) {
17834
+ getSharedEventState = getSharedEventState || this.getSharedEventState;
17835
+ var sharedParentState = getSharedEventState("parent", "parent");
17836
+ var parentState = this.getEventState("parent", "parent");
17837
17837
 
17838
- return lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(WrappedComponent.getBaseProps) ? WrappedComponent.getBaseProps(modifiedProps) : {};
17839
- }
17840
- }, {
17841
- key: "getAllEvents",
17842
- value: function getAllEvents(props) {
17843
- if (Array.isArray(this.componentEvents)) {
17844
- var _componentEvents;
17838
+ var baseParentProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({}, parentState, sharedParentState);
17845
17839
 
17846
- return Array.isArray(props.events) ? (_componentEvents = this.componentEvents).concat.apply(_componentEvents, _toConsumableArray(props.events)) : this.componentEvents;
17847
- }
17840
+ var parentPropsList = baseParentProps.parentControlledProps;
17841
+ var parentProps = parentPropsList ? lodash_pick__WEBPACK_IMPORTED_MODULE_4___default()(baseParentProps, parentPropsList) : {};
17848
17842
 
17849
- return props.events;
17850
- }
17851
- }, {
17852
- key: "getComponentProps",
17853
- value: function getComponentProps(component, type, index) {
17854
- var name = this.props.name || WrappedComponent.role;
17855
- var key = this.dataKeys && this.dataKeys[index] || index;
17856
- var id = "".concat(name, "-").concat(type, "-").concat(key);
17857
- var baseProps = this.baseProps[key] && this.baseProps[key][type] || this.baseProps[key];
17858
-
17859
- if (!baseProps && !this.hasEvents) {
17860
- return undefined;
17861
- }
17843
+ var modifiedProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({}, parentProps, props);
17862
17844
 
17863
- if (this.hasEvents) {
17864
- var baseEvents = this.getEvents(this.props, type, key);
17845
+ return lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(WrappedComponent.getBaseProps) ? WrappedComponent.getBaseProps(modifiedProps) : {};
17846
+ }
17847
+ }, {
17848
+ key: "getAllEvents",
17849
+ value: function getAllEvents(props) {
17850
+ if (Array.isArray(this.componentEvents)) {
17851
+ var _componentEvents;
17865
17852
 
17866
- var componentProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({
17867
- index: index,
17868
- key: id
17869
- }, this.getEventState(key, type), this.getSharedEventState(key, type), component.props, baseProps, {
17870
- id: id
17871
- });
17853
+ return Array.isArray(props.events) ? (_componentEvents = this.componentEvents).concat.apply(_componentEvents, _toConsumableArray(props.events)) : this.componentEvents;
17854
+ }
17872
17855
 
17873
- var events = lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({}, _events__WEBPACK_IMPORTED_MODULE_11__.getPartialEvents(baseEvents, key, componentProps), componentProps.events);
17856
+ return props.events;
17857
+ }
17858
+ }, {
17859
+ key: "getComponentProps",
17860
+ value: function getComponentProps(component, type, index) {
17861
+ var name = this.props.name || WrappedComponent.role;
17862
+ var key = this.dataKeys && this.dataKeys[index] || index;
17863
+ var id = "".concat(name, "-").concat(type, "-").concat(key);
17864
+ var baseProps = this.baseProps[key] && this.baseProps[key][type] || this.baseProps[key];
17865
+
17866
+ if (!baseProps && !this.hasEvents) {
17867
+ return undefined;
17868
+ }
17874
17869
 
17875
- return lodash_assign__WEBPACK_IMPORTED_MODULE_7___default()({}, componentProps, {
17876
- events: events
17877
- });
17878
- }
17870
+ if (this.hasEvents) {
17871
+ var baseEvents = this.getEvents(this.props, type, key);
17879
17872
 
17880
- return lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({
17873
+ var componentProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({
17881
17874
  index: index,
17882
17875
  key: id
17883
- }, component.props, baseProps, {
17876
+ }, this.getEventState(key, type), this.getSharedEventState(key, type), component.props, baseProps, {
17884
17877
  id: id
17885
17878
  });
17886
- }
17887
- }, {
17888
- key: "renderContainer",
17889
- value: function renderContainer(component, children) {
17890
- var isContainer = component.type && component.type.role === "container";
17891
- var parentProps = isContainer ? this.getComponentProps(component, "parent", "parent") : {};
17892
-
17893
- if (parentProps.events) {
17894
- this.globalEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getGlobalEvents(parentProps.events);
17895
- parentProps.events = _events__WEBPACK_IMPORTED_MODULE_11__.omitGlobalEvents(parentProps.events);
17896
- }
17897
17879
 
17898
- return react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(component, parentProps, children);
17880
+ var events = lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({}, _events__WEBPACK_IMPORTED_MODULE_11__.getPartialEvents(baseEvents, key, componentProps), componentProps.events);
17881
+
17882
+ return lodash_assign__WEBPACK_IMPORTED_MODULE_7___default()({}, componentProps, {
17883
+ events: events
17884
+ });
17899
17885
  }
17900
- }, {
17901
- key: "animateComponent",
17902
- value: function animateComponent(props, defaultAnimationWhitelist) {
17903
- var animationWhitelist = props.animate && props.animate.animationWhitelist ? props.animate.animationWhitelist : defaultAnimationWhitelist;
17904
- return react__WEBPACK_IMPORTED_MODULE_9___default().createElement(_victory_transition_victory_transition__WEBPACK_IMPORTED_MODULE_12__.default, {
17905
- animate: props.animate,
17906
- animationWhitelist: animationWhitelist
17907
- }, react__WEBPACK_IMPORTED_MODULE_9___default().createElement(this.constructor, props));
17908
- } // Used by `VictoryLine` and `VictoryArea`
17909
-
17910
- }, {
17911
- key: "renderContinuousData",
17912
- value: function renderContinuousData(props) {
17913
- var _this8 = this;
17914
-
17915
- var dataComponent = props.dataComponent,
17916
- labelComponent = props.labelComponent,
17917
- groupComponent = props.groupComponent;
17918
-
17919
- var dataKeys = lodash_without__WEBPACK_IMPORTED_MODULE_3___default()(this.dataKeys, "all");
17920
-
17921
- var labelComponents = dataKeys.reduce(function (memo, key) {
17922
- var labelProps = _this8.getComponentProps(labelComponent, "labels", key);
17923
-
17924
- if (labelProps && labelProps.text !== undefined && labelProps.text !== null) {
17925
- memo = memo.concat(react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(labelComponent, labelProps));
17926
- }
17927
17886
 
17928
- return memo;
17929
- }, []);
17930
- var dataProps = this.getComponentProps(dataComponent, "data", "all");
17931
- var children = [react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(dataComponent, dataProps)].concat(_toConsumableArray(labelComponents));
17932
- return this.renderContainer(groupComponent, children);
17887
+ return lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({
17888
+ index: index,
17889
+ key: id
17890
+ }, component.props, baseProps, {
17891
+ id: id
17892
+ });
17893
+ }
17894
+ }, {
17895
+ key: "renderContainer",
17896
+ value: function renderContainer(component, children) {
17897
+ var isContainer = component.type && component.type.role === "container";
17898
+ var parentProps = isContainer ? this.getComponentProps(component, "parent", "parent") : {};
17899
+
17900
+ if (parentProps.events) {
17901
+ this.globalEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getGlobalEvents(parentProps.events);
17902
+ parentProps.events = _events__WEBPACK_IMPORTED_MODULE_11__.omitGlobalEvents(parentProps.events);
17933
17903
  }
17934
- }, {
17935
- key: "renderData",
17936
- value: function renderData(props) {
17937
- var _this9 = this;
17938
-
17939
- var shouldRenderDatum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : datumHasXandY;
17940
- var dataComponent = props.dataComponent,
17941
- labelComponent = props.labelComponent,
17942
- groupComponent = props.groupComponent;
17943
- var dataComponents = this.dataKeys.reduce(function (validDataComponents, _dataKey, index) {
17944
- var dataProps = _this9.getComponentProps(dataComponent, "data", index);
17945
-
17946
- if (shouldRenderDatum(dataProps.datum)) {
17947
- validDataComponents.push(react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(dataComponent, dataProps));
17948
- }
17949
17904
 
17950
- return validDataComponents;
17951
- }, []);
17952
- var labelComponents = this.dataKeys.map(function (_dataKey, index) {
17953
- var labelProps = _this9.getComponentProps(labelComponent, "labels", index);
17905
+ return react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(component, parentProps, children);
17906
+ }
17907
+ }, {
17908
+ key: "animateComponent",
17909
+ value: function animateComponent(props, defaultAnimationWhitelist) {
17910
+ var animationWhitelist = props.animate && props.animate.animationWhitelist ? props.animate.animationWhitelist : defaultAnimationWhitelist;
17911
+ return react__WEBPACK_IMPORTED_MODULE_9___default().createElement(_victory_transition_victory_transition__WEBPACK_IMPORTED_MODULE_12__.default, {
17912
+ animate: props.animate,
17913
+ animationWhitelist: animationWhitelist
17914
+ }, react__WEBPACK_IMPORTED_MODULE_9___default().createElement(this.constructor, props));
17915
+ } // Used by `VictoryLine` and `VictoryArea`
17916
+
17917
+ }, {
17918
+ key: "renderContinuousData",
17919
+ value: function renderContinuousData(props) {
17920
+ var _this8 = this;
17921
+
17922
+ var dataComponent = props.dataComponent,
17923
+ labelComponent = props.labelComponent,
17924
+ groupComponent = props.groupComponent;
17925
+
17926
+ var dataKeys = lodash_without__WEBPACK_IMPORTED_MODULE_3___default()(this.dataKeys, "all");
17927
+
17928
+ var labelComponents = dataKeys.reduce(function (memo, key) {
17929
+ var labelProps = _this8.getComponentProps(labelComponent, "labels", key);
17930
+
17931
+ if (labelProps && labelProps.text !== undefined && labelProps.text !== null) {
17932
+ memo = memo.concat(react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(labelComponent, labelProps));
17933
+ }
17954
17934
 
17955
- if (labelProps.text !== undefined && labelProps.text !== null) {
17956
- return react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(labelComponent, labelProps);
17957
- }
17935
+ return memo;
17936
+ }, []);
17937
+ var dataProps = this.getComponentProps(dataComponent, "data", "all");
17938
+ var children = [react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(dataComponent, dataProps)].concat(_toConsumableArray(labelComponents));
17939
+ return this.renderContainer(groupComponent, children);
17940
+ }
17941
+ }, {
17942
+ key: "renderData",
17943
+ value: function renderData(props) {
17944
+ var _this9 = this;
17945
+
17946
+ var shouldRenderDatum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : datumHasXandY;
17947
+ var dataComponent = props.dataComponent,
17948
+ labelComponent = props.labelComponent,
17949
+ groupComponent = props.groupComponent;
17950
+ var dataComponents = this.dataKeys.reduce(function (validDataComponents, _dataKey, index) {
17951
+ var dataProps = _this9.getComponentProps(dataComponent, "data", index);
17952
+
17953
+ if (shouldRenderDatum(dataProps.datum)) {
17954
+ validDataComponents.push(react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(dataComponent, dataProps));
17955
+ }
17958
17956
 
17959
- return undefined;
17960
- }).filter(Boolean);
17957
+ return validDataComponents;
17958
+ }, []);
17959
+ var labelComponents = this.dataKeys.map(function (_dataKey, index) {
17960
+ var labelProps = _this9.getComponentProps(labelComponent, "labels", index);
17961
17961
 
17962
- var children = _toConsumableArray(dataComponents).concat(_toConsumableArray(labelComponents));
17962
+ if (labelProps.text !== undefined && labelProps.text !== null) {
17963
+ return react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(labelComponent, labelProps);
17964
+ }
17963
17965
 
17964
- return this.renderContainer(groupComponent, children);
17965
- }
17966
- }]);
17966
+ return undefined;
17967
+ }).filter(Boolean);
17968
+
17969
+ var children = _toConsumableArray(dataComponents).concat(_toConsumableArray(labelComponents));
17967
17970
 
17968
- return addEvents;
17969
- }(WrappedComponent)
17970
- );
17971
+ return this.renderContainer(groupComponent, children);
17972
+ }
17973
+ }]);
17974
+
17975
+ return addEvents;
17976
+ }(WrappedComponent);
17971
17977
  });
17972
17978
 
17973
17979
  /***/ }),
@@ -21248,9 +21254,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
21248
21254
 
21249
21255
 
21250
21256
 
21251
- var Timer =
21252
- /*#__PURE__*/
21253
- function () {
21257
+ var Timer = /*#__PURE__*/function () {
21254
21258
  function Timer() {
21255
21259
  _classCallCheck(this, Timer);
21256
21260
 
@@ -21878,12 +21882,20 @@ __webpack_require__.r(__webpack_exports__);
21878
21882
  /* harmony export */ "getBarPosition": () => (/* reexport safe */ _helper_methods__WEBPACK_IMPORTED_MODULE_2__.getBarPosition),
21879
21883
  /* harmony export */ "getVerticalBarPath": () => (/* reexport safe */ _path_helper_methods__WEBPACK_IMPORTED_MODULE_3__.getVerticalBarPath),
21880
21884
  /* harmony export */ "getHorizontalBarPath": () => (/* reexport safe */ _path_helper_methods__WEBPACK_IMPORTED_MODULE_3__.getHorizontalBarPath),
21881
- /* harmony export */ "getVerticalPolarBarPath": () => (/* reexport safe */ _path_helper_methods__WEBPACK_IMPORTED_MODULE_3__.getVerticalPolarBarPath)
21885
+ /* harmony export */ "getVerticalPolarBarPath": () => (/* reexport safe */ _path_helper_methods__WEBPACK_IMPORTED_MODULE_3__.getVerticalPolarBarPath),
21886
+ /* harmony export */ "getCustomBarPath": () => (/* reexport safe */ _path_helper_methods__WEBPACK_IMPORTED_MODULE_3__.getCustomBarPath),
21887
+ /* harmony export */ "getPolarBarPath": () => (/* reexport safe */ _path_helper_methods__WEBPACK_IMPORTED_MODULE_3__.getPolarBarPath),
21888
+ /* harmony export */ "getBarPath": () => (/* reexport safe */ _path_helper_methods__WEBPACK_IMPORTED_MODULE_3__.getBarPath),
21889
+ /* harmony export */ "getBarWidth": () => (/* reexport safe */ _bar_helper_methods__WEBPACK_IMPORTED_MODULE_4__.getBarWidth),
21890
+ /* harmony export */ "getStyle": () => (/* reexport safe */ _bar_helper_methods__WEBPACK_IMPORTED_MODULE_4__.getStyle),
21891
+ /* harmony export */ "getCornerRadius": () => (/* reexport safe */ _bar_helper_methods__WEBPACK_IMPORTED_MODULE_4__.getCornerRadius)
21882
21892
  /* harmony export */ });
21883
21893
  /* harmony import */ var _victory_bar__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./victory-bar */ "./victory-bar.js");
21884
21894
  /* harmony import */ var _bar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bar */ "./bar.js");
21885
21895
  /* harmony import */ var _helper_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./helper-methods */ "./helper-methods.js");
21886
21896
  /* harmony import */ var _path_helper_methods__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./path-helper-methods */ "./path-helper-methods.js");
21897
+ /* harmony import */ var _bar_helper_methods__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./bar-helper-methods */ "./bar-helper-methods.js");
21898
+
21887
21899
 
21888
21900
 
21889
21901