victory-create-container 37.1.2 → 37.3.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.
- package/CHANGELOG.md +4 -0
- package/dist/victory-create-container.js +294 -168
- package/dist/victory-create-container.min.js +1 -1
- package/package.json +7 -7
|
@@ -8177,31 +8177,34 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8177
8177
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
8178
8178
|
/* harmony export */ "VictoryPortal": function() { return /* binding */ VictoryPortal; }
|
|
8179
8179
|
/* harmony export */ });
|
|
8180
|
-
/* harmony import */ var
|
|
8181
|
-
/* harmony import */ var
|
|
8182
|
-
/* harmony import */ var
|
|
8183
|
-
/* harmony import */ var
|
|
8184
|
-
/* harmony import */ var
|
|
8185
|
-
/* harmony import */ var
|
|
8186
|
-
/* harmony import */ var
|
|
8180
|
+
/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/uniqueId */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/uniqueId.js");
|
|
8181
|
+
/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0__);
|
|
8182
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaults.js");
|
|
8183
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
8184
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
|
|
8185
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
|
|
8186
|
+
/* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
|
|
8187
|
+
/* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
8188
|
+
/* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
|
|
8189
|
+
|
|
8187
8190
|
|
|
8188
8191
|
|
|
8189
8192
|
|
|
8190
8193
|
|
|
8191
8194
|
|
|
8192
8195
|
const defaultProps = {
|
|
8193
|
-
groupComponent: /*#__PURE__*/
|
|
8196
|
+
groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement("g", null)
|
|
8194
8197
|
};
|
|
8195
8198
|
const VictoryPortal = initialProps => {
|
|
8196
8199
|
const props = {
|
|
8197
8200
|
...defaultProps,
|
|
8198
8201
|
...initialProps
|
|
8199
8202
|
};
|
|
8200
|
-
const id =
|
|
8201
|
-
const portalContext = (0,
|
|
8203
|
+
const [id] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default()());
|
|
8204
|
+
const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_3__.usePortalContext)();
|
|
8202
8205
|
if (!portalContext) {
|
|
8203
8206
|
const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
|
|
8204
|
-
|
|
8207
|
+
_victory_util_log__WEBPACK_IMPORTED_MODULE_4__.warn(msg);
|
|
8205
8208
|
}
|
|
8206
8209
|
const children = Array.isArray(props.children) ? props.children[0] : props.children;
|
|
8207
8210
|
const {
|
|
@@ -8212,15 +8215,15 @@ const VictoryPortal = initialProps => {
|
|
|
8212
8215
|
groupComponent,
|
|
8213
8216
|
standalone: false
|
|
8214
8217
|
} : {};
|
|
8215
|
-
const newProps =
|
|
8218
|
+
const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__.omit(props, ["children", "groupComponent"]), {
|
|
8216
8219
|
key: childProps.key ?? id
|
|
8217
8220
|
});
|
|
8218
|
-
const child = children && /*#__PURE__*/
|
|
8219
|
-
|
|
8221
|
+
const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().cloneElement(children, newProps);
|
|
8222
|
+
react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
|
|
8220
8223
|
portalContext?.addChild(id, child);
|
|
8221
8224
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
8222
8225
|
}, [props.children]);
|
|
8223
|
-
|
|
8226
|
+
react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
|
|
8224
8227
|
return () => portalContext?.removeChild(id);
|
|
8225
8228
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
8226
8229
|
}, []);
|
|
@@ -8608,20 +8611,16 @@ const orange = {
|
|
|
8608
8611
|
"100": "#FEE2D5",
|
|
8609
8612
|
"300": "#FFA981",
|
|
8610
8613
|
"500": "#FF6F2C",
|
|
8614
|
+
"700": "#FF4E1B",
|
|
8611
8615
|
"900": "#D74D26"
|
|
8612
8616
|
};
|
|
8613
8617
|
const red = {
|
|
8614
8618
|
"100": "#FFDCE5",
|
|
8615
8619
|
"300": "#FF9EB7",
|
|
8616
8620
|
"500": "#F82B60",
|
|
8621
|
+
"700": "#D31A3D",
|
|
8617
8622
|
"900": "#BA1E45"
|
|
8618
8623
|
};
|
|
8619
|
-
const pink = {
|
|
8620
|
-
"100": "#FFDAF6",
|
|
8621
|
-
"300": "#F99DE2",
|
|
8622
|
-
"500": "#FF08C2",
|
|
8623
|
-
"900": "#B2158B"
|
|
8624
|
-
};
|
|
8625
8624
|
const purple = {
|
|
8626
8625
|
"100": "#EDE3FE",
|
|
8627
8626
|
"300": "#CDB0FF",
|
|
@@ -8632,6 +8631,7 @@ const blue = {
|
|
|
8632
8631
|
"100": "#CFDFFF",
|
|
8633
8632
|
"300": "#9CC7FF",
|
|
8634
8633
|
"500": "#2D7FF9",
|
|
8634
|
+
"700": "#0056B3",
|
|
8635
8635
|
"900": "#2750AE"
|
|
8636
8636
|
};
|
|
8637
8637
|
const cyan = {
|
|
@@ -8650,9 +8650,29 @@ const green = {
|
|
|
8650
8650
|
"100": "#D1F7C4",
|
|
8651
8651
|
"300": "#93E088",
|
|
8652
8652
|
"500": "#20C933",
|
|
8653
|
+
"700": "#1B9B2A",
|
|
8653
8654
|
"900": "#338A17"
|
|
8654
8655
|
};
|
|
8655
|
-
const colors =
|
|
8656
|
+
const colors = {
|
|
8657
|
+
blue: blue["500"],
|
|
8658
|
+
cyan: cyan["500"],
|
|
8659
|
+
green: green["500"],
|
|
8660
|
+
yellow: yellow["500"],
|
|
8661
|
+
orange: orange["500"],
|
|
8662
|
+
red: red["500"],
|
|
8663
|
+
purple: purple["500"],
|
|
8664
|
+
teal: teal["500"]
|
|
8665
|
+
};
|
|
8666
|
+
const colorScale = Object.values(colors);
|
|
8667
|
+
const grayscale = [gray["100"], gray["300"], gray["500"], gray["700"], gray["900"]];
|
|
8668
|
+
const warm = [yellow["300"], yellow["500"], orange["500"], orange["900"], red["500"]];
|
|
8669
|
+
const cool = [purple["500"], blue["500"], cyan["500"], teal["500"], green["500"]];
|
|
8670
|
+
const heatmap = [green["900"], green["500"], yellow["500"], orange["500"], red["500"]];
|
|
8671
|
+
const redPalette = Object.values(red);
|
|
8672
|
+
const greenPalette = Object.values(green);
|
|
8673
|
+
const bluePalette = Object.values(blue);
|
|
8674
|
+
const defaultColor = blue["500"];
|
|
8675
|
+
|
|
8656
8676
|
// *
|
|
8657
8677
|
// * Typography
|
|
8658
8678
|
// *
|
|
@@ -8666,8 +8686,8 @@ const padding = 8;
|
|
|
8666
8686
|
const baseProps = {
|
|
8667
8687
|
width: 450,
|
|
8668
8688
|
height: 300,
|
|
8669
|
-
padding:
|
|
8670
|
-
colorScale
|
|
8689
|
+
padding: 60,
|
|
8690
|
+
colorScale
|
|
8671
8691
|
};
|
|
8672
8692
|
// *
|
|
8673
8693
|
// * Labels
|
|
@@ -8696,10 +8716,23 @@ const borderRadius = 1;
|
|
|
8696
8716
|
// * Theme
|
|
8697
8717
|
// *
|
|
8698
8718
|
const clean = {
|
|
8719
|
+
palette: {
|
|
8720
|
+
colors,
|
|
8721
|
+
grayscale,
|
|
8722
|
+
qualitative: colorScale,
|
|
8723
|
+
heatmap,
|
|
8724
|
+
warm,
|
|
8725
|
+
cool,
|
|
8726
|
+
red: redPalette,
|
|
8727
|
+
green: greenPalette,
|
|
8728
|
+
blue: bluePalette
|
|
8729
|
+
},
|
|
8699
8730
|
area: Object.assign({
|
|
8700
8731
|
style: {
|
|
8701
8732
|
data: {
|
|
8702
|
-
fill:
|
|
8733
|
+
fill: defaultColor,
|
|
8734
|
+
strokeWidth: 2,
|
|
8735
|
+
fillOpacity: 0.5
|
|
8703
8736
|
},
|
|
8704
8737
|
labels: baseLabelStyles
|
|
8705
8738
|
}
|
|
@@ -8708,13 +8741,13 @@ const clean = {
|
|
|
8708
8741
|
style: {
|
|
8709
8742
|
axis: {
|
|
8710
8743
|
fill: "transparent",
|
|
8711
|
-
stroke: gray["
|
|
8744
|
+
stroke: gray["500"],
|
|
8712
8745
|
strokeWidth: 1,
|
|
8713
8746
|
strokeLinecap,
|
|
8714
8747
|
strokeLinejoin
|
|
8715
8748
|
},
|
|
8716
8749
|
axisLabel: Object.assign({}, centeredLabelStyles, {
|
|
8717
|
-
padding,
|
|
8750
|
+
padding: 35,
|
|
8718
8751
|
stroke: "transparent"
|
|
8719
8752
|
}),
|
|
8720
8753
|
grid: {
|
|
@@ -8733,10 +8766,10 @@ const clean = {
|
|
|
8733
8766
|
polarAxis: Object.assign({
|
|
8734
8767
|
style: {
|
|
8735
8768
|
axis: {
|
|
8736
|
-
stroke: gray["
|
|
8769
|
+
stroke: gray["500"]
|
|
8737
8770
|
},
|
|
8738
8771
|
grid: {
|
|
8739
|
-
stroke: gray["
|
|
8772
|
+
stroke: gray["400"],
|
|
8740
8773
|
strokeDasharray,
|
|
8741
8774
|
strokeLinecap,
|
|
8742
8775
|
strokeLinejoin,
|
|
@@ -8745,7 +8778,7 @@ const clean = {
|
|
|
8745
8778
|
ticks: {
|
|
8746
8779
|
fill: "transparent",
|
|
8747
8780
|
size: 5,
|
|
8748
|
-
stroke: gray["
|
|
8781
|
+
stroke: gray["400"],
|
|
8749
8782
|
strokeWidth: 1,
|
|
8750
8783
|
strokeLinecap,
|
|
8751
8784
|
strokeLinejoin
|
|
@@ -8756,10 +8789,10 @@ const clean = {
|
|
|
8756
8789
|
polarDependentAxis: Object.assign({
|
|
8757
8790
|
style: {
|
|
8758
8791
|
axis: {
|
|
8759
|
-
stroke: gray["
|
|
8792
|
+
stroke: gray["500"]
|
|
8760
8793
|
},
|
|
8761
8794
|
grid: {
|
|
8762
|
-
stroke: gray["
|
|
8795
|
+
stroke: gray["400"],
|
|
8763
8796
|
strokeDasharray,
|
|
8764
8797
|
strokeLinecap,
|
|
8765
8798
|
strokeLinejoin,
|
|
@@ -8768,7 +8801,7 @@ const clean = {
|
|
|
8768
8801
|
ticks: {
|
|
8769
8802
|
fill: "transparent",
|
|
8770
8803
|
size: 5,
|
|
8771
|
-
stroke: gray["
|
|
8804
|
+
stroke: gray["300"],
|
|
8772
8805
|
strokeWidth: 1,
|
|
8773
8806
|
strokeLinecap,
|
|
8774
8807
|
strokeLinejoin
|
|
@@ -8779,9 +8812,10 @@ const clean = {
|
|
|
8779
8812
|
bar: Object.assign({
|
|
8780
8813
|
style: {
|
|
8781
8814
|
data: {
|
|
8782
|
-
fill:
|
|
8815
|
+
fill: defaultColor,
|
|
8783
8816
|
padding,
|
|
8784
|
-
strokeWidth:
|
|
8817
|
+
strokeWidth: 1,
|
|
8818
|
+
fillOpacity: 0.5
|
|
8785
8819
|
},
|
|
8786
8820
|
labels: baseLabelStyles
|
|
8787
8821
|
},
|
|
@@ -8817,15 +8851,16 @@ const clean = {
|
|
|
8817
8851
|
}),
|
|
8818
8852
|
q1: {
|
|
8819
8853
|
padding,
|
|
8820
|
-
fill:
|
|
8821
|
-
rx: borderRadius
|
|
8854
|
+
fill: colorScale[0],
|
|
8855
|
+
rx: borderRadius,
|
|
8856
|
+
strokeWidth: 2
|
|
8822
8857
|
},
|
|
8823
8858
|
q1Labels: Object.assign({}, baseLabelStyles, {
|
|
8824
8859
|
padding: 3
|
|
8825
8860
|
}),
|
|
8826
8861
|
q3: {
|
|
8827
8862
|
padding,
|
|
8828
|
-
fill:
|
|
8863
|
+
fill: colorScale[1],
|
|
8829
8864
|
rx: borderRadius
|
|
8830
8865
|
},
|
|
8831
8866
|
q3Labels: Object.assign({}, baseLabelStyles, {
|
|
@@ -8846,8 +8881,8 @@ const clean = {
|
|
|
8846
8881
|
})
|
|
8847
8882
|
},
|
|
8848
8883
|
candleColors: {
|
|
8849
|
-
positive:
|
|
8850
|
-
negative:
|
|
8884
|
+
positive: green["500"],
|
|
8885
|
+
negative: red["500"]
|
|
8851
8886
|
},
|
|
8852
8887
|
wickStrokeWidth: 2
|
|
8853
8888
|
}, baseProps),
|
|
@@ -8866,14 +8901,13 @@ const clean = {
|
|
|
8866
8901
|
}
|
|
8867
8902
|
}, baseProps),
|
|
8868
8903
|
group: Object.assign({
|
|
8869
|
-
colorScale
|
|
8904
|
+
colorScale
|
|
8870
8905
|
}, baseProps),
|
|
8871
8906
|
histogram: Object.assign({
|
|
8872
8907
|
style: {
|
|
8873
8908
|
data: {
|
|
8874
8909
|
fill: cyan["500"],
|
|
8875
|
-
|
|
8876
|
-
strokeWidth: 0
|
|
8910
|
+
fillOpacity: 0.5
|
|
8877
8911
|
},
|
|
8878
8912
|
labels: baseLabelStyles
|
|
8879
8913
|
},
|
|
@@ -8884,21 +8918,23 @@ const clean = {
|
|
|
8884
8918
|
}, baseProps),
|
|
8885
8919
|
label: baseLabelStyles,
|
|
8886
8920
|
legend: {
|
|
8887
|
-
colorScale
|
|
8888
|
-
gutter:
|
|
8889
|
-
|
|
8921
|
+
colorScale,
|
|
8922
|
+
gutter: 24,
|
|
8923
|
+
borderPadding: 10,
|
|
8924
|
+
orientation: "horizontal",
|
|
8890
8925
|
titleOrientation: "top",
|
|
8926
|
+
centerTitle: true,
|
|
8891
8927
|
style: {
|
|
8892
8928
|
data: {
|
|
8893
8929
|
type: "circle"
|
|
8894
8930
|
},
|
|
8895
8931
|
labels: {
|
|
8896
8932
|
...baseLabelStyles,
|
|
8897
|
-
fontSize:
|
|
8933
|
+
fontSize: 12
|
|
8898
8934
|
},
|
|
8899
8935
|
title: Object.assign({}, baseLabelStyles, {
|
|
8900
8936
|
padding,
|
|
8901
|
-
fontSize:
|
|
8937
|
+
fontSize: 16
|
|
8902
8938
|
}),
|
|
8903
8939
|
border: {
|
|
8904
8940
|
stroke: gray["200"],
|
|
@@ -8912,7 +8948,7 @@ const clean = {
|
|
|
8912
8948
|
data: {
|
|
8913
8949
|
fill: "transparent",
|
|
8914
8950
|
opacity: 1,
|
|
8915
|
-
stroke:
|
|
8951
|
+
stroke: defaultColor,
|
|
8916
8952
|
strokeWidth: 2,
|
|
8917
8953
|
strokeLinecap,
|
|
8918
8954
|
strokeLinejoin
|
|
@@ -8922,31 +8958,40 @@ const clean = {
|
|
|
8922
8958
|
}, baseProps),
|
|
8923
8959
|
pie: Object.assign({
|
|
8924
8960
|
style: {
|
|
8961
|
+
parent: {
|
|
8962
|
+
backgroundColor: gray.white
|
|
8963
|
+
},
|
|
8925
8964
|
data: {
|
|
8926
8965
|
padding,
|
|
8927
8966
|
stroke: gray.white,
|
|
8928
8967
|
strokeWidth: 1
|
|
8929
8968
|
},
|
|
8930
|
-
labels:
|
|
8931
|
-
|
|
8932
|
-
|
|
8969
|
+
labels: {
|
|
8970
|
+
...baseLabelStyles,
|
|
8971
|
+
padding: 20,
|
|
8972
|
+
fill: gray["600"],
|
|
8973
|
+
fontSize: 10
|
|
8974
|
+
}
|
|
8933
8975
|
},
|
|
8934
|
-
colorScale
|
|
8976
|
+
colorScale,
|
|
8935
8977
|
cornerRadius: borderRadius
|
|
8936
8978
|
}, baseProps),
|
|
8937
8979
|
scatter: Object.assign({
|
|
8938
8980
|
style: {
|
|
8939
8981
|
data: {
|
|
8940
|
-
fill:
|
|
8982
|
+
fill: defaultColor,
|
|
8941
8983
|
opacity: 1,
|
|
8942
8984
|
stroke: "transparent",
|
|
8943
8985
|
strokeWidth: 0
|
|
8944
8986
|
},
|
|
8945
|
-
labels:
|
|
8987
|
+
labels: {
|
|
8988
|
+
...baseLabelStyles,
|
|
8989
|
+
padding: 20
|
|
8990
|
+
}
|
|
8946
8991
|
}
|
|
8947
8992
|
}, baseProps),
|
|
8948
8993
|
stack: Object.assign({
|
|
8949
|
-
colorScale
|
|
8994
|
+
colorScale
|
|
8950
8995
|
}, baseProps),
|
|
8951
8996
|
tooltip: {
|
|
8952
8997
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -8954,7 +8999,7 @@ const clean = {
|
|
|
8954
8999
|
pointerEvents: "none"
|
|
8955
9000
|
}),
|
|
8956
9001
|
flyoutStyle: {
|
|
8957
|
-
stroke: gray["
|
|
9002
|
+
stroke: gray["300"],
|
|
8958
9003
|
strokeWidth: 2,
|
|
8959
9004
|
fill: gray.white,
|
|
8960
9005
|
pointerEvents: "none"
|
|
@@ -8971,8 +9016,8 @@ const clean = {
|
|
|
8971
9016
|
voronoi: Object.assign({
|
|
8972
9017
|
style: {
|
|
8973
9018
|
data: {
|
|
8974
|
-
fill:
|
|
8975
|
-
stroke:
|
|
9019
|
+
fill: blue["100"],
|
|
9020
|
+
stroke: defaultColor,
|
|
8976
9021
|
strokeWidth: 2
|
|
8977
9022
|
},
|
|
8978
9023
|
labels: Object.assign({}, baseLabelStyles, {
|
|
@@ -9009,9 +9054,28 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9009
9054
|
// *
|
|
9010
9055
|
// * Colors
|
|
9011
9056
|
// *
|
|
9012
|
-
const colors =
|
|
9057
|
+
const colors = {
|
|
9058
|
+
blue: "#4F7DA1",
|
|
9059
|
+
pink: "#E2A37F",
|
|
9060
|
+
teal: "#00796B",
|
|
9061
|
+
purple: "#DF948A",
|
|
9062
|
+
green: "#8BC34A",
|
|
9063
|
+
orange: "#F4511E",
|
|
9064
|
+
cyan: "#006064",
|
|
9065
|
+
red: "#DF5A49",
|
|
9066
|
+
yellow: "#FFF59D"
|
|
9067
|
+
};
|
|
9068
|
+
const colorScale = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
|
|
9013
9069
|
const charcoal = "#252525";
|
|
9014
9070
|
const grey = "#969696";
|
|
9071
|
+
const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
|
|
9072
|
+
const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
|
|
9073
|
+
const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
|
|
9074
|
+
const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
|
|
9075
|
+
const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
|
|
9076
|
+
const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
|
|
9077
|
+
const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
|
|
9078
|
+
|
|
9015
9079
|
// *
|
|
9016
9080
|
// * Typography
|
|
9017
9081
|
// *
|
|
@@ -9025,7 +9089,7 @@ const baseProps = {
|
|
|
9025
9089
|
width: 450,
|
|
9026
9090
|
height: 300,
|
|
9027
9091
|
padding: 50,
|
|
9028
|
-
colorScale
|
|
9092
|
+
colorScale
|
|
9029
9093
|
};
|
|
9030
9094
|
// *
|
|
9031
9095
|
// * Labels
|
|
@@ -9047,6 +9111,17 @@ const centeredLabelStyles = Object.assign({
|
|
|
9047
9111
|
const strokeLinecap = "round";
|
|
9048
9112
|
const strokeLinejoin = "round";
|
|
9049
9113
|
const grayscale = {
|
|
9114
|
+
palette: {
|
|
9115
|
+
colors,
|
|
9116
|
+
grayscale: colorScale,
|
|
9117
|
+
qualitative,
|
|
9118
|
+
heatmap,
|
|
9119
|
+
warm,
|
|
9120
|
+
cool,
|
|
9121
|
+
red,
|
|
9122
|
+
green,
|
|
9123
|
+
blue
|
|
9124
|
+
},
|
|
9050
9125
|
area: Object.assign({
|
|
9051
9126
|
style: {
|
|
9052
9127
|
data: {
|
|
@@ -9161,7 +9236,7 @@ const grayscale = {
|
|
|
9161
9236
|
}
|
|
9162
9237
|
}, baseProps),
|
|
9163
9238
|
group: Object.assign({
|
|
9164
|
-
colorScale
|
|
9239
|
+
colorScale
|
|
9165
9240
|
}, baseProps),
|
|
9166
9241
|
histogram: Object.assign({
|
|
9167
9242
|
style: {
|
|
@@ -9174,7 +9249,7 @@ const grayscale = {
|
|
|
9174
9249
|
}
|
|
9175
9250
|
}, baseProps),
|
|
9176
9251
|
legend: {
|
|
9177
|
-
colorScale
|
|
9252
|
+
colorScale,
|
|
9178
9253
|
gutter: 10,
|
|
9179
9254
|
orientation: "vertical",
|
|
9180
9255
|
titleOrientation: "top",
|
|
@@ -9209,7 +9284,7 @@ const grayscale = {
|
|
|
9209
9284
|
padding: 20
|
|
9210
9285
|
})
|
|
9211
9286
|
},
|
|
9212
|
-
colorScale
|
|
9287
|
+
colorScale,
|
|
9213
9288
|
width: 400,
|
|
9214
9289
|
height: 400,
|
|
9215
9290
|
padding: 50
|
|
@@ -9225,7 +9300,7 @@ const grayscale = {
|
|
|
9225
9300
|
}
|
|
9226
9301
|
}, baseProps),
|
|
9227
9302
|
stack: Object.assign({
|
|
9228
|
-
colorScale
|
|
9303
|
+
colorScale
|
|
9229
9304
|
}, baseProps),
|
|
9230
9305
|
tooltip: {
|
|
9231
9306
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -9285,11 +9360,31 @@ const lime300 = "#DCE775";
|
|
|
9285
9360
|
const lightGreen500 = "#8BC34A";
|
|
9286
9361
|
const teal700 = "#00796B";
|
|
9287
9362
|
const cyan900 = "#006064";
|
|
9288
|
-
const
|
|
9363
|
+
const colorScale = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
|
|
9289
9364
|
const blueGrey50 = "#ECEFF1";
|
|
9290
9365
|
const blueGrey300 = "#90A4AE";
|
|
9291
9366
|
const blueGrey700 = "#455A64";
|
|
9292
9367
|
const grey900 = "#212121";
|
|
9368
|
+
const colors = {
|
|
9369
|
+
blue: "#4F7DA1",
|
|
9370
|
+
pink: "#E2A37F",
|
|
9371
|
+
teal: teal700,
|
|
9372
|
+
purple: "#DF948A",
|
|
9373
|
+
green: lightGreen500,
|
|
9374
|
+
orange: deepOrange600,
|
|
9375
|
+
cyan: cyan900,
|
|
9376
|
+
red: "#DF5A49",
|
|
9377
|
+
yellow: yellow200
|
|
9378
|
+
};
|
|
9379
|
+
const grayscale = [blueGrey50, blueGrey300, blueGrey700, grey900];
|
|
9380
|
+
const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
|
|
9381
|
+
const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
|
|
9382
|
+
const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
|
|
9383
|
+
const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
|
|
9384
|
+
const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
|
|
9385
|
+
const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
|
|
9386
|
+
const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
|
|
9387
|
+
|
|
9293
9388
|
// *
|
|
9294
9389
|
// * Typography
|
|
9295
9390
|
// *
|
|
@@ -9327,6 +9422,17 @@ const strokeDasharray = "10, 5";
|
|
|
9327
9422
|
const strokeLinecap = "round";
|
|
9328
9423
|
const strokeLinejoin = "round";
|
|
9329
9424
|
const material = {
|
|
9425
|
+
palette: {
|
|
9426
|
+
colors,
|
|
9427
|
+
grayscale,
|
|
9428
|
+
qualitative,
|
|
9429
|
+
heatmap,
|
|
9430
|
+
warm,
|
|
9431
|
+
cool,
|
|
9432
|
+
red,
|
|
9433
|
+
green,
|
|
9434
|
+
blue
|
|
9435
|
+
},
|
|
9330
9436
|
area: Object.assign({
|
|
9331
9437
|
style: {
|
|
9332
9438
|
data: {
|
|
@@ -9459,7 +9565,7 @@ const material = {
|
|
|
9459
9565
|
}
|
|
9460
9566
|
}, baseProps),
|
|
9461
9567
|
group: Object.assign({
|
|
9462
|
-
colorScale
|
|
9568
|
+
colorScale
|
|
9463
9569
|
}, baseProps),
|
|
9464
9570
|
histogram: Object.assign({
|
|
9465
9571
|
style: {
|
|
@@ -9472,7 +9578,7 @@ const material = {
|
|
|
9472
9578
|
}
|
|
9473
9579
|
}, baseProps),
|
|
9474
9580
|
legend: {
|
|
9475
|
-
colorScale
|
|
9581
|
+
colorScale,
|
|
9476
9582
|
gutter: 10,
|
|
9477
9583
|
orientation: "vertical",
|
|
9478
9584
|
titleOrientation: "top",
|
|
@@ -9498,7 +9604,7 @@ const material = {
|
|
|
9498
9604
|
}
|
|
9499
9605
|
}, baseProps),
|
|
9500
9606
|
pie: Object.assign({
|
|
9501
|
-
colorScale
|
|
9607
|
+
colorScale,
|
|
9502
9608
|
style: {
|
|
9503
9609
|
data: {
|
|
9504
9610
|
padding,
|
|
@@ -9522,7 +9628,7 @@ const material = {
|
|
|
9522
9628
|
}
|
|
9523
9629
|
}, baseProps),
|
|
9524
9630
|
stack: Object.assign({
|
|
9525
|
-
colorScale
|
|
9631
|
+
colorScale
|
|
9526
9632
|
}, baseProps),
|
|
9527
9633
|
tooltip: {
|
|
9528
9634
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -12387,6 +12493,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
12387
12493
|
/* harmony export */ "getColorScale": function() { return /* binding */ getColorScale; },
|
|
12388
12494
|
/* harmony export */ "toTransformString": function() { return /* binding */ toTransformString; }
|
|
12389
12495
|
/* harmony export */ });
|
|
12496
|
+
/* harmony import */ var _victory_theme_victory_theme__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../victory-theme/victory-theme */ "../../victory-core/es/victory-theme/victory-theme.js");
|
|
12497
|
+
|
|
12498
|
+
|
|
12390
12499
|
/**
|
|
12391
12500
|
* Given an object with CSS/SVG transform definitions, return the string value
|
|
12392
12501
|
* for use with the `transform` CSS property or SVG attribute. Note that we
|
|
@@ -12423,20 +12532,37 @@ const toTransformString = function (obj) {
|
|
|
12423
12532
|
* of 5 hex string values in that color scale. If no 'name' parameter
|
|
12424
12533
|
* is given, it will return the Victory default grayscale.
|
|
12425
12534
|
* @param {String} name The name of the color scale to return (optional).
|
|
12535
|
+
* @param {Object} theme The theme object to retrieve the color scale from (optional).
|
|
12426
12536
|
* @returns {Array} An array of 5 hex string values composing a color scale.
|
|
12427
12537
|
*/
|
|
12428
|
-
function getColorScale(name) {
|
|
12538
|
+
function getColorScale(name, theme) {
|
|
12539
|
+
if (theme === void 0) {
|
|
12540
|
+
theme = _victory_theme_victory_theme__WEBPACK_IMPORTED_MODULE_0__.VictoryTheme.material;
|
|
12541
|
+
}
|
|
12542
|
+
const {
|
|
12543
|
+
palette: {
|
|
12544
|
+
grayscale = ["#cccccc", "#969696", "#636363", "#252525"],
|
|
12545
|
+
qualitative = [],
|
|
12546
|
+
heatmap = [],
|
|
12547
|
+
warm = [],
|
|
12548
|
+
cool = [],
|
|
12549
|
+
red = [],
|
|
12550
|
+
blue = [],
|
|
12551
|
+
green = []
|
|
12552
|
+
} = {}
|
|
12553
|
+
} = theme;
|
|
12429
12554
|
const scales = {
|
|
12430
|
-
grayscale
|
|
12431
|
-
qualitative
|
|
12432
|
-
heatmap
|
|
12433
|
-
warm
|
|
12434
|
-
cool
|
|
12435
|
-
red
|
|
12436
|
-
blue
|
|
12437
|
-
green
|
|
12555
|
+
grayscale,
|
|
12556
|
+
qualitative,
|
|
12557
|
+
heatmap,
|
|
12558
|
+
warm,
|
|
12559
|
+
cool,
|
|
12560
|
+
red,
|
|
12561
|
+
blue,
|
|
12562
|
+
green
|
|
12438
12563
|
};
|
|
12439
|
-
|
|
12564
|
+
const selectedScale = name && scales[name]?.length ? scales[name] : scales.grayscale;
|
|
12565
|
+
return selectedScale;
|
|
12440
12566
|
}
|
|
12441
12567
|
|
|
12442
12568
|
/***/ }),
|
|
@@ -12911,34 +13037,31 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
12911
13037
|
/* harmony export */ "getDomain": function() { return /* binding */ getDomain; },
|
|
12912
13038
|
/* harmony export */ "getDomainFromChildren": function() { return /* binding */ getDomainFromChildren; },
|
|
12913
13039
|
/* harmony export */ "getScale": function() { return /* binding */ getScale; },
|
|
12914
|
-
/* harmony export */ "getStringsFromCategories": function() { return /* binding */ getStringsFromCategories; },
|
|
12915
13040
|
/* harmony export */ "getStringsFromChildren": function() { return /* binding */ getStringsFromChildren; },
|
|
13041
|
+
/* harmony export */ "getStringsFromChildrenCategories": function() { return /* binding */ getStringsFromChildrenCategories; },
|
|
12916
13042
|
/* harmony export */ "getStringsFromData": function() { return /* binding */ getStringsFromData; },
|
|
12917
13043
|
/* harmony export */ "getStyle": function() { return /* binding */ getStyle; },
|
|
12918
13044
|
/* harmony export */ "getWidth": function() { return /* binding */ getWidth; }
|
|
12919
13045
|
/* harmony export */ });
|
|
12920
|
-
/* harmony import */ var
|
|
12921
|
-
/* harmony import */ var
|
|
12922
|
-
/* harmony import */ var
|
|
12923
|
-
/* harmony import */ var
|
|
12924
|
-
/* harmony import */ var
|
|
12925
|
-
/* harmony import */ var
|
|
12926
|
-
/* harmony import */ var
|
|
12927
|
-
/* harmony import */ var
|
|
12928
|
-
/* harmony import */ var
|
|
12929
|
-
/* harmony import */ var
|
|
12930
|
-
/* harmony import */ var
|
|
12931
|
-
/* harmony import */ var
|
|
12932
|
-
/* harmony import */ var
|
|
12933
|
-
/* harmony import */ var
|
|
12934
|
-
/* harmony import */ var
|
|
12935
|
-
/* harmony import */ var
|
|
12936
|
-
/* harmony import */ var
|
|
12937
|
-
/* harmony import */ var
|
|
12938
|
-
/* harmony import */ var
|
|
12939
|
-
/* harmony import */ var _scale__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./scale */ "../../victory-core/es/victory-util/scale.js");
|
|
12940
|
-
/* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./log */ "../../victory-core/es/victory-util/log.js");
|
|
12941
|
-
|
|
13046
|
+
/* 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");
|
|
13047
|
+
/* harmony import */ var lodash_uniqBy__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqBy__WEBPACK_IMPORTED_MODULE_0__);
|
|
13048
|
+
/* 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");
|
|
13049
|
+
/* harmony import */ var lodash_groupBy__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_groupBy__WEBPACK_IMPORTED_MODULE_1__);
|
|
13050
|
+
/* 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");
|
|
13051
|
+
/* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_uniq__WEBPACK_IMPORTED_MODULE_2__);
|
|
13052
|
+
/* 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");
|
|
13053
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_3__);
|
|
13054
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "react");
|
|
13055
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
|
|
13056
|
+
/* harmony import */ var _axis__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./axis */ "../../victory-core/es/victory-util/axis.js");
|
|
13057
|
+
/* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./style */ "../../victory-core/es/victory-util/style.js");
|
|
13058
|
+
/* harmony import */ var _data__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./data */ "../../victory-core/es/victory-util/data.js");
|
|
13059
|
+
/* harmony import */ var _domain__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./domain */ "../../victory-core/es/victory-util/domain.js");
|
|
13060
|
+
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./events */ "../../victory-core/es/victory-util/events.js");
|
|
13061
|
+
/* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./collection */ "../../victory-core/es/victory-util/collection.js");
|
|
13062
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
13063
|
+
/* harmony import */ var _scale__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./scale */ "../../victory-core/es/victory-util/scale.js");
|
|
13064
|
+
/* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./log */ "../../victory-core/es/victory-util/log.js");
|
|
12942
13065
|
|
|
12943
13066
|
|
|
12944
13067
|
|
|
@@ -12967,7 +13090,7 @@ function addBinsToParentPropsIfHistogram(_ref) {
|
|
|
12967
13090
|
return child.type && child.type.role === "histogram";
|
|
12968
13091
|
});
|
|
12969
13092
|
if (someChildrenAreHistograms && !allChildrenAreHistograms) {
|
|
12970
|
-
|
|
13093
|
+
_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");
|
|
12971
13094
|
}
|
|
12972
13095
|
|
|
12973
13096
|
// if we are stacking histograms, we need to generate explicit bins
|
|
@@ -12980,7 +13103,7 @@ function addBinsToParentPropsIfHistogram(_ref) {
|
|
|
12980
13103
|
// if we have explicit bins then we don't need to calculate them
|
|
12981
13104
|
if (!Array.isArray(childBins)) {
|
|
12982
13105
|
const combinedData = children.reduce((memo, child) => {
|
|
12983
|
-
const xAccessor =
|
|
13106
|
+
const xAccessor = _helpers__WEBPACK_IMPORTED_MODULE_6__.createAccessor(child.props.x || "x");
|
|
12984
13107
|
return memo.concat(child.props.data.map(datum => ({
|
|
12985
13108
|
x: xAccessor(datum)
|
|
12986
13109
|
})));
|
|
@@ -13023,7 +13146,7 @@ function getDataFromChildren(props, childComponents) {
|
|
|
13023
13146
|
maxDomain
|
|
13024
13147
|
};
|
|
13025
13148
|
let stack = 0;
|
|
13026
|
-
const children = childComponents ? childComponents.slice(0) :
|
|
13149
|
+
const children = childComponents ? childComponents.slice(0) : react__WEBPACK_IMPORTED_MODULE_4___default().Children.toArray(props.children);
|
|
13027
13150
|
parentProps = addBinsToParentPropsIfHistogram({
|
|
13028
13151
|
children,
|
|
13029
13152
|
props,
|
|
@@ -13034,13 +13157,13 @@ function getDataFromChildren(props, childComponents) {
|
|
|
13034
13157
|
const childProps = Object.assign({}, child.props, parentProps);
|
|
13035
13158
|
let childData;
|
|
13036
13159
|
let childElement = child;
|
|
13037
|
-
if (!
|
|
13160
|
+
if (!_data__WEBPACK_IMPORTED_MODULE_7__.isDataComponent(child)) {
|
|
13038
13161
|
return null;
|
|
13039
|
-
} else if (child.type &&
|
|
13040
|
-
childElement = parent ? /*#__PURE__*/
|
|
13162
|
+
} else if (child.type && _helpers__WEBPACK_IMPORTED_MODULE_6__.isFunction(child.type.getData)) {
|
|
13163
|
+
childElement = parent ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().cloneElement(child, parent.props) : child;
|
|
13041
13164
|
childData = childElement.type.getData(childProps);
|
|
13042
13165
|
} else {
|
|
13043
|
-
childData =
|
|
13166
|
+
childData = _data__WEBPACK_IMPORTED_MODULE_7__.getData(childProps);
|
|
13044
13167
|
}
|
|
13045
13168
|
stack += 1;
|
|
13046
13169
|
return childData.map((datum, index) => Object.assign({
|
|
@@ -13049,23 +13172,23 @@ function getDataFromChildren(props, childComponents) {
|
|
|
13049
13172
|
}, datum));
|
|
13050
13173
|
};
|
|
13051
13174
|
const stacked = children.filter(c => c.type && c.type.role === "stack").length;
|
|
13052
|
-
const combine = (memo, val) => memo.concat(
|
|
13053
|
-
const datasets =
|
|
13175
|
+
const combine = (memo, val) => memo.concat(lodash_uniqBy__WEBPACK_IMPORTED_MODULE_0___default()(val, "_group"));
|
|
13176
|
+
const datasets = _helpers__WEBPACK_IMPORTED_MODULE_6__.reduceChildren(children, iteratee, props, [], combine);
|
|
13054
13177
|
const group = stacked ? "_group" : "_stack";
|
|
13055
|
-
return Object.values(
|
|
13178
|
+
return Object.values(lodash_groupBy__WEBPACK_IMPORTED_MODULE_1___default()(datasets, group));
|
|
13056
13179
|
}
|
|
13057
13180
|
function getData(props, childComponents) {
|
|
13058
13181
|
if (props.data) {
|
|
13059
|
-
return
|
|
13182
|
+
return _data__WEBPACK_IMPORTED_MODULE_7__.getData(props);
|
|
13060
13183
|
}
|
|
13061
|
-
return getDataFromChildren(props, childComponents ||
|
|
13184
|
+
return getDataFromChildren(props, childComponents || react__WEBPACK_IMPORTED_MODULE_4___default().Children.toArray(props.children));
|
|
13062
13185
|
}
|
|
13063
13186
|
function getWidth(props, groupLength, seriesLength) {
|
|
13064
13187
|
const {
|
|
13065
13188
|
datasets,
|
|
13066
13189
|
horizontal
|
|
13067
13190
|
} = props;
|
|
13068
|
-
const range = horizontal ?
|
|
13191
|
+
const range = horizontal ? _helpers__WEBPACK_IMPORTED_MODULE_6__.getRange(props, "y") : _helpers__WEBPACK_IMPORTED_MODULE_6__.getRange(props, "x");
|
|
13069
13192
|
const extent = Math.abs(range[1] - range[0]);
|
|
13070
13193
|
const seriesLengthValue = seriesLength !== undefined ? seriesLength : Array.isArray(datasets[0]) && datasets[0].length || 1;
|
|
13071
13194
|
const groupLengthValue = groupLength || datasets.length;
|
|
@@ -13111,8 +13234,8 @@ function getDefaultDomainPadding(props, axis, childComponents) {
|
|
|
13111
13234
|
}
|
|
13112
13235
|
function getDomainFromChildren(props, axis, childComponents) {
|
|
13113
13236
|
// eslint-disable-line max-statements, complexity, max-len
|
|
13114
|
-
const children = childComponents ? childComponents.slice(0) :
|
|
13115
|
-
const parentData = props.data ?
|
|
13237
|
+
const children = childComponents ? childComponents.slice(0) : react__WEBPACK_IMPORTED_MODULE_4___default().Children.toArray(props.children);
|
|
13238
|
+
const parentData = props.data ? _data__WEBPACK_IMPORTED_MODULE_7__.getData(props) : undefined;
|
|
13116
13239
|
const {
|
|
13117
13240
|
polar,
|
|
13118
13241
|
startAngle,
|
|
@@ -13136,65 +13259,67 @@ function getDomainFromChildren(props, axis, childComponents) {
|
|
|
13136
13259
|
}) : baseParentProps;
|
|
13137
13260
|
const iteratee = child => {
|
|
13138
13261
|
const sharedProps = Object.assign({}, child.props, parentProps);
|
|
13139
|
-
if (!
|
|
13262
|
+
if (!_domain__WEBPACK_IMPORTED_MODULE_8__.isDomainComponent(child)) {
|
|
13140
13263
|
return null;
|
|
13141
|
-
} else if (child.type &&
|
|
13264
|
+
} else if (child.type && _helpers__WEBPACK_IMPORTED_MODULE_6__.isFunction(child.type.getDomain)) {
|
|
13142
13265
|
return child.props && child.type.getDomain(sharedProps, axis);
|
|
13143
13266
|
}
|
|
13144
|
-
return
|
|
13267
|
+
return _domain__WEBPACK_IMPORTED_MODULE_8__.getDomain(sharedProps, axis);
|
|
13145
13268
|
};
|
|
13146
|
-
const childDomains =
|
|
13147
|
-
const min = childDomains.length === 0 ? 0 :
|
|
13148
|
-
const max = childDomains.length === 0 ? 1 :
|
|
13269
|
+
const childDomains = _helpers__WEBPACK_IMPORTED_MODULE_6__.reduceChildren(children, iteratee, props);
|
|
13270
|
+
const min = childDomains.length === 0 ? 0 : _collection__WEBPACK_IMPORTED_MODULE_9__.getMinValue(childDomains);
|
|
13271
|
+
const max = childDomains.length === 0 ? 1 : _collection__WEBPACK_IMPORTED_MODULE_9__.getMaxValue(childDomains);
|
|
13149
13272
|
return [min, max];
|
|
13150
13273
|
}
|
|
13151
13274
|
function getDomain(props, axis, childComponents) {
|
|
13152
|
-
const children = childComponents ||
|
|
13153
|
-
const propsDomain =
|
|
13275
|
+
const children = childComponents || react__WEBPACK_IMPORTED_MODULE_4___default().Children.toArray(props.children);
|
|
13276
|
+
const propsDomain = _domain__WEBPACK_IMPORTED_MODULE_8__.getDomainFromProps(props, axis);
|
|
13154
13277
|
const domainPadding = getDefaultDomainPadding(props, axis, children);
|
|
13155
13278
|
let domain;
|
|
13156
13279
|
if (propsDomain) {
|
|
13157
13280
|
domain = propsDomain;
|
|
13158
13281
|
} else {
|
|
13159
|
-
const minDomain =
|
|
13160
|
-
const maxDomain =
|
|
13161
|
-
const dataset = (props.data || props.y) &&
|
|
13162
|
-
const dataDomain = dataset ?
|
|
13282
|
+
const minDomain = _domain__WEBPACK_IMPORTED_MODULE_8__.getMinFromProps(props, axis);
|
|
13283
|
+
const maxDomain = _domain__WEBPACK_IMPORTED_MODULE_8__.getMaxFromProps(props, axis);
|
|
13284
|
+
const dataset = (props.data || props.y) && _data__WEBPACK_IMPORTED_MODULE_7__.getData(props);
|
|
13285
|
+
const dataDomain = dataset ? _domain__WEBPACK_IMPORTED_MODULE_8__.getDomainFromData(props, axis, dataset) : [];
|
|
13163
13286
|
const childDomain = getDomainFromChildren(props, axis, children);
|
|
13164
|
-
const min = minDomain ||
|
|
13165
|
-
const max = maxDomain ||
|
|
13166
|
-
domain =
|
|
13287
|
+
const min = minDomain || _collection__WEBPACK_IMPORTED_MODULE_9__.getMinValue([...dataDomain, ...childDomain]);
|
|
13288
|
+
const max = maxDomain || _collection__WEBPACK_IMPORTED_MODULE_9__.getMaxValue([...dataDomain, ...childDomain]);
|
|
13289
|
+
domain = _domain__WEBPACK_IMPORTED_MODULE_8__.getDomainFromMinMax(min, max);
|
|
13167
13290
|
}
|
|
13168
|
-
return
|
|
13291
|
+
return _domain__WEBPACK_IMPORTED_MODULE_8__.formatDomain(domain, Object.assign({
|
|
13169
13292
|
domainPadding
|
|
13170
13293
|
}, props), axis);
|
|
13171
13294
|
}
|
|
13172
13295
|
function getScale(props, axis, childComponents) {
|
|
13173
13296
|
if (props.data) {
|
|
13174
|
-
return
|
|
13297
|
+
return _scale__WEBPACK_IMPORTED_MODULE_10__.getBaseScale(props, axis);
|
|
13175
13298
|
}
|
|
13176
|
-
const children = childComponents ? childComponents.slice(0) :
|
|
13299
|
+
const children = childComponents ? childComponents.slice(0) : react__WEBPACK_IMPORTED_MODULE_4___default().Children.toArray(props.children);
|
|
13177
13300
|
const iteratee = child => {
|
|
13178
13301
|
const sharedProps = Object.assign({}, child.props, {
|
|
13179
13302
|
horizontal: props.horizontal
|
|
13180
13303
|
});
|
|
13181
|
-
return
|
|
13304
|
+
return _scale__WEBPACK_IMPORTED_MODULE_10__.getScaleType(sharedProps, axis);
|
|
13182
13305
|
};
|
|
13183
|
-
const childScale =
|
|
13306
|
+
const childScale = lodash_uniq__WEBPACK_IMPORTED_MODULE_2___default()(_helpers__WEBPACK_IMPORTED_MODULE_6__.reduceChildren(children, iteratee, props));
|
|
13184
13307
|
|
|
13185
13308
|
// default to linear scale if more than one uniq scale type is given by children
|
|
13186
|
-
return childScale.length > 1 ?
|
|
13309
|
+
return childScale.length > 1 ? _scale__WEBPACK_IMPORTED_MODULE_10__.getScaleFromName("linear") : _scale__WEBPACK_IMPORTED_MODULE_10__.getScaleFromName(childScale[0]);
|
|
13187
13310
|
}
|
|
13188
13311
|
function getAllEvents(props) {
|
|
13189
13312
|
const components = ["groupComponent", "containerComponent", "labelComponent"];
|
|
13190
|
-
const componentEvents =
|
|
13313
|
+
const componentEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getComponentEvents(props, components);
|
|
13191
13314
|
let events = props.events;
|
|
13192
13315
|
if (Array.isArray(componentEvents)) {
|
|
13193
13316
|
events = Array.isArray(props.events) ? componentEvents.concat(...props.events) : componentEvents;
|
|
13194
13317
|
}
|
|
13195
13318
|
return events || [];
|
|
13196
13319
|
}
|
|
13197
|
-
|
|
13320
|
+
|
|
13321
|
+
// eslint-disable-next-line max-params
|
|
13322
|
+
function getColor(calculatedProps, child, index, theme) {
|
|
13198
13323
|
// check for styles first
|
|
13199
13324
|
const {
|
|
13200
13325
|
style
|
|
@@ -13211,14 +13336,16 @@ function getColor(calculatedProps, child, index) {
|
|
|
13211
13336
|
if (!colorScale && !color) {
|
|
13212
13337
|
return undefined;
|
|
13213
13338
|
}
|
|
13214
|
-
const colors = Array.isArray(colorScale) ? colorScale :
|
|
13339
|
+
const colors = Array.isArray(colorScale) ? colorScale : _style__WEBPACK_IMPORTED_MODULE_12__.getColorScale(colorScale, theme);
|
|
13215
13340
|
return color || colors[index % colors.length];
|
|
13216
13341
|
}
|
|
13217
13342
|
function getStyle(theme, style, role) {
|
|
13218
13343
|
const defaultStyle = theme && theme[role] && theme[role].style ? theme[role].style : {};
|
|
13219
|
-
return
|
|
13344
|
+
return _helpers__WEBPACK_IMPORTED_MODULE_6__.getStyles(style, defaultStyle);
|
|
13220
13345
|
}
|
|
13221
|
-
|
|
13346
|
+
|
|
13347
|
+
// eslint-disable-next-line max-params
|
|
13348
|
+
function getChildStyle(child, index, calculatedProps, theme) {
|
|
13222
13349
|
const {
|
|
13223
13350
|
style,
|
|
13224
13351
|
role
|
|
@@ -13228,7 +13355,7 @@ function getChildStyle(child, index, calculatedProps) {
|
|
|
13228
13355
|
return childStyle;
|
|
13229
13356
|
}
|
|
13230
13357
|
const childRole = child.type && child.type.role;
|
|
13231
|
-
const defaultFill = childRole === "stack" ? undefined : getColor(calculatedProps, child, index);
|
|
13358
|
+
const defaultFill = childRole === "stack" ? undefined : getColor(calculatedProps, child, index, theme);
|
|
13232
13359
|
const defaultColor = childRole === "line" ? {
|
|
13233
13360
|
fill: "none",
|
|
13234
13361
|
stroke: defaultFill
|
|
@@ -13238,8 +13365,8 @@ function getChildStyle(child, index, calculatedProps) {
|
|
|
13238
13365
|
const dataWidth = role === "stack" ? {} : {
|
|
13239
13366
|
width: getWidth(calculatedProps)
|
|
13240
13367
|
};
|
|
13241
|
-
const dataStyle =
|
|
13242
|
-
const labelsStyle =
|
|
13368
|
+
const dataStyle = lodash_defaults__WEBPACK_IMPORTED_MODULE_3___default()({}, childStyle.data, Object.assign({}, dataWidth, style.data, defaultColor));
|
|
13369
|
+
const labelsStyle = lodash_defaults__WEBPACK_IMPORTED_MODULE_3___default()({}, childStyle.labels, style.labels);
|
|
13243
13370
|
return {
|
|
13244
13371
|
...childStyle,
|
|
13245
13372
|
parent: style.parent,
|
|
@@ -13247,28 +13374,26 @@ function getChildStyle(child, index, calculatedProps) {
|
|
|
13247
13374
|
labels: labelsStyle
|
|
13248
13375
|
};
|
|
13249
13376
|
}
|
|
13250
|
-
function
|
|
13377
|
+
function getStringsFromChildrenCategories(childComponents, axis) {
|
|
13251
13378
|
const iteratee = child => {
|
|
13252
|
-
|
|
13253
|
-
if (!_domain__WEBPACK_IMPORTED_MODULE_9__.isDomainComponent(child) || !childProps.categories) {
|
|
13379
|
+
if (!_domain__WEBPACK_IMPORTED_MODULE_8__.isDomainComponent(child)) {
|
|
13254
13380
|
return null;
|
|
13255
13381
|
}
|
|
13256
|
-
const
|
|
13257
|
-
|
|
13258
|
-
return categoryStrings ? _collection__WEBPACK_IMPORTED_MODULE_10__.removeUndefined(categoryStrings) : [];
|
|
13382
|
+
const childProps = child.props || {};
|
|
13383
|
+
return _data__WEBPACK_IMPORTED_MODULE_7__.getStringsFromCategories(childProps, axis);
|
|
13259
13384
|
};
|
|
13260
|
-
return
|
|
13385
|
+
return _helpers__WEBPACK_IMPORTED_MODULE_6__.reduceChildren(childComponents.slice(0), iteratee);
|
|
13261
13386
|
}
|
|
13262
13387
|
function getStringsFromData(childComponents) {
|
|
13263
13388
|
const iteratee = child => {
|
|
13264
13389
|
const childProps = child.props || {};
|
|
13265
13390
|
let data;
|
|
13266
|
-
if (!
|
|
13391
|
+
if (!_data__WEBPACK_IMPORTED_MODULE_7__.isDataComponent(child)) {
|
|
13267
13392
|
return null;
|
|
13268
|
-
} else if (child.type &&
|
|
13393
|
+
} else if (child.type && _helpers__WEBPACK_IMPORTED_MODULE_6__.isFunction(child.type.getData)) {
|
|
13269
13394
|
data = child.type.getData(childProps);
|
|
13270
13395
|
} else {
|
|
13271
|
-
data =
|
|
13396
|
+
data = _data__WEBPACK_IMPORTED_MODULE_7__.getData(childProps);
|
|
13272
13397
|
}
|
|
13273
13398
|
return data.map(d => ({
|
|
13274
13399
|
x: d.xName,
|
|
@@ -13287,28 +13412,28 @@ function getStringsFromData(childComponents) {
|
|
|
13287
13412
|
y: y !== undefined ? memo.y.concat(y) : memo.y
|
|
13288
13413
|
};
|
|
13289
13414
|
};
|
|
13290
|
-
return
|
|
13415
|
+
return _helpers__WEBPACK_IMPORTED_MODULE_6__.reduceChildren(childComponents.slice(0), iteratee, {}, initialMemo, combine);
|
|
13291
13416
|
}
|
|
13292
13417
|
function getCategoryAndAxisStringsFromChildren(props, axis, childComponents) {
|
|
13293
|
-
const categories =
|
|
13294
|
-
const axisComponent =
|
|
13295
|
-
const axisStrings = axisComponent ?
|
|
13296
|
-
const categoryStrings = categories
|
|
13297
|
-
return
|
|
13418
|
+
const categories = _data__WEBPACK_IMPORTED_MODULE_7__.getStringsFromCategories(props, axis);
|
|
13419
|
+
const axisComponent = _axis__WEBPACK_IMPORTED_MODULE_13__.getAxisComponent(childComponents, axis);
|
|
13420
|
+
const axisStrings = axisComponent ? _data__WEBPACK_IMPORTED_MODULE_7__.getStringsFromAxes(axisComponent.props, axis) : [];
|
|
13421
|
+
const categoryStrings = categories.length ? categories : getStringsFromChildrenCategories(childComponents, axis);
|
|
13422
|
+
return lodash_uniq__WEBPACK_IMPORTED_MODULE_2___default()([...categoryStrings, ...axisStrings].flat());
|
|
13298
13423
|
}
|
|
13299
13424
|
function getStringsFromChildren(props, childComponents) {
|
|
13300
|
-
const children = childComponents ||
|
|
13425
|
+
const children = childComponents || react__WEBPACK_IMPORTED_MODULE_4___default().Children.toArray(props.children);
|
|
13301
13426
|
const xStrings = getCategoryAndAxisStringsFromChildren(props, "x", children);
|
|
13302
13427
|
const yStrings = getCategoryAndAxisStringsFromChildren(props, "y", children);
|
|
13303
13428
|
const dataStrings = getStringsFromData(children);
|
|
13304
13429
|
return {
|
|
13305
|
-
x:
|
|
13306
|
-
y:
|
|
13430
|
+
x: lodash_uniq__WEBPACK_IMPORTED_MODULE_2___default()([...xStrings, ...dataStrings.x].flat()),
|
|
13431
|
+
y: lodash_uniq__WEBPACK_IMPORTED_MODULE_2___default()([...yStrings, ...dataStrings.y].flat())
|
|
13307
13432
|
};
|
|
13308
13433
|
}
|
|
13309
13434
|
function getCategories(props, childComponents, allStrings) {
|
|
13310
|
-
const xPropCategories = props.categories &&
|
|
13311
|
-
const yPropCategories = props.categories &&
|
|
13435
|
+
const xPropCategories = props.categories && _data__WEBPACK_IMPORTED_MODULE_7__.getStringsFromCategories(props, "x");
|
|
13436
|
+
const yPropCategories = props.categories && _data__WEBPACK_IMPORTED_MODULE_7__.getStringsFromCategories(props, "y");
|
|
13312
13437
|
const fallbackRequired = !xPropCategories || !yPropCategories;
|
|
13313
13438
|
const fallbackProps = fallbackRequired ? allStrings || getStringsFromChildren(props, childComponents) : {};
|
|
13314
13439
|
const xCategories = xPropCategories || fallbackProps.x;
|
|
@@ -15172,6 +15297,7 @@ class VoronoiHelpersClass {
|
|
|
15172
15297
|
}
|
|
15173
15298
|
}
|
|
15174
15299
|
onMouseLeave = (evt, targetProps) => {
|
|
15300
|
+
this.onMouseMove.cancel();
|
|
15175
15301
|
const activePoints = targetProps.activePoints || [];
|
|
15176
15302
|
this.onDeactivated(targetProps, activePoints);
|
|
15177
15303
|
const inactiveMutations = activePoints.length ? activePoints.map(point => this.getInactiveMutations(targetProps, point)) : [];
|