victory-area 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-area.js +198 -69
- package/dist/victory-area.min.js +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/dist/victory-area.js
CHANGED
|
@@ -6220,31 +6220,34 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6220
6220
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6221
6221
|
/* harmony export */ "VictoryPortal": function() { return /* binding */ VictoryPortal; }
|
|
6222
6222
|
/* harmony export */ });
|
|
6223
|
-
/* harmony import */ var
|
|
6224
|
-
/* harmony import */ var
|
|
6225
|
-
/* harmony import */ var
|
|
6226
|
-
/* harmony import */ var
|
|
6227
|
-
/* harmony import */ var
|
|
6228
|
-
/* harmony import */ var
|
|
6229
|
-
/* harmony import */ var
|
|
6223
|
+
/* 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");
|
|
6224
|
+
/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0__);
|
|
6225
|
+
/* 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");
|
|
6226
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
6227
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
|
|
6228
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
|
|
6229
|
+
/* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
|
|
6230
|
+
/* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
6231
|
+
/* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
|
|
6232
|
+
|
|
6230
6233
|
|
|
6231
6234
|
|
|
6232
6235
|
|
|
6233
6236
|
|
|
6234
6237
|
|
|
6235
6238
|
const defaultProps = {
|
|
6236
|
-
groupComponent: /*#__PURE__*/
|
|
6239
|
+
groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement("g", null)
|
|
6237
6240
|
};
|
|
6238
6241
|
const VictoryPortal = initialProps => {
|
|
6239
6242
|
const props = {
|
|
6240
6243
|
...defaultProps,
|
|
6241
6244
|
...initialProps
|
|
6242
6245
|
};
|
|
6243
|
-
const id =
|
|
6244
|
-
const portalContext = (0,
|
|
6246
|
+
const id = lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default()();
|
|
6247
|
+
const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_3__.usePortalContext)();
|
|
6245
6248
|
if (!portalContext) {
|
|
6246
6249
|
const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
|
|
6247
|
-
|
|
6250
|
+
_victory_util_log__WEBPACK_IMPORTED_MODULE_4__.warn(msg);
|
|
6248
6251
|
}
|
|
6249
6252
|
const children = Array.isArray(props.children) ? props.children[0] : props.children;
|
|
6250
6253
|
const {
|
|
@@ -6255,15 +6258,15 @@ const VictoryPortal = initialProps => {
|
|
|
6255
6258
|
groupComponent,
|
|
6256
6259
|
standalone: false
|
|
6257
6260
|
} : {};
|
|
6258
|
-
const newProps =
|
|
6261
|
+
const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__.omit(props, ["children", "groupComponent"]), {
|
|
6259
6262
|
key: childProps.key ?? id
|
|
6260
6263
|
});
|
|
6261
|
-
const child = children && /*#__PURE__*/
|
|
6262
|
-
|
|
6264
|
+
const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().cloneElement(children, newProps);
|
|
6265
|
+
react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
|
|
6263
6266
|
portalContext?.addChild(id, child);
|
|
6264
6267
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6265
6268
|
}, [props.children]);
|
|
6266
|
-
|
|
6269
|
+
react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
|
|
6267
6270
|
return () => portalContext?.removeChild(id);
|
|
6268
6271
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6269
6272
|
}, []);
|
|
@@ -6580,7 +6583,26 @@ const green = {
|
|
|
6580
6583
|
"500": "#20C933",
|
|
6581
6584
|
"900": "#338A17"
|
|
6582
6585
|
};
|
|
6583
|
-
const colors =
|
|
6586
|
+
const colors = {
|
|
6587
|
+
blue: blue["500"],
|
|
6588
|
+
pink: pink["500"],
|
|
6589
|
+
teal: teal["500"],
|
|
6590
|
+
purple: purple["500"],
|
|
6591
|
+
green: green["500"],
|
|
6592
|
+
orange: orange["500"],
|
|
6593
|
+
cyan: cyan["500"],
|
|
6594
|
+
red: red["500"],
|
|
6595
|
+
yellow: yellow["500"]
|
|
6596
|
+
};
|
|
6597
|
+
const colorScale = Object.values(colors);
|
|
6598
|
+
const grayscale = [gray["200"], gray["400"], gray["600"], gray["900"]];
|
|
6599
|
+
const warm = [yellow["500"], orange["500"], red["500"], pink["500"]];
|
|
6600
|
+
const cool = [cyan["500"], teal["500"], blue["500"], purple["500"]];
|
|
6601
|
+
const heatmap = [green["500"], yellow["500"], red["500"]];
|
|
6602
|
+
const redPalette = [red["500"], red["300"], red["100"]];
|
|
6603
|
+
const greenPalette = [green["500"], green["300"], green["100"]];
|
|
6604
|
+
const bluePalette = [blue["500"], blue["300"], blue["100"]];
|
|
6605
|
+
|
|
6584
6606
|
// *
|
|
6585
6607
|
// * Typography
|
|
6586
6608
|
// *
|
|
@@ -6595,7 +6617,7 @@ const baseProps = {
|
|
|
6595
6617
|
width: 450,
|
|
6596
6618
|
height: 300,
|
|
6597
6619
|
padding: 50,
|
|
6598
|
-
colorScale
|
|
6620
|
+
colorScale
|
|
6599
6621
|
};
|
|
6600
6622
|
// *
|
|
6601
6623
|
// * Labels
|
|
@@ -6624,10 +6646,23 @@ const borderRadius = 1;
|
|
|
6624
6646
|
// * Theme
|
|
6625
6647
|
// *
|
|
6626
6648
|
const clean = {
|
|
6649
|
+
palette: {
|
|
6650
|
+
colors,
|
|
6651
|
+
grayscale,
|
|
6652
|
+
qualitative: colorScale,
|
|
6653
|
+
heatmap,
|
|
6654
|
+
warm,
|
|
6655
|
+
cool,
|
|
6656
|
+
red: redPalette,
|
|
6657
|
+
green: greenPalette,
|
|
6658
|
+
blue: bluePalette
|
|
6659
|
+
},
|
|
6627
6660
|
area: Object.assign({
|
|
6628
6661
|
style: {
|
|
6629
6662
|
data: {
|
|
6630
|
-
fill:
|
|
6663
|
+
fill: blue["500"],
|
|
6664
|
+
strokeWidth: 2,
|
|
6665
|
+
fillOpacity: 0.5
|
|
6631
6666
|
},
|
|
6632
6667
|
labels: baseLabelStyles
|
|
6633
6668
|
}
|
|
@@ -6636,7 +6671,7 @@ const clean = {
|
|
|
6636
6671
|
style: {
|
|
6637
6672
|
axis: {
|
|
6638
6673
|
fill: "transparent",
|
|
6639
|
-
stroke: gray["
|
|
6674
|
+
stroke: gray["500"],
|
|
6640
6675
|
strokeWidth: 1,
|
|
6641
6676
|
strokeLinecap,
|
|
6642
6677
|
strokeLinejoin
|
|
@@ -6661,10 +6696,10 @@ const clean = {
|
|
|
6661
6696
|
polarAxis: Object.assign({
|
|
6662
6697
|
style: {
|
|
6663
6698
|
axis: {
|
|
6664
|
-
stroke: gray["
|
|
6699
|
+
stroke: gray["500"]
|
|
6665
6700
|
},
|
|
6666
6701
|
grid: {
|
|
6667
|
-
stroke: gray["
|
|
6702
|
+
stroke: gray["400"],
|
|
6668
6703
|
strokeDasharray,
|
|
6669
6704
|
strokeLinecap,
|
|
6670
6705
|
strokeLinejoin,
|
|
@@ -6673,7 +6708,7 @@ const clean = {
|
|
|
6673
6708
|
ticks: {
|
|
6674
6709
|
fill: "transparent",
|
|
6675
6710
|
size: 5,
|
|
6676
|
-
stroke: gray["
|
|
6711
|
+
stroke: gray["400"],
|
|
6677
6712
|
strokeWidth: 1,
|
|
6678
6713
|
strokeLinecap,
|
|
6679
6714
|
strokeLinejoin
|
|
@@ -6684,10 +6719,10 @@ const clean = {
|
|
|
6684
6719
|
polarDependentAxis: Object.assign({
|
|
6685
6720
|
style: {
|
|
6686
6721
|
axis: {
|
|
6687
|
-
stroke: gray["
|
|
6722
|
+
stroke: gray["500"]
|
|
6688
6723
|
},
|
|
6689
6724
|
grid: {
|
|
6690
|
-
stroke: gray["
|
|
6725
|
+
stroke: gray["400"],
|
|
6691
6726
|
strokeDasharray,
|
|
6692
6727
|
strokeLinecap,
|
|
6693
6728
|
strokeLinejoin,
|
|
@@ -6696,7 +6731,7 @@ const clean = {
|
|
|
6696
6731
|
ticks: {
|
|
6697
6732
|
fill: "transparent",
|
|
6698
6733
|
size: 5,
|
|
6699
|
-
stroke: gray["
|
|
6734
|
+
stroke: gray["300"],
|
|
6700
6735
|
strokeWidth: 1,
|
|
6701
6736
|
strokeLinecap,
|
|
6702
6737
|
strokeLinejoin
|
|
@@ -6709,7 +6744,8 @@ const clean = {
|
|
|
6709
6744
|
data: {
|
|
6710
6745
|
fill: blue["500"],
|
|
6711
6746
|
padding,
|
|
6712
|
-
strokeWidth:
|
|
6747
|
+
strokeWidth: 1,
|
|
6748
|
+
fillOpacity: 0.5
|
|
6713
6749
|
},
|
|
6714
6750
|
labels: baseLabelStyles
|
|
6715
6751
|
},
|
|
@@ -6746,14 +6782,15 @@ const clean = {
|
|
|
6746
6782
|
q1: {
|
|
6747
6783
|
padding,
|
|
6748
6784
|
fill: teal["500"],
|
|
6749
|
-
rx: borderRadius
|
|
6785
|
+
rx: borderRadius,
|
|
6786
|
+
strokeWidth: 2
|
|
6750
6787
|
},
|
|
6751
6788
|
q1Labels: Object.assign({}, baseLabelStyles, {
|
|
6752
6789
|
padding: 3
|
|
6753
6790
|
}),
|
|
6754
6791
|
q3: {
|
|
6755
6792
|
padding,
|
|
6756
|
-
fill:
|
|
6793
|
+
fill: cyan["500"],
|
|
6757
6794
|
rx: borderRadius
|
|
6758
6795
|
},
|
|
6759
6796
|
q3Labels: Object.assign({}, baseLabelStyles, {
|
|
@@ -6794,14 +6831,13 @@ const clean = {
|
|
|
6794
6831
|
}
|
|
6795
6832
|
}, baseProps),
|
|
6796
6833
|
group: Object.assign({
|
|
6797
|
-
colorScale
|
|
6834
|
+
colorScale
|
|
6798
6835
|
}, baseProps),
|
|
6799
6836
|
histogram: Object.assign({
|
|
6800
6837
|
style: {
|
|
6801
6838
|
data: {
|
|
6802
6839
|
fill: cyan["500"],
|
|
6803
|
-
|
|
6804
|
-
strokeWidth: 0
|
|
6840
|
+
fillOpacity: 0.5
|
|
6805
6841
|
},
|
|
6806
6842
|
labels: baseLabelStyles
|
|
6807
6843
|
},
|
|
@@ -6812,21 +6848,23 @@ const clean = {
|
|
|
6812
6848
|
}, baseProps),
|
|
6813
6849
|
label: baseLabelStyles,
|
|
6814
6850
|
legend: {
|
|
6815
|
-
colorScale
|
|
6816
|
-
gutter:
|
|
6817
|
-
|
|
6851
|
+
colorScale,
|
|
6852
|
+
gutter: 24,
|
|
6853
|
+
borderPadding: 10,
|
|
6854
|
+
orientation: "horizontal",
|
|
6818
6855
|
titleOrientation: "top",
|
|
6856
|
+
centerTitle: true,
|
|
6819
6857
|
style: {
|
|
6820
6858
|
data: {
|
|
6821
6859
|
type: "circle"
|
|
6822
6860
|
},
|
|
6823
6861
|
labels: {
|
|
6824
6862
|
...baseLabelStyles,
|
|
6825
|
-
fontSize:
|
|
6863
|
+
fontSize: 12
|
|
6826
6864
|
},
|
|
6827
6865
|
title: Object.assign({}, baseLabelStyles, {
|
|
6828
6866
|
padding,
|
|
6829
|
-
fontSize:
|
|
6867
|
+
fontSize: 16
|
|
6830
6868
|
}),
|
|
6831
6869
|
border: {
|
|
6832
6870
|
stroke: gray["200"],
|
|
@@ -6840,7 +6878,7 @@ const clean = {
|
|
|
6840
6878
|
data: {
|
|
6841
6879
|
fill: "transparent",
|
|
6842
6880
|
opacity: 1,
|
|
6843
|
-
stroke:
|
|
6881
|
+
stroke: blue["500"],
|
|
6844
6882
|
strokeWidth: 2,
|
|
6845
6883
|
strokeLinecap,
|
|
6846
6884
|
strokeLinejoin
|
|
@@ -6850,16 +6888,22 @@ const clean = {
|
|
|
6850
6888
|
}, baseProps),
|
|
6851
6889
|
pie: Object.assign({
|
|
6852
6890
|
style: {
|
|
6891
|
+
parent: {
|
|
6892
|
+
backgroundColor: gray.white
|
|
6893
|
+
},
|
|
6853
6894
|
data: {
|
|
6854
6895
|
padding,
|
|
6855
6896
|
stroke: gray.white,
|
|
6856
6897
|
strokeWidth: 1
|
|
6857
6898
|
},
|
|
6858
|
-
labels:
|
|
6859
|
-
|
|
6860
|
-
|
|
6899
|
+
labels: {
|
|
6900
|
+
...baseLabelStyles,
|
|
6901
|
+
padding: 20,
|
|
6902
|
+
fill: gray["600"],
|
|
6903
|
+
fontSize: 10
|
|
6904
|
+
}
|
|
6861
6905
|
},
|
|
6862
|
-
colorScale
|
|
6906
|
+
colorScale,
|
|
6863
6907
|
cornerRadius: borderRadius
|
|
6864
6908
|
}, baseProps),
|
|
6865
6909
|
scatter: Object.assign({
|
|
@@ -6870,11 +6914,14 @@ const clean = {
|
|
|
6870
6914
|
stroke: "transparent",
|
|
6871
6915
|
strokeWidth: 0
|
|
6872
6916
|
},
|
|
6873
|
-
labels:
|
|
6917
|
+
labels: {
|
|
6918
|
+
...baseLabelStyles,
|
|
6919
|
+
padding: 20
|
|
6920
|
+
}
|
|
6874
6921
|
}
|
|
6875
6922
|
}, baseProps),
|
|
6876
6923
|
stack: Object.assign({
|
|
6877
|
-
colorScale
|
|
6924
|
+
colorScale
|
|
6878
6925
|
}, baseProps),
|
|
6879
6926
|
tooltip: {
|
|
6880
6927
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -6882,7 +6929,7 @@ const clean = {
|
|
|
6882
6929
|
pointerEvents: "none"
|
|
6883
6930
|
}),
|
|
6884
6931
|
flyoutStyle: {
|
|
6885
|
-
stroke: gray["
|
|
6932
|
+
stroke: gray["300"],
|
|
6886
6933
|
strokeWidth: 2,
|
|
6887
6934
|
fill: gray.white,
|
|
6888
6935
|
pointerEvents: "none"
|
|
@@ -6899,9 +6946,10 @@ const clean = {
|
|
|
6899
6946
|
voronoi: Object.assign({
|
|
6900
6947
|
style: {
|
|
6901
6948
|
data: {
|
|
6902
|
-
fill:
|
|
6903
|
-
stroke:
|
|
6904
|
-
strokeWidth: 2
|
|
6949
|
+
fill: blue["100"],
|
|
6950
|
+
stroke: blue["500"],
|
|
6951
|
+
strokeWidth: 2,
|
|
6952
|
+
opacity: 0.4
|
|
6905
6953
|
},
|
|
6906
6954
|
labels: Object.assign({}, baseLabelStyles, {
|
|
6907
6955
|
padding: 5,
|
|
@@ -6937,9 +6985,28 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6937
6985
|
// *
|
|
6938
6986
|
// * Colors
|
|
6939
6987
|
// *
|
|
6940
|
-
const colors =
|
|
6988
|
+
const colors = {
|
|
6989
|
+
blue: "#4F7DA1",
|
|
6990
|
+
pink: "#E2A37F",
|
|
6991
|
+
teal: "#00796B",
|
|
6992
|
+
purple: "#DF948A",
|
|
6993
|
+
green: "#8BC34A",
|
|
6994
|
+
orange: "#F4511E",
|
|
6995
|
+
cyan: "#006064",
|
|
6996
|
+
red: "#DF5A49",
|
|
6997
|
+
yellow: "#FFF59D"
|
|
6998
|
+
};
|
|
6999
|
+
const colorScale = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
|
|
6941
7000
|
const charcoal = "#252525";
|
|
6942
7001
|
const grey = "#969696";
|
|
7002
|
+
const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
|
|
7003
|
+
const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
|
|
7004
|
+
const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
|
|
7005
|
+
const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
|
|
7006
|
+
const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
|
|
7007
|
+
const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
|
|
7008
|
+
const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
|
|
7009
|
+
|
|
6943
7010
|
// *
|
|
6944
7011
|
// * Typography
|
|
6945
7012
|
// *
|
|
@@ -6953,7 +7020,7 @@ const baseProps = {
|
|
|
6953
7020
|
width: 450,
|
|
6954
7021
|
height: 300,
|
|
6955
7022
|
padding: 50,
|
|
6956
|
-
colorScale
|
|
7023
|
+
colorScale
|
|
6957
7024
|
};
|
|
6958
7025
|
// *
|
|
6959
7026
|
// * Labels
|
|
@@ -6975,6 +7042,17 @@ const centeredLabelStyles = Object.assign({
|
|
|
6975
7042
|
const strokeLinecap = "round";
|
|
6976
7043
|
const strokeLinejoin = "round";
|
|
6977
7044
|
const grayscale = {
|
|
7045
|
+
palette: {
|
|
7046
|
+
colors,
|
|
7047
|
+
grayscale: colorScale,
|
|
7048
|
+
qualitative,
|
|
7049
|
+
heatmap,
|
|
7050
|
+
warm,
|
|
7051
|
+
cool,
|
|
7052
|
+
red,
|
|
7053
|
+
green,
|
|
7054
|
+
blue
|
|
7055
|
+
},
|
|
6978
7056
|
area: Object.assign({
|
|
6979
7057
|
style: {
|
|
6980
7058
|
data: {
|
|
@@ -7089,7 +7167,7 @@ const grayscale = {
|
|
|
7089
7167
|
}
|
|
7090
7168
|
}, baseProps),
|
|
7091
7169
|
group: Object.assign({
|
|
7092
|
-
colorScale
|
|
7170
|
+
colorScale
|
|
7093
7171
|
}, baseProps),
|
|
7094
7172
|
histogram: Object.assign({
|
|
7095
7173
|
style: {
|
|
@@ -7102,7 +7180,7 @@ const grayscale = {
|
|
|
7102
7180
|
}
|
|
7103
7181
|
}, baseProps),
|
|
7104
7182
|
legend: {
|
|
7105
|
-
colorScale
|
|
7183
|
+
colorScale,
|
|
7106
7184
|
gutter: 10,
|
|
7107
7185
|
orientation: "vertical",
|
|
7108
7186
|
titleOrientation: "top",
|
|
@@ -7137,7 +7215,7 @@ const grayscale = {
|
|
|
7137
7215
|
padding: 20
|
|
7138
7216
|
})
|
|
7139
7217
|
},
|
|
7140
|
-
colorScale
|
|
7218
|
+
colorScale,
|
|
7141
7219
|
width: 400,
|
|
7142
7220
|
height: 400,
|
|
7143
7221
|
padding: 50
|
|
@@ -7153,7 +7231,7 @@ const grayscale = {
|
|
|
7153
7231
|
}
|
|
7154
7232
|
}, baseProps),
|
|
7155
7233
|
stack: Object.assign({
|
|
7156
|
-
colorScale
|
|
7234
|
+
colorScale
|
|
7157
7235
|
}, baseProps),
|
|
7158
7236
|
tooltip: {
|
|
7159
7237
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -7213,11 +7291,31 @@ const lime300 = "#DCE775";
|
|
|
7213
7291
|
const lightGreen500 = "#8BC34A";
|
|
7214
7292
|
const teal700 = "#00796B";
|
|
7215
7293
|
const cyan900 = "#006064";
|
|
7216
|
-
const
|
|
7294
|
+
const colorScale = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
|
|
7217
7295
|
const blueGrey50 = "#ECEFF1";
|
|
7218
7296
|
const blueGrey300 = "#90A4AE";
|
|
7219
7297
|
const blueGrey700 = "#455A64";
|
|
7220
7298
|
const grey900 = "#212121";
|
|
7299
|
+
const colors = {
|
|
7300
|
+
blue: "#4F7DA1",
|
|
7301
|
+
pink: "#E2A37F",
|
|
7302
|
+
teal: teal700,
|
|
7303
|
+
purple: "#DF948A",
|
|
7304
|
+
green: lightGreen500,
|
|
7305
|
+
orange: deepOrange600,
|
|
7306
|
+
cyan: cyan900,
|
|
7307
|
+
red: "#DF5A49",
|
|
7308
|
+
yellow: yellow200
|
|
7309
|
+
};
|
|
7310
|
+
const grayscale = [blueGrey50, blueGrey300, blueGrey700, grey900];
|
|
7311
|
+
const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
|
|
7312
|
+
const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
|
|
7313
|
+
const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
|
|
7314
|
+
const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
|
|
7315
|
+
const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
|
|
7316
|
+
const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
|
|
7317
|
+
const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
|
|
7318
|
+
|
|
7221
7319
|
// *
|
|
7222
7320
|
// * Typography
|
|
7223
7321
|
// *
|
|
@@ -7255,6 +7353,17 @@ const strokeDasharray = "10, 5";
|
|
|
7255
7353
|
const strokeLinecap = "round";
|
|
7256
7354
|
const strokeLinejoin = "round";
|
|
7257
7355
|
const material = {
|
|
7356
|
+
palette: {
|
|
7357
|
+
colors,
|
|
7358
|
+
grayscale,
|
|
7359
|
+
qualitative,
|
|
7360
|
+
heatmap,
|
|
7361
|
+
warm,
|
|
7362
|
+
cool,
|
|
7363
|
+
red,
|
|
7364
|
+
green,
|
|
7365
|
+
blue
|
|
7366
|
+
},
|
|
7258
7367
|
area: Object.assign({
|
|
7259
7368
|
style: {
|
|
7260
7369
|
data: {
|
|
@@ -7387,7 +7496,7 @@ const material = {
|
|
|
7387
7496
|
}
|
|
7388
7497
|
}, baseProps),
|
|
7389
7498
|
group: Object.assign({
|
|
7390
|
-
colorScale
|
|
7499
|
+
colorScale
|
|
7391
7500
|
}, baseProps),
|
|
7392
7501
|
histogram: Object.assign({
|
|
7393
7502
|
style: {
|
|
@@ -7400,7 +7509,7 @@ const material = {
|
|
|
7400
7509
|
}
|
|
7401
7510
|
}, baseProps),
|
|
7402
7511
|
legend: {
|
|
7403
|
-
colorScale
|
|
7512
|
+
colorScale,
|
|
7404
7513
|
gutter: 10,
|
|
7405
7514
|
orientation: "vertical",
|
|
7406
7515
|
titleOrientation: "top",
|
|
@@ -7426,7 +7535,7 @@ const material = {
|
|
|
7426
7535
|
}
|
|
7427
7536
|
}, baseProps),
|
|
7428
7537
|
pie: Object.assign({
|
|
7429
|
-
colorScale
|
|
7538
|
+
colorScale,
|
|
7430
7539
|
style: {
|
|
7431
7540
|
data: {
|
|
7432
7541
|
padding,
|
|
@@ -7450,7 +7559,7 @@ const material = {
|
|
|
7450
7559
|
}
|
|
7451
7560
|
}, baseProps),
|
|
7452
7561
|
stack: Object.assign({
|
|
7453
|
-
colorScale
|
|
7562
|
+
colorScale
|
|
7454
7563
|
}, baseProps),
|
|
7455
7564
|
tooltip: {
|
|
7456
7565
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -10482,6 +10591,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10482
10591
|
/* harmony export */ "getColorScale": function() { return /* binding */ getColorScale; },
|
|
10483
10592
|
/* harmony export */ "toTransformString": function() { return /* binding */ toTransformString; }
|
|
10484
10593
|
/* harmony export */ });
|
|
10594
|
+
/* 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");
|
|
10595
|
+
|
|
10596
|
+
|
|
10485
10597
|
/**
|
|
10486
10598
|
* Given an object with CSS/SVG transform definitions, return the string value
|
|
10487
10599
|
* for use with the `transform` CSS property or SVG attribute. Note that we
|
|
@@ -10518,20 +10630,37 @@ const toTransformString = function (obj) {
|
|
|
10518
10630
|
* of 5 hex string values in that color scale. If no 'name' parameter
|
|
10519
10631
|
* is given, it will return the Victory default grayscale.
|
|
10520
10632
|
* @param {String} name The name of the color scale to return (optional).
|
|
10633
|
+
* @param {Object} theme The theme object to retrieve the color scale from (optional).
|
|
10521
10634
|
* @returns {Array} An array of 5 hex string values composing a color scale.
|
|
10522
10635
|
*/
|
|
10523
|
-
function getColorScale(name) {
|
|
10636
|
+
function getColorScale(name, theme) {
|
|
10637
|
+
if (theme === void 0) {
|
|
10638
|
+
theme = _victory_theme_victory_theme__WEBPACK_IMPORTED_MODULE_0__.VictoryTheme.material;
|
|
10639
|
+
}
|
|
10640
|
+
const {
|
|
10641
|
+
palette: {
|
|
10642
|
+
grayscale = ["#cccccc", "#969696", "#636363", "#252525"],
|
|
10643
|
+
qualitative = [],
|
|
10644
|
+
heatmap = [],
|
|
10645
|
+
warm = [],
|
|
10646
|
+
cool = [],
|
|
10647
|
+
red = [],
|
|
10648
|
+
blue = [],
|
|
10649
|
+
green = []
|
|
10650
|
+
} = {}
|
|
10651
|
+
} = theme;
|
|
10524
10652
|
const scales = {
|
|
10525
|
-
grayscale
|
|
10526
|
-
qualitative
|
|
10527
|
-
heatmap
|
|
10528
|
-
warm
|
|
10529
|
-
cool
|
|
10530
|
-
red
|
|
10531
|
-
blue
|
|
10532
|
-
green
|
|
10533
|
-
};
|
|
10534
|
-
|
|
10653
|
+
grayscale,
|
|
10654
|
+
qualitative,
|
|
10655
|
+
heatmap,
|
|
10656
|
+
warm,
|
|
10657
|
+
cool,
|
|
10658
|
+
red,
|
|
10659
|
+
blue,
|
|
10660
|
+
green
|
|
10661
|
+
};
|
|
10662
|
+
const selectedScale = name && scales[name]?.length ? scales[name] : scales.grayscale;
|
|
10663
|
+
return selectedScale;
|
|
10535
10664
|
}
|
|
10536
10665
|
|
|
10537
10666
|
/***/ }),
|