victory-chart 37.2.0 → 37.3.1
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.md +4 -0
- package/dist/victory-chart.js +109 -117
- package/dist/victory-chart.min.js +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
package/dist/victory-chart.js
CHANGED
|
@@ -7139,7 +7139,7 @@ const VictoryPortal = initialProps => {
|
|
|
7139
7139
|
...defaultProps,
|
|
7140
7140
|
...initialProps
|
|
7141
7141
|
};
|
|
7142
|
-
const id = lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default()();
|
|
7142
|
+
const [id] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default()());
|
|
7143
7143
|
const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_3__.usePortalContext)();
|
|
7144
7144
|
if (!portalContext) {
|
|
7145
7145
|
const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
|
|
@@ -7693,20 +7693,16 @@ const orange = {
|
|
|
7693
7693
|
"100": "#FEE2D5",
|
|
7694
7694
|
"300": "#FFA981",
|
|
7695
7695
|
"500": "#FF6F2C",
|
|
7696
|
+
"700": "#FF4E1B",
|
|
7696
7697
|
"900": "#D74D26"
|
|
7697
7698
|
};
|
|
7698
7699
|
const red = {
|
|
7699
7700
|
"100": "#FFDCE5",
|
|
7700
7701
|
"300": "#FF9EB7",
|
|
7701
7702
|
"500": "#F82B60",
|
|
7703
|
+
"700": "#D31A3D",
|
|
7702
7704
|
"900": "#BA1E45"
|
|
7703
7705
|
};
|
|
7704
|
-
const pink = {
|
|
7705
|
-
"100": "#FFDAF6",
|
|
7706
|
-
"300": "#F99DE2",
|
|
7707
|
-
"500": "#FF08C2",
|
|
7708
|
-
"900": "#B2158B"
|
|
7709
|
-
};
|
|
7710
7706
|
const purple = {
|
|
7711
7707
|
"100": "#EDE3FE",
|
|
7712
7708
|
"300": "#CDB0FF",
|
|
@@ -7717,6 +7713,7 @@ const blue = {
|
|
|
7717
7713
|
"100": "#CFDFFF",
|
|
7718
7714
|
"300": "#9CC7FF",
|
|
7719
7715
|
"500": "#2D7FF9",
|
|
7716
|
+
"700": "#0056B3",
|
|
7720
7717
|
"900": "#2750AE"
|
|
7721
7718
|
};
|
|
7722
7719
|
const cyan = {
|
|
@@ -7735,27 +7732,28 @@ const green = {
|
|
|
7735
7732
|
"100": "#D1F7C4",
|
|
7736
7733
|
"300": "#93E088",
|
|
7737
7734
|
"500": "#20C933",
|
|
7735
|
+
"700": "#1B9B2A",
|
|
7738
7736
|
"900": "#338A17"
|
|
7739
7737
|
};
|
|
7740
7738
|
const colors = {
|
|
7741
7739
|
blue: blue["500"],
|
|
7742
|
-
|
|
7743
|
-
teal: teal["500"],
|
|
7744
|
-
purple: purple["500"],
|
|
7740
|
+
cyan: cyan["500"],
|
|
7745
7741
|
green: green["500"],
|
|
7742
|
+
yellow: yellow["500"],
|
|
7746
7743
|
orange: orange["500"],
|
|
7747
|
-
cyan: cyan["500"],
|
|
7748
7744
|
red: red["500"],
|
|
7749
|
-
|
|
7745
|
+
purple: purple["500"],
|
|
7746
|
+
teal: teal["500"]
|
|
7750
7747
|
};
|
|
7751
7748
|
const colorScale = Object.values(colors);
|
|
7752
|
-
const grayscale = [gray["
|
|
7753
|
-
const warm = [yellow["500"], orange["500"],
|
|
7754
|
-
const cool = [
|
|
7755
|
-
const heatmap = [green["500"], yellow["500"], red["500"]];
|
|
7756
|
-
const redPalette =
|
|
7757
|
-
const greenPalette =
|
|
7758
|
-
const bluePalette =
|
|
7749
|
+
const grayscale = [gray["100"], gray["300"], gray["500"], gray["700"], gray["900"]];
|
|
7750
|
+
const warm = [yellow["300"], yellow["500"], orange["500"], orange["900"], red["500"]];
|
|
7751
|
+
const cool = [purple["500"], blue["500"], cyan["500"], teal["500"], green["500"]];
|
|
7752
|
+
const heatmap = [green["900"], green["500"], yellow["500"], orange["500"], red["500"]];
|
|
7753
|
+
const redPalette = Object.values(red);
|
|
7754
|
+
const greenPalette = Object.values(green);
|
|
7755
|
+
const bluePalette = Object.values(blue);
|
|
7756
|
+
const defaultColor = blue["500"];
|
|
7759
7757
|
|
|
7760
7758
|
// *
|
|
7761
7759
|
// * Typography
|
|
@@ -7770,7 +7768,7 @@ const padding = 8;
|
|
|
7770
7768
|
const baseProps = {
|
|
7771
7769
|
width: 450,
|
|
7772
7770
|
height: 300,
|
|
7773
|
-
padding:
|
|
7771
|
+
padding: 60,
|
|
7774
7772
|
colorScale
|
|
7775
7773
|
};
|
|
7776
7774
|
// *
|
|
@@ -7814,7 +7812,7 @@ const clean = {
|
|
|
7814
7812
|
area: Object.assign({
|
|
7815
7813
|
style: {
|
|
7816
7814
|
data: {
|
|
7817
|
-
fill:
|
|
7815
|
+
fill: defaultColor,
|
|
7818
7816
|
strokeWidth: 2,
|
|
7819
7817
|
fillOpacity: 0.5
|
|
7820
7818
|
},
|
|
@@ -7831,7 +7829,7 @@ const clean = {
|
|
|
7831
7829
|
strokeLinejoin
|
|
7832
7830
|
},
|
|
7833
7831
|
axisLabel: Object.assign({}, centeredLabelStyles, {
|
|
7834
|
-
padding,
|
|
7832
|
+
padding: 35,
|
|
7835
7833
|
stroke: "transparent"
|
|
7836
7834
|
}),
|
|
7837
7835
|
grid: {
|
|
@@ -7896,7 +7894,7 @@ const clean = {
|
|
|
7896
7894
|
bar: Object.assign({
|
|
7897
7895
|
style: {
|
|
7898
7896
|
data: {
|
|
7899
|
-
fill:
|
|
7897
|
+
fill: defaultColor,
|
|
7900
7898
|
padding,
|
|
7901
7899
|
strokeWidth: 1,
|
|
7902
7900
|
fillOpacity: 0.5
|
|
@@ -7935,7 +7933,7 @@ const clean = {
|
|
|
7935
7933
|
}),
|
|
7936
7934
|
q1: {
|
|
7937
7935
|
padding,
|
|
7938
|
-
fill:
|
|
7936
|
+
fill: colorScale[0],
|
|
7939
7937
|
rx: borderRadius,
|
|
7940
7938
|
strokeWidth: 2
|
|
7941
7939
|
},
|
|
@@ -7944,7 +7942,7 @@ const clean = {
|
|
|
7944
7942
|
}),
|
|
7945
7943
|
q3: {
|
|
7946
7944
|
padding,
|
|
7947
|
-
fill:
|
|
7945
|
+
fill: colorScale[1],
|
|
7948
7946
|
rx: borderRadius
|
|
7949
7947
|
},
|
|
7950
7948
|
q3Labels: Object.assign({}, baseLabelStyles, {
|
|
@@ -7965,8 +7963,8 @@ const clean = {
|
|
|
7965
7963
|
})
|
|
7966
7964
|
},
|
|
7967
7965
|
candleColors: {
|
|
7968
|
-
positive:
|
|
7969
|
-
negative:
|
|
7966
|
+
positive: green["500"],
|
|
7967
|
+
negative: red["500"]
|
|
7970
7968
|
},
|
|
7971
7969
|
wickStrokeWidth: 2
|
|
7972
7970
|
}, baseProps),
|
|
@@ -8032,7 +8030,7 @@ const clean = {
|
|
|
8032
8030
|
data: {
|
|
8033
8031
|
fill: "transparent",
|
|
8034
8032
|
opacity: 1,
|
|
8035
|
-
stroke:
|
|
8033
|
+
stroke: defaultColor,
|
|
8036
8034
|
strokeWidth: 2,
|
|
8037
8035
|
strokeLinecap,
|
|
8038
8036
|
strokeLinejoin
|
|
@@ -8063,7 +8061,7 @@ const clean = {
|
|
|
8063
8061
|
scatter: Object.assign({
|
|
8064
8062
|
style: {
|
|
8065
8063
|
data: {
|
|
8066
|
-
fill:
|
|
8064
|
+
fill: defaultColor,
|
|
8067
8065
|
opacity: 1,
|
|
8068
8066
|
stroke: "transparent",
|
|
8069
8067
|
strokeWidth: 0
|
|
@@ -8101,9 +8099,8 @@ const clean = {
|
|
|
8101
8099
|
style: {
|
|
8102
8100
|
data: {
|
|
8103
8101
|
fill: blue["100"],
|
|
8104
|
-
stroke:
|
|
8105
|
-
strokeWidth: 2
|
|
8106
|
-
opacity: 0.4
|
|
8102
|
+
stroke: defaultColor,
|
|
8103
|
+
strokeWidth: 2
|
|
8107
8104
|
},
|
|
8108
8105
|
labels: Object.assign({}, baseLabelStyles, {
|
|
8109
8106
|
padding: 5,
|
|
@@ -13129,34 +13126,31 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
13129
13126
|
/* harmony export */ "getDomain": function() { return /* binding */ getDomain; },
|
|
13130
13127
|
/* harmony export */ "getDomainFromChildren": function() { return /* binding */ getDomainFromChildren; },
|
|
13131
13128
|
/* harmony export */ "getScale": function() { return /* binding */ getScale; },
|
|
13132
|
-
/* harmony export */ "getStringsFromCategories": function() { return /* binding */ getStringsFromCategories; },
|
|
13133
13129
|
/* harmony export */ "getStringsFromChildren": function() { return /* binding */ getStringsFromChildren; },
|
|
13130
|
+
/* harmony export */ "getStringsFromChildrenCategories": function() { return /* binding */ getStringsFromChildrenCategories; },
|
|
13134
13131
|
/* harmony export */ "getStringsFromData": function() { return /* binding */ getStringsFromData; },
|
|
13135
13132
|
/* harmony export */ "getStyle": function() { return /* binding */ getStyle; },
|
|
13136
13133
|
/* harmony export */ "getWidth": function() { return /* binding */ getWidth; }
|
|
13137
13134
|
/* harmony export */ });
|
|
13138
|
-
/* harmony import */ var
|
|
13139
|
-
/* harmony import */ var
|
|
13140
|
-
/* harmony import */ var
|
|
13141
|
-
/* harmony import */ var
|
|
13142
|
-
/* harmony import */ var
|
|
13143
|
-
/* harmony import */ var
|
|
13144
|
-
/* harmony import */ var
|
|
13145
|
-
/* harmony import */ var
|
|
13146
|
-
/* harmony import */ var
|
|
13147
|
-
/* harmony import */ var
|
|
13148
|
-
/* harmony import */ var
|
|
13149
|
-
/* harmony import */ var
|
|
13150
|
-
/* harmony import */ var
|
|
13151
|
-
/* harmony import */ var
|
|
13152
|
-
/* harmony import */ var
|
|
13153
|
-
/* harmony import */ var
|
|
13154
|
-
/* harmony import */ var
|
|
13155
|
-
/* harmony import */ var
|
|
13156
|
-
/* harmony import */ var
|
|
13157
|
-
/* harmony import */ var _scale__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./scale */ "../../victory-core/es/victory-util/scale.js");
|
|
13158
|
-
/* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./log */ "../../victory-core/es/victory-util/log.js");
|
|
13159
|
-
|
|
13135
|
+
/* harmony import */ var lodash_uniqBy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/uniqBy */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/uniqBy.js");
|
|
13136
|
+
/* harmony import */ var lodash_uniqBy__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqBy__WEBPACK_IMPORTED_MODULE_0__);
|
|
13137
|
+
/* harmony import */ var lodash_groupBy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/groupBy */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/groupBy.js");
|
|
13138
|
+
/* harmony import */ var lodash_groupBy__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_groupBy__WEBPACK_IMPORTED_MODULE_1__);
|
|
13139
|
+
/* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash/uniq */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/uniq.js");
|
|
13140
|
+
/* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_uniq__WEBPACK_IMPORTED_MODULE_2__);
|
|
13141
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaults.js");
|
|
13142
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_3__);
|
|
13143
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "react");
|
|
13144
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
|
|
13145
|
+
/* harmony import */ var _axis__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./axis */ "../../victory-core/es/victory-util/axis.js");
|
|
13146
|
+
/* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./style */ "../../victory-core/es/victory-util/style.js");
|
|
13147
|
+
/* harmony import */ var _data__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./data */ "../../victory-core/es/victory-util/data.js");
|
|
13148
|
+
/* harmony import */ var _domain__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./domain */ "../../victory-core/es/victory-util/domain.js");
|
|
13149
|
+
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./events */ "../../victory-core/es/victory-util/events.js");
|
|
13150
|
+
/* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./collection */ "../../victory-core/es/victory-util/collection.js");
|
|
13151
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
13152
|
+
/* harmony import */ var _scale__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./scale */ "../../victory-core/es/victory-util/scale.js");
|
|
13153
|
+
/* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./log */ "../../victory-core/es/victory-util/log.js");
|
|
13160
13154
|
|
|
13161
13155
|
|
|
13162
13156
|
|
|
@@ -13185,7 +13179,7 @@ function addBinsToParentPropsIfHistogram(_ref) {
|
|
|
13185
13179
|
return child.type && child.type.role === "histogram";
|
|
13186
13180
|
});
|
|
13187
13181
|
if (someChildrenAreHistograms && !allChildrenAreHistograms) {
|
|
13188
|
-
|
|
13182
|
+
_log__WEBPACK_IMPORTED_MODULE_5__.warn("VictoryHistogram only supports being stacked with other VictoryHistogram components. Check to make sure that you are only passing VictoryHistogram components to VictoryStack");
|
|
13189
13183
|
}
|
|
13190
13184
|
|
|
13191
13185
|
// if we are stacking histograms, we need to generate explicit bins
|
|
@@ -13198,7 +13192,7 @@ function addBinsToParentPropsIfHistogram(_ref) {
|
|
|
13198
13192
|
// if we have explicit bins then we don't need to calculate them
|
|
13199
13193
|
if (!Array.isArray(childBins)) {
|
|
13200
13194
|
const combinedData = children.reduce((memo, child) => {
|
|
13201
|
-
const xAccessor =
|
|
13195
|
+
const xAccessor = _helpers__WEBPACK_IMPORTED_MODULE_6__.createAccessor(child.props.x || "x");
|
|
13202
13196
|
return memo.concat(child.props.data.map(datum => ({
|
|
13203
13197
|
x: xAccessor(datum)
|
|
13204
13198
|
})));
|
|
@@ -13241,7 +13235,7 @@ function getDataFromChildren(props, childComponents) {
|
|
|
13241
13235
|
maxDomain
|
|
13242
13236
|
};
|
|
13243
13237
|
let stack = 0;
|
|
13244
|
-
const children = childComponents ? childComponents.slice(0) :
|
|
13238
|
+
const children = childComponents ? childComponents.slice(0) : react__WEBPACK_IMPORTED_MODULE_4___default().Children.toArray(props.children);
|
|
13245
13239
|
parentProps = addBinsToParentPropsIfHistogram({
|
|
13246
13240
|
children,
|
|
13247
13241
|
props,
|
|
@@ -13252,13 +13246,13 @@ function getDataFromChildren(props, childComponents) {
|
|
|
13252
13246
|
const childProps = Object.assign({}, child.props, parentProps);
|
|
13253
13247
|
let childData;
|
|
13254
13248
|
let childElement = child;
|
|
13255
|
-
if (!
|
|
13249
|
+
if (!_data__WEBPACK_IMPORTED_MODULE_7__.isDataComponent(child)) {
|
|
13256
13250
|
return null;
|
|
13257
|
-
} else if (child.type &&
|
|
13258
|
-
childElement = parent ? /*#__PURE__*/
|
|
13251
|
+
} else if (child.type && _helpers__WEBPACK_IMPORTED_MODULE_6__.isFunction(child.type.getData)) {
|
|
13252
|
+
childElement = parent ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().cloneElement(child, parent.props) : child;
|
|
13259
13253
|
childData = childElement.type.getData(childProps);
|
|
13260
13254
|
} else {
|
|
13261
|
-
childData =
|
|
13255
|
+
childData = _data__WEBPACK_IMPORTED_MODULE_7__.getData(childProps);
|
|
13262
13256
|
}
|
|
13263
13257
|
stack += 1;
|
|
13264
13258
|
return childData.map((datum, index) => Object.assign({
|
|
@@ -13267,23 +13261,23 @@ function getDataFromChildren(props, childComponents) {
|
|
|
13267
13261
|
}, datum));
|
|
13268
13262
|
};
|
|
13269
13263
|
const stacked = children.filter(c => c.type && c.type.role === "stack").length;
|
|
13270
|
-
const combine = (memo, val) => memo.concat(
|
|
13271
|
-
const datasets =
|
|
13264
|
+
const combine = (memo, val) => memo.concat(lodash_uniqBy__WEBPACK_IMPORTED_MODULE_0___default()(val, "_group"));
|
|
13265
|
+
const datasets = _helpers__WEBPACK_IMPORTED_MODULE_6__.reduceChildren(children, iteratee, props, [], combine);
|
|
13272
13266
|
const group = stacked ? "_group" : "_stack";
|
|
13273
|
-
return Object.values(
|
|
13267
|
+
return Object.values(lodash_groupBy__WEBPACK_IMPORTED_MODULE_1___default()(datasets, group));
|
|
13274
13268
|
}
|
|
13275
13269
|
function getData(props, childComponents) {
|
|
13276
13270
|
if (props.data) {
|
|
13277
|
-
return
|
|
13271
|
+
return _data__WEBPACK_IMPORTED_MODULE_7__.getData(props);
|
|
13278
13272
|
}
|
|
13279
|
-
return getDataFromChildren(props, childComponents ||
|
|
13273
|
+
return getDataFromChildren(props, childComponents || react__WEBPACK_IMPORTED_MODULE_4___default().Children.toArray(props.children));
|
|
13280
13274
|
}
|
|
13281
13275
|
function getWidth(props, groupLength, seriesLength) {
|
|
13282
13276
|
const {
|
|
13283
13277
|
datasets,
|
|
13284
13278
|
horizontal
|
|
13285
13279
|
} = props;
|
|
13286
|
-
const range = horizontal ?
|
|
13280
|
+
const range = horizontal ? _helpers__WEBPACK_IMPORTED_MODULE_6__.getRange(props, "y") : _helpers__WEBPACK_IMPORTED_MODULE_6__.getRange(props, "x");
|
|
13287
13281
|
const extent = Math.abs(range[1] - range[0]);
|
|
13288
13282
|
const seriesLengthValue = seriesLength !== undefined ? seriesLength : Array.isArray(datasets[0]) && datasets[0].length || 1;
|
|
13289
13283
|
const groupLengthValue = groupLength || datasets.length;
|
|
@@ -13329,8 +13323,8 @@ function getDefaultDomainPadding(props, axis, childComponents) {
|
|
|
13329
13323
|
}
|
|
13330
13324
|
function getDomainFromChildren(props, axis, childComponents) {
|
|
13331
13325
|
// eslint-disable-line max-statements, complexity, max-len
|
|
13332
|
-
const children = childComponents ? childComponents.slice(0) :
|
|
13333
|
-
const parentData = props.data ?
|
|
13326
|
+
const children = childComponents ? childComponents.slice(0) : react__WEBPACK_IMPORTED_MODULE_4___default().Children.toArray(props.children);
|
|
13327
|
+
const parentData = props.data ? _data__WEBPACK_IMPORTED_MODULE_7__.getData(props) : undefined;
|
|
13334
13328
|
const {
|
|
13335
13329
|
polar,
|
|
13336
13330
|
startAngle,
|
|
@@ -13354,58 +13348,58 @@ function getDomainFromChildren(props, axis, childComponents) {
|
|
|
13354
13348
|
}) : baseParentProps;
|
|
13355
13349
|
const iteratee = child => {
|
|
13356
13350
|
const sharedProps = Object.assign({}, child.props, parentProps);
|
|
13357
|
-
if (!
|
|
13351
|
+
if (!_domain__WEBPACK_IMPORTED_MODULE_8__.isDomainComponent(child)) {
|
|
13358
13352
|
return null;
|
|
13359
|
-
} else if (child.type &&
|
|
13353
|
+
} else if (child.type && _helpers__WEBPACK_IMPORTED_MODULE_6__.isFunction(child.type.getDomain)) {
|
|
13360
13354
|
return child.props && child.type.getDomain(sharedProps, axis);
|
|
13361
13355
|
}
|
|
13362
|
-
return
|
|
13356
|
+
return _domain__WEBPACK_IMPORTED_MODULE_8__.getDomain(sharedProps, axis);
|
|
13363
13357
|
};
|
|
13364
|
-
const childDomains =
|
|
13365
|
-
const min = childDomains.length === 0 ? 0 :
|
|
13366
|
-
const max = childDomains.length === 0 ? 1 :
|
|
13358
|
+
const childDomains = _helpers__WEBPACK_IMPORTED_MODULE_6__.reduceChildren(children, iteratee, props);
|
|
13359
|
+
const min = childDomains.length === 0 ? 0 : _collection__WEBPACK_IMPORTED_MODULE_9__.getMinValue(childDomains);
|
|
13360
|
+
const max = childDomains.length === 0 ? 1 : _collection__WEBPACK_IMPORTED_MODULE_9__.getMaxValue(childDomains);
|
|
13367
13361
|
return [min, max];
|
|
13368
13362
|
}
|
|
13369
13363
|
function getDomain(props, axis, childComponents) {
|
|
13370
|
-
const children = childComponents ||
|
|
13371
|
-
const propsDomain =
|
|
13364
|
+
const children = childComponents || react__WEBPACK_IMPORTED_MODULE_4___default().Children.toArray(props.children);
|
|
13365
|
+
const propsDomain = _domain__WEBPACK_IMPORTED_MODULE_8__.getDomainFromProps(props, axis);
|
|
13372
13366
|
const domainPadding = getDefaultDomainPadding(props, axis, children);
|
|
13373
13367
|
let domain;
|
|
13374
13368
|
if (propsDomain) {
|
|
13375
13369
|
domain = propsDomain;
|
|
13376
13370
|
} else {
|
|
13377
|
-
const minDomain =
|
|
13378
|
-
const maxDomain =
|
|
13379
|
-
const dataset = (props.data || props.y) &&
|
|
13380
|
-
const dataDomain = dataset ?
|
|
13371
|
+
const minDomain = _domain__WEBPACK_IMPORTED_MODULE_8__.getMinFromProps(props, axis);
|
|
13372
|
+
const maxDomain = _domain__WEBPACK_IMPORTED_MODULE_8__.getMaxFromProps(props, axis);
|
|
13373
|
+
const dataset = (props.data || props.y) && _data__WEBPACK_IMPORTED_MODULE_7__.getData(props);
|
|
13374
|
+
const dataDomain = dataset ? _domain__WEBPACK_IMPORTED_MODULE_8__.getDomainFromData(props, axis, dataset) : [];
|
|
13381
13375
|
const childDomain = getDomainFromChildren(props, axis, children);
|
|
13382
|
-
const min = minDomain ||
|
|
13383
|
-
const max = maxDomain ||
|
|
13384
|
-
domain =
|
|
13376
|
+
const min = minDomain || _collection__WEBPACK_IMPORTED_MODULE_9__.getMinValue([...dataDomain, ...childDomain]);
|
|
13377
|
+
const max = maxDomain || _collection__WEBPACK_IMPORTED_MODULE_9__.getMaxValue([...dataDomain, ...childDomain]);
|
|
13378
|
+
domain = _domain__WEBPACK_IMPORTED_MODULE_8__.getDomainFromMinMax(min, max);
|
|
13385
13379
|
}
|
|
13386
|
-
return
|
|
13380
|
+
return _domain__WEBPACK_IMPORTED_MODULE_8__.formatDomain(domain, Object.assign({
|
|
13387
13381
|
domainPadding
|
|
13388
13382
|
}, props), axis);
|
|
13389
13383
|
}
|
|
13390
13384
|
function getScale(props, axis, childComponents) {
|
|
13391
13385
|
if (props.data) {
|
|
13392
|
-
return
|
|
13386
|
+
return _scale__WEBPACK_IMPORTED_MODULE_10__.getBaseScale(props, axis);
|
|
13393
13387
|
}
|
|
13394
|
-
const children = childComponents ? childComponents.slice(0) :
|
|
13388
|
+
const children = childComponents ? childComponents.slice(0) : react__WEBPACK_IMPORTED_MODULE_4___default().Children.toArray(props.children);
|
|
13395
13389
|
const iteratee = child => {
|
|
13396
13390
|
const sharedProps = Object.assign({}, child.props, {
|
|
13397
13391
|
horizontal: props.horizontal
|
|
13398
13392
|
});
|
|
13399
|
-
return
|
|
13393
|
+
return _scale__WEBPACK_IMPORTED_MODULE_10__.getScaleType(sharedProps, axis);
|
|
13400
13394
|
};
|
|
13401
|
-
const childScale =
|
|
13395
|
+
const childScale = lodash_uniq__WEBPACK_IMPORTED_MODULE_2___default()(_helpers__WEBPACK_IMPORTED_MODULE_6__.reduceChildren(children, iteratee, props));
|
|
13402
13396
|
|
|
13403
13397
|
// default to linear scale if more than one uniq scale type is given by children
|
|
13404
|
-
return childScale.length > 1 ?
|
|
13398
|
+
return childScale.length > 1 ? _scale__WEBPACK_IMPORTED_MODULE_10__.getScaleFromName("linear") : _scale__WEBPACK_IMPORTED_MODULE_10__.getScaleFromName(childScale[0]);
|
|
13405
13399
|
}
|
|
13406
13400
|
function getAllEvents(props) {
|
|
13407
13401
|
const components = ["groupComponent", "containerComponent", "labelComponent"];
|
|
13408
|
-
const componentEvents =
|
|
13402
|
+
const componentEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getComponentEvents(props, components);
|
|
13409
13403
|
let events = props.events;
|
|
13410
13404
|
if (Array.isArray(componentEvents)) {
|
|
13411
13405
|
events = Array.isArray(props.events) ? componentEvents.concat(...props.events) : componentEvents;
|
|
@@ -13431,12 +13425,12 @@ function getColor(calculatedProps, child, index, theme) {
|
|
|
13431
13425
|
if (!colorScale && !color) {
|
|
13432
13426
|
return undefined;
|
|
13433
13427
|
}
|
|
13434
|
-
const colors = Array.isArray(colorScale) ? colorScale :
|
|
13428
|
+
const colors = Array.isArray(colorScale) ? colorScale : _style__WEBPACK_IMPORTED_MODULE_12__.getColorScale(colorScale, theme);
|
|
13435
13429
|
return color || colors[index % colors.length];
|
|
13436
13430
|
}
|
|
13437
13431
|
function getStyle(theme, style, role) {
|
|
13438
13432
|
const defaultStyle = theme && theme[role] && theme[role].style ? theme[role].style : {};
|
|
13439
|
-
return
|
|
13433
|
+
return _helpers__WEBPACK_IMPORTED_MODULE_6__.getStyles(style, defaultStyle);
|
|
13440
13434
|
}
|
|
13441
13435
|
|
|
13442
13436
|
// eslint-disable-next-line max-params
|
|
@@ -13460,8 +13454,8 @@ function getChildStyle(child, index, calculatedProps, theme) {
|
|
|
13460
13454
|
const dataWidth = role === "stack" ? {} : {
|
|
13461
13455
|
width: getWidth(calculatedProps)
|
|
13462
13456
|
};
|
|
13463
|
-
const dataStyle =
|
|
13464
|
-
const labelsStyle =
|
|
13457
|
+
const dataStyle = lodash_defaults__WEBPACK_IMPORTED_MODULE_3___default()({}, childStyle.data, Object.assign({}, dataWidth, style.data, defaultColor));
|
|
13458
|
+
const labelsStyle = lodash_defaults__WEBPACK_IMPORTED_MODULE_3___default()({}, childStyle.labels, style.labels);
|
|
13465
13459
|
return {
|
|
13466
13460
|
...childStyle,
|
|
13467
13461
|
parent: style.parent,
|
|
@@ -13469,28 +13463,26 @@ function getChildStyle(child, index, calculatedProps, theme) {
|
|
|
13469
13463
|
labels: labelsStyle
|
|
13470
13464
|
};
|
|
13471
13465
|
}
|
|
13472
|
-
function
|
|
13466
|
+
function getStringsFromChildrenCategories(childComponents, axis) {
|
|
13473
13467
|
const iteratee = child => {
|
|
13474
|
-
|
|
13475
|
-
if (!_domain__WEBPACK_IMPORTED_MODULE_9__.isDomainComponent(child) || !childProps.categories) {
|
|
13468
|
+
if (!_domain__WEBPACK_IMPORTED_MODULE_8__.isDomainComponent(child)) {
|
|
13476
13469
|
return null;
|
|
13477
13470
|
}
|
|
13478
|
-
const
|
|
13479
|
-
|
|
13480
|
-
return categoryStrings ? _collection__WEBPACK_IMPORTED_MODULE_10__.removeUndefined(categoryStrings) : [];
|
|
13471
|
+
const childProps = child.props || {};
|
|
13472
|
+
return _data__WEBPACK_IMPORTED_MODULE_7__.getStringsFromCategories(childProps, axis);
|
|
13481
13473
|
};
|
|
13482
|
-
return
|
|
13474
|
+
return _helpers__WEBPACK_IMPORTED_MODULE_6__.reduceChildren(childComponents.slice(0), iteratee);
|
|
13483
13475
|
}
|
|
13484
13476
|
function getStringsFromData(childComponents) {
|
|
13485
13477
|
const iteratee = child => {
|
|
13486
13478
|
const childProps = child.props || {};
|
|
13487
13479
|
let data;
|
|
13488
|
-
if (!
|
|
13480
|
+
if (!_data__WEBPACK_IMPORTED_MODULE_7__.isDataComponent(child)) {
|
|
13489
13481
|
return null;
|
|
13490
|
-
} else if (child.type &&
|
|
13482
|
+
} else if (child.type && _helpers__WEBPACK_IMPORTED_MODULE_6__.isFunction(child.type.getData)) {
|
|
13491
13483
|
data = child.type.getData(childProps);
|
|
13492
13484
|
} else {
|
|
13493
|
-
data =
|
|
13485
|
+
data = _data__WEBPACK_IMPORTED_MODULE_7__.getData(childProps);
|
|
13494
13486
|
}
|
|
13495
13487
|
return data.map(d => ({
|
|
13496
13488
|
x: d.xName,
|
|
@@ -13509,28 +13501,28 @@ function getStringsFromData(childComponents) {
|
|
|
13509
13501
|
y: y !== undefined ? memo.y.concat(y) : memo.y
|
|
13510
13502
|
};
|
|
13511
13503
|
};
|
|
13512
|
-
return
|
|
13504
|
+
return _helpers__WEBPACK_IMPORTED_MODULE_6__.reduceChildren(childComponents.slice(0), iteratee, {}, initialMemo, combine);
|
|
13513
13505
|
}
|
|
13514
13506
|
function getCategoryAndAxisStringsFromChildren(props, axis, childComponents) {
|
|
13515
|
-
const categories =
|
|
13516
|
-
const axisComponent =
|
|
13517
|
-
const axisStrings = axisComponent ?
|
|
13518
|
-
const categoryStrings = categories
|
|
13519
|
-
return
|
|
13507
|
+
const categories = _data__WEBPACK_IMPORTED_MODULE_7__.getStringsFromCategories(props, axis);
|
|
13508
|
+
const axisComponent = _axis__WEBPACK_IMPORTED_MODULE_13__.getAxisComponent(childComponents, axis);
|
|
13509
|
+
const axisStrings = axisComponent ? _data__WEBPACK_IMPORTED_MODULE_7__.getStringsFromAxes(axisComponent.props, axis) : [];
|
|
13510
|
+
const categoryStrings = categories.length ? categories : getStringsFromChildrenCategories(childComponents, axis);
|
|
13511
|
+
return lodash_uniq__WEBPACK_IMPORTED_MODULE_2___default()([...categoryStrings, ...axisStrings].flat());
|
|
13520
13512
|
}
|
|
13521
13513
|
function getStringsFromChildren(props, childComponents) {
|
|
13522
|
-
const children = childComponents ||
|
|
13514
|
+
const children = childComponents || react__WEBPACK_IMPORTED_MODULE_4___default().Children.toArray(props.children);
|
|
13523
13515
|
const xStrings = getCategoryAndAxisStringsFromChildren(props, "x", children);
|
|
13524
13516
|
const yStrings = getCategoryAndAxisStringsFromChildren(props, "y", children);
|
|
13525
13517
|
const dataStrings = getStringsFromData(children);
|
|
13526
13518
|
return {
|
|
13527
|
-
x:
|
|
13528
|
-
y:
|
|
13519
|
+
x: lodash_uniq__WEBPACK_IMPORTED_MODULE_2___default()([...xStrings, ...dataStrings.x].flat()),
|
|
13520
|
+
y: lodash_uniq__WEBPACK_IMPORTED_MODULE_2___default()([...yStrings, ...dataStrings.y].flat())
|
|
13529
13521
|
};
|
|
13530
13522
|
}
|
|
13531
13523
|
function getCategories(props, childComponents, allStrings) {
|
|
13532
|
-
const xPropCategories = props.categories &&
|
|
13533
|
-
const yPropCategories = props.categories &&
|
|
13524
|
+
const xPropCategories = props.categories && _data__WEBPACK_IMPORTED_MODULE_7__.getStringsFromCategories(props, "x");
|
|
13525
|
+
const yPropCategories = props.categories && _data__WEBPACK_IMPORTED_MODULE_7__.getStringsFromCategories(props, "y");
|
|
13534
13526
|
const fallbackRequired = !xPropCategories || !yPropCategories;
|
|
13535
13527
|
const fallbackProps = fallbackRequired ? allStrings || getStringsFromChildren(props, childComponents) : {};
|
|
13536
13528
|
const xCategories = xPropCategories || fallbackProps.x;
|