victory-voronoi 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 +2 -0
- package/dist/victory-voronoi.js +197 -68
- package/dist/victory-voronoi.min.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/dist/victory-voronoi.js
CHANGED
|
@@ -7158,31 +7158,34 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7158
7158
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7159
7159
|
/* harmony export */ "VictoryPortal": function() { return /* binding */ VictoryPortal; }
|
|
7160
7160
|
/* harmony export */ });
|
|
7161
|
-
/* harmony import */ var
|
|
7162
|
-
/* harmony import */ var
|
|
7163
|
-
/* harmony import */ var
|
|
7164
|
-
/* harmony import */ var
|
|
7165
|
-
/* harmony import */ var
|
|
7166
|
-
/* harmony import */ var
|
|
7167
|
-
/* harmony import */ var
|
|
7161
|
+
/* 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");
|
|
7162
|
+
/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0__);
|
|
7163
|
+
/* 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");
|
|
7164
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
7165
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
|
|
7166
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
|
|
7167
|
+
/* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
|
|
7168
|
+
/* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
7169
|
+
/* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
|
|
7170
|
+
|
|
7168
7171
|
|
|
7169
7172
|
|
|
7170
7173
|
|
|
7171
7174
|
|
|
7172
7175
|
|
|
7173
7176
|
const defaultProps = {
|
|
7174
|
-
groupComponent: /*#__PURE__*/
|
|
7177
|
+
groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement("g", null)
|
|
7175
7178
|
};
|
|
7176
7179
|
const VictoryPortal = initialProps => {
|
|
7177
7180
|
const props = {
|
|
7178
7181
|
...defaultProps,
|
|
7179
7182
|
...initialProps
|
|
7180
7183
|
};
|
|
7181
|
-
const id =
|
|
7182
|
-
const portalContext = (0,
|
|
7184
|
+
const id = lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default()();
|
|
7185
|
+
const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_3__.usePortalContext)();
|
|
7183
7186
|
if (!portalContext) {
|
|
7184
7187
|
const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
|
|
7185
|
-
|
|
7188
|
+
_victory_util_log__WEBPACK_IMPORTED_MODULE_4__.warn(msg);
|
|
7186
7189
|
}
|
|
7187
7190
|
const children = Array.isArray(props.children) ? props.children[0] : props.children;
|
|
7188
7191
|
const {
|
|
@@ -7193,15 +7196,15 @@ const VictoryPortal = initialProps => {
|
|
|
7193
7196
|
groupComponent,
|
|
7194
7197
|
standalone: false
|
|
7195
7198
|
} : {};
|
|
7196
|
-
const newProps =
|
|
7199
|
+
const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__.omit(props, ["children", "groupComponent"]), {
|
|
7197
7200
|
key: childProps.key ?? id
|
|
7198
7201
|
});
|
|
7199
|
-
const child = children && /*#__PURE__*/
|
|
7200
|
-
|
|
7202
|
+
const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().cloneElement(children, newProps);
|
|
7203
|
+
react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
|
|
7201
7204
|
portalContext?.addChild(id, child);
|
|
7202
7205
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7203
7206
|
}, [props.children]);
|
|
7204
|
-
|
|
7207
|
+
react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
|
|
7205
7208
|
return () => portalContext?.removeChild(id);
|
|
7206
7209
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7207
7210
|
}, []);
|
|
@@ -7518,7 +7521,26 @@ const green = {
|
|
|
7518
7521
|
"500": "#20C933",
|
|
7519
7522
|
"900": "#338A17"
|
|
7520
7523
|
};
|
|
7521
|
-
const colors =
|
|
7524
|
+
const colors = {
|
|
7525
|
+
blue: blue["500"],
|
|
7526
|
+
pink: pink["500"],
|
|
7527
|
+
teal: teal["500"],
|
|
7528
|
+
purple: purple["500"],
|
|
7529
|
+
green: green["500"],
|
|
7530
|
+
orange: orange["500"],
|
|
7531
|
+
cyan: cyan["500"],
|
|
7532
|
+
red: red["500"],
|
|
7533
|
+
yellow: yellow["500"]
|
|
7534
|
+
};
|
|
7535
|
+
const colorScale = Object.values(colors);
|
|
7536
|
+
const grayscale = [gray["200"], gray["400"], gray["600"], gray["900"]];
|
|
7537
|
+
const warm = [yellow["500"], orange["500"], red["500"], pink["500"]];
|
|
7538
|
+
const cool = [cyan["500"], teal["500"], blue["500"], purple["500"]];
|
|
7539
|
+
const heatmap = [green["500"], yellow["500"], red["500"]];
|
|
7540
|
+
const redPalette = [red["500"], red["300"], red["100"]];
|
|
7541
|
+
const greenPalette = [green["500"], green["300"], green["100"]];
|
|
7542
|
+
const bluePalette = [blue["500"], blue["300"], blue["100"]];
|
|
7543
|
+
|
|
7522
7544
|
// *
|
|
7523
7545
|
// * Typography
|
|
7524
7546
|
// *
|
|
@@ -7533,7 +7555,7 @@ const baseProps = {
|
|
|
7533
7555
|
width: 450,
|
|
7534
7556
|
height: 300,
|
|
7535
7557
|
padding: 50,
|
|
7536
|
-
colorScale
|
|
7558
|
+
colorScale
|
|
7537
7559
|
};
|
|
7538
7560
|
// *
|
|
7539
7561
|
// * Labels
|
|
@@ -7562,10 +7584,23 @@ const borderRadius = 1;
|
|
|
7562
7584
|
// * Theme
|
|
7563
7585
|
// *
|
|
7564
7586
|
const clean = {
|
|
7587
|
+
palette: {
|
|
7588
|
+
colors,
|
|
7589
|
+
grayscale,
|
|
7590
|
+
qualitative: colorScale,
|
|
7591
|
+
heatmap,
|
|
7592
|
+
warm,
|
|
7593
|
+
cool,
|
|
7594
|
+
red: redPalette,
|
|
7595
|
+
green: greenPalette,
|
|
7596
|
+
blue: bluePalette
|
|
7597
|
+
},
|
|
7565
7598
|
area: Object.assign({
|
|
7566
7599
|
style: {
|
|
7567
7600
|
data: {
|
|
7568
|
-
fill:
|
|
7601
|
+
fill: blue["500"],
|
|
7602
|
+
strokeWidth: 2,
|
|
7603
|
+
fillOpacity: 0.5
|
|
7569
7604
|
},
|
|
7570
7605
|
labels: baseLabelStyles
|
|
7571
7606
|
}
|
|
@@ -7574,7 +7609,7 @@ const clean = {
|
|
|
7574
7609
|
style: {
|
|
7575
7610
|
axis: {
|
|
7576
7611
|
fill: "transparent",
|
|
7577
|
-
stroke: gray["
|
|
7612
|
+
stroke: gray["500"],
|
|
7578
7613
|
strokeWidth: 1,
|
|
7579
7614
|
strokeLinecap,
|
|
7580
7615
|
strokeLinejoin
|
|
@@ -7599,10 +7634,10 @@ const clean = {
|
|
|
7599
7634
|
polarAxis: Object.assign({
|
|
7600
7635
|
style: {
|
|
7601
7636
|
axis: {
|
|
7602
|
-
stroke: gray["
|
|
7637
|
+
stroke: gray["500"]
|
|
7603
7638
|
},
|
|
7604
7639
|
grid: {
|
|
7605
|
-
stroke: gray["
|
|
7640
|
+
stroke: gray["400"],
|
|
7606
7641
|
strokeDasharray,
|
|
7607
7642
|
strokeLinecap,
|
|
7608
7643
|
strokeLinejoin,
|
|
@@ -7611,7 +7646,7 @@ const clean = {
|
|
|
7611
7646
|
ticks: {
|
|
7612
7647
|
fill: "transparent",
|
|
7613
7648
|
size: 5,
|
|
7614
|
-
stroke: gray["
|
|
7649
|
+
stroke: gray["400"],
|
|
7615
7650
|
strokeWidth: 1,
|
|
7616
7651
|
strokeLinecap,
|
|
7617
7652
|
strokeLinejoin
|
|
@@ -7622,10 +7657,10 @@ const clean = {
|
|
|
7622
7657
|
polarDependentAxis: Object.assign({
|
|
7623
7658
|
style: {
|
|
7624
7659
|
axis: {
|
|
7625
|
-
stroke: gray["
|
|
7660
|
+
stroke: gray["500"]
|
|
7626
7661
|
},
|
|
7627
7662
|
grid: {
|
|
7628
|
-
stroke: gray["
|
|
7663
|
+
stroke: gray["400"],
|
|
7629
7664
|
strokeDasharray,
|
|
7630
7665
|
strokeLinecap,
|
|
7631
7666
|
strokeLinejoin,
|
|
@@ -7634,7 +7669,7 @@ const clean = {
|
|
|
7634
7669
|
ticks: {
|
|
7635
7670
|
fill: "transparent",
|
|
7636
7671
|
size: 5,
|
|
7637
|
-
stroke: gray["
|
|
7672
|
+
stroke: gray["300"],
|
|
7638
7673
|
strokeWidth: 1,
|
|
7639
7674
|
strokeLinecap,
|
|
7640
7675
|
strokeLinejoin
|
|
@@ -7647,7 +7682,8 @@ const clean = {
|
|
|
7647
7682
|
data: {
|
|
7648
7683
|
fill: blue["500"],
|
|
7649
7684
|
padding,
|
|
7650
|
-
strokeWidth:
|
|
7685
|
+
strokeWidth: 1,
|
|
7686
|
+
fillOpacity: 0.5
|
|
7651
7687
|
},
|
|
7652
7688
|
labels: baseLabelStyles
|
|
7653
7689
|
},
|
|
@@ -7684,14 +7720,15 @@ const clean = {
|
|
|
7684
7720
|
q1: {
|
|
7685
7721
|
padding,
|
|
7686
7722
|
fill: teal["500"],
|
|
7687
|
-
rx: borderRadius
|
|
7723
|
+
rx: borderRadius,
|
|
7724
|
+
strokeWidth: 2
|
|
7688
7725
|
},
|
|
7689
7726
|
q1Labels: Object.assign({}, baseLabelStyles, {
|
|
7690
7727
|
padding: 3
|
|
7691
7728
|
}),
|
|
7692
7729
|
q3: {
|
|
7693
7730
|
padding,
|
|
7694
|
-
fill:
|
|
7731
|
+
fill: cyan["500"],
|
|
7695
7732
|
rx: borderRadius
|
|
7696
7733
|
},
|
|
7697
7734
|
q3Labels: Object.assign({}, baseLabelStyles, {
|
|
@@ -7732,14 +7769,13 @@ const clean = {
|
|
|
7732
7769
|
}
|
|
7733
7770
|
}, baseProps),
|
|
7734
7771
|
group: Object.assign({
|
|
7735
|
-
colorScale
|
|
7772
|
+
colorScale
|
|
7736
7773
|
}, baseProps),
|
|
7737
7774
|
histogram: Object.assign({
|
|
7738
7775
|
style: {
|
|
7739
7776
|
data: {
|
|
7740
7777
|
fill: cyan["500"],
|
|
7741
|
-
|
|
7742
|
-
strokeWidth: 0
|
|
7778
|
+
fillOpacity: 0.5
|
|
7743
7779
|
},
|
|
7744
7780
|
labels: baseLabelStyles
|
|
7745
7781
|
},
|
|
@@ -7750,21 +7786,23 @@ const clean = {
|
|
|
7750
7786
|
}, baseProps),
|
|
7751
7787
|
label: baseLabelStyles,
|
|
7752
7788
|
legend: {
|
|
7753
|
-
colorScale
|
|
7754
|
-
gutter:
|
|
7755
|
-
|
|
7789
|
+
colorScale,
|
|
7790
|
+
gutter: 24,
|
|
7791
|
+
borderPadding: 10,
|
|
7792
|
+
orientation: "horizontal",
|
|
7756
7793
|
titleOrientation: "top",
|
|
7794
|
+
centerTitle: true,
|
|
7757
7795
|
style: {
|
|
7758
7796
|
data: {
|
|
7759
7797
|
type: "circle"
|
|
7760
7798
|
},
|
|
7761
7799
|
labels: {
|
|
7762
7800
|
...baseLabelStyles,
|
|
7763
|
-
fontSize:
|
|
7801
|
+
fontSize: 12
|
|
7764
7802
|
},
|
|
7765
7803
|
title: Object.assign({}, baseLabelStyles, {
|
|
7766
7804
|
padding,
|
|
7767
|
-
fontSize:
|
|
7805
|
+
fontSize: 16
|
|
7768
7806
|
}),
|
|
7769
7807
|
border: {
|
|
7770
7808
|
stroke: gray["200"],
|
|
@@ -7778,7 +7816,7 @@ const clean = {
|
|
|
7778
7816
|
data: {
|
|
7779
7817
|
fill: "transparent",
|
|
7780
7818
|
opacity: 1,
|
|
7781
|
-
stroke:
|
|
7819
|
+
stroke: blue["500"],
|
|
7782
7820
|
strokeWidth: 2,
|
|
7783
7821
|
strokeLinecap,
|
|
7784
7822
|
strokeLinejoin
|
|
@@ -7788,16 +7826,22 @@ const clean = {
|
|
|
7788
7826
|
}, baseProps),
|
|
7789
7827
|
pie: Object.assign({
|
|
7790
7828
|
style: {
|
|
7829
|
+
parent: {
|
|
7830
|
+
backgroundColor: gray.white
|
|
7831
|
+
},
|
|
7791
7832
|
data: {
|
|
7792
7833
|
padding,
|
|
7793
7834
|
stroke: gray.white,
|
|
7794
7835
|
strokeWidth: 1
|
|
7795
7836
|
},
|
|
7796
|
-
labels:
|
|
7797
|
-
|
|
7798
|
-
|
|
7837
|
+
labels: {
|
|
7838
|
+
...baseLabelStyles,
|
|
7839
|
+
padding: 20,
|
|
7840
|
+
fill: gray["600"],
|
|
7841
|
+
fontSize: 10
|
|
7842
|
+
}
|
|
7799
7843
|
},
|
|
7800
|
-
colorScale
|
|
7844
|
+
colorScale,
|
|
7801
7845
|
cornerRadius: borderRadius
|
|
7802
7846
|
}, baseProps),
|
|
7803
7847
|
scatter: Object.assign({
|
|
@@ -7808,11 +7852,14 @@ const clean = {
|
|
|
7808
7852
|
stroke: "transparent",
|
|
7809
7853
|
strokeWidth: 0
|
|
7810
7854
|
},
|
|
7811
|
-
labels:
|
|
7855
|
+
labels: {
|
|
7856
|
+
...baseLabelStyles,
|
|
7857
|
+
padding: 20
|
|
7858
|
+
}
|
|
7812
7859
|
}
|
|
7813
7860
|
}, baseProps),
|
|
7814
7861
|
stack: Object.assign({
|
|
7815
|
-
colorScale
|
|
7862
|
+
colorScale
|
|
7816
7863
|
}, baseProps),
|
|
7817
7864
|
tooltip: {
|
|
7818
7865
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -7820,7 +7867,7 @@ const clean = {
|
|
|
7820
7867
|
pointerEvents: "none"
|
|
7821
7868
|
}),
|
|
7822
7869
|
flyoutStyle: {
|
|
7823
|
-
stroke: gray["
|
|
7870
|
+
stroke: gray["300"],
|
|
7824
7871
|
strokeWidth: 2,
|
|
7825
7872
|
fill: gray.white,
|
|
7826
7873
|
pointerEvents: "none"
|
|
@@ -7837,9 +7884,10 @@ const clean = {
|
|
|
7837
7884
|
voronoi: Object.assign({
|
|
7838
7885
|
style: {
|
|
7839
7886
|
data: {
|
|
7840
|
-
fill:
|
|
7841
|
-
stroke:
|
|
7842
|
-
strokeWidth: 2
|
|
7887
|
+
fill: blue["100"],
|
|
7888
|
+
stroke: blue["500"],
|
|
7889
|
+
strokeWidth: 2,
|
|
7890
|
+
opacity: 0.4
|
|
7843
7891
|
},
|
|
7844
7892
|
labels: Object.assign({}, baseLabelStyles, {
|
|
7845
7893
|
padding: 5,
|
|
@@ -7875,9 +7923,28 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7875
7923
|
// *
|
|
7876
7924
|
// * Colors
|
|
7877
7925
|
// *
|
|
7878
|
-
const colors =
|
|
7926
|
+
const colors = {
|
|
7927
|
+
blue: "#4F7DA1",
|
|
7928
|
+
pink: "#E2A37F",
|
|
7929
|
+
teal: "#00796B",
|
|
7930
|
+
purple: "#DF948A",
|
|
7931
|
+
green: "#8BC34A",
|
|
7932
|
+
orange: "#F4511E",
|
|
7933
|
+
cyan: "#006064",
|
|
7934
|
+
red: "#DF5A49",
|
|
7935
|
+
yellow: "#FFF59D"
|
|
7936
|
+
};
|
|
7937
|
+
const colorScale = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
|
|
7879
7938
|
const charcoal = "#252525";
|
|
7880
7939
|
const grey = "#969696";
|
|
7940
|
+
const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
|
|
7941
|
+
const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
|
|
7942
|
+
const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
|
|
7943
|
+
const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
|
|
7944
|
+
const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
|
|
7945
|
+
const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
|
|
7946
|
+
const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
|
|
7947
|
+
|
|
7881
7948
|
// *
|
|
7882
7949
|
// * Typography
|
|
7883
7950
|
// *
|
|
@@ -7891,7 +7958,7 @@ const baseProps = {
|
|
|
7891
7958
|
width: 450,
|
|
7892
7959
|
height: 300,
|
|
7893
7960
|
padding: 50,
|
|
7894
|
-
colorScale
|
|
7961
|
+
colorScale
|
|
7895
7962
|
};
|
|
7896
7963
|
// *
|
|
7897
7964
|
// * Labels
|
|
@@ -7913,6 +7980,17 @@ const centeredLabelStyles = Object.assign({
|
|
|
7913
7980
|
const strokeLinecap = "round";
|
|
7914
7981
|
const strokeLinejoin = "round";
|
|
7915
7982
|
const grayscale = {
|
|
7983
|
+
palette: {
|
|
7984
|
+
colors,
|
|
7985
|
+
grayscale: colorScale,
|
|
7986
|
+
qualitative,
|
|
7987
|
+
heatmap,
|
|
7988
|
+
warm,
|
|
7989
|
+
cool,
|
|
7990
|
+
red,
|
|
7991
|
+
green,
|
|
7992
|
+
blue
|
|
7993
|
+
},
|
|
7916
7994
|
area: Object.assign({
|
|
7917
7995
|
style: {
|
|
7918
7996
|
data: {
|
|
@@ -8027,7 +8105,7 @@ const grayscale = {
|
|
|
8027
8105
|
}
|
|
8028
8106
|
}, baseProps),
|
|
8029
8107
|
group: Object.assign({
|
|
8030
|
-
colorScale
|
|
8108
|
+
colorScale
|
|
8031
8109
|
}, baseProps),
|
|
8032
8110
|
histogram: Object.assign({
|
|
8033
8111
|
style: {
|
|
@@ -8040,7 +8118,7 @@ const grayscale = {
|
|
|
8040
8118
|
}
|
|
8041
8119
|
}, baseProps),
|
|
8042
8120
|
legend: {
|
|
8043
|
-
colorScale
|
|
8121
|
+
colorScale,
|
|
8044
8122
|
gutter: 10,
|
|
8045
8123
|
orientation: "vertical",
|
|
8046
8124
|
titleOrientation: "top",
|
|
@@ -8075,7 +8153,7 @@ const grayscale = {
|
|
|
8075
8153
|
padding: 20
|
|
8076
8154
|
})
|
|
8077
8155
|
},
|
|
8078
|
-
colorScale
|
|
8156
|
+
colorScale,
|
|
8079
8157
|
width: 400,
|
|
8080
8158
|
height: 400,
|
|
8081
8159
|
padding: 50
|
|
@@ -8091,7 +8169,7 @@ const grayscale = {
|
|
|
8091
8169
|
}
|
|
8092
8170
|
}, baseProps),
|
|
8093
8171
|
stack: Object.assign({
|
|
8094
|
-
colorScale
|
|
8172
|
+
colorScale
|
|
8095
8173
|
}, baseProps),
|
|
8096
8174
|
tooltip: {
|
|
8097
8175
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -8151,11 +8229,31 @@ const lime300 = "#DCE775";
|
|
|
8151
8229
|
const lightGreen500 = "#8BC34A";
|
|
8152
8230
|
const teal700 = "#00796B";
|
|
8153
8231
|
const cyan900 = "#006064";
|
|
8154
|
-
const
|
|
8232
|
+
const colorScale = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
|
|
8155
8233
|
const blueGrey50 = "#ECEFF1";
|
|
8156
8234
|
const blueGrey300 = "#90A4AE";
|
|
8157
8235
|
const blueGrey700 = "#455A64";
|
|
8158
8236
|
const grey900 = "#212121";
|
|
8237
|
+
const colors = {
|
|
8238
|
+
blue: "#4F7DA1",
|
|
8239
|
+
pink: "#E2A37F",
|
|
8240
|
+
teal: teal700,
|
|
8241
|
+
purple: "#DF948A",
|
|
8242
|
+
green: lightGreen500,
|
|
8243
|
+
orange: deepOrange600,
|
|
8244
|
+
cyan: cyan900,
|
|
8245
|
+
red: "#DF5A49",
|
|
8246
|
+
yellow: yellow200
|
|
8247
|
+
};
|
|
8248
|
+
const grayscale = [blueGrey50, blueGrey300, blueGrey700, grey900];
|
|
8249
|
+
const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
|
|
8250
|
+
const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
|
|
8251
|
+
const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
|
|
8252
|
+
const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
|
|
8253
|
+
const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
|
|
8254
|
+
const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
|
|
8255
|
+
const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
|
|
8256
|
+
|
|
8159
8257
|
// *
|
|
8160
8258
|
// * Typography
|
|
8161
8259
|
// *
|
|
@@ -8193,6 +8291,17 @@ const strokeDasharray = "10, 5";
|
|
|
8193
8291
|
const strokeLinecap = "round";
|
|
8194
8292
|
const strokeLinejoin = "round";
|
|
8195
8293
|
const material = {
|
|
8294
|
+
palette: {
|
|
8295
|
+
colors,
|
|
8296
|
+
grayscale,
|
|
8297
|
+
qualitative,
|
|
8298
|
+
heatmap,
|
|
8299
|
+
warm,
|
|
8300
|
+
cool,
|
|
8301
|
+
red,
|
|
8302
|
+
green,
|
|
8303
|
+
blue
|
|
8304
|
+
},
|
|
8196
8305
|
area: Object.assign({
|
|
8197
8306
|
style: {
|
|
8198
8307
|
data: {
|
|
@@ -8325,7 +8434,7 @@ const material = {
|
|
|
8325
8434
|
}
|
|
8326
8435
|
}, baseProps),
|
|
8327
8436
|
group: Object.assign({
|
|
8328
|
-
colorScale
|
|
8437
|
+
colorScale
|
|
8329
8438
|
}, baseProps),
|
|
8330
8439
|
histogram: Object.assign({
|
|
8331
8440
|
style: {
|
|
@@ -8338,7 +8447,7 @@ const material = {
|
|
|
8338
8447
|
}
|
|
8339
8448
|
}, baseProps),
|
|
8340
8449
|
legend: {
|
|
8341
|
-
colorScale
|
|
8450
|
+
colorScale,
|
|
8342
8451
|
gutter: 10,
|
|
8343
8452
|
orientation: "vertical",
|
|
8344
8453
|
titleOrientation: "top",
|
|
@@ -8364,7 +8473,7 @@ const material = {
|
|
|
8364
8473
|
}
|
|
8365
8474
|
}, baseProps),
|
|
8366
8475
|
pie: Object.assign({
|
|
8367
|
-
colorScale
|
|
8476
|
+
colorScale,
|
|
8368
8477
|
style: {
|
|
8369
8478
|
data: {
|
|
8370
8479
|
padding,
|
|
@@ -8388,7 +8497,7 @@ const material = {
|
|
|
8388
8497
|
}
|
|
8389
8498
|
}, baseProps),
|
|
8390
8499
|
stack: Object.assign({
|
|
8391
|
-
colorScale
|
|
8500
|
+
colorScale
|
|
8392
8501
|
}, baseProps),
|
|
8393
8502
|
tooltip: {
|
|
8394
8503
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -11354,6 +11463,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11354
11463
|
/* harmony export */ "getColorScale": function() { return /* binding */ getColorScale; },
|
|
11355
11464
|
/* harmony export */ "toTransformString": function() { return /* binding */ toTransformString; }
|
|
11356
11465
|
/* harmony export */ });
|
|
11466
|
+
/* 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");
|
|
11467
|
+
|
|
11468
|
+
|
|
11357
11469
|
/**
|
|
11358
11470
|
* Given an object with CSS/SVG transform definitions, return the string value
|
|
11359
11471
|
* for use with the `transform` CSS property or SVG attribute. Note that we
|
|
@@ -11390,20 +11502,37 @@ const toTransformString = function (obj) {
|
|
|
11390
11502
|
* of 5 hex string values in that color scale. If no 'name' parameter
|
|
11391
11503
|
* is given, it will return the Victory default grayscale.
|
|
11392
11504
|
* @param {String} name The name of the color scale to return (optional).
|
|
11505
|
+
* @param {Object} theme The theme object to retrieve the color scale from (optional).
|
|
11393
11506
|
* @returns {Array} An array of 5 hex string values composing a color scale.
|
|
11394
11507
|
*/
|
|
11395
|
-
function getColorScale(name) {
|
|
11508
|
+
function getColorScale(name, theme) {
|
|
11509
|
+
if (theme === void 0) {
|
|
11510
|
+
theme = _victory_theme_victory_theme__WEBPACK_IMPORTED_MODULE_0__.VictoryTheme.material;
|
|
11511
|
+
}
|
|
11512
|
+
const {
|
|
11513
|
+
palette: {
|
|
11514
|
+
grayscale = ["#cccccc", "#969696", "#636363", "#252525"],
|
|
11515
|
+
qualitative = [],
|
|
11516
|
+
heatmap = [],
|
|
11517
|
+
warm = [],
|
|
11518
|
+
cool = [],
|
|
11519
|
+
red = [],
|
|
11520
|
+
blue = [],
|
|
11521
|
+
green = []
|
|
11522
|
+
} = {}
|
|
11523
|
+
} = theme;
|
|
11396
11524
|
const scales = {
|
|
11397
|
-
grayscale
|
|
11398
|
-
qualitative
|
|
11399
|
-
heatmap
|
|
11400
|
-
warm
|
|
11401
|
-
cool
|
|
11402
|
-
red
|
|
11403
|
-
blue
|
|
11404
|
-
green
|
|
11525
|
+
grayscale,
|
|
11526
|
+
qualitative,
|
|
11527
|
+
heatmap,
|
|
11528
|
+
warm,
|
|
11529
|
+
cool,
|
|
11530
|
+
red,
|
|
11531
|
+
blue,
|
|
11532
|
+
green
|
|
11405
11533
|
};
|
|
11406
|
-
|
|
11534
|
+
const selectedScale = name && scales[name]?.length ? scales[name] : scales.grayscale;
|
|
11535
|
+
return selectedScale;
|
|
11407
11536
|
}
|
|
11408
11537
|
|
|
11409
11538
|
/***/ }),
|