victory-create-container 37.1.2 → 37.2.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
CHANGED
|
@@ -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 = 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
|
}, []);
|
|
@@ -8652,7 +8655,26 @@ const green = {
|
|
|
8652
8655
|
"500": "#20C933",
|
|
8653
8656
|
"900": "#338A17"
|
|
8654
8657
|
};
|
|
8655
|
-
const colors =
|
|
8658
|
+
const colors = {
|
|
8659
|
+
blue: blue["500"],
|
|
8660
|
+
pink: pink["500"],
|
|
8661
|
+
teal: teal["500"],
|
|
8662
|
+
purple: purple["500"],
|
|
8663
|
+
green: green["500"],
|
|
8664
|
+
orange: orange["500"],
|
|
8665
|
+
cyan: cyan["500"],
|
|
8666
|
+
red: red["500"],
|
|
8667
|
+
yellow: yellow["500"]
|
|
8668
|
+
};
|
|
8669
|
+
const colorScale = Object.values(colors);
|
|
8670
|
+
const grayscale = [gray["200"], gray["400"], gray["600"], gray["900"]];
|
|
8671
|
+
const warm = [yellow["500"], orange["500"], red["500"], pink["500"]];
|
|
8672
|
+
const cool = [cyan["500"], teal["500"], blue["500"], purple["500"]];
|
|
8673
|
+
const heatmap = [green["500"], yellow["500"], red["500"]];
|
|
8674
|
+
const redPalette = [red["500"], red["300"], red["100"]];
|
|
8675
|
+
const greenPalette = [green["500"], green["300"], green["100"]];
|
|
8676
|
+
const bluePalette = [blue["500"], blue["300"], blue["100"]];
|
|
8677
|
+
|
|
8656
8678
|
// *
|
|
8657
8679
|
// * Typography
|
|
8658
8680
|
// *
|
|
@@ -8667,7 +8689,7 @@ const baseProps = {
|
|
|
8667
8689
|
width: 450,
|
|
8668
8690
|
height: 300,
|
|
8669
8691
|
padding: 50,
|
|
8670
|
-
colorScale
|
|
8692
|
+
colorScale
|
|
8671
8693
|
};
|
|
8672
8694
|
// *
|
|
8673
8695
|
// * Labels
|
|
@@ -8696,10 +8718,23 @@ const borderRadius = 1;
|
|
|
8696
8718
|
// * Theme
|
|
8697
8719
|
// *
|
|
8698
8720
|
const clean = {
|
|
8721
|
+
palette: {
|
|
8722
|
+
colors,
|
|
8723
|
+
grayscale,
|
|
8724
|
+
qualitative: colorScale,
|
|
8725
|
+
heatmap,
|
|
8726
|
+
warm,
|
|
8727
|
+
cool,
|
|
8728
|
+
red: redPalette,
|
|
8729
|
+
green: greenPalette,
|
|
8730
|
+
blue: bluePalette
|
|
8731
|
+
},
|
|
8699
8732
|
area: Object.assign({
|
|
8700
8733
|
style: {
|
|
8701
8734
|
data: {
|
|
8702
|
-
fill:
|
|
8735
|
+
fill: blue["500"],
|
|
8736
|
+
strokeWidth: 2,
|
|
8737
|
+
fillOpacity: 0.5
|
|
8703
8738
|
},
|
|
8704
8739
|
labels: baseLabelStyles
|
|
8705
8740
|
}
|
|
@@ -8708,7 +8743,7 @@ const clean = {
|
|
|
8708
8743
|
style: {
|
|
8709
8744
|
axis: {
|
|
8710
8745
|
fill: "transparent",
|
|
8711
|
-
stroke: gray["
|
|
8746
|
+
stroke: gray["500"],
|
|
8712
8747
|
strokeWidth: 1,
|
|
8713
8748
|
strokeLinecap,
|
|
8714
8749
|
strokeLinejoin
|
|
@@ -8733,10 +8768,10 @@ const clean = {
|
|
|
8733
8768
|
polarAxis: Object.assign({
|
|
8734
8769
|
style: {
|
|
8735
8770
|
axis: {
|
|
8736
|
-
stroke: gray["
|
|
8771
|
+
stroke: gray["500"]
|
|
8737
8772
|
},
|
|
8738
8773
|
grid: {
|
|
8739
|
-
stroke: gray["
|
|
8774
|
+
stroke: gray["400"],
|
|
8740
8775
|
strokeDasharray,
|
|
8741
8776
|
strokeLinecap,
|
|
8742
8777
|
strokeLinejoin,
|
|
@@ -8745,7 +8780,7 @@ const clean = {
|
|
|
8745
8780
|
ticks: {
|
|
8746
8781
|
fill: "transparent",
|
|
8747
8782
|
size: 5,
|
|
8748
|
-
stroke: gray["
|
|
8783
|
+
stroke: gray["400"],
|
|
8749
8784
|
strokeWidth: 1,
|
|
8750
8785
|
strokeLinecap,
|
|
8751
8786
|
strokeLinejoin
|
|
@@ -8756,10 +8791,10 @@ const clean = {
|
|
|
8756
8791
|
polarDependentAxis: Object.assign({
|
|
8757
8792
|
style: {
|
|
8758
8793
|
axis: {
|
|
8759
|
-
stroke: gray["
|
|
8794
|
+
stroke: gray["500"]
|
|
8760
8795
|
},
|
|
8761
8796
|
grid: {
|
|
8762
|
-
stroke: gray["
|
|
8797
|
+
stroke: gray["400"],
|
|
8763
8798
|
strokeDasharray,
|
|
8764
8799
|
strokeLinecap,
|
|
8765
8800
|
strokeLinejoin,
|
|
@@ -8768,7 +8803,7 @@ const clean = {
|
|
|
8768
8803
|
ticks: {
|
|
8769
8804
|
fill: "transparent",
|
|
8770
8805
|
size: 5,
|
|
8771
|
-
stroke: gray["
|
|
8806
|
+
stroke: gray["300"],
|
|
8772
8807
|
strokeWidth: 1,
|
|
8773
8808
|
strokeLinecap,
|
|
8774
8809
|
strokeLinejoin
|
|
@@ -8781,7 +8816,8 @@ const clean = {
|
|
|
8781
8816
|
data: {
|
|
8782
8817
|
fill: blue["500"],
|
|
8783
8818
|
padding,
|
|
8784
|
-
strokeWidth:
|
|
8819
|
+
strokeWidth: 1,
|
|
8820
|
+
fillOpacity: 0.5
|
|
8785
8821
|
},
|
|
8786
8822
|
labels: baseLabelStyles
|
|
8787
8823
|
},
|
|
@@ -8818,14 +8854,15 @@ const clean = {
|
|
|
8818
8854
|
q1: {
|
|
8819
8855
|
padding,
|
|
8820
8856
|
fill: teal["500"],
|
|
8821
|
-
rx: borderRadius
|
|
8857
|
+
rx: borderRadius,
|
|
8858
|
+
strokeWidth: 2
|
|
8822
8859
|
},
|
|
8823
8860
|
q1Labels: Object.assign({}, baseLabelStyles, {
|
|
8824
8861
|
padding: 3
|
|
8825
8862
|
}),
|
|
8826
8863
|
q3: {
|
|
8827
8864
|
padding,
|
|
8828
|
-
fill:
|
|
8865
|
+
fill: cyan["500"],
|
|
8829
8866
|
rx: borderRadius
|
|
8830
8867
|
},
|
|
8831
8868
|
q3Labels: Object.assign({}, baseLabelStyles, {
|
|
@@ -8866,14 +8903,13 @@ const clean = {
|
|
|
8866
8903
|
}
|
|
8867
8904
|
}, baseProps),
|
|
8868
8905
|
group: Object.assign({
|
|
8869
|
-
colorScale
|
|
8906
|
+
colorScale
|
|
8870
8907
|
}, baseProps),
|
|
8871
8908
|
histogram: Object.assign({
|
|
8872
8909
|
style: {
|
|
8873
8910
|
data: {
|
|
8874
8911
|
fill: cyan["500"],
|
|
8875
|
-
|
|
8876
|
-
strokeWidth: 0
|
|
8912
|
+
fillOpacity: 0.5
|
|
8877
8913
|
},
|
|
8878
8914
|
labels: baseLabelStyles
|
|
8879
8915
|
},
|
|
@@ -8884,21 +8920,23 @@ const clean = {
|
|
|
8884
8920
|
}, baseProps),
|
|
8885
8921
|
label: baseLabelStyles,
|
|
8886
8922
|
legend: {
|
|
8887
|
-
colorScale
|
|
8888
|
-
gutter:
|
|
8889
|
-
|
|
8923
|
+
colorScale,
|
|
8924
|
+
gutter: 24,
|
|
8925
|
+
borderPadding: 10,
|
|
8926
|
+
orientation: "horizontal",
|
|
8890
8927
|
titleOrientation: "top",
|
|
8928
|
+
centerTitle: true,
|
|
8891
8929
|
style: {
|
|
8892
8930
|
data: {
|
|
8893
8931
|
type: "circle"
|
|
8894
8932
|
},
|
|
8895
8933
|
labels: {
|
|
8896
8934
|
...baseLabelStyles,
|
|
8897
|
-
fontSize:
|
|
8935
|
+
fontSize: 12
|
|
8898
8936
|
},
|
|
8899
8937
|
title: Object.assign({}, baseLabelStyles, {
|
|
8900
8938
|
padding,
|
|
8901
|
-
fontSize:
|
|
8939
|
+
fontSize: 16
|
|
8902
8940
|
}),
|
|
8903
8941
|
border: {
|
|
8904
8942
|
stroke: gray["200"],
|
|
@@ -8912,7 +8950,7 @@ const clean = {
|
|
|
8912
8950
|
data: {
|
|
8913
8951
|
fill: "transparent",
|
|
8914
8952
|
opacity: 1,
|
|
8915
|
-
stroke:
|
|
8953
|
+
stroke: blue["500"],
|
|
8916
8954
|
strokeWidth: 2,
|
|
8917
8955
|
strokeLinecap,
|
|
8918
8956
|
strokeLinejoin
|
|
@@ -8922,16 +8960,22 @@ const clean = {
|
|
|
8922
8960
|
}, baseProps),
|
|
8923
8961
|
pie: Object.assign({
|
|
8924
8962
|
style: {
|
|
8963
|
+
parent: {
|
|
8964
|
+
backgroundColor: gray.white
|
|
8965
|
+
},
|
|
8925
8966
|
data: {
|
|
8926
8967
|
padding,
|
|
8927
8968
|
stroke: gray.white,
|
|
8928
8969
|
strokeWidth: 1
|
|
8929
8970
|
},
|
|
8930
|
-
labels:
|
|
8931
|
-
|
|
8932
|
-
|
|
8971
|
+
labels: {
|
|
8972
|
+
...baseLabelStyles,
|
|
8973
|
+
padding: 20,
|
|
8974
|
+
fill: gray["600"],
|
|
8975
|
+
fontSize: 10
|
|
8976
|
+
}
|
|
8933
8977
|
},
|
|
8934
|
-
colorScale
|
|
8978
|
+
colorScale,
|
|
8935
8979
|
cornerRadius: borderRadius
|
|
8936
8980
|
}, baseProps),
|
|
8937
8981
|
scatter: Object.assign({
|
|
@@ -8942,11 +8986,14 @@ const clean = {
|
|
|
8942
8986
|
stroke: "transparent",
|
|
8943
8987
|
strokeWidth: 0
|
|
8944
8988
|
},
|
|
8945
|
-
labels:
|
|
8989
|
+
labels: {
|
|
8990
|
+
...baseLabelStyles,
|
|
8991
|
+
padding: 20
|
|
8992
|
+
}
|
|
8946
8993
|
}
|
|
8947
8994
|
}, baseProps),
|
|
8948
8995
|
stack: Object.assign({
|
|
8949
|
-
colorScale
|
|
8996
|
+
colorScale
|
|
8950
8997
|
}, baseProps),
|
|
8951
8998
|
tooltip: {
|
|
8952
8999
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -8954,7 +9001,7 @@ const clean = {
|
|
|
8954
9001
|
pointerEvents: "none"
|
|
8955
9002
|
}),
|
|
8956
9003
|
flyoutStyle: {
|
|
8957
|
-
stroke: gray["
|
|
9004
|
+
stroke: gray["300"],
|
|
8958
9005
|
strokeWidth: 2,
|
|
8959
9006
|
fill: gray.white,
|
|
8960
9007
|
pointerEvents: "none"
|
|
@@ -8971,9 +9018,10 @@ const clean = {
|
|
|
8971
9018
|
voronoi: Object.assign({
|
|
8972
9019
|
style: {
|
|
8973
9020
|
data: {
|
|
8974
|
-
fill:
|
|
8975
|
-
stroke:
|
|
8976
|
-
strokeWidth: 2
|
|
9021
|
+
fill: blue["100"],
|
|
9022
|
+
stroke: blue["500"],
|
|
9023
|
+
strokeWidth: 2,
|
|
9024
|
+
opacity: 0.4
|
|
8977
9025
|
},
|
|
8978
9026
|
labels: Object.assign({}, baseLabelStyles, {
|
|
8979
9027
|
padding: 5,
|
|
@@ -9009,9 +9057,28 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9009
9057
|
// *
|
|
9010
9058
|
// * Colors
|
|
9011
9059
|
// *
|
|
9012
|
-
const colors =
|
|
9060
|
+
const colors = {
|
|
9061
|
+
blue: "#4F7DA1",
|
|
9062
|
+
pink: "#E2A37F",
|
|
9063
|
+
teal: "#00796B",
|
|
9064
|
+
purple: "#DF948A",
|
|
9065
|
+
green: "#8BC34A",
|
|
9066
|
+
orange: "#F4511E",
|
|
9067
|
+
cyan: "#006064",
|
|
9068
|
+
red: "#DF5A49",
|
|
9069
|
+
yellow: "#FFF59D"
|
|
9070
|
+
};
|
|
9071
|
+
const colorScale = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
|
|
9013
9072
|
const charcoal = "#252525";
|
|
9014
9073
|
const grey = "#969696";
|
|
9074
|
+
const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
|
|
9075
|
+
const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
|
|
9076
|
+
const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
|
|
9077
|
+
const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
|
|
9078
|
+
const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
|
|
9079
|
+
const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
|
|
9080
|
+
const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
|
|
9081
|
+
|
|
9015
9082
|
// *
|
|
9016
9083
|
// * Typography
|
|
9017
9084
|
// *
|
|
@@ -9025,7 +9092,7 @@ const baseProps = {
|
|
|
9025
9092
|
width: 450,
|
|
9026
9093
|
height: 300,
|
|
9027
9094
|
padding: 50,
|
|
9028
|
-
colorScale
|
|
9095
|
+
colorScale
|
|
9029
9096
|
};
|
|
9030
9097
|
// *
|
|
9031
9098
|
// * Labels
|
|
@@ -9047,6 +9114,17 @@ const centeredLabelStyles = Object.assign({
|
|
|
9047
9114
|
const strokeLinecap = "round";
|
|
9048
9115
|
const strokeLinejoin = "round";
|
|
9049
9116
|
const grayscale = {
|
|
9117
|
+
palette: {
|
|
9118
|
+
colors,
|
|
9119
|
+
grayscale: colorScale,
|
|
9120
|
+
qualitative,
|
|
9121
|
+
heatmap,
|
|
9122
|
+
warm,
|
|
9123
|
+
cool,
|
|
9124
|
+
red,
|
|
9125
|
+
green,
|
|
9126
|
+
blue
|
|
9127
|
+
},
|
|
9050
9128
|
area: Object.assign({
|
|
9051
9129
|
style: {
|
|
9052
9130
|
data: {
|
|
@@ -9161,7 +9239,7 @@ const grayscale = {
|
|
|
9161
9239
|
}
|
|
9162
9240
|
}, baseProps),
|
|
9163
9241
|
group: Object.assign({
|
|
9164
|
-
colorScale
|
|
9242
|
+
colorScale
|
|
9165
9243
|
}, baseProps),
|
|
9166
9244
|
histogram: Object.assign({
|
|
9167
9245
|
style: {
|
|
@@ -9174,7 +9252,7 @@ const grayscale = {
|
|
|
9174
9252
|
}
|
|
9175
9253
|
}, baseProps),
|
|
9176
9254
|
legend: {
|
|
9177
|
-
colorScale
|
|
9255
|
+
colorScale,
|
|
9178
9256
|
gutter: 10,
|
|
9179
9257
|
orientation: "vertical",
|
|
9180
9258
|
titleOrientation: "top",
|
|
@@ -9209,7 +9287,7 @@ const grayscale = {
|
|
|
9209
9287
|
padding: 20
|
|
9210
9288
|
})
|
|
9211
9289
|
},
|
|
9212
|
-
colorScale
|
|
9290
|
+
colorScale,
|
|
9213
9291
|
width: 400,
|
|
9214
9292
|
height: 400,
|
|
9215
9293
|
padding: 50
|
|
@@ -9225,7 +9303,7 @@ const grayscale = {
|
|
|
9225
9303
|
}
|
|
9226
9304
|
}, baseProps),
|
|
9227
9305
|
stack: Object.assign({
|
|
9228
|
-
colorScale
|
|
9306
|
+
colorScale
|
|
9229
9307
|
}, baseProps),
|
|
9230
9308
|
tooltip: {
|
|
9231
9309
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -9285,11 +9363,31 @@ const lime300 = "#DCE775";
|
|
|
9285
9363
|
const lightGreen500 = "#8BC34A";
|
|
9286
9364
|
const teal700 = "#00796B";
|
|
9287
9365
|
const cyan900 = "#006064";
|
|
9288
|
-
const
|
|
9366
|
+
const colorScale = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
|
|
9289
9367
|
const blueGrey50 = "#ECEFF1";
|
|
9290
9368
|
const blueGrey300 = "#90A4AE";
|
|
9291
9369
|
const blueGrey700 = "#455A64";
|
|
9292
9370
|
const grey900 = "#212121";
|
|
9371
|
+
const colors = {
|
|
9372
|
+
blue: "#4F7DA1",
|
|
9373
|
+
pink: "#E2A37F",
|
|
9374
|
+
teal: teal700,
|
|
9375
|
+
purple: "#DF948A",
|
|
9376
|
+
green: lightGreen500,
|
|
9377
|
+
orange: deepOrange600,
|
|
9378
|
+
cyan: cyan900,
|
|
9379
|
+
red: "#DF5A49",
|
|
9380
|
+
yellow: yellow200
|
|
9381
|
+
};
|
|
9382
|
+
const grayscale = [blueGrey50, blueGrey300, blueGrey700, grey900];
|
|
9383
|
+
const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
|
|
9384
|
+
const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
|
|
9385
|
+
const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
|
|
9386
|
+
const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
|
|
9387
|
+
const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
|
|
9388
|
+
const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
|
|
9389
|
+
const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
|
|
9390
|
+
|
|
9293
9391
|
// *
|
|
9294
9392
|
// * Typography
|
|
9295
9393
|
// *
|
|
@@ -9327,6 +9425,17 @@ const strokeDasharray = "10, 5";
|
|
|
9327
9425
|
const strokeLinecap = "round";
|
|
9328
9426
|
const strokeLinejoin = "round";
|
|
9329
9427
|
const material = {
|
|
9428
|
+
palette: {
|
|
9429
|
+
colors,
|
|
9430
|
+
grayscale,
|
|
9431
|
+
qualitative,
|
|
9432
|
+
heatmap,
|
|
9433
|
+
warm,
|
|
9434
|
+
cool,
|
|
9435
|
+
red,
|
|
9436
|
+
green,
|
|
9437
|
+
blue
|
|
9438
|
+
},
|
|
9330
9439
|
area: Object.assign({
|
|
9331
9440
|
style: {
|
|
9332
9441
|
data: {
|
|
@@ -9459,7 +9568,7 @@ const material = {
|
|
|
9459
9568
|
}
|
|
9460
9569
|
}, baseProps),
|
|
9461
9570
|
group: Object.assign({
|
|
9462
|
-
colorScale
|
|
9571
|
+
colorScale
|
|
9463
9572
|
}, baseProps),
|
|
9464
9573
|
histogram: Object.assign({
|
|
9465
9574
|
style: {
|
|
@@ -9472,7 +9581,7 @@ const material = {
|
|
|
9472
9581
|
}
|
|
9473
9582
|
}, baseProps),
|
|
9474
9583
|
legend: {
|
|
9475
|
-
colorScale
|
|
9584
|
+
colorScale,
|
|
9476
9585
|
gutter: 10,
|
|
9477
9586
|
orientation: "vertical",
|
|
9478
9587
|
titleOrientation: "top",
|
|
@@ -9498,7 +9607,7 @@ const material = {
|
|
|
9498
9607
|
}
|
|
9499
9608
|
}, baseProps),
|
|
9500
9609
|
pie: Object.assign({
|
|
9501
|
-
colorScale
|
|
9610
|
+
colorScale,
|
|
9502
9611
|
style: {
|
|
9503
9612
|
data: {
|
|
9504
9613
|
padding,
|
|
@@ -9522,7 +9631,7 @@ const material = {
|
|
|
9522
9631
|
}
|
|
9523
9632
|
}, baseProps),
|
|
9524
9633
|
stack: Object.assign({
|
|
9525
|
-
colorScale
|
|
9634
|
+
colorScale
|
|
9526
9635
|
}, baseProps),
|
|
9527
9636
|
tooltip: {
|
|
9528
9637
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -12387,6 +12496,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
12387
12496
|
/* harmony export */ "getColorScale": function() { return /* binding */ getColorScale; },
|
|
12388
12497
|
/* harmony export */ "toTransformString": function() { return /* binding */ toTransformString; }
|
|
12389
12498
|
/* harmony export */ });
|
|
12499
|
+
/* 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");
|
|
12500
|
+
|
|
12501
|
+
|
|
12390
12502
|
/**
|
|
12391
12503
|
* Given an object with CSS/SVG transform definitions, return the string value
|
|
12392
12504
|
* for use with the `transform` CSS property or SVG attribute. Note that we
|
|
@@ -12423,20 +12535,37 @@ const toTransformString = function (obj) {
|
|
|
12423
12535
|
* of 5 hex string values in that color scale. If no 'name' parameter
|
|
12424
12536
|
* is given, it will return the Victory default grayscale.
|
|
12425
12537
|
* @param {String} name The name of the color scale to return (optional).
|
|
12538
|
+
* @param {Object} theme The theme object to retrieve the color scale from (optional).
|
|
12426
12539
|
* @returns {Array} An array of 5 hex string values composing a color scale.
|
|
12427
12540
|
*/
|
|
12428
|
-
function getColorScale(name) {
|
|
12541
|
+
function getColorScale(name, theme) {
|
|
12542
|
+
if (theme === void 0) {
|
|
12543
|
+
theme = _victory_theme_victory_theme__WEBPACK_IMPORTED_MODULE_0__.VictoryTheme.material;
|
|
12544
|
+
}
|
|
12545
|
+
const {
|
|
12546
|
+
palette: {
|
|
12547
|
+
grayscale = ["#cccccc", "#969696", "#636363", "#252525"],
|
|
12548
|
+
qualitative = [],
|
|
12549
|
+
heatmap = [],
|
|
12550
|
+
warm = [],
|
|
12551
|
+
cool = [],
|
|
12552
|
+
red = [],
|
|
12553
|
+
blue = [],
|
|
12554
|
+
green = []
|
|
12555
|
+
} = {}
|
|
12556
|
+
} = theme;
|
|
12429
12557
|
const scales = {
|
|
12430
|
-
grayscale
|
|
12431
|
-
qualitative
|
|
12432
|
-
heatmap
|
|
12433
|
-
warm
|
|
12434
|
-
cool
|
|
12435
|
-
red
|
|
12436
|
-
blue
|
|
12437
|
-
green
|
|
12558
|
+
grayscale,
|
|
12559
|
+
qualitative,
|
|
12560
|
+
heatmap,
|
|
12561
|
+
warm,
|
|
12562
|
+
cool,
|
|
12563
|
+
red,
|
|
12564
|
+
blue,
|
|
12565
|
+
green
|
|
12438
12566
|
};
|
|
12439
|
-
|
|
12567
|
+
const selectedScale = name && scales[name]?.length ? scales[name] : scales.grayscale;
|
|
12568
|
+
return selectedScale;
|
|
12440
12569
|
}
|
|
12441
12570
|
|
|
12442
12571
|
/***/ }),
|
|
@@ -13194,7 +13323,9 @@ function getAllEvents(props) {
|
|
|
13194
13323
|
}
|
|
13195
13324
|
return events || [];
|
|
13196
13325
|
}
|
|
13197
|
-
|
|
13326
|
+
|
|
13327
|
+
// eslint-disable-next-line max-params
|
|
13328
|
+
function getColor(calculatedProps, child, index, theme) {
|
|
13198
13329
|
// check for styles first
|
|
13199
13330
|
const {
|
|
13200
13331
|
style
|
|
@@ -13211,14 +13342,16 @@ function getColor(calculatedProps, child, index) {
|
|
|
13211
13342
|
if (!colorScale && !color) {
|
|
13212
13343
|
return undefined;
|
|
13213
13344
|
}
|
|
13214
|
-
const colors = Array.isArray(colorScale) ? colorScale : _style__WEBPACK_IMPORTED_MODULE_13__.getColorScale(colorScale);
|
|
13345
|
+
const colors = Array.isArray(colorScale) ? colorScale : _style__WEBPACK_IMPORTED_MODULE_13__.getColorScale(colorScale, theme);
|
|
13215
13346
|
return color || colors[index % colors.length];
|
|
13216
13347
|
}
|
|
13217
13348
|
function getStyle(theme, style, role) {
|
|
13218
13349
|
const defaultStyle = theme && theme[role] && theme[role].style ? theme[role].style : {};
|
|
13219
13350
|
return _helpers__WEBPACK_IMPORTED_MODULE_7__.getStyles(style, defaultStyle);
|
|
13220
13351
|
}
|
|
13221
|
-
|
|
13352
|
+
|
|
13353
|
+
// eslint-disable-next-line max-params
|
|
13354
|
+
function getChildStyle(child, index, calculatedProps, theme) {
|
|
13222
13355
|
const {
|
|
13223
13356
|
style,
|
|
13224
13357
|
role
|
|
@@ -13228,7 +13361,7 @@ function getChildStyle(child, index, calculatedProps) {
|
|
|
13228
13361
|
return childStyle;
|
|
13229
13362
|
}
|
|
13230
13363
|
const childRole = child.type && child.type.role;
|
|
13231
|
-
const defaultFill = childRole === "stack" ? undefined : getColor(calculatedProps, child, index);
|
|
13364
|
+
const defaultFill = childRole === "stack" ? undefined : getColor(calculatedProps, child, index, theme);
|
|
13232
13365
|
const defaultColor = childRole === "line" ? {
|
|
13233
13366
|
fill: "none",
|
|
13234
13367
|
stroke: defaultFill
|
|
@@ -15172,6 +15305,7 @@ class VoronoiHelpersClass {
|
|
|
15172
15305
|
}
|
|
15173
15306
|
}
|
|
15174
15307
|
onMouseLeave = (evt, targetProps) => {
|
|
15308
|
+
this.onMouseMove.cancel();
|
|
15175
15309
|
const activePoints = targetProps.activePoints || [];
|
|
15176
15310
|
this.onDeactivated(targetProps, activePoints);
|
|
15177
15311
|
const inactiveMutations = activePoints.length ? activePoints.map(point => this.getInactiveMutations(targetProps, point)) : [];
|