victory-pie 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 +8 -0
- package/dist/victory-pie.js +210 -83
- 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] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(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
|
}, []);
|
|
@@ -6450,20 +6454,16 @@ const orange = {
|
|
|
6450
6454
|
"100": "#FEE2D5",
|
|
6451
6455
|
"300": "#FFA981",
|
|
6452
6456
|
"500": "#FF6F2C",
|
|
6457
|
+
"700": "#FF4E1B",
|
|
6453
6458
|
"900": "#D74D26"
|
|
6454
6459
|
};
|
|
6455
6460
|
const red = {
|
|
6456
6461
|
"100": "#FFDCE5",
|
|
6457
6462
|
"300": "#FF9EB7",
|
|
6458
6463
|
"500": "#F82B60",
|
|
6464
|
+
"700": "#D31A3D",
|
|
6459
6465
|
"900": "#BA1E45"
|
|
6460
6466
|
};
|
|
6461
|
-
const pink = {
|
|
6462
|
-
"100": "#FFDAF6",
|
|
6463
|
-
"300": "#F99DE2",
|
|
6464
|
-
"500": "#FF08C2",
|
|
6465
|
-
"900": "#B2158B"
|
|
6466
|
-
};
|
|
6467
6467
|
const purple = {
|
|
6468
6468
|
"100": "#EDE3FE",
|
|
6469
6469
|
"300": "#CDB0FF",
|
|
@@ -6474,6 +6474,7 @@ const blue = {
|
|
|
6474
6474
|
"100": "#CFDFFF",
|
|
6475
6475
|
"300": "#9CC7FF",
|
|
6476
6476
|
"500": "#2D7FF9",
|
|
6477
|
+
"700": "#0056B3",
|
|
6477
6478
|
"900": "#2750AE"
|
|
6478
6479
|
};
|
|
6479
6480
|
const cyan = {
|
|
@@ -6492,9 +6493,29 @@ const green = {
|
|
|
6492
6493
|
"100": "#D1F7C4",
|
|
6493
6494
|
"300": "#93E088",
|
|
6494
6495
|
"500": "#20C933",
|
|
6496
|
+
"700": "#1B9B2A",
|
|
6495
6497
|
"900": "#338A17"
|
|
6496
6498
|
};
|
|
6497
|
-
const colors =
|
|
6499
|
+
const colors = {
|
|
6500
|
+
blue: blue["500"],
|
|
6501
|
+
cyan: cyan["500"],
|
|
6502
|
+
green: green["500"],
|
|
6503
|
+
yellow: yellow["500"],
|
|
6504
|
+
orange: orange["500"],
|
|
6505
|
+
red: red["500"],
|
|
6506
|
+
purple: purple["500"],
|
|
6507
|
+
teal: teal["500"]
|
|
6508
|
+
};
|
|
6509
|
+
const colorScale = Object.values(colors);
|
|
6510
|
+
const grayscale = [gray["100"], gray["300"], gray["500"], gray["700"], gray["900"]];
|
|
6511
|
+
const warm = [yellow["300"], yellow["500"], orange["500"], orange["900"], red["500"]];
|
|
6512
|
+
const cool = [purple["500"], blue["500"], cyan["500"], teal["500"], green["500"]];
|
|
6513
|
+
const heatmap = [green["900"], green["500"], yellow["500"], orange["500"], red["500"]];
|
|
6514
|
+
const redPalette = Object.values(red);
|
|
6515
|
+
const greenPalette = Object.values(green);
|
|
6516
|
+
const bluePalette = Object.values(blue);
|
|
6517
|
+
const defaultColor = blue["500"];
|
|
6518
|
+
|
|
6498
6519
|
// *
|
|
6499
6520
|
// * Typography
|
|
6500
6521
|
// *
|
|
@@ -6508,8 +6529,8 @@ const padding = 8;
|
|
|
6508
6529
|
const baseProps = {
|
|
6509
6530
|
width: 450,
|
|
6510
6531
|
height: 300,
|
|
6511
|
-
padding:
|
|
6512
|
-
colorScale
|
|
6532
|
+
padding: 60,
|
|
6533
|
+
colorScale
|
|
6513
6534
|
};
|
|
6514
6535
|
// *
|
|
6515
6536
|
// * Labels
|
|
@@ -6538,10 +6559,23 @@ const borderRadius = 1;
|
|
|
6538
6559
|
// * Theme
|
|
6539
6560
|
// *
|
|
6540
6561
|
const clean = {
|
|
6562
|
+
palette: {
|
|
6563
|
+
colors,
|
|
6564
|
+
grayscale,
|
|
6565
|
+
qualitative: colorScale,
|
|
6566
|
+
heatmap,
|
|
6567
|
+
warm,
|
|
6568
|
+
cool,
|
|
6569
|
+
red: redPalette,
|
|
6570
|
+
green: greenPalette,
|
|
6571
|
+
blue: bluePalette
|
|
6572
|
+
},
|
|
6541
6573
|
area: Object.assign({
|
|
6542
6574
|
style: {
|
|
6543
6575
|
data: {
|
|
6544
|
-
fill:
|
|
6576
|
+
fill: defaultColor,
|
|
6577
|
+
strokeWidth: 2,
|
|
6578
|
+
fillOpacity: 0.5
|
|
6545
6579
|
},
|
|
6546
6580
|
labels: baseLabelStyles
|
|
6547
6581
|
}
|
|
@@ -6550,13 +6584,13 @@ const clean = {
|
|
|
6550
6584
|
style: {
|
|
6551
6585
|
axis: {
|
|
6552
6586
|
fill: "transparent",
|
|
6553
|
-
stroke: gray["
|
|
6587
|
+
stroke: gray["500"],
|
|
6554
6588
|
strokeWidth: 1,
|
|
6555
6589
|
strokeLinecap,
|
|
6556
6590
|
strokeLinejoin
|
|
6557
6591
|
},
|
|
6558
6592
|
axisLabel: Object.assign({}, centeredLabelStyles, {
|
|
6559
|
-
padding,
|
|
6593
|
+
padding: 35,
|
|
6560
6594
|
stroke: "transparent"
|
|
6561
6595
|
}),
|
|
6562
6596
|
grid: {
|
|
@@ -6575,10 +6609,10 @@ const clean = {
|
|
|
6575
6609
|
polarAxis: Object.assign({
|
|
6576
6610
|
style: {
|
|
6577
6611
|
axis: {
|
|
6578
|
-
stroke: gray["
|
|
6612
|
+
stroke: gray["500"]
|
|
6579
6613
|
},
|
|
6580
6614
|
grid: {
|
|
6581
|
-
stroke: gray["
|
|
6615
|
+
stroke: gray["400"],
|
|
6582
6616
|
strokeDasharray,
|
|
6583
6617
|
strokeLinecap,
|
|
6584
6618
|
strokeLinejoin,
|
|
@@ -6587,7 +6621,7 @@ const clean = {
|
|
|
6587
6621
|
ticks: {
|
|
6588
6622
|
fill: "transparent",
|
|
6589
6623
|
size: 5,
|
|
6590
|
-
stroke: gray["
|
|
6624
|
+
stroke: gray["400"],
|
|
6591
6625
|
strokeWidth: 1,
|
|
6592
6626
|
strokeLinecap,
|
|
6593
6627
|
strokeLinejoin
|
|
@@ -6598,10 +6632,10 @@ const clean = {
|
|
|
6598
6632
|
polarDependentAxis: Object.assign({
|
|
6599
6633
|
style: {
|
|
6600
6634
|
axis: {
|
|
6601
|
-
stroke: gray["
|
|
6635
|
+
stroke: gray["500"]
|
|
6602
6636
|
},
|
|
6603
6637
|
grid: {
|
|
6604
|
-
stroke: gray["
|
|
6638
|
+
stroke: gray["400"],
|
|
6605
6639
|
strokeDasharray,
|
|
6606
6640
|
strokeLinecap,
|
|
6607
6641
|
strokeLinejoin,
|
|
@@ -6610,7 +6644,7 @@ const clean = {
|
|
|
6610
6644
|
ticks: {
|
|
6611
6645
|
fill: "transparent",
|
|
6612
6646
|
size: 5,
|
|
6613
|
-
stroke: gray["
|
|
6647
|
+
stroke: gray["300"],
|
|
6614
6648
|
strokeWidth: 1,
|
|
6615
6649
|
strokeLinecap,
|
|
6616
6650
|
strokeLinejoin
|
|
@@ -6621,9 +6655,10 @@ const clean = {
|
|
|
6621
6655
|
bar: Object.assign({
|
|
6622
6656
|
style: {
|
|
6623
6657
|
data: {
|
|
6624
|
-
fill:
|
|
6658
|
+
fill: defaultColor,
|
|
6625
6659
|
padding,
|
|
6626
|
-
strokeWidth:
|
|
6660
|
+
strokeWidth: 1,
|
|
6661
|
+
fillOpacity: 0.5
|
|
6627
6662
|
},
|
|
6628
6663
|
labels: baseLabelStyles
|
|
6629
6664
|
},
|
|
@@ -6659,15 +6694,16 @@ const clean = {
|
|
|
6659
6694
|
}),
|
|
6660
6695
|
q1: {
|
|
6661
6696
|
padding,
|
|
6662
|
-
fill:
|
|
6663
|
-
rx: borderRadius
|
|
6697
|
+
fill: colorScale[0],
|
|
6698
|
+
rx: borderRadius,
|
|
6699
|
+
strokeWidth: 2
|
|
6664
6700
|
},
|
|
6665
6701
|
q1Labels: Object.assign({}, baseLabelStyles, {
|
|
6666
6702
|
padding: 3
|
|
6667
6703
|
}),
|
|
6668
6704
|
q3: {
|
|
6669
6705
|
padding,
|
|
6670
|
-
fill:
|
|
6706
|
+
fill: colorScale[1],
|
|
6671
6707
|
rx: borderRadius
|
|
6672
6708
|
},
|
|
6673
6709
|
q3Labels: Object.assign({}, baseLabelStyles, {
|
|
@@ -6688,8 +6724,8 @@ const clean = {
|
|
|
6688
6724
|
})
|
|
6689
6725
|
},
|
|
6690
6726
|
candleColors: {
|
|
6691
|
-
positive:
|
|
6692
|
-
negative:
|
|
6727
|
+
positive: green["500"],
|
|
6728
|
+
negative: red["500"]
|
|
6693
6729
|
},
|
|
6694
6730
|
wickStrokeWidth: 2
|
|
6695
6731
|
}, baseProps),
|
|
@@ -6708,14 +6744,13 @@ const clean = {
|
|
|
6708
6744
|
}
|
|
6709
6745
|
}, baseProps),
|
|
6710
6746
|
group: Object.assign({
|
|
6711
|
-
colorScale
|
|
6747
|
+
colorScale
|
|
6712
6748
|
}, baseProps),
|
|
6713
6749
|
histogram: Object.assign({
|
|
6714
6750
|
style: {
|
|
6715
6751
|
data: {
|
|
6716
6752
|
fill: cyan["500"],
|
|
6717
|
-
|
|
6718
|
-
strokeWidth: 0
|
|
6753
|
+
fillOpacity: 0.5
|
|
6719
6754
|
},
|
|
6720
6755
|
labels: baseLabelStyles
|
|
6721
6756
|
},
|
|
@@ -6726,21 +6761,23 @@ const clean = {
|
|
|
6726
6761
|
}, baseProps),
|
|
6727
6762
|
label: baseLabelStyles,
|
|
6728
6763
|
legend: {
|
|
6729
|
-
colorScale
|
|
6730
|
-
gutter:
|
|
6731
|
-
|
|
6764
|
+
colorScale,
|
|
6765
|
+
gutter: 24,
|
|
6766
|
+
borderPadding: 10,
|
|
6767
|
+
orientation: "horizontal",
|
|
6732
6768
|
titleOrientation: "top",
|
|
6769
|
+
centerTitle: true,
|
|
6733
6770
|
style: {
|
|
6734
6771
|
data: {
|
|
6735
6772
|
type: "circle"
|
|
6736
6773
|
},
|
|
6737
6774
|
labels: {
|
|
6738
6775
|
...baseLabelStyles,
|
|
6739
|
-
fontSize:
|
|
6776
|
+
fontSize: 12
|
|
6740
6777
|
},
|
|
6741
6778
|
title: Object.assign({}, baseLabelStyles, {
|
|
6742
6779
|
padding,
|
|
6743
|
-
fontSize:
|
|
6780
|
+
fontSize: 16
|
|
6744
6781
|
}),
|
|
6745
6782
|
border: {
|
|
6746
6783
|
stroke: gray["200"],
|
|
@@ -6754,7 +6791,7 @@ const clean = {
|
|
|
6754
6791
|
data: {
|
|
6755
6792
|
fill: "transparent",
|
|
6756
6793
|
opacity: 1,
|
|
6757
|
-
stroke:
|
|
6794
|
+
stroke: defaultColor,
|
|
6758
6795
|
strokeWidth: 2,
|
|
6759
6796
|
strokeLinecap,
|
|
6760
6797
|
strokeLinejoin
|
|
@@ -6764,31 +6801,40 @@ const clean = {
|
|
|
6764
6801
|
}, baseProps),
|
|
6765
6802
|
pie: Object.assign({
|
|
6766
6803
|
style: {
|
|
6804
|
+
parent: {
|
|
6805
|
+
backgroundColor: gray.white
|
|
6806
|
+
},
|
|
6767
6807
|
data: {
|
|
6768
6808
|
padding,
|
|
6769
6809
|
stroke: gray.white,
|
|
6770
6810
|
strokeWidth: 1
|
|
6771
6811
|
},
|
|
6772
|
-
labels:
|
|
6773
|
-
|
|
6774
|
-
|
|
6812
|
+
labels: {
|
|
6813
|
+
...baseLabelStyles,
|
|
6814
|
+
padding: 20,
|
|
6815
|
+
fill: gray["600"],
|
|
6816
|
+
fontSize: 10
|
|
6817
|
+
}
|
|
6775
6818
|
},
|
|
6776
|
-
colorScale
|
|
6819
|
+
colorScale,
|
|
6777
6820
|
cornerRadius: borderRadius
|
|
6778
6821
|
}, baseProps),
|
|
6779
6822
|
scatter: Object.assign({
|
|
6780
6823
|
style: {
|
|
6781
6824
|
data: {
|
|
6782
|
-
fill:
|
|
6825
|
+
fill: defaultColor,
|
|
6783
6826
|
opacity: 1,
|
|
6784
6827
|
stroke: "transparent",
|
|
6785
6828
|
strokeWidth: 0
|
|
6786
6829
|
},
|
|
6787
|
-
labels:
|
|
6830
|
+
labels: {
|
|
6831
|
+
...baseLabelStyles,
|
|
6832
|
+
padding: 20
|
|
6833
|
+
}
|
|
6788
6834
|
}
|
|
6789
6835
|
}, baseProps),
|
|
6790
6836
|
stack: Object.assign({
|
|
6791
|
-
colorScale
|
|
6837
|
+
colorScale
|
|
6792
6838
|
}, baseProps),
|
|
6793
6839
|
tooltip: {
|
|
6794
6840
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -6796,7 +6842,7 @@ const clean = {
|
|
|
6796
6842
|
pointerEvents: "none"
|
|
6797
6843
|
}),
|
|
6798
6844
|
flyoutStyle: {
|
|
6799
|
-
stroke: gray["
|
|
6845
|
+
stroke: gray["300"],
|
|
6800
6846
|
strokeWidth: 2,
|
|
6801
6847
|
fill: gray.white,
|
|
6802
6848
|
pointerEvents: "none"
|
|
@@ -6813,8 +6859,8 @@ const clean = {
|
|
|
6813
6859
|
voronoi: Object.assign({
|
|
6814
6860
|
style: {
|
|
6815
6861
|
data: {
|
|
6816
|
-
fill:
|
|
6817
|
-
stroke:
|
|
6862
|
+
fill: blue["100"],
|
|
6863
|
+
stroke: defaultColor,
|
|
6818
6864
|
strokeWidth: 2
|
|
6819
6865
|
},
|
|
6820
6866
|
labels: Object.assign({}, baseLabelStyles, {
|
|
@@ -6851,9 +6897,28 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6851
6897
|
// *
|
|
6852
6898
|
// * Colors
|
|
6853
6899
|
// *
|
|
6854
|
-
const colors =
|
|
6900
|
+
const colors = {
|
|
6901
|
+
blue: "#4F7DA1",
|
|
6902
|
+
pink: "#E2A37F",
|
|
6903
|
+
teal: "#00796B",
|
|
6904
|
+
purple: "#DF948A",
|
|
6905
|
+
green: "#8BC34A",
|
|
6906
|
+
orange: "#F4511E",
|
|
6907
|
+
cyan: "#006064",
|
|
6908
|
+
red: "#DF5A49",
|
|
6909
|
+
yellow: "#FFF59D"
|
|
6910
|
+
};
|
|
6911
|
+
const colorScale = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
|
|
6855
6912
|
const charcoal = "#252525";
|
|
6856
6913
|
const grey = "#969696";
|
|
6914
|
+
const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
|
|
6915
|
+
const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
|
|
6916
|
+
const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
|
|
6917
|
+
const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
|
|
6918
|
+
const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
|
|
6919
|
+
const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
|
|
6920
|
+
const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
|
|
6921
|
+
|
|
6857
6922
|
// *
|
|
6858
6923
|
// * Typography
|
|
6859
6924
|
// *
|
|
@@ -6867,7 +6932,7 @@ const baseProps = {
|
|
|
6867
6932
|
width: 450,
|
|
6868
6933
|
height: 300,
|
|
6869
6934
|
padding: 50,
|
|
6870
|
-
colorScale
|
|
6935
|
+
colorScale
|
|
6871
6936
|
};
|
|
6872
6937
|
// *
|
|
6873
6938
|
// * Labels
|
|
@@ -6889,6 +6954,17 @@ const centeredLabelStyles = Object.assign({
|
|
|
6889
6954
|
const strokeLinecap = "round";
|
|
6890
6955
|
const strokeLinejoin = "round";
|
|
6891
6956
|
const grayscale = {
|
|
6957
|
+
palette: {
|
|
6958
|
+
colors,
|
|
6959
|
+
grayscale: colorScale,
|
|
6960
|
+
qualitative,
|
|
6961
|
+
heatmap,
|
|
6962
|
+
warm,
|
|
6963
|
+
cool,
|
|
6964
|
+
red,
|
|
6965
|
+
green,
|
|
6966
|
+
blue
|
|
6967
|
+
},
|
|
6892
6968
|
area: Object.assign({
|
|
6893
6969
|
style: {
|
|
6894
6970
|
data: {
|
|
@@ -7003,7 +7079,7 @@ const grayscale = {
|
|
|
7003
7079
|
}
|
|
7004
7080
|
}, baseProps),
|
|
7005
7081
|
group: Object.assign({
|
|
7006
|
-
colorScale
|
|
7082
|
+
colorScale
|
|
7007
7083
|
}, baseProps),
|
|
7008
7084
|
histogram: Object.assign({
|
|
7009
7085
|
style: {
|
|
@@ -7016,7 +7092,7 @@ const grayscale = {
|
|
|
7016
7092
|
}
|
|
7017
7093
|
}, baseProps),
|
|
7018
7094
|
legend: {
|
|
7019
|
-
colorScale
|
|
7095
|
+
colorScale,
|
|
7020
7096
|
gutter: 10,
|
|
7021
7097
|
orientation: "vertical",
|
|
7022
7098
|
titleOrientation: "top",
|
|
@@ -7051,7 +7127,7 @@ const grayscale = {
|
|
|
7051
7127
|
padding: 20
|
|
7052
7128
|
})
|
|
7053
7129
|
},
|
|
7054
|
-
colorScale
|
|
7130
|
+
colorScale,
|
|
7055
7131
|
width: 400,
|
|
7056
7132
|
height: 400,
|
|
7057
7133
|
padding: 50
|
|
@@ -7067,7 +7143,7 @@ const grayscale = {
|
|
|
7067
7143
|
}
|
|
7068
7144
|
}, baseProps),
|
|
7069
7145
|
stack: Object.assign({
|
|
7070
|
-
colorScale
|
|
7146
|
+
colorScale
|
|
7071
7147
|
}, baseProps),
|
|
7072
7148
|
tooltip: {
|
|
7073
7149
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -7127,11 +7203,31 @@ const lime300 = "#DCE775";
|
|
|
7127
7203
|
const lightGreen500 = "#8BC34A";
|
|
7128
7204
|
const teal700 = "#00796B";
|
|
7129
7205
|
const cyan900 = "#006064";
|
|
7130
|
-
const
|
|
7206
|
+
const colorScale = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
|
|
7131
7207
|
const blueGrey50 = "#ECEFF1";
|
|
7132
7208
|
const blueGrey300 = "#90A4AE";
|
|
7133
7209
|
const blueGrey700 = "#455A64";
|
|
7134
7210
|
const grey900 = "#212121";
|
|
7211
|
+
const colors = {
|
|
7212
|
+
blue: "#4F7DA1",
|
|
7213
|
+
pink: "#E2A37F",
|
|
7214
|
+
teal: teal700,
|
|
7215
|
+
purple: "#DF948A",
|
|
7216
|
+
green: lightGreen500,
|
|
7217
|
+
orange: deepOrange600,
|
|
7218
|
+
cyan: cyan900,
|
|
7219
|
+
red: "#DF5A49",
|
|
7220
|
+
yellow: yellow200
|
|
7221
|
+
};
|
|
7222
|
+
const grayscale = [blueGrey50, blueGrey300, blueGrey700, grey900];
|
|
7223
|
+
const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
|
|
7224
|
+
const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
|
|
7225
|
+
const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
|
|
7226
|
+
const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
|
|
7227
|
+
const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
|
|
7228
|
+
const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
|
|
7229
|
+
const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
|
|
7230
|
+
|
|
7135
7231
|
// *
|
|
7136
7232
|
// * Typography
|
|
7137
7233
|
// *
|
|
@@ -7169,6 +7265,17 @@ const strokeDasharray = "10, 5";
|
|
|
7169
7265
|
const strokeLinecap = "round";
|
|
7170
7266
|
const strokeLinejoin = "round";
|
|
7171
7267
|
const material = {
|
|
7268
|
+
palette: {
|
|
7269
|
+
colors,
|
|
7270
|
+
grayscale,
|
|
7271
|
+
qualitative,
|
|
7272
|
+
heatmap,
|
|
7273
|
+
warm,
|
|
7274
|
+
cool,
|
|
7275
|
+
red,
|
|
7276
|
+
green,
|
|
7277
|
+
blue
|
|
7278
|
+
},
|
|
7172
7279
|
area: Object.assign({
|
|
7173
7280
|
style: {
|
|
7174
7281
|
data: {
|
|
@@ -7301,7 +7408,7 @@ const material = {
|
|
|
7301
7408
|
}
|
|
7302
7409
|
}, baseProps),
|
|
7303
7410
|
group: Object.assign({
|
|
7304
|
-
colorScale
|
|
7411
|
+
colorScale
|
|
7305
7412
|
}, baseProps),
|
|
7306
7413
|
histogram: Object.assign({
|
|
7307
7414
|
style: {
|
|
@@ -7314,7 +7421,7 @@ const material = {
|
|
|
7314
7421
|
}
|
|
7315
7422
|
}, baseProps),
|
|
7316
7423
|
legend: {
|
|
7317
|
-
colorScale
|
|
7424
|
+
colorScale,
|
|
7318
7425
|
gutter: 10,
|
|
7319
7426
|
orientation: "vertical",
|
|
7320
7427
|
titleOrientation: "top",
|
|
@@ -7340,7 +7447,7 @@ const material = {
|
|
|
7340
7447
|
}
|
|
7341
7448
|
}, baseProps),
|
|
7342
7449
|
pie: Object.assign({
|
|
7343
|
-
colorScale
|
|
7450
|
+
colorScale,
|
|
7344
7451
|
style: {
|
|
7345
7452
|
data: {
|
|
7346
7453
|
padding,
|
|
@@ -7364,7 +7471,7 @@ const material = {
|
|
|
7364
7471
|
}
|
|
7365
7472
|
}, baseProps),
|
|
7366
7473
|
stack: Object.assign({
|
|
7367
|
-
colorScale
|
|
7474
|
+
colorScale
|
|
7368
7475
|
}, baseProps),
|
|
7369
7476
|
tooltip: {
|
|
7370
7477
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -9831,6 +9938,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9831
9938
|
/* harmony export */ "getColorScale": function() { return /* binding */ getColorScale; },
|
|
9832
9939
|
/* harmony export */ "toTransformString": function() { return /* binding */ toTransformString; }
|
|
9833
9940
|
/* harmony export */ });
|
|
9941
|
+
/* 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");
|
|
9942
|
+
|
|
9943
|
+
|
|
9834
9944
|
/**
|
|
9835
9945
|
* Given an object with CSS/SVG transform definitions, return the string value
|
|
9836
9946
|
* for use with the `transform` CSS property or SVG attribute. Note that we
|
|
@@ -9867,20 +9977,37 @@ const toTransformString = function (obj) {
|
|
|
9867
9977
|
* of 5 hex string values in that color scale. If no 'name' parameter
|
|
9868
9978
|
* is given, it will return the Victory default grayscale.
|
|
9869
9979
|
* @param {String} name The name of the color scale to return (optional).
|
|
9980
|
+
* @param {Object} theme The theme object to retrieve the color scale from (optional).
|
|
9870
9981
|
* @returns {Array} An array of 5 hex string values composing a color scale.
|
|
9871
9982
|
*/
|
|
9872
|
-
function getColorScale(name) {
|
|
9983
|
+
function getColorScale(name, theme) {
|
|
9984
|
+
if (theme === void 0) {
|
|
9985
|
+
theme = _victory_theme_victory_theme__WEBPACK_IMPORTED_MODULE_0__.VictoryTheme.material;
|
|
9986
|
+
}
|
|
9987
|
+
const {
|
|
9988
|
+
palette: {
|
|
9989
|
+
grayscale = ["#cccccc", "#969696", "#636363", "#252525"],
|
|
9990
|
+
qualitative = [],
|
|
9991
|
+
heatmap = [],
|
|
9992
|
+
warm = [],
|
|
9993
|
+
cool = [],
|
|
9994
|
+
red = [],
|
|
9995
|
+
blue = [],
|
|
9996
|
+
green = []
|
|
9997
|
+
} = {}
|
|
9998
|
+
} = theme;
|
|
9873
9999
|
const scales = {
|
|
9874
|
-
grayscale
|
|
9875
|
-
qualitative
|
|
9876
|
-
heatmap
|
|
9877
|
-
warm
|
|
9878
|
-
cool
|
|
9879
|
-
red
|
|
9880
|
-
blue
|
|
9881
|
-
green
|
|
9882
|
-
};
|
|
9883
|
-
|
|
10000
|
+
grayscale,
|
|
10001
|
+
qualitative,
|
|
10002
|
+
heatmap,
|
|
10003
|
+
warm,
|
|
10004
|
+
cool,
|
|
10005
|
+
red,
|
|
10006
|
+
blue,
|
|
10007
|
+
green
|
|
10008
|
+
};
|
|
10009
|
+
const selectedScale = name && scales[name]?.length ? scales[name] : scales.grayscale;
|
|
10010
|
+
return selectedScale;
|
|
9884
10011
|
}
|
|
9885
10012
|
|
|
9886
10013
|
/***/ }),
|