victory-area 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-area.js +207 -81
- 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] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(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
|
}, []);
|
|
@@ -6536,20 +6539,16 @@ const orange = {
|
|
|
6536
6539
|
"100": "#FEE2D5",
|
|
6537
6540
|
"300": "#FFA981",
|
|
6538
6541
|
"500": "#FF6F2C",
|
|
6542
|
+
"700": "#FF4E1B",
|
|
6539
6543
|
"900": "#D74D26"
|
|
6540
6544
|
};
|
|
6541
6545
|
const red = {
|
|
6542
6546
|
"100": "#FFDCE5",
|
|
6543
6547
|
"300": "#FF9EB7",
|
|
6544
6548
|
"500": "#F82B60",
|
|
6549
|
+
"700": "#D31A3D",
|
|
6545
6550
|
"900": "#BA1E45"
|
|
6546
6551
|
};
|
|
6547
|
-
const pink = {
|
|
6548
|
-
"100": "#FFDAF6",
|
|
6549
|
-
"300": "#F99DE2",
|
|
6550
|
-
"500": "#FF08C2",
|
|
6551
|
-
"900": "#B2158B"
|
|
6552
|
-
};
|
|
6553
6552
|
const purple = {
|
|
6554
6553
|
"100": "#EDE3FE",
|
|
6555
6554
|
"300": "#CDB0FF",
|
|
@@ -6560,6 +6559,7 @@ const blue = {
|
|
|
6560
6559
|
"100": "#CFDFFF",
|
|
6561
6560
|
"300": "#9CC7FF",
|
|
6562
6561
|
"500": "#2D7FF9",
|
|
6562
|
+
"700": "#0056B3",
|
|
6563
6563
|
"900": "#2750AE"
|
|
6564
6564
|
};
|
|
6565
6565
|
const cyan = {
|
|
@@ -6578,9 +6578,29 @@ const green = {
|
|
|
6578
6578
|
"100": "#D1F7C4",
|
|
6579
6579
|
"300": "#93E088",
|
|
6580
6580
|
"500": "#20C933",
|
|
6581
|
+
"700": "#1B9B2A",
|
|
6581
6582
|
"900": "#338A17"
|
|
6582
6583
|
};
|
|
6583
|
-
const colors =
|
|
6584
|
+
const colors = {
|
|
6585
|
+
blue: blue["500"],
|
|
6586
|
+
cyan: cyan["500"],
|
|
6587
|
+
green: green["500"],
|
|
6588
|
+
yellow: yellow["500"],
|
|
6589
|
+
orange: orange["500"],
|
|
6590
|
+
red: red["500"],
|
|
6591
|
+
purple: purple["500"],
|
|
6592
|
+
teal: teal["500"]
|
|
6593
|
+
};
|
|
6594
|
+
const colorScale = Object.values(colors);
|
|
6595
|
+
const grayscale = [gray["100"], gray["300"], gray["500"], gray["700"], gray["900"]];
|
|
6596
|
+
const warm = [yellow["300"], yellow["500"], orange["500"], orange["900"], red["500"]];
|
|
6597
|
+
const cool = [purple["500"], blue["500"], cyan["500"], teal["500"], green["500"]];
|
|
6598
|
+
const heatmap = [green["900"], green["500"], yellow["500"], orange["500"], red["500"]];
|
|
6599
|
+
const redPalette = Object.values(red);
|
|
6600
|
+
const greenPalette = Object.values(green);
|
|
6601
|
+
const bluePalette = Object.values(blue);
|
|
6602
|
+
const defaultColor = blue["500"];
|
|
6603
|
+
|
|
6584
6604
|
// *
|
|
6585
6605
|
// * Typography
|
|
6586
6606
|
// *
|
|
@@ -6594,8 +6614,8 @@ const padding = 8;
|
|
|
6594
6614
|
const baseProps = {
|
|
6595
6615
|
width: 450,
|
|
6596
6616
|
height: 300,
|
|
6597
|
-
padding:
|
|
6598
|
-
colorScale
|
|
6617
|
+
padding: 60,
|
|
6618
|
+
colorScale
|
|
6599
6619
|
};
|
|
6600
6620
|
// *
|
|
6601
6621
|
// * Labels
|
|
@@ -6624,10 +6644,23 @@ const borderRadius = 1;
|
|
|
6624
6644
|
// * Theme
|
|
6625
6645
|
// *
|
|
6626
6646
|
const clean = {
|
|
6647
|
+
palette: {
|
|
6648
|
+
colors,
|
|
6649
|
+
grayscale,
|
|
6650
|
+
qualitative: colorScale,
|
|
6651
|
+
heatmap,
|
|
6652
|
+
warm,
|
|
6653
|
+
cool,
|
|
6654
|
+
red: redPalette,
|
|
6655
|
+
green: greenPalette,
|
|
6656
|
+
blue: bluePalette
|
|
6657
|
+
},
|
|
6627
6658
|
area: Object.assign({
|
|
6628
6659
|
style: {
|
|
6629
6660
|
data: {
|
|
6630
|
-
fill:
|
|
6661
|
+
fill: defaultColor,
|
|
6662
|
+
strokeWidth: 2,
|
|
6663
|
+
fillOpacity: 0.5
|
|
6631
6664
|
},
|
|
6632
6665
|
labels: baseLabelStyles
|
|
6633
6666
|
}
|
|
@@ -6636,13 +6669,13 @@ const clean = {
|
|
|
6636
6669
|
style: {
|
|
6637
6670
|
axis: {
|
|
6638
6671
|
fill: "transparent",
|
|
6639
|
-
stroke: gray["
|
|
6672
|
+
stroke: gray["500"],
|
|
6640
6673
|
strokeWidth: 1,
|
|
6641
6674
|
strokeLinecap,
|
|
6642
6675
|
strokeLinejoin
|
|
6643
6676
|
},
|
|
6644
6677
|
axisLabel: Object.assign({}, centeredLabelStyles, {
|
|
6645
|
-
padding,
|
|
6678
|
+
padding: 35,
|
|
6646
6679
|
stroke: "transparent"
|
|
6647
6680
|
}),
|
|
6648
6681
|
grid: {
|
|
@@ -6661,10 +6694,10 @@ const clean = {
|
|
|
6661
6694
|
polarAxis: Object.assign({
|
|
6662
6695
|
style: {
|
|
6663
6696
|
axis: {
|
|
6664
|
-
stroke: gray["
|
|
6697
|
+
stroke: gray["500"]
|
|
6665
6698
|
},
|
|
6666
6699
|
grid: {
|
|
6667
|
-
stroke: gray["
|
|
6700
|
+
stroke: gray["400"],
|
|
6668
6701
|
strokeDasharray,
|
|
6669
6702
|
strokeLinecap,
|
|
6670
6703
|
strokeLinejoin,
|
|
@@ -6673,7 +6706,7 @@ const clean = {
|
|
|
6673
6706
|
ticks: {
|
|
6674
6707
|
fill: "transparent",
|
|
6675
6708
|
size: 5,
|
|
6676
|
-
stroke: gray["
|
|
6709
|
+
stroke: gray["400"],
|
|
6677
6710
|
strokeWidth: 1,
|
|
6678
6711
|
strokeLinecap,
|
|
6679
6712
|
strokeLinejoin
|
|
@@ -6684,10 +6717,10 @@ const clean = {
|
|
|
6684
6717
|
polarDependentAxis: Object.assign({
|
|
6685
6718
|
style: {
|
|
6686
6719
|
axis: {
|
|
6687
|
-
stroke: gray["
|
|
6720
|
+
stroke: gray["500"]
|
|
6688
6721
|
},
|
|
6689
6722
|
grid: {
|
|
6690
|
-
stroke: gray["
|
|
6723
|
+
stroke: gray["400"],
|
|
6691
6724
|
strokeDasharray,
|
|
6692
6725
|
strokeLinecap,
|
|
6693
6726
|
strokeLinejoin,
|
|
@@ -6696,7 +6729,7 @@ const clean = {
|
|
|
6696
6729
|
ticks: {
|
|
6697
6730
|
fill: "transparent",
|
|
6698
6731
|
size: 5,
|
|
6699
|
-
stroke: gray["
|
|
6732
|
+
stroke: gray["300"],
|
|
6700
6733
|
strokeWidth: 1,
|
|
6701
6734
|
strokeLinecap,
|
|
6702
6735
|
strokeLinejoin
|
|
@@ -6707,9 +6740,10 @@ const clean = {
|
|
|
6707
6740
|
bar: Object.assign({
|
|
6708
6741
|
style: {
|
|
6709
6742
|
data: {
|
|
6710
|
-
fill:
|
|
6743
|
+
fill: defaultColor,
|
|
6711
6744
|
padding,
|
|
6712
|
-
strokeWidth:
|
|
6745
|
+
strokeWidth: 1,
|
|
6746
|
+
fillOpacity: 0.5
|
|
6713
6747
|
},
|
|
6714
6748
|
labels: baseLabelStyles
|
|
6715
6749
|
},
|
|
@@ -6745,15 +6779,16 @@ const clean = {
|
|
|
6745
6779
|
}),
|
|
6746
6780
|
q1: {
|
|
6747
6781
|
padding,
|
|
6748
|
-
fill:
|
|
6749
|
-
rx: borderRadius
|
|
6782
|
+
fill: colorScale[0],
|
|
6783
|
+
rx: borderRadius,
|
|
6784
|
+
strokeWidth: 2
|
|
6750
6785
|
},
|
|
6751
6786
|
q1Labels: Object.assign({}, baseLabelStyles, {
|
|
6752
6787
|
padding: 3
|
|
6753
6788
|
}),
|
|
6754
6789
|
q3: {
|
|
6755
6790
|
padding,
|
|
6756
|
-
fill:
|
|
6791
|
+
fill: colorScale[1],
|
|
6757
6792
|
rx: borderRadius
|
|
6758
6793
|
},
|
|
6759
6794
|
q3Labels: Object.assign({}, baseLabelStyles, {
|
|
@@ -6774,8 +6809,8 @@ const clean = {
|
|
|
6774
6809
|
})
|
|
6775
6810
|
},
|
|
6776
6811
|
candleColors: {
|
|
6777
|
-
positive:
|
|
6778
|
-
negative:
|
|
6812
|
+
positive: green["500"],
|
|
6813
|
+
negative: red["500"]
|
|
6779
6814
|
},
|
|
6780
6815
|
wickStrokeWidth: 2
|
|
6781
6816
|
}, baseProps),
|
|
@@ -6794,14 +6829,13 @@ const clean = {
|
|
|
6794
6829
|
}
|
|
6795
6830
|
}, baseProps),
|
|
6796
6831
|
group: Object.assign({
|
|
6797
|
-
colorScale
|
|
6832
|
+
colorScale
|
|
6798
6833
|
}, baseProps),
|
|
6799
6834
|
histogram: Object.assign({
|
|
6800
6835
|
style: {
|
|
6801
6836
|
data: {
|
|
6802
6837
|
fill: cyan["500"],
|
|
6803
|
-
|
|
6804
|
-
strokeWidth: 0
|
|
6838
|
+
fillOpacity: 0.5
|
|
6805
6839
|
},
|
|
6806
6840
|
labels: baseLabelStyles
|
|
6807
6841
|
},
|
|
@@ -6812,21 +6846,23 @@ const clean = {
|
|
|
6812
6846
|
}, baseProps),
|
|
6813
6847
|
label: baseLabelStyles,
|
|
6814
6848
|
legend: {
|
|
6815
|
-
colorScale
|
|
6816
|
-
gutter:
|
|
6817
|
-
|
|
6849
|
+
colorScale,
|
|
6850
|
+
gutter: 24,
|
|
6851
|
+
borderPadding: 10,
|
|
6852
|
+
orientation: "horizontal",
|
|
6818
6853
|
titleOrientation: "top",
|
|
6854
|
+
centerTitle: true,
|
|
6819
6855
|
style: {
|
|
6820
6856
|
data: {
|
|
6821
6857
|
type: "circle"
|
|
6822
6858
|
},
|
|
6823
6859
|
labels: {
|
|
6824
6860
|
...baseLabelStyles,
|
|
6825
|
-
fontSize:
|
|
6861
|
+
fontSize: 12
|
|
6826
6862
|
},
|
|
6827
6863
|
title: Object.assign({}, baseLabelStyles, {
|
|
6828
6864
|
padding,
|
|
6829
|
-
fontSize:
|
|
6865
|
+
fontSize: 16
|
|
6830
6866
|
}),
|
|
6831
6867
|
border: {
|
|
6832
6868
|
stroke: gray["200"],
|
|
@@ -6840,7 +6876,7 @@ const clean = {
|
|
|
6840
6876
|
data: {
|
|
6841
6877
|
fill: "transparent",
|
|
6842
6878
|
opacity: 1,
|
|
6843
|
-
stroke:
|
|
6879
|
+
stroke: defaultColor,
|
|
6844
6880
|
strokeWidth: 2,
|
|
6845
6881
|
strokeLinecap,
|
|
6846
6882
|
strokeLinejoin
|
|
@@ -6850,31 +6886,40 @@ const clean = {
|
|
|
6850
6886
|
}, baseProps),
|
|
6851
6887
|
pie: Object.assign({
|
|
6852
6888
|
style: {
|
|
6889
|
+
parent: {
|
|
6890
|
+
backgroundColor: gray.white
|
|
6891
|
+
},
|
|
6853
6892
|
data: {
|
|
6854
6893
|
padding,
|
|
6855
6894
|
stroke: gray.white,
|
|
6856
6895
|
strokeWidth: 1
|
|
6857
6896
|
},
|
|
6858
|
-
labels:
|
|
6859
|
-
|
|
6860
|
-
|
|
6897
|
+
labels: {
|
|
6898
|
+
...baseLabelStyles,
|
|
6899
|
+
padding: 20,
|
|
6900
|
+
fill: gray["600"],
|
|
6901
|
+
fontSize: 10
|
|
6902
|
+
}
|
|
6861
6903
|
},
|
|
6862
|
-
colorScale
|
|
6904
|
+
colorScale,
|
|
6863
6905
|
cornerRadius: borderRadius
|
|
6864
6906
|
}, baseProps),
|
|
6865
6907
|
scatter: Object.assign({
|
|
6866
6908
|
style: {
|
|
6867
6909
|
data: {
|
|
6868
|
-
fill:
|
|
6910
|
+
fill: defaultColor,
|
|
6869
6911
|
opacity: 1,
|
|
6870
6912
|
stroke: "transparent",
|
|
6871
6913
|
strokeWidth: 0
|
|
6872
6914
|
},
|
|
6873
|
-
labels:
|
|
6915
|
+
labels: {
|
|
6916
|
+
...baseLabelStyles,
|
|
6917
|
+
padding: 20
|
|
6918
|
+
}
|
|
6874
6919
|
}
|
|
6875
6920
|
}, baseProps),
|
|
6876
6921
|
stack: Object.assign({
|
|
6877
|
-
colorScale
|
|
6922
|
+
colorScale
|
|
6878
6923
|
}, baseProps),
|
|
6879
6924
|
tooltip: {
|
|
6880
6925
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -6882,7 +6927,7 @@ const clean = {
|
|
|
6882
6927
|
pointerEvents: "none"
|
|
6883
6928
|
}),
|
|
6884
6929
|
flyoutStyle: {
|
|
6885
|
-
stroke: gray["
|
|
6930
|
+
stroke: gray["300"],
|
|
6886
6931
|
strokeWidth: 2,
|
|
6887
6932
|
fill: gray.white,
|
|
6888
6933
|
pointerEvents: "none"
|
|
@@ -6899,8 +6944,8 @@ const clean = {
|
|
|
6899
6944
|
voronoi: Object.assign({
|
|
6900
6945
|
style: {
|
|
6901
6946
|
data: {
|
|
6902
|
-
fill:
|
|
6903
|
-
stroke:
|
|
6947
|
+
fill: blue["100"],
|
|
6948
|
+
stroke: defaultColor,
|
|
6904
6949
|
strokeWidth: 2
|
|
6905
6950
|
},
|
|
6906
6951
|
labels: Object.assign({}, baseLabelStyles, {
|
|
@@ -6937,9 +6982,28 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6937
6982
|
// *
|
|
6938
6983
|
// * Colors
|
|
6939
6984
|
// *
|
|
6940
|
-
const colors =
|
|
6985
|
+
const colors = {
|
|
6986
|
+
blue: "#4F7DA1",
|
|
6987
|
+
pink: "#E2A37F",
|
|
6988
|
+
teal: "#00796B",
|
|
6989
|
+
purple: "#DF948A",
|
|
6990
|
+
green: "#8BC34A",
|
|
6991
|
+
orange: "#F4511E",
|
|
6992
|
+
cyan: "#006064",
|
|
6993
|
+
red: "#DF5A49",
|
|
6994
|
+
yellow: "#FFF59D"
|
|
6995
|
+
};
|
|
6996
|
+
const colorScale = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
|
|
6941
6997
|
const charcoal = "#252525";
|
|
6942
6998
|
const grey = "#969696";
|
|
6999
|
+
const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
|
|
7000
|
+
const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
|
|
7001
|
+
const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
|
|
7002
|
+
const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
|
|
7003
|
+
const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
|
|
7004
|
+
const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
|
|
7005
|
+
const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
|
|
7006
|
+
|
|
6943
7007
|
// *
|
|
6944
7008
|
// * Typography
|
|
6945
7009
|
// *
|
|
@@ -6953,7 +7017,7 @@ const baseProps = {
|
|
|
6953
7017
|
width: 450,
|
|
6954
7018
|
height: 300,
|
|
6955
7019
|
padding: 50,
|
|
6956
|
-
colorScale
|
|
7020
|
+
colorScale
|
|
6957
7021
|
};
|
|
6958
7022
|
// *
|
|
6959
7023
|
// * Labels
|
|
@@ -6975,6 +7039,17 @@ const centeredLabelStyles = Object.assign({
|
|
|
6975
7039
|
const strokeLinecap = "round";
|
|
6976
7040
|
const strokeLinejoin = "round";
|
|
6977
7041
|
const grayscale = {
|
|
7042
|
+
palette: {
|
|
7043
|
+
colors,
|
|
7044
|
+
grayscale: colorScale,
|
|
7045
|
+
qualitative,
|
|
7046
|
+
heatmap,
|
|
7047
|
+
warm,
|
|
7048
|
+
cool,
|
|
7049
|
+
red,
|
|
7050
|
+
green,
|
|
7051
|
+
blue
|
|
7052
|
+
},
|
|
6978
7053
|
area: Object.assign({
|
|
6979
7054
|
style: {
|
|
6980
7055
|
data: {
|
|
@@ -7089,7 +7164,7 @@ const grayscale = {
|
|
|
7089
7164
|
}
|
|
7090
7165
|
}, baseProps),
|
|
7091
7166
|
group: Object.assign({
|
|
7092
|
-
colorScale
|
|
7167
|
+
colorScale
|
|
7093
7168
|
}, baseProps),
|
|
7094
7169
|
histogram: Object.assign({
|
|
7095
7170
|
style: {
|
|
@@ -7102,7 +7177,7 @@ const grayscale = {
|
|
|
7102
7177
|
}
|
|
7103
7178
|
}, baseProps),
|
|
7104
7179
|
legend: {
|
|
7105
|
-
colorScale
|
|
7180
|
+
colorScale,
|
|
7106
7181
|
gutter: 10,
|
|
7107
7182
|
orientation: "vertical",
|
|
7108
7183
|
titleOrientation: "top",
|
|
@@ -7137,7 +7212,7 @@ const grayscale = {
|
|
|
7137
7212
|
padding: 20
|
|
7138
7213
|
})
|
|
7139
7214
|
},
|
|
7140
|
-
colorScale
|
|
7215
|
+
colorScale,
|
|
7141
7216
|
width: 400,
|
|
7142
7217
|
height: 400,
|
|
7143
7218
|
padding: 50
|
|
@@ -7153,7 +7228,7 @@ const grayscale = {
|
|
|
7153
7228
|
}
|
|
7154
7229
|
}, baseProps),
|
|
7155
7230
|
stack: Object.assign({
|
|
7156
|
-
colorScale
|
|
7231
|
+
colorScale
|
|
7157
7232
|
}, baseProps),
|
|
7158
7233
|
tooltip: {
|
|
7159
7234
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -7213,11 +7288,31 @@ const lime300 = "#DCE775";
|
|
|
7213
7288
|
const lightGreen500 = "#8BC34A";
|
|
7214
7289
|
const teal700 = "#00796B";
|
|
7215
7290
|
const cyan900 = "#006064";
|
|
7216
|
-
const
|
|
7291
|
+
const colorScale = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
|
|
7217
7292
|
const blueGrey50 = "#ECEFF1";
|
|
7218
7293
|
const blueGrey300 = "#90A4AE";
|
|
7219
7294
|
const blueGrey700 = "#455A64";
|
|
7220
7295
|
const grey900 = "#212121";
|
|
7296
|
+
const colors = {
|
|
7297
|
+
blue: "#4F7DA1",
|
|
7298
|
+
pink: "#E2A37F",
|
|
7299
|
+
teal: teal700,
|
|
7300
|
+
purple: "#DF948A",
|
|
7301
|
+
green: lightGreen500,
|
|
7302
|
+
orange: deepOrange600,
|
|
7303
|
+
cyan: cyan900,
|
|
7304
|
+
red: "#DF5A49",
|
|
7305
|
+
yellow: yellow200
|
|
7306
|
+
};
|
|
7307
|
+
const grayscale = [blueGrey50, blueGrey300, blueGrey700, grey900];
|
|
7308
|
+
const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
|
|
7309
|
+
const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
|
|
7310
|
+
const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
|
|
7311
|
+
const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
|
|
7312
|
+
const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
|
|
7313
|
+
const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
|
|
7314
|
+
const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
|
|
7315
|
+
|
|
7221
7316
|
// *
|
|
7222
7317
|
// * Typography
|
|
7223
7318
|
// *
|
|
@@ -7255,6 +7350,17 @@ const strokeDasharray = "10, 5";
|
|
|
7255
7350
|
const strokeLinecap = "round";
|
|
7256
7351
|
const strokeLinejoin = "round";
|
|
7257
7352
|
const material = {
|
|
7353
|
+
palette: {
|
|
7354
|
+
colors,
|
|
7355
|
+
grayscale,
|
|
7356
|
+
qualitative,
|
|
7357
|
+
heatmap,
|
|
7358
|
+
warm,
|
|
7359
|
+
cool,
|
|
7360
|
+
red,
|
|
7361
|
+
green,
|
|
7362
|
+
blue
|
|
7363
|
+
},
|
|
7258
7364
|
area: Object.assign({
|
|
7259
7365
|
style: {
|
|
7260
7366
|
data: {
|
|
@@ -7387,7 +7493,7 @@ const material = {
|
|
|
7387
7493
|
}
|
|
7388
7494
|
}, baseProps),
|
|
7389
7495
|
group: Object.assign({
|
|
7390
|
-
colorScale
|
|
7496
|
+
colorScale
|
|
7391
7497
|
}, baseProps),
|
|
7392
7498
|
histogram: Object.assign({
|
|
7393
7499
|
style: {
|
|
@@ -7400,7 +7506,7 @@ const material = {
|
|
|
7400
7506
|
}
|
|
7401
7507
|
}, baseProps),
|
|
7402
7508
|
legend: {
|
|
7403
|
-
colorScale
|
|
7509
|
+
colorScale,
|
|
7404
7510
|
gutter: 10,
|
|
7405
7511
|
orientation: "vertical",
|
|
7406
7512
|
titleOrientation: "top",
|
|
@@ -7426,7 +7532,7 @@ const material = {
|
|
|
7426
7532
|
}
|
|
7427
7533
|
}, baseProps),
|
|
7428
7534
|
pie: Object.assign({
|
|
7429
|
-
colorScale
|
|
7535
|
+
colorScale,
|
|
7430
7536
|
style: {
|
|
7431
7537
|
data: {
|
|
7432
7538
|
padding,
|
|
@@ -7450,7 +7556,7 @@ const material = {
|
|
|
7450
7556
|
}
|
|
7451
7557
|
}, baseProps),
|
|
7452
7558
|
stack: Object.assign({
|
|
7453
|
-
colorScale
|
|
7559
|
+
colorScale
|
|
7454
7560
|
}, baseProps),
|
|
7455
7561
|
tooltip: {
|
|
7456
7562
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -10482,6 +10588,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10482
10588
|
/* harmony export */ "getColorScale": function() { return /* binding */ getColorScale; },
|
|
10483
10589
|
/* harmony export */ "toTransformString": function() { return /* binding */ toTransformString; }
|
|
10484
10590
|
/* harmony export */ });
|
|
10591
|
+
/* 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");
|
|
10592
|
+
|
|
10593
|
+
|
|
10485
10594
|
/**
|
|
10486
10595
|
* Given an object with CSS/SVG transform definitions, return the string value
|
|
10487
10596
|
* for use with the `transform` CSS property or SVG attribute. Note that we
|
|
@@ -10518,20 +10627,37 @@ const toTransformString = function (obj) {
|
|
|
10518
10627
|
* of 5 hex string values in that color scale. If no 'name' parameter
|
|
10519
10628
|
* is given, it will return the Victory default grayscale.
|
|
10520
10629
|
* @param {String} name The name of the color scale to return (optional).
|
|
10630
|
+
* @param {Object} theme The theme object to retrieve the color scale from (optional).
|
|
10521
10631
|
* @returns {Array} An array of 5 hex string values composing a color scale.
|
|
10522
10632
|
*/
|
|
10523
|
-
function getColorScale(name) {
|
|
10633
|
+
function getColorScale(name, theme) {
|
|
10634
|
+
if (theme === void 0) {
|
|
10635
|
+
theme = _victory_theme_victory_theme__WEBPACK_IMPORTED_MODULE_0__.VictoryTheme.material;
|
|
10636
|
+
}
|
|
10637
|
+
const {
|
|
10638
|
+
palette: {
|
|
10639
|
+
grayscale = ["#cccccc", "#969696", "#636363", "#252525"],
|
|
10640
|
+
qualitative = [],
|
|
10641
|
+
heatmap = [],
|
|
10642
|
+
warm = [],
|
|
10643
|
+
cool = [],
|
|
10644
|
+
red = [],
|
|
10645
|
+
blue = [],
|
|
10646
|
+
green = []
|
|
10647
|
+
} = {}
|
|
10648
|
+
} = theme;
|
|
10524
10649
|
const scales = {
|
|
10525
|
-
grayscale
|
|
10526
|
-
qualitative
|
|
10527
|
-
heatmap
|
|
10528
|
-
warm
|
|
10529
|
-
cool
|
|
10530
|
-
red
|
|
10531
|
-
blue
|
|
10532
|
-
green
|
|
10533
|
-
};
|
|
10534
|
-
|
|
10650
|
+
grayscale,
|
|
10651
|
+
qualitative,
|
|
10652
|
+
heatmap,
|
|
10653
|
+
warm,
|
|
10654
|
+
cool,
|
|
10655
|
+
red,
|
|
10656
|
+
blue,
|
|
10657
|
+
green
|
|
10658
|
+
};
|
|
10659
|
+
const selectedScale = name && scales[name]?.length ? scales[name] : scales.grayscale;
|
|
10660
|
+
return selectedScale;
|
|
10535
10661
|
}
|
|
10536
10662
|
|
|
10537
10663
|
/***/ }),
|