victory 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.js +219 -79
- package/dist/victory.min.js +1 -1
- package/package.json +28 -28
package/CHANGELOG.md
CHANGED
package/dist/victory.js
CHANGED
|
@@ -15443,31 +15443,34 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
15443
15443
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
15444
15444
|
/* harmony export */ "VictoryPortal": function() { return /* binding */ VictoryPortal; }
|
|
15445
15445
|
/* harmony export */ });
|
|
15446
|
-
/* harmony import */ var
|
|
15447
|
-
/* harmony import */ var
|
|
15448
|
-
/* harmony import */ var
|
|
15449
|
-
/* harmony import */ var
|
|
15450
|
-
/* harmony import */ var
|
|
15451
|
-
/* harmony import */ var
|
|
15452
|
-
/* harmony import */ var
|
|
15446
|
+
/* 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");
|
|
15447
|
+
/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0__);
|
|
15448
|
+
/* 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");
|
|
15449
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
15450
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
|
|
15451
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
|
|
15452
|
+
/* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
|
|
15453
|
+
/* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
15454
|
+
/* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
|
|
15455
|
+
|
|
15453
15456
|
|
|
15454
15457
|
|
|
15455
15458
|
|
|
15456
15459
|
|
|
15457
15460
|
|
|
15458
15461
|
const defaultProps = {
|
|
15459
|
-
groupComponent: /*#__PURE__*/
|
|
15462
|
+
groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement("g", null)
|
|
15460
15463
|
};
|
|
15461
15464
|
const VictoryPortal = initialProps => {
|
|
15462
15465
|
const props = {
|
|
15463
15466
|
...defaultProps,
|
|
15464
15467
|
...initialProps
|
|
15465
15468
|
};
|
|
15466
|
-
const id =
|
|
15467
|
-
const portalContext = (0,
|
|
15469
|
+
const id = lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default()();
|
|
15470
|
+
const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_3__.usePortalContext)();
|
|
15468
15471
|
if (!portalContext) {
|
|
15469
15472
|
const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
|
|
15470
|
-
|
|
15473
|
+
_victory_util_log__WEBPACK_IMPORTED_MODULE_4__.warn(msg);
|
|
15471
15474
|
}
|
|
15472
15475
|
const children = Array.isArray(props.children) ? props.children[0] : props.children;
|
|
15473
15476
|
const {
|
|
@@ -15478,15 +15481,15 @@ const VictoryPortal = initialProps => {
|
|
|
15478
15481
|
groupComponent,
|
|
15479
15482
|
standalone: false
|
|
15480
15483
|
} : {};
|
|
15481
|
-
const newProps =
|
|
15484
|
+
const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__.omit(props, ["children", "groupComponent"]), {
|
|
15482
15485
|
key: childProps.key ?? id
|
|
15483
15486
|
});
|
|
15484
|
-
const child = children && /*#__PURE__*/
|
|
15485
|
-
|
|
15487
|
+
const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().cloneElement(children, newProps);
|
|
15488
|
+
react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
|
|
15486
15489
|
portalContext?.addChild(id, child);
|
|
15487
15490
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
15488
15491
|
}, [props.children]);
|
|
15489
|
-
|
|
15492
|
+
react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
|
|
15490
15493
|
return () => portalContext?.removeChild(id);
|
|
15491
15494
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
15492
15495
|
}, []);
|
|
@@ -16388,7 +16391,26 @@ const green = {
|
|
|
16388
16391
|
"500": "#20C933",
|
|
16389
16392
|
"900": "#338A17"
|
|
16390
16393
|
};
|
|
16391
|
-
const colors =
|
|
16394
|
+
const colors = {
|
|
16395
|
+
blue: blue["500"],
|
|
16396
|
+
pink: pink["500"],
|
|
16397
|
+
teal: teal["500"],
|
|
16398
|
+
purple: purple["500"],
|
|
16399
|
+
green: green["500"],
|
|
16400
|
+
orange: orange["500"],
|
|
16401
|
+
cyan: cyan["500"],
|
|
16402
|
+
red: red["500"],
|
|
16403
|
+
yellow: yellow["500"]
|
|
16404
|
+
};
|
|
16405
|
+
const colorScale = Object.values(colors);
|
|
16406
|
+
const grayscale = [gray["200"], gray["400"], gray["600"], gray["900"]];
|
|
16407
|
+
const warm = [yellow["500"], orange["500"], red["500"], pink["500"]];
|
|
16408
|
+
const cool = [cyan["500"], teal["500"], blue["500"], purple["500"]];
|
|
16409
|
+
const heatmap = [green["500"], yellow["500"], red["500"]];
|
|
16410
|
+
const redPalette = [red["500"], red["300"], red["100"]];
|
|
16411
|
+
const greenPalette = [green["500"], green["300"], green["100"]];
|
|
16412
|
+
const bluePalette = [blue["500"], blue["300"], blue["100"]];
|
|
16413
|
+
|
|
16392
16414
|
// *
|
|
16393
16415
|
// * Typography
|
|
16394
16416
|
// *
|
|
@@ -16403,7 +16425,7 @@ const baseProps = {
|
|
|
16403
16425
|
width: 450,
|
|
16404
16426
|
height: 300,
|
|
16405
16427
|
padding: 50,
|
|
16406
|
-
colorScale
|
|
16428
|
+
colorScale
|
|
16407
16429
|
};
|
|
16408
16430
|
// *
|
|
16409
16431
|
// * Labels
|
|
@@ -16432,10 +16454,23 @@ const borderRadius = 1;
|
|
|
16432
16454
|
// * Theme
|
|
16433
16455
|
// *
|
|
16434
16456
|
const clean = {
|
|
16457
|
+
palette: {
|
|
16458
|
+
colors,
|
|
16459
|
+
grayscale,
|
|
16460
|
+
qualitative: colorScale,
|
|
16461
|
+
heatmap,
|
|
16462
|
+
warm,
|
|
16463
|
+
cool,
|
|
16464
|
+
red: redPalette,
|
|
16465
|
+
green: greenPalette,
|
|
16466
|
+
blue: bluePalette
|
|
16467
|
+
},
|
|
16435
16468
|
area: Object.assign({
|
|
16436
16469
|
style: {
|
|
16437
16470
|
data: {
|
|
16438
|
-
fill:
|
|
16471
|
+
fill: blue["500"],
|
|
16472
|
+
strokeWidth: 2,
|
|
16473
|
+
fillOpacity: 0.5
|
|
16439
16474
|
},
|
|
16440
16475
|
labels: baseLabelStyles
|
|
16441
16476
|
}
|
|
@@ -16444,7 +16479,7 @@ const clean = {
|
|
|
16444
16479
|
style: {
|
|
16445
16480
|
axis: {
|
|
16446
16481
|
fill: "transparent",
|
|
16447
|
-
stroke: gray["
|
|
16482
|
+
stroke: gray["500"],
|
|
16448
16483
|
strokeWidth: 1,
|
|
16449
16484
|
strokeLinecap,
|
|
16450
16485
|
strokeLinejoin
|
|
@@ -16469,10 +16504,10 @@ const clean = {
|
|
|
16469
16504
|
polarAxis: Object.assign({
|
|
16470
16505
|
style: {
|
|
16471
16506
|
axis: {
|
|
16472
|
-
stroke: gray["
|
|
16507
|
+
stroke: gray["500"]
|
|
16473
16508
|
},
|
|
16474
16509
|
grid: {
|
|
16475
|
-
stroke: gray["
|
|
16510
|
+
stroke: gray["400"],
|
|
16476
16511
|
strokeDasharray,
|
|
16477
16512
|
strokeLinecap,
|
|
16478
16513
|
strokeLinejoin,
|
|
@@ -16481,7 +16516,7 @@ const clean = {
|
|
|
16481
16516
|
ticks: {
|
|
16482
16517
|
fill: "transparent",
|
|
16483
16518
|
size: 5,
|
|
16484
|
-
stroke: gray["
|
|
16519
|
+
stroke: gray["400"],
|
|
16485
16520
|
strokeWidth: 1,
|
|
16486
16521
|
strokeLinecap,
|
|
16487
16522
|
strokeLinejoin
|
|
@@ -16492,10 +16527,10 @@ const clean = {
|
|
|
16492
16527
|
polarDependentAxis: Object.assign({
|
|
16493
16528
|
style: {
|
|
16494
16529
|
axis: {
|
|
16495
|
-
stroke: gray["
|
|
16530
|
+
stroke: gray["500"]
|
|
16496
16531
|
},
|
|
16497
16532
|
grid: {
|
|
16498
|
-
stroke: gray["
|
|
16533
|
+
stroke: gray["400"],
|
|
16499
16534
|
strokeDasharray,
|
|
16500
16535
|
strokeLinecap,
|
|
16501
16536
|
strokeLinejoin,
|
|
@@ -16504,7 +16539,7 @@ const clean = {
|
|
|
16504
16539
|
ticks: {
|
|
16505
16540
|
fill: "transparent",
|
|
16506
16541
|
size: 5,
|
|
16507
|
-
stroke: gray["
|
|
16542
|
+
stroke: gray["300"],
|
|
16508
16543
|
strokeWidth: 1,
|
|
16509
16544
|
strokeLinecap,
|
|
16510
16545
|
strokeLinejoin
|
|
@@ -16517,7 +16552,8 @@ const clean = {
|
|
|
16517
16552
|
data: {
|
|
16518
16553
|
fill: blue["500"],
|
|
16519
16554
|
padding,
|
|
16520
|
-
strokeWidth:
|
|
16555
|
+
strokeWidth: 1,
|
|
16556
|
+
fillOpacity: 0.5
|
|
16521
16557
|
},
|
|
16522
16558
|
labels: baseLabelStyles
|
|
16523
16559
|
},
|
|
@@ -16554,14 +16590,15 @@ const clean = {
|
|
|
16554
16590
|
q1: {
|
|
16555
16591
|
padding,
|
|
16556
16592
|
fill: teal["500"],
|
|
16557
|
-
rx: borderRadius
|
|
16593
|
+
rx: borderRadius,
|
|
16594
|
+
strokeWidth: 2
|
|
16558
16595
|
},
|
|
16559
16596
|
q1Labels: Object.assign({}, baseLabelStyles, {
|
|
16560
16597
|
padding: 3
|
|
16561
16598
|
}),
|
|
16562
16599
|
q3: {
|
|
16563
16600
|
padding,
|
|
16564
|
-
fill:
|
|
16601
|
+
fill: cyan["500"],
|
|
16565
16602
|
rx: borderRadius
|
|
16566
16603
|
},
|
|
16567
16604
|
q3Labels: Object.assign({}, baseLabelStyles, {
|
|
@@ -16602,14 +16639,13 @@ const clean = {
|
|
|
16602
16639
|
}
|
|
16603
16640
|
}, baseProps),
|
|
16604
16641
|
group: Object.assign({
|
|
16605
|
-
colorScale
|
|
16642
|
+
colorScale
|
|
16606
16643
|
}, baseProps),
|
|
16607
16644
|
histogram: Object.assign({
|
|
16608
16645
|
style: {
|
|
16609
16646
|
data: {
|
|
16610
16647
|
fill: cyan["500"],
|
|
16611
|
-
|
|
16612
|
-
strokeWidth: 0
|
|
16648
|
+
fillOpacity: 0.5
|
|
16613
16649
|
},
|
|
16614
16650
|
labels: baseLabelStyles
|
|
16615
16651
|
},
|
|
@@ -16620,21 +16656,23 @@ const clean = {
|
|
|
16620
16656
|
}, baseProps),
|
|
16621
16657
|
label: baseLabelStyles,
|
|
16622
16658
|
legend: {
|
|
16623
|
-
colorScale
|
|
16624
|
-
gutter:
|
|
16625
|
-
|
|
16659
|
+
colorScale,
|
|
16660
|
+
gutter: 24,
|
|
16661
|
+
borderPadding: 10,
|
|
16662
|
+
orientation: "horizontal",
|
|
16626
16663
|
titleOrientation: "top",
|
|
16664
|
+
centerTitle: true,
|
|
16627
16665
|
style: {
|
|
16628
16666
|
data: {
|
|
16629
16667
|
type: "circle"
|
|
16630
16668
|
},
|
|
16631
16669
|
labels: {
|
|
16632
16670
|
...baseLabelStyles,
|
|
16633
|
-
fontSize:
|
|
16671
|
+
fontSize: 12
|
|
16634
16672
|
},
|
|
16635
16673
|
title: Object.assign({}, baseLabelStyles, {
|
|
16636
16674
|
padding,
|
|
16637
|
-
fontSize:
|
|
16675
|
+
fontSize: 16
|
|
16638
16676
|
}),
|
|
16639
16677
|
border: {
|
|
16640
16678
|
stroke: gray["200"],
|
|
@@ -16648,7 +16686,7 @@ const clean = {
|
|
|
16648
16686
|
data: {
|
|
16649
16687
|
fill: "transparent",
|
|
16650
16688
|
opacity: 1,
|
|
16651
|
-
stroke:
|
|
16689
|
+
stroke: blue["500"],
|
|
16652
16690
|
strokeWidth: 2,
|
|
16653
16691
|
strokeLinecap,
|
|
16654
16692
|
strokeLinejoin
|
|
@@ -16658,16 +16696,22 @@ const clean = {
|
|
|
16658
16696
|
}, baseProps),
|
|
16659
16697
|
pie: Object.assign({
|
|
16660
16698
|
style: {
|
|
16699
|
+
parent: {
|
|
16700
|
+
backgroundColor: gray.white
|
|
16701
|
+
},
|
|
16661
16702
|
data: {
|
|
16662
16703
|
padding,
|
|
16663
16704
|
stroke: gray.white,
|
|
16664
16705
|
strokeWidth: 1
|
|
16665
16706
|
},
|
|
16666
|
-
labels:
|
|
16667
|
-
|
|
16668
|
-
|
|
16707
|
+
labels: {
|
|
16708
|
+
...baseLabelStyles,
|
|
16709
|
+
padding: 20,
|
|
16710
|
+
fill: gray["600"],
|
|
16711
|
+
fontSize: 10
|
|
16712
|
+
}
|
|
16669
16713
|
},
|
|
16670
|
-
colorScale
|
|
16714
|
+
colorScale,
|
|
16671
16715
|
cornerRadius: borderRadius
|
|
16672
16716
|
}, baseProps),
|
|
16673
16717
|
scatter: Object.assign({
|
|
@@ -16678,11 +16722,14 @@ const clean = {
|
|
|
16678
16722
|
stroke: "transparent",
|
|
16679
16723
|
strokeWidth: 0
|
|
16680
16724
|
},
|
|
16681
|
-
labels:
|
|
16725
|
+
labels: {
|
|
16726
|
+
...baseLabelStyles,
|
|
16727
|
+
padding: 20
|
|
16728
|
+
}
|
|
16682
16729
|
}
|
|
16683
16730
|
}, baseProps),
|
|
16684
16731
|
stack: Object.assign({
|
|
16685
|
-
colorScale
|
|
16732
|
+
colorScale
|
|
16686
16733
|
}, baseProps),
|
|
16687
16734
|
tooltip: {
|
|
16688
16735
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -16690,7 +16737,7 @@ const clean = {
|
|
|
16690
16737
|
pointerEvents: "none"
|
|
16691
16738
|
}),
|
|
16692
16739
|
flyoutStyle: {
|
|
16693
|
-
stroke: gray["
|
|
16740
|
+
stroke: gray["300"],
|
|
16694
16741
|
strokeWidth: 2,
|
|
16695
16742
|
fill: gray.white,
|
|
16696
16743
|
pointerEvents: "none"
|
|
@@ -16707,9 +16754,10 @@ const clean = {
|
|
|
16707
16754
|
voronoi: Object.assign({
|
|
16708
16755
|
style: {
|
|
16709
16756
|
data: {
|
|
16710
|
-
fill:
|
|
16711
|
-
stroke:
|
|
16712
|
-
strokeWidth: 2
|
|
16757
|
+
fill: blue["100"],
|
|
16758
|
+
stroke: blue["500"],
|
|
16759
|
+
strokeWidth: 2,
|
|
16760
|
+
opacity: 0.4
|
|
16713
16761
|
},
|
|
16714
16762
|
labels: Object.assign({}, baseLabelStyles, {
|
|
16715
16763
|
padding: 5,
|
|
@@ -16745,9 +16793,28 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
16745
16793
|
// *
|
|
16746
16794
|
// * Colors
|
|
16747
16795
|
// *
|
|
16748
|
-
const colors =
|
|
16796
|
+
const colors = {
|
|
16797
|
+
blue: "#4F7DA1",
|
|
16798
|
+
pink: "#E2A37F",
|
|
16799
|
+
teal: "#00796B",
|
|
16800
|
+
purple: "#DF948A",
|
|
16801
|
+
green: "#8BC34A",
|
|
16802
|
+
orange: "#F4511E",
|
|
16803
|
+
cyan: "#006064",
|
|
16804
|
+
red: "#DF5A49",
|
|
16805
|
+
yellow: "#FFF59D"
|
|
16806
|
+
};
|
|
16807
|
+
const colorScale = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
|
|
16749
16808
|
const charcoal = "#252525";
|
|
16750
16809
|
const grey = "#969696";
|
|
16810
|
+
const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
|
|
16811
|
+
const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
|
|
16812
|
+
const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
|
|
16813
|
+
const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
|
|
16814
|
+
const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
|
|
16815
|
+
const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
|
|
16816
|
+
const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
|
|
16817
|
+
|
|
16751
16818
|
// *
|
|
16752
16819
|
// * Typography
|
|
16753
16820
|
// *
|
|
@@ -16761,7 +16828,7 @@ const baseProps = {
|
|
|
16761
16828
|
width: 450,
|
|
16762
16829
|
height: 300,
|
|
16763
16830
|
padding: 50,
|
|
16764
|
-
colorScale
|
|
16831
|
+
colorScale
|
|
16765
16832
|
};
|
|
16766
16833
|
// *
|
|
16767
16834
|
// * Labels
|
|
@@ -16783,6 +16850,17 @@ const centeredLabelStyles = Object.assign({
|
|
|
16783
16850
|
const strokeLinecap = "round";
|
|
16784
16851
|
const strokeLinejoin = "round";
|
|
16785
16852
|
const grayscale = {
|
|
16853
|
+
palette: {
|
|
16854
|
+
colors,
|
|
16855
|
+
grayscale: colorScale,
|
|
16856
|
+
qualitative,
|
|
16857
|
+
heatmap,
|
|
16858
|
+
warm,
|
|
16859
|
+
cool,
|
|
16860
|
+
red,
|
|
16861
|
+
green,
|
|
16862
|
+
blue
|
|
16863
|
+
},
|
|
16786
16864
|
area: Object.assign({
|
|
16787
16865
|
style: {
|
|
16788
16866
|
data: {
|
|
@@ -16897,7 +16975,7 @@ const grayscale = {
|
|
|
16897
16975
|
}
|
|
16898
16976
|
}, baseProps),
|
|
16899
16977
|
group: Object.assign({
|
|
16900
|
-
colorScale
|
|
16978
|
+
colorScale
|
|
16901
16979
|
}, baseProps),
|
|
16902
16980
|
histogram: Object.assign({
|
|
16903
16981
|
style: {
|
|
@@ -16910,7 +16988,7 @@ const grayscale = {
|
|
|
16910
16988
|
}
|
|
16911
16989
|
}, baseProps),
|
|
16912
16990
|
legend: {
|
|
16913
|
-
colorScale
|
|
16991
|
+
colorScale,
|
|
16914
16992
|
gutter: 10,
|
|
16915
16993
|
orientation: "vertical",
|
|
16916
16994
|
titleOrientation: "top",
|
|
@@ -16945,7 +17023,7 @@ const grayscale = {
|
|
|
16945
17023
|
padding: 20
|
|
16946
17024
|
})
|
|
16947
17025
|
},
|
|
16948
|
-
colorScale
|
|
17026
|
+
colorScale,
|
|
16949
17027
|
width: 400,
|
|
16950
17028
|
height: 400,
|
|
16951
17029
|
padding: 50
|
|
@@ -16961,7 +17039,7 @@ const grayscale = {
|
|
|
16961
17039
|
}
|
|
16962
17040
|
}, baseProps),
|
|
16963
17041
|
stack: Object.assign({
|
|
16964
|
-
colorScale
|
|
17042
|
+
colorScale
|
|
16965
17043
|
}, baseProps),
|
|
16966
17044
|
tooltip: {
|
|
16967
17045
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -17021,11 +17099,31 @@ const lime300 = "#DCE775";
|
|
|
17021
17099
|
const lightGreen500 = "#8BC34A";
|
|
17022
17100
|
const teal700 = "#00796B";
|
|
17023
17101
|
const cyan900 = "#006064";
|
|
17024
|
-
const
|
|
17102
|
+
const colorScale = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
|
|
17025
17103
|
const blueGrey50 = "#ECEFF1";
|
|
17026
17104
|
const blueGrey300 = "#90A4AE";
|
|
17027
17105
|
const blueGrey700 = "#455A64";
|
|
17028
17106
|
const grey900 = "#212121";
|
|
17107
|
+
const colors = {
|
|
17108
|
+
blue: "#4F7DA1",
|
|
17109
|
+
pink: "#E2A37F",
|
|
17110
|
+
teal: teal700,
|
|
17111
|
+
purple: "#DF948A",
|
|
17112
|
+
green: lightGreen500,
|
|
17113
|
+
orange: deepOrange600,
|
|
17114
|
+
cyan: cyan900,
|
|
17115
|
+
red: "#DF5A49",
|
|
17116
|
+
yellow: yellow200
|
|
17117
|
+
};
|
|
17118
|
+
const grayscale = [blueGrey50, blueGrey300, blueGrey700, grey900];
|
|
17119
|
+
const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
|
|
17120
|
+
const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
|
|
17121
|
+
const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
|
|
17122
|
+
const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
|
|
17123
|
+
const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
|
|
17124
|
+
const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
|
|
17125
|
+
const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
|
|
17126
|
+
|
|
17029
17127
|
// *
|
|
17030
17128
|
// * Typography
|
|
17031
17129
|
// *
|
|
@@ -17063,6 +17161,17 @@ const strokeDasharray = "10, 5";
|
|
|
17063
17161
|
const strokeLinecap = "round";
|
|
17064
17162
|
const strokeLinejoin = "round";
|
|
17065
17163
|
const material = {
|
|
17164
|
+
palette: {
|
|
17165
|
+
colors,
|
|
17166
|
+
grayscale,
|
|
17167
|
+
qualitative,
|
|
17168
|
+
heatmap,
|
|
17169
|
+
warm,
|
|
17170
|
+
cool,
|
|
17171
|
+
red,
|
|
17172
|
+
green,
|
|
17173
|
+
blue
|
|
17174
|
+
},
|
|
17066
17175
|
area: Object.assign({
|
|
17067
17176
|
style: {
|
|
17068
17177
|
data: {
|
|
@@ -17195,7 +17304,7 @@ const material = {
|
|
|
17195
17304
|
}
|
|
17196
17305
|
}, baseProps),
|
|
17197
17306
|
group: Object.assign({
|
|
17198
|
-
colorScale
|
|
17307
|
+
colorScale
|
|
17199
17308
|
}, baseProps),
|
|
17200
17309
|
histogram: Object.assign({
|
|
17201
17310
|
style: {
|
|
@@ -17208,7 +17317,7 @@ const material = {
|
|
|
17208
17317
|
}
|
|
17209
17318
|
}, baseProps),
|
|
17210
17319
|
legend: {
|
|
17211
|
-
colorScale
|
|
17320
|
+
colorScale,
|
|
17212
17321
|
gutter: 10,
|
|
17213
17322
|
orientation: "vertical",
|
|
17214
17323
|
titleOrientation: "top",
|
|
@@ -17234,7 +17343,7 @@ const material = {
|
|
|
17234
17343
|
}
|
|
17235
17344
|
}, baseProps),
|
|
17236
17345
|
pie: Object.assign({
|
|
17237
|
-
colorScale
|
|
17346
|
+
colorScale,
|
|
17238
17347
|
style: {
|
|
17239
17348
|
data: {
|
|
17240
17349
|
padding,
|
|
@@ -17258,7 +17367,7 @@ const material = {
|
|
|
17258
17367
|
}
|
|
17259
17368
|
}, baseProps),
|
|
17260
17369
|
stack: Object.assign({
|
|
17261
|
-
colorScale
|
|
17370
|
+
colorScale
|
|
17262
17371
|
}, baseProps),
|
|
17263
17372
|
tooltip: {
|
|
17264
17373
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -21206,6 +21315,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
21206
21315
|
/* harmony export */ "getColorScale": function() { return /* binding */ getColorScale; },
|
|
21207
21316
|
/* harmony export */ "toTransformString": function() { return /* binding */ toTransformString; }
|
|
21208
21317
|
/* harmony export */ });
|
|
21318
|
+
/* 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");
|
|
21319
|
+
|
|
21320
|
+
|
|
21209
21321
|
/**
|
|
21210
21322
|
* Given an object with CSS/SVG transform definitions, return the string value
|
|
21211
21323
|
* for use with the `transform` CSS property or SVG attribute. Note that we
|
|
@@ -21242,20 +21354,37 @@ const toTransformString = function (obj) {
|
|
|
21242
21354
|
* of 5 hex string values in that color scale. If no 'name' parameter
|
|
21243
21355
|
* is given, it will return the Victory default grayscale.
|
|
21244
21356
|
* @param {String} name The name of the color scale to return (optional).
|
|
21357
|
+
* @param {Object} theme The theme object to retrieve the color scale from (optional).
|
|
21245
21358
|
* @returns {Array} An array of 5 hex string values composing a color scale.
|
|
21246
21359
|
*/
|
|
21247
|
-
function getColorScale(name) {
|
|
21360
|
+
function getColorScale(name, theme) {
|
|
21361
|
+
if (theme === void 0) {
|
|
21362
|
+
theme = _victory_theme_victory_theme__WEBPACK_IMPORTED_MODULE_0__.VictoryTheme.material;
|
|
21363
|
+
}
|
|
21364
|
+
const {
|
|
21365
|
+
palette: {
|
|
21366
|
+
grayscale = ["#cccccc", "#969696", "#636363", "#252525"],
|
|
21367
|
+
qualitative = [],
|
|
21368
|
+
heatmap = [],
|
|
21369
|
+
warm = [],
|
|
21370
|
+
cool = [],
|
|
21371
|
+
red = [],
|
|
21372
|
+
blue = [],
|
|
21373
|
+
green = []
|
|
21374
|
+
} = {}
|
|
21375
|
+
} = theme;
|
|
21248
21376
|
const scales = {
|
|
21249
|
-
grayscale
|
|
21250
|
-
qualitative
|
|
21251
|
-
heatmap
|
|
21252
|
-
warm
|
|
21253
|
-
cool
|
|
21254
|
-
red
|
|
21255
|
-
blue
|
|
21256
|
-
green
|
|
21377
|
+
grayscale,
|
|
21378
|
+
qualitative,
|
|
21379
|
+
heatmap,
|
|
21380
|
+
warm,
|
|
21381
|
+
cool,
|
|
21382
|
+
red,
|
|
21383
|
+
blue,
|
|
21384
|
+
green
|
|
21257
21385
|
};
|
|
21258
|
-
|
|
21386
|
+
const selectedScale = name && scales[name]?.length ? scales[name] : scales.grayscale;
|
|
21387
|
+
return selectedScale;
|
|
21259
21388
|
}
|
|
21260
21389
|
|
|
21261
21390
|
/***/ }),
|
|
@@ -22497,7 +22626,9 @@ function getAllEvents(props) {
|
|
|
22497
22626
|
}
|
|
22498
22627
|
return events || [];
|
|
22499
22628
|
}
|
|
22500
|
-
|
|
22629
|
+
|
|
22630
|
+
// eslint-disable-next-line max-params
|
|
22631
|
+
function getColor(calculatedProps, child, index, theme) {
|
|
22501
22632
|
// check for styles first
|
|
22502
22633
|
const {
|
|
22503
22634
|
style
|
|
@@ -22514,14 +22645,16 @@ function getColor(calculatedProps, child, index) {
|
|
|
22514
22645
|
if (!colorScale && !color) {
|
|
22515
22646
|
return undefined;
|
|
22516
22647
|
}
|
|
22517
|
-
const colors = Array.isArray(colorScale) ? colorScale : _style__WEBPACK_IMPORTED_MODULE_13__.getColorScale(colorScale);
|
|
22648
|
+
const colors = Array.isArray(colorScale) ? colorScale : _style__WEBPACK_IMPORTED_MODULE_13__.getColorScale(colorScale, theme);
|
|
22518
22649
|
return color || colors[index % colors.length];
|
|
22519
22650
|
}
|
|
22520
22651
|
function getStyle(theme, style, role) {
|
|
22521
22652
|
const defaultStyle = theme && theme[role] && theme[role].style ? theme[role].style : {};
|
|
22522
22653
|
return _helpers__WEBPACK_IMPORTED_MODULE_7__.getStyles(style, defaultStyle);
|
|
22523
22654
|
}
|
|
22524
|
-
|
|
22655
|
+
|
|
22656
|
+
// eslint-disable-next-line max-params
|
|
22657
|
+
function getChildStyle(child, index, calculatedProps, theme) {
|
|
22525
22658
|
const {
|
|
22526
22659
|
style,
|
|
22527
22660
|
role
|
|
@@ -22531,7 +22664,7 @@ function getChildStyle(child, index, calculatedProps) {
|
|
|
22531
22664
|
return childStyle;
|
|
22532
22665
|
}
|
|
22533
22666
|
const childRole = child.type && child.type.role;
|
|
22534
|
-
const defaultFill = childRole === "stack" ? undefined : getColor(calculatedProps, child, index);
|
|
22667
|
+
const defaultFill = childRole === "stack" ? undefined : getColor(calculatedProps, child, index, theme);
|
|
22535
22668
|
const defaultColor = childRole === "line" ? {
|
|
22536
22669
|
fill: "none",
|
|
22537
22670
|
stroke: defaultFill
|
|
@@ -23851,14 +23984,15 @@ function getChildren(initialProps, childComponents, calculatedProps) {
|
|
|
23851
23984
|
} = newCalculatedProps;
|
|
23852
23985
|
const {
|
|
23853
23986
|
labelComponent,
|
|
23854
|
-
polar
|
|
23987
|
+
polar,
|
|
23988
|
+
theme
|
|
23855
23989
|
} = props;
|
|
23856
23990
|
const childProps = getChildProps(props, newCalculatedProps);
|
|
23857
23991
|
const parentName = props.name || "group";
|
|
23858
23992
|
return children.map((child, index) => {
|
|
23859
23993
|
const role = child.type && child.type.role;
|
|
23860
23994
|
const xOffset = polar ? getPolarX0(props, newCalculatedProps, index, role) : getX0(props, newCalculatedProps, index, role);
|
|
23861
|
-
const style = role === "voronoi" || role === "tooltip" || role === "label" ? child.props.style : victory_core__WEBPACK_IMPORTED_MODULE_3__.getChildStyle(child, index, newCalculatedProps);
|
|
23995
|
+
const style = role === "voronoi" || role === "tooltip" || role === "label" ? child.props.style : victory_core__WEBPACK_IMPORTED_MODULE_3__.getChildStyle(child, index, newCalculatedProps, theme);
|
|
23862
23996
|
const labels = props.labels ? getLabels(props, datasets, index) : child.props.labels;
|
|
23863
23997
|
const name = child.props.name || `${parentName}-${role}-${index}`;
|
|
23864
23998
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(child, Object.assign({
|
|
@@ -24498,9 +24632,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
24498
24632
|
|
|
24499
24633
|
const getColorScale = props => {
|
|
24500
24634
|
const {
|
|
24501
|
-
colorScale
|
|
24635
|
+
colorScale,
|
|
24636
|
+
theme
|
|
24502
24637
|
} = props;
|
|
24503
|
-
return typeof colorScale === "string" ? victory_core__WEBPACK_IMPORTED_MODULE_3__.getColorScale(colorScale) : colorScale || [];
|
|
24638
|
+
return typeof colorScale === "string" ? victory_core__WEBPACK_IMPORTED_MODULE_3__.getColorScale(colorScale, theme) : colorScale || [];
|
|
24504
24639
|
};
|
|
24505
24640
|
const getLabelStyles = props => {
|
|
24506
24641
|
const {
|
|
@@ -25362,11 +25497,12 @@ const getSlices = (props, data) => {
|
|
|
25362
25497
|
};
|
|
25363
25498
|
const getCalculatedValues = props => {
|
|
25364
25499
|
const {
|
|
25365
|
-
colorScale
|
|
25500
|
+
colorScale,
|
|
25501
|
+
theme
|
|
25366
25502
|
} = props;
|
|
25367
25503
|
const styleObject = victory_core__WEBPACK_IMPORTED_MODULE_3__.getDefaultStyles(props, "pie");
|
|
25368
25504
|
const style = victory_core__WEBPACK_IMPORTED_MODULE_3__.getStyles(props.style, styleObject);
|
|
25369
|
-
const colors = Array.isArray(colorScale) ? colorScale : victory_core__WEBPACK_IMPORTED_MODULE_4__.getColorScale(colorScale);
|
|
25505
|
+
const colors = Array.isArray(colorScale) ? colorScale : victory_core__WEBPACK_IMPORTED_MODULE_4__.getColorScale(colorScale, theme);
|
|
25370
25506
|
const padding = victory_core__WEBPACK_IMPORTED_MODULE_3__.getPadding(props);
|
|
25371
25507
|
const defaultRadius = getRadius(props, padding);
|
|
25372
25508
|
const origin = getOrigin(props, padding);
|
|
@@ -27701,10 +27837,13 @@ function getChildren(initialProps, childComponents, calculatedProps) {
|
|
|
27701
27837
|
} = newCalculatedProps;
|
|
27702
27838
|
const childProps = getChildProps(props, newCalculatedProps);
|
|
27703
27839
|
const parentName = props.name || "stack";
|
|
27840
|
+
const {
|
|
27841
|
+
theme
|
|
27842
|
+
} = props;
|
|
27704
27843
|
return children.map((child, index) => {
|
|
27705
27844
|
const role = child.type && child.type.role;
|
|
27706
27845
|
const data = datasets[index];
|
|
27707
|
-
const style = victory_core__WEBPACK_IMPORTED_MODULE_3__.getChildStyle(child, index, newCalculatedProps);
|
|
27846
|
+
const style = victory_core__WEBPACK_IMPORTED_MODULE_3__.getChildStyle(child, index, newCalculatedProps, theme);
|
|
27708
27847
|
const labels = props.labels ? getLabels(props, datasets, index) : child.props.labels;
|
|
27709
27848
|
const name = child.props.name || `${parentName}-${role}-${index}`;
|
|
27710
27849
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(child, Object.assign({
|
|
@@ -29438,6 +29577,7 @@ class VoronoiHelpersClass {
|
|
|
29438
29577
|
}
|
|
29439
29578
|
}
|
|
29440
29579
|
onMouseLeave = (evt, targetProps) => {
|
|
29580
|
+
this.onMouseMove.cancel();
|
|
29441
29581
|
const activePoints = targetProps.activePoints || [];
|
|
29442
29582
|
this.onDeactivated(targetProps, activePoints);
|
|
29443
29583
|
const inactiveMutations = activePoints.length ? activePoints.map(point => this.getInactiveMutations(targetProps, point)) : [];
|