victory-pie 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 +6 -0
- package/dist/victory-pie.js +201 -71
- package/dist/victory-pie.min.js +1 -1
- package/es/helper-methods.js +3 -2
- package/lib/helper-methods.js +3 -2
- package/package.json +3 -3
- package/src/helper-methods.ts +2 -2
package/CHANGELOG.md
CHANGED
package/dist/victory-pie.js
CHANGED
|
@@ -79,11 +79,12 @@ const getSlices = (props, data) => {
|
|
|
79
79
|
};
|
|
80
80
|
const getCalculatedValues = props => {
|
|
81
81
|
const {
|
|
82
|
-
colorScale
|
|
82
|
+
colorScale,
|
|
83
|
+
theme
|
|
83
84
|
} = props;
|
|
84
85
|
const styleObject = victory_core__WEBPACK_IMPORTED_MODULE_3__.getDefaultStyles(props, "pie");
|
|
85
86
|
const style = victory_core__WEBPACK_IMPORTED_MODULE_3__.getStyles(props.style, styleObject);
|
|
86
|
-
const colors = Array.isArray(colorScale) ? colorScale : victory_core__WEBPACK_IMPORTED_MODULE_4__.getColorScale(colorScale);
|
|
87
|
+
const colors = Array.isArray(colorScale) ? colorScale : victory_core__WEBPACK_IMPORTED_MODULE_4__.getColorScale(colorScale, theme);
|
|
87
88
|
const padding = victory_core__WEBPACK_IMPORTED_MODULE_3__.getPadding(props);
|
|
88
89
|
const defaultRadius = getRadius(props, padding);
|
|
89
90
|
const origin = getOrigin(props, padding);
|
|
@@ -6082,31 +6083,34 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6082
6083
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6083
6084
|
/* harmony export */ "VictoryPortal": function() { return /* binding */ VictoryPortal; }
|
|
6084
6085
|
/* harmony export */ });
|
|
6085
|
-
/* harmony import */ var
|
|
6086
|
-
/* harmony import */ var
|
|
6087
|
-
/* harmony import */ var
|
|
6088
|
-
/* harmony import */ var
|
|
6089
|
-
/* harmony import */ var
|
|
6090
|
-
/* harmony import */ var
|
|
6091
|
-
/* harmony import */ var
|
|
6086
|
+
/* 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");
|
|
6087
|
+
/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0__);
|
|
6088
|
+
/* 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");
|
|
6089
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
6090
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
|
|
6091
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
|
|
6092
|
+
/* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
|
|
6093
|
+
/* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
6094
|
+
/* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
|
|
6095
|
+
|
|
6092
6096
|
|
|
6093
6097
|
|
|
6094
6098
|
|
|
6095
6099
|
|
|
6096
6100
|
|
|
6097
6101
|
const defaultProps = {
|
|
6098
|
-
groupComponent: /*#__PURE__*/
|
|
6102
|
+
groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement("g", null)
|
|
6099
6103
|
};
|
|
6100
6104
|
const VictoryPortal = initialProps => {
|
|
6101
6105
|
const props = {
|
|
6102
6106
|
...defaultProps,
|
|
6103
6107
|
...initialProps
|
|
6104
6108
|
};
|
|
6105
|
-
const id =
|
|
6106
|
-
const portalContext = (0,
|
|
6109
|
+
const id = lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default()();
|
|
6110
|
+
const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_3__.usePortalContext)();
|
|
6107
6111
|
if (!portalContext) {
|
|
6108
6112
|
const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
|
|
6109
|
-
|
|
6113
|
+
_victory_util_log__WEBPACK_IMPORTED_MODULE_4__.warn(msg);
|
|
6110
6114
|
}
|
|
6111
6115
|
const children = Array.isArray(props.children) ? props.children[0] : props.children;
|
|
6112
6116
|
const {
|
|
@@ -6117,15 +6121,15 @@ const VictoryPortal = initialProps => {
|
|
|
6117
6121
|
groupComponent,
|
|
6118
6122
|
standalone: false
|
|
6119
6123
|
} : {};
|
|
6120
|
-
const newProps =
|
|
6124
|
+
const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__.omit(props, ["children", "groupComponent"]), {
|
|
6121
6125
|
key: childProps.key ?? id
|
|
6122
6126
|
});
|
|
6123
|
-
const child = children && /*#__PURE__*/
|
|
6124
|
-
|
|
6127
|
+
const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().cloneElement(children, newProps);
|
|
6128
|
+
react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
|
|
6125
6129
|
portalContext?.addChild(id, child);
|
|
6126
6130
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6127
6131
|
}, [props.children]);
|
|
6128
|
-
|
|
6132
|
+
react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
|
|
6129
6133
|
return () => portalContext?.removeChild(id);
|
|
6130
6134
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6131
6135
|
}, []);
|
|
@@ -6494,7 +6498,26 @@ const green = {
|
|
|
6494
6498
|
"500": "#20C933",
|
|
6495
6499
|
"900": "#338A17"
|
|
6496
6500
|
};
|
|
6497
|
-
const colors =
|
|
6501
|
+
const colors = {
|
|
6502
|
+
blue: blue["500"],
|
|
6503
|
+
pink: pink["500"],
|
|
6504
|
+
teal: teal["500"],
|
|
6505
|
+
purple: purple["500"],
|
|
6506
|
+
green: green["500"],
|
|
6507
|
+
orange: orange["500"],
|
|
6508
|
+
cyan: cyan["500"],
|
|
6509
|
+
red: red["500"],
|
|
6510
|
+
yellow: yellow["500"]
|
|
6511
|
+
};
|
|
6512
|
+
const colorScale = Object.values(colors);
|
|
6513
|
+
const grayscale = [gray["200"], gray["400"], gray["600"], gray["900"]];
|
|
6514
|
+
const warm = [yellow["500"], orange["500"], red["500"], pink["500"]];
|
|
6515
|
+
const cool = [cyan["500"], teal["500"], blue["500"], purple["500"]];
|
|
6516
|
+
const heatmap = [green["500"], yellow["500"], red["500"]];
|
|
6517
|
+
const redPalette = [red["500"], red["300"], red["100"]];
|
|
6518
|
+
const greenPalette = [green["500"], green["300"], green["100"]];
|
|
6519
|
+
const bluePalette = [blue["500"], blue["300"], blue["100"]];
|
|
6520
|
+
|
|
6498
6521
|
// *
|
|
6499
6522
|
// * Typography
|
|
6500
6523
|
// *
|
|
@@ -6509,7 +6532,7 @@ const baseProps = {
|
|
|
6509
6532
|
width: 450,
|
|
6510
6533
|
height: 300,
|
|
6511
6534
|
padding: 50,
|
|
6512
|
-
colorScale
|
|
6535
|
+
colorScale
|
|
6513
6536
|
};
|
|
6514
6537
|
// *
|
|
6515
6538
|
// * Labels
|
|
@@ -6538,10 +6561,23 @@ const borderRadius = 1;
|
|
|
6538
6561
|
// * Theme
|
|
6539
6562
|
// *
|
|
6540
6563
|
const clean = {
|
|
6564
|
+
palette: {
|
|
6565
|
+
colors,
|
|
6566
|
+
grayscale,
|
|
6567
|
+
qualitative: colorScale,
|
|
6568
|
+
heatmap,
|
|
6569
|
+
warm,
|
|
6570
|
+
cool,
|
|
6571
|
+
red: redPalette,
|
|
6572
|
+
green: greenPalette,
|
|
6573
|
+
blue: bluePalette
|
|
6574
|
+
},
|
|
6541
6575
|
area: Object.assign({
|
|
6542
6576
|
style: {
|
|
6543
6577
|
data: {
|
|
6544
|
-
fill:
|
|
6578
|
+
fill: blue["500"],
|
|
6579
|
+
strokeWidth: 2,
|
|
6580
|
+
fillOpacity: 0.5
|
|
6545
6581
|
},
|
|
6546
6582
|
labels: baseLabelStyles
|
|
6547
6583
|
}
|
|
@@ -6550,7 +6586,7 @@ const clean = {
|
|
|
6550
6586
|
style: {
|
|
6551
6587
|
axis: {
|
|
6552
6588
|
fill: "transparent",
|
|
6553
|
-
stroke: gray["
|
|
6589
|
+
stroke: gray["500"],
|
|
6554
6590
|
strokeWidth: 1,
|
|
6555
6591
|
strokeLinecap,
|
|
6556
6592
|
strokeLinejoin
|
|
@@ -6575,10 +6611,10 @@ const clean = {
|
|
|
6575
6611
|
polarAxis: Object.assign({
|
|
6576
6612
|
style: {
|
|
6577
6613
|
axis: {
|
|
6578
|
-
stroke: gray["
|
|
6614
|
+
stroke: gray["500"]
|
|
6579
6615
|
},
|
|
6580
6616
|
grid: {
|
|
6581
|
-
stroke: gray["
|
|
6617
|
+
stroke: gray["400"],
|
|
6582
6618
|
strokeDasharray,
|
|
6583
6619
|
strokeLinecap,
|
|
6584
6620
|
strokeLinejoin,
|
|
@@ -6587,7 +6623,7 @@ const clean = {
|
|
|
6587
6623
|
ticks: {
|
|
6588
6624
|
fill: "transparent",
|
|
6589
6625
|
size: 5,
|
|
6590
|
-
stroke: gray["
|
|
6626
|
+
stroke: gray["400"],
|
|
6591
6627
|
strokeWidth: 1,
|
|
6592
6628
|
strokeLinecap,
|
|
6593
6629
|
strokeLinejoin
|
|
@@ -6598,10 +6634,10 @@ const clean = {
|
|
|
6598
6634
|
polarDependentAxis: Object.assign({
|
|
6599
6635
|
style: {
|
|
6600
6636
|
axis: {
|
|
6601
|
-
stroke: gray["
|
|
6637
|
+
stroke: gray["500"]
|
|
6602
6638
|
},
|
|
6603
6639
|
grid: {
|
|
6604
|
-
stroke: gray["
|
|
6640
|
+
stroke: gray["400"],
|
|
6605
6641
|
strokeDasharray,
|
|
6606
6642
|
strokeLinecap,
|
|
6607
6643
|
strokeLinejoin,
|
|
@@ -6610,7 +6646,7 @@ const clean = {
|
|
|
6610
6646
|
ticks: {
|
|
6611
6647
|
fill: "transparent",
|
|
6612
6648
|
size: 5,
|
|
6613
|
-
stroke: gray["
|
|
6649
|
+
stroke: gray["300"],
|
|
6614
6650
|
strokeWidth: 1,
|
|
6615
6651
|
strokeLinecap,
|
|
6616
6652
|
strokeLinejoin
|
|
@@ -6623,7 +6659,8 @@ const clean = {
|
|
|
6623
6659
|
data: {
|
|
6624
6660
|
fill: blue["500"],
|
|
6625
6661
|
padding,
|
|
6626
|
-
strokeWidth:
|
|
6662
|
+
strokeWidth: 1,
|
|
6663
|
+
fillOpacity: 0.5
|
|
6627
6664
|
},
|
|
6628
6665
|
labels: baseLabelStyles
|
|
6629
6666
|
},
|
|
@@ -6660,14 +6697,15 @@ const clean = {
|
|
|
6660
6697
|
q1: {
|
|
6661
6698
|
padding,
|
|
6662
6699
|
fill: teal["500"],
|
|
6663
|
-
rx: borderRadius
|
|
6700
|
+
rx: borderRadius,
|
|
6701
|
+
strokeWidth: 2
|
|
6664
6702
|
},
|
|
6665
6703
|
q1Labels: Object.assign({}, baseLabelStyles, {
|
|
6666
6704
|
padding: 3
|
|
6667
6705
|
}),
|
|
6668
6706
|
q3: {
|
|
6669
6707
|
padding,
|
|
6670
|
-
fill:
|
|
6708
|
+
fill: cyan["500"],
|
|
6671
6709
|
rx: borderRadius
|
|
6672
6710
|
},
|
|
6673
6711
|
q3Labels: Object.assign({}, baseLabelStyles, {
|
|
@@ -6708,14 +6746,13 @@ const clean = {
|
|
|
6708
6746
|
}
|
|
6709
6747
|
}, baseProps),
|
|
6710
6748
|
group: Object.assign({
|
|
6711
|
-
colorScale
|
|
6749
|
+
colorScale
|
|
6712
6750
|
}, baseProps),
|
|
6713
6751
|
histogram: Object.assign({
|
|
6714
6752
|
style: {
|
|
6715
6753
|
data: {
|
|
6716
6754
|
fill: cyan["500"],
|
|
6717
|
-
|
|
6718
|
-
strokeWidth: 0
|
|
6755
|
+
fillOpacity: 0.5
|
|
6719
6756
|
},
|
|
6720
6757
|
labels: baseLabelStyles
|
|
6721
6758
|
},
|
|
@@ -6726,21 +6763,23 @@ const clean = {
|
|
|
6726
6763
|
}, baseProps),
|
|
6727
6764
|
label: baseLabelStyles,
|
|
6728
6765
|
legend: {
|
|
6729
|
-
colorScale
|
|
6730
|
-
gutter:
|
|
6731
|
-
|
|
6766
|
+
colorScale,
|
|
6767
|
+
gutter: 24,
|
|
6768
|
+
borderPadding: 10,
|
|
6769
|
+
orientation: "horizontal",
|
|
6732
6770
|
titleOrientation: "top",
|
|
6771
|
+
centerTitle: true,
|
|
6733
6772
|
style: {
|
|
6734
6773
|
data: {
|
|
6735
6774
|
type: "circle"
|
|
6736
6775
|
},
|
|
6737
6776
|
labels: {
|
|
6738
6777
|
...baseLabelStyles,
|
|
6739
|
-
fontSize:
|
|
6778
|
+
fontSize: 12
|
|
6740
6779
|
},
|
|
6741
6780
|
title: Object.assign({}, baseLabelStyles, {
|
|
6742
6781
|
padding,
|
|
6743
|
-
fontSize:
|
|
6782
|
+
fontSize: 16
|
|
6744
6783
|
}),
|
|
6745
6784
|
border: {
|
|
6746
6785
|
stroke: gray["200"],
|
|
@@ -6754,7 +6793,7 @@ const clean = {
|
|
|
6754
6793
|
data: {
|
|
6755
6794
|
fill: "transparent",
|
|
6756
6795
|
opacity: 1,
|
|
6757
|
-
stroke:
|
|
6796
|
+
stroke: blue["500"],
|
|
6758
6797
|
strokeWidth: 2,
|
|
6759
6798
|
strokeLinecap,
|
|
6760
6799
|
strokeLinejoin
|
|
@@ -6764,16 +6803,22 @@ const clean = {
|
|
|
6764
6803
|
}, baseProps),
|
|
6765
6804
|
pie: Object.assign({
|
|
6766
6805
|
style: {
|
|
6806
|
+
parent: {
|
|
6807
|
+
backgroundColor: gray.white
|
|
6808
|
+
},
|
|
6767
6809
|
data: {
|
|
6768
6810
|
padding,
|
|
6769
6811
|
stroke: gray.white,
|
|
6770
6812
|
strokeWidth: 1
|
|
6771
6813
|
},
|
|
6772
|
-
labels:
|
|
6773
|
-
|
|
6774
|
-
|
|
6814
|
+
labels: {
|
|
6815
|
+
...baseLabelStyles,
|
|
6816
|
+
padding: 20,
|
|
6817
|
+
fill: gray["600"],
|
|
6818
|
+
fontSize: 10
|
|
6819
|
+
}
|
|
6775
6820
|
},
|
|
6776
|
-
colorScale
|
|
6821
|
+
colorScale,
|
|
6777
6822
|
cornerRadius: borderRadius
|
|
6778
6823
|
}, baseProps),
|
|
6779
6824
|
scatter: Object.assign({
|
|
@@ -6784,11 +6829,14 @@ const clean = {
|
|
|
6784
6829
|
stroke: "transparent",
|
|
6785
6830
|
strokeWidth: 0
|
|
6786
6831
|
},
|
|
6787
|
-
labels:
|
|
6832
|
+
labels: {
|
|
6833
|
+
...baseLabelStyles,
|
|
6834
|
+
padding: 20
|
|
6835
|
+
}
|
|
6788
6836
|
}
|
|
6789
6837
|
}, baseProps),
|
|
6790
6838
|
stack: Object.assign({
|
|
6791
|
-
colorScale
|
|
6839
|
+
colorScale
|
|
6792
6840
|
}, baseProps),
|
|
6793
6841
|
tooltip: {
|
|
6794
6842
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -6796,7 +6844,7 @@ const clean = {
|
|
|
6796
6844
|
pointerEvents: "none"
|
|
6797
6845
|
}),
|
|
6798
6846
|
flyoutStyle: {
|
|
6799
|
-
stroke: gray["
|
|
6847
|
+
stroke: gray["300"],
|
|
6800
6848
|
strokeWidth: 2,
|
|
6801
6849
|
fill: gray.white,
|
|
6802
6850
|
pointerEvents: "none"
|
|
@@ -6813,9 +6861,10 @@ const clean = {
|
|
|
6813
6861
|
voronoi: Object.assign({
|
|
6814
6862
|
style: {
|
|
6815
6863
|
data: {
|
|
6816
|
-
fill:
|
|
6817
|
-
stroke:
|
|
6818
|
-
strokeWidth: 2
|
|
6864
|
+
fill: blue["100"],
|
|
6865
|
+
stroke: blue["500"],
|
|
6866
|
+
strokeWidth: 2,
|
|
6867
|
+
opacity: 0.4
|
|
6819
6868
|
},
|
|
6820
6869
|
labels: Object.assign({}, baseLabelStyles, {
|
|
6821
6870
|
padding: 5,
|
|
@@ -6851,9 +6900,28 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6851
6900
|
// *
|
|
6852
6901
|
// * Colors
|
|
6853
6902
|
// *
|
|
6854
|
-
const colors =
|
|
6903
|
+
const colors = {
|
|
6904
|
+
blue: "#4F7DA1",
|
|
6905
|
+
pink: "#E2A37F",
|
|
6906
|
+
teal: "#00796B",
|
|
6907
|
+
purple: "#DF948A",
|
|
6908
|
+
green: "#8BC34A",
|
|
6909
|
+
orange: "#F4511E",
|
|
6910
|
+
cyan: "#006064",
|
|
6911
|
+
red: "#DF5A49",
|
|
6912
|
+
yellow: "#FFF59D"
|
|
6913
|
+
};
|
|
6914
|
+
const colorScale = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
|
|
6855
6915
|
const charcoal = "#252525";
|
|
6856
6916
|
const grey = "#969696";
|
|
6917
|
+
const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
|
|
6918
|
+
const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
|
|
6919
|
+
const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
|
|
6920
|
+
const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
|
|
6921
|
+
const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
|
|
6922
|
+
const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
|
|
6923
|
+
const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
|
|
6924
|
+
|
|
6857
6925
|
// *
|
|
6858
6926
|
// * Typography
|
|
6859
6927
|
// *
|
|
@@ -6867,7 +6935,7 @@ const baseProps = {
|
|
|
6867
6935
|
width: 450,
|
|
6868
6936
|
height: 300,
|
|
6869
6937
|
padding: 50,
|
|
6870
|
-
colorScale
|
|
6938
|
+
colorScale
|
|
6871
6939
|
};
|
|
6872
6940
|
// *
|
|
6873
6941
|
// * Labels
|
|
@@ -6889,6 +6957,17 @@ const centeredLabelStyles = Object.assign({
|
|
|
6889
6957
|
const strokeLinecap = "round";
|
|
6890
6958
|
const strokeLinejoin = "round";
|
|
6891
6959
|
const grayscale = {
|
|
6960
|
+
palette: {
|
|
6961
|
+
colors,
|
|
6962
|
+
grayscale: colorScale,
|
|
6963
|
+
qualitative,
|
|
6964
|
+
heatmap,
|
|
6965
|
+
warm,
|
|
6966
|
+
cool,
|
|
6967
|
+
red,
|
|
6968
|
+
green,
|
|
6969
|
+
blue
|
|
6970
|
+
},
|
|
6892
6971
|
area: Object.assign({
|
|
6893
6972
|
style: {
|
|
6894
6973
|
data: {
|
|
@@ -7003,7 +7082,7 @@ const grayscale = {
|
|
|
7003
7082
|
}
|
|
7004
7083
|
}, baseProps),
|
|
7005
7084
|
group: Object.assign({
|
|
7006
|
-
colorScale
|
|
7085
|
+
colorScale
|
|
7007
7086
|
}, baseProps),
|
|
7008
7087
|
histogram: Object.assign({
|
|
7009
7088
|
style: {
|
|
@@ -7016,7 +7095,7 @@ const grayscale = {
|
|
|
7016
7095
|
}
|
|
7017
7096
|
}, baseProps),
|
|
7018
7097
|
legend: {
|
|
7019
|
-
colorScale
|
|
7098
|
+
colorScale,
|
|
7020
7099
|
gutter: 10,
|
|
7021
7100
|
orientation: "vertical",
|
|
7022
7101
|
titleOrientation: "top",
|
|
@@ -7051,7 +7130,7 @@ const grayscale = {
|
|
|
7051
7130
|
padding: 20
|
|
7052
7131
|
})
|
|
7053
7132
|
},
|
|
7054
|
-
colorScale
|
|
7133
|
+
colorScale,
|
|
7055
7134
|
width: 400,
|
|
7056
7135
|
height: 400,
|
|
7057
7136
|
padding: 50
|
|
@@ -7067,7 +7146,7 @@ const grayscale = {
|
|
|
7067
7146
|
}
|
|
7068
7147
|
}, baseProps),
|
|
7069
7148
|
stack: Object.assign({
|
|
7070
|
-
colorScale
|
|
7149
|
+
colorScale
|
|
7071
7150
|
}, baseProps),
|
|
7072
7151
|
tooltip: {
|
|
7073
7152
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -7127,11 +7206,31 @@ const lime300 = "#DCE775";
|
|
|
7127
7206
|
const lightGreen500 = "#8BC34A";
|
|
7128
7207
|
const teal700 = "#00796B";
|
|
7129
7208
|
const cyan900 = "#006064";
|
|
7130
|
-
const
|
|
7209
|
+
const colorScale = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
|
|
7131
7210
|
const blueGrey50 = "#ECEFF1";
|
|
7132
7211
|
const blueGrey300 = "#90A4AE";
|
|
7133
7212
|
const blueGrey700 = "#455A64";
|
|
7134
7213
|
const grey900 = "#212121";
|
|
7214
|
+
const colors = {
|
|
7215
|
+
blue: "#4F7DA1",
|
|
7216
|
+
pink: "#E2A37F",
|
|
7217
|
+
teal: teal700,
|
|
7218
|
+
purple: "#DF948A",
|
|
7219
|
+
green: lightGreen500,
|
|
7220
|
+
orange: deepOrange600,
|
|
7221
|
+
cyan: cyan900,
|
|
7222
|
+
red: "#DF5A49",
|
|
7223
|
+
yellow: yellow200
|
|
7224
|
+
};
|
|
7225
|
+
const grayscale = [blueGrey50, blueGrey300, blueGrey700, grey900];
|
|
7226
|
+
const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
|
|
7227
|
+
const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
|
|
7228
|
+
const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
|
|
7229
|
+
const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
|
|
7230
|
+
const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
|
|
7231
|
+
const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
|
|
7232
|
+
const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
|
|
7233
|
+
|
|
7135
7234
|
// *
|
|
7136
7235
|
// * Typography
|
|
7137
7236
|
// *
|
|
@@ -7169,6 +7268,17 @@ const strokeDasharray = "10, 5";
|
|
|
7169
7268
|
const strokeLinecap = "round";
|
|
7170
7269
|
const strokeLinejoin = "round";
|
|
7171
7270
|
const material = {
|
|
7271
|
+
palette: {
|
|
7272
|
+
colors,
|
|
7273
|
+
grayscale,
|
|
7274
|
+
qualitative,
|
|
7275
|
+
heatmap,
|
|
7276
|
+
warm,
|
|
7277
|
+
cool,
|
|
7278
|
+
red,
|
|
7279
|
+
green,
|
|
7280
|
+
blue
|
|
7281
|
+
},
|
|
7172
7282
|
area: Object.assign({
|
|
7173
7283
|
style: {
|
|
7174
7284
|
data: {
|
|
@@ -7301,7 +7411,7 @@ const material = {
|
|
|
7301
7411
|
}
|
|
7302
7412
|
}, baseProps),
|
|
7303
7413
|
group: Object.assign({
|
|
7304
|
-
colorScale
|
|
7414
|
+
colorScale
|
|
7305
7415
|
}, baseProps),
|
|
7306
7416
|
histogram: Object.assign({
|
|
7307
7417
|
style: {
|
|
@@ -7314,7 +7424,7 @@ const material = {
|
|
|
7314
7424
|
}
|
|
7315
7425
|
}, baseProps),
|
|
7316
7426
|
legend: {
|
|
7317
|
-
colorScale
|
|
7427
|
+
colorScale,
|
|
7318
7428
|
gutter: 10,
|
|
7319
7429
|
orientation: "vertical",
|
|
7320
7430
|
titleOrientation: "top",
|
|
@@ -7340,7 +7450,7 @@ const material = {
|
|
|
7340
7450
|
}
|
|
7341
7451
|
}, baseProps),
|
|
7342
7452
|
pie: Object.assign({
|
|
7343
|
-
colorScale
|
|
7453
|
+
colorScale,
|
|
7344
7454
|
style: {
|
|
7345
7455
|
data: {
|
|
7346
7456
|
padding,
|
|
@@ -7364,7 +7474,7 @@ const material = {
|
|
|
7364
7474
|
}
|
|
7365
7475
|
}, baseProps),
|
|
7366
7476
|
stack: Object.assign({
|
|
7367
|
-
colorScale
|
|
7477
|
+
colorScale
|
|
7368
7478
|
}, baseProps),
|
|
7369
7479
|
tooltip: {
|
|
7370
7480
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -9831,6 +9941,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9831
9941
|
/* harmony export */ "getColorScale": function() { return /* binding */ getColorScale; },
|
|
9832
9942
|
/* harmony export */ "toTransformString": function() { return /* binding */ toTransformString; }
|
|
9833
9943
|
/* harmony export */ });
|
|
9944
|
+
/* 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");
|
|
9945
|
+
|
|
9946
|
+
|
|
9834
9947
|
/**
|
|
9835
9948
|
* Given an object with CSS/SVG transform definitions, return the string value
|
|
9836
9949
|
* for use with the `transform` CSS property or SVG attribute. Note that we
|
|
@@ -9867,20 +9980,37 @@ const toTransformString = function (obj) {
|
|
|
9867
9980
|
* of 5 hex string values in that color scale. If no 'name' parameter
|
|
9868
9981
|
* is given, it will return the Victory default grayscale.
|
|
9869
9982
|
* @param {String} name The name of the color scale to return (optional).
|
|
9983
|
+
* @param {Object} theme The theme object to retrieve the color scale from (optional).
|
|
9870
9984
|
* @returns {Array} An array of 5 hex string values composing a color scale.
|
|
9871
9985
|
*/
|
|
9872
|
-
function getColorScale(name) {
|
|
9986
|
+
function getColorScale(name, theme) {
|
|
9987
|
+
if (theme === void 0) {
|
|
9988
|
+
theme = _victory_theme_victory_theme__WEBPACK_IMPORTED_MODULE_0__.VictoryTheme.material;
|
|
9989
|
+
}
|
|
9990
|
+
const {
|
|
9991
|
+
palette: {
|
|
9992
|
+
grayscale = ["#cccccc", "#969696", "#636363", "#252525"],
|
|
9993
|
+
qualitative = [],
|
|
9994
|
+
heatmap = [],
|
|
9995
|
+
warm = [],
|
|
9996
|
+
cool = [],
|
|
9997
|
+
red = [],
|
|
9998
|
+
blue = [],
|
|
9999
|
+
green = []
|
|
10000
|
+
} = {}
|
|
10001
|
+
} = theme;
|
|
9873
10002
|
const scales = {
|
|
9874
|
-
grayscale
|
|
9875
|
-
qualitative
|
|
9876
|
-
heatmap
|
|
9877
|
-
warm
|
|
9878
|
-
cool
|
|
9879
|
-
red
|
|
9880
|
-
blue
|
|
9881
|
-
green
|
|
9882
|
-
};
|
|
9883
|
-
|
|
10003
|
+
grayscale,
|
|
10004
|
+
qualitative,
|
|
10005
|
+
heatmap,
|
|
10006
|
+
warm,
|
|
10007
|
+
cool,
|
|
10008
|
+
red,
|
|
10009
|
+
blue,
|
|
10010
|
+
green
|
|
10011
|
+
};
|
|
10012
|
+
const selectedScale = name && scales[name]?.length ? scales[name] : scales.grayscale;
|
|
10013
|
+
return selectedScale;
|
|
9884
10014
|
}
|
|
9885
10015
|
|
|
9886
10016
|
/***/ }),
|