victory 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.js +307 -175
- package/dist/victory.min.js +1 -1
- package/package.json +28 -28
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] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(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
|
}, []);
|
|
@@ -16344,20 +16347,16 @@ const orange = {
|
|
|
16344
16347
|
"100": "#FEE2D5",
|
|
16345
16348
|
"300": "#FFA981",
|
|
16346
16349
|
"500": "#FF6F2C",
|
|
16350
|
+
"700": "#FF4E1B",
|
|
16347
16351
|
"900": "#D74D26"
|
|
16348
16352
|
};
|
|
16349
16353
|
const red = {
|
|
16350
16354
|
"100": "#FFDCE5",
|
|
16351
16355
|
"300": "#FF9EB7",
|
|
16352
16356
|
"500": "#F82B60",
|
|
16357
|
+
"700": "#D31A3D",
|
|
16353
16358
|
"900": "#BA1E45"
|
|
16354
16359
|
};
|
|
16355
|
-
const pink = {
|
|
16356
|
-
"100": "#FFDAF6",
|
|
16357
|
-
"300": "#F99DE2",
|
|
16358
|
-
"500": "#FF08C2",
|
|
16359
|
-
"900": "#B2158B"
|
|
16360
|
-
};
|
|
16361
16360
|
const purple = {
|
|
16362
16361
|
"100": "#EDE3FE",
|
|
16363
16362
|
"300": "#CDB0FF",
|
|
@@ -16368,6 +16367,7 @@ const blue = {
|
|
|
16368
16367
|
"100": "#CFDFFF",
|
|
16369
16368
|
"300": "#9CC7FF",
|
|
16370
16369
|
"500": "#2D7FF9",
|
|
16370
|
+
"700": "#0056B3",
|
|
16371
16371
|
"900": "#2750AE"
|
|
16372
16372
|
};
|
|
16373
16373
|
const cyan = {
|
|
@@ -16386,9 +16386,29 @@ const green = {
|
|
|
16386
16386
|
"100": "#D1F7C4",
|
|
16387
16387
|
"300": "#93E088",
|
|
16388
16388
|
"500": "#20C933",
|
|
16389
|
+
"700": "#1B9B2A",
|
|
16389
16390
|
"900": "#338A17"
|
|
16390
16391
|
};
|
|
16391
|
-
const colors =
|
|
16392
|
+
const colors = {
|
|
16393
|
+
blue: blue["500"],
|
|
16394
|
+
cyan: cyan["500"],
|
|
16395
|
+
green: green["500"],
|
|
16396
|
+
yellow: yellow["500"],
|
|
16397
|
+
orange: orange["500"],
|
|
16398
|
+
red: red["500"],
|
|
16399
|
+
purple: purple["500"],
|
|
16400
|
+
teal: teal["500"]
|
|
16401
|
+
};
|
|
16402
|
+
const colorScale = Object.values(colors);
|
|
16403
|
+
const grayscale = [gray["100"], gray["300"], gray["500"], gray["700"], gray["900"]];
|
|
16404
|
+
const warm = [yellow["300"], yellow["500"], orange["500"], orange["900"], red["500"]];
|
|
16405
|
+
const cool = [purple["500"], blue["500"], cyan["500"], teal["500"], green["500"]];
|
|
16406
|
+
const heatmap = [green["900"], green["500"], yellow["500"], orange["500"], red["500"]];
|
|
16407
|
+
const redPalette = Object.values(red);
|
|
16408
|
+
const greenPalette = Object.values(green);
|
|
16409
|
+
const bluePalette = Object.values(blue);
|
|
16410
|
+
const defaultColor = blue["500"];
|
|
16411
|
+
|
|
16392
16412
|
// *
|
|
16393
16413
|
// * Typography
|
|
16394
16414
|
// *
|
|
@@ -16402,8 +16422,8 @@ const padding = 8;
|
|
|
16402
16422
|
const baseProps = {
|
|
16403
16423
|
width: 450,
|
|
16404
16424
|
height: 300,
|
|
16405
|
-
padding:
|
|
16406
|
-
colorScale
|
|
16425
|
+
padding: 60,
|
|
16426
|
+
colorScale
|
|
16407
16427
|
};
|
|
16408
16428
|
// *
|
|
16409
16429
|
// * Labels
|
|
@@ -16432,10 +16452,23 @@ const borderRadius = 1;
|
|
|
16432
16452
|
// * Theme
|
|
16433
16453
|
// *
|
|
16434
16454
|
const clean = {
|
|
16455
|
+
palette: {
|
|
16456
|
+
colors,
|
|
16457
|
+
grayscale,
|
|
16458
|
+
qualitative: colorScale,
|
|
16459
|
+
heatmap,
|
|
16460
|
+
warm,
|
|
16461
|
+
cool,
|
|
16462
|
+
red: redPalette,
|
|
16463
|
+
green: greenPalette,
|
|
16464
|
+
blue: bluePalette
|
|
16465
|
+
},
|
|
16435
16466
|
area: Object.assign({
|
|
16436
16467
|
style: {
|
|
16437
16468
|
data: {
|
|
16438
|
-
fill:
|
|
16469
|
+
fill: defaultColor,
|
|
16470
|
+
strokeWidth: 2,
|
|
16471
|
+
fillOpacity: 0.5
|
|
16439
16472
|
},
|
|
16440
16473
|
labels: baseLabelStyles
|
|
16441
16474
|
}
|
|
@@ -16444,13 +16477,13 @@ const clean = {
|
|
|
16444
16477
|
style: {
|
|
16445
16478
|
axis: {
|
|
16446
16479
|
fill: "transparent",
|
|
16447
|
-
stroke: gray["
|
|
16480
|
+
stroke: gray["500"],
|
|
16448
16481
|
strokeWidth: 1,
|
|
16449
16482
|
strokeLinecap,
|
|
16450
16483
|
strokeLinejoin
|
|
16451
16484
|
},
|
|
16452
16485
|
axisLabel: Object.assign({}, centeredLabelStyles, {
|
|
16453
|
-
padding,
|
|
16486
|
+
padding: 35,
|
|
16454
16487
|
stroke: "transparent"
|
|
16455
16488
|
}),
|
|
16456
16489
|
grid: {
|
|
@@ -16469,10 +16502,10 @@ const clean = {
|
|
|
16469
16502
|
polarAxis: Object.assign({
|
|
16470
16503
|
style: {
|
|
16471
16504
|
axis: {
|
|
16472
|
-
stroke: gray["
|
|
16505
|
+
stroke: gray["500"]
|
|
16473
16506
|
},
|
|
16474
16507
|
grid: {
|
|
16475
|
-
stroke: gray["
|
|
16508
|
+
stroke: gray["400"],
|
|
16476
16509
|
strokeDasharray,
|
|
16477
16510
|
strokeLinecap,
|
|
16478
16511
|
strokeLinejoin,
|
|
@@ -16481,7 +16514,7 @@ const clean = {
|
|
|
16481
16514
|
ticks: {
|
|
16482
16515
|
fill: "transparent",
|
|
16483
16516
|
size: 5,
|
|
16484
|
-
stroke: gray["
|
|
16517
|
+
stroke: gray["400"],
|
|
16485
16518
|
strokeWidth: 1,
|
|
16486
16519
|
strokeLinecap,
|
|
16487
16520
|
strokeLinejoin
|
|
@@ -16492,10 +16525,10 @@ const clean = {
|
|
|
16492
16525
|
polarDependentAxis: Object.assign({
|
|
16493
16526
|
style: {
|
|
16494
16527
|
axis: {
|
|
16495
|
-
stroke: gray["
|
|
16528
|
+
stroke: gray["500"]
|
|
16496
16529
|
},
|
|
16497
16530
|
grid: {
|
|
16498
|
-
stroke: gray["
|
|
16531
|
+
stroke: gray["400"],
|
|
16499
16532
|
strokeDasharray,
|
|
16500
16533
|
strokeLinecap,
|
|
16501
16534
|
strokeLinejoin,
|
|
@@ -16504,7 +16537,7 @@ const clean = {
|
|
|
16504
16537
|
ticks: {
|
|
16505
16538
|
fill: "transparent",
|
|
16506
16539
|
size: 5,
|
|
16507
|
-
stroke: gray["
|
|
16540
|
+
stroke: gray["300"],
|
|
16508
16541
|
strokeWidth: 1,
|
|
16509
16542
|
strokeLinecap,
|
|
16510
16543
|
strokeLinejoin
|
|
@@ -16515,9 +16548,10 @@ const clean = {
|
|
|
16515
16548
|
bar: Object.assign({
|
|
16516
16549
|
style: {
|
|
16517
16550
|
data: {
|
|
16518
|
-
fill:
|
|
16551
|
+
fill: defaultColor,
|
|
16519
16552
|
padding,
|
|
16520
|
-
strokeWidth:
|
|
16553
|
+
strokeWidth: 1,
|
|
16554
|
+
fillOpacity: 0.5
|
|
16521
16555
|
},
|
|
16522
16556
|
labels: baseLabelStyles
|
|
16523
16557
|
},
|
|
@@ -16553,15 +16587,16 @@ const clean = {
|
|
|
16553
16587
|
}),
|
|
16554
16588
|
q1: {
|
|
16555
16589
|
padding,
|
|
16556
|
-
fill:
|
|
16557
|
-
rx: borderRadius
|
|
16590
|
+
fill: colorScale[0],
|
|
16591
|
+
rx: borderRadius,
|
|
16592
|
+
strokeWidth: 2
|
|
16558
16593
|
},
|
|
16559
16594
|
q1Labels: Object.assign({}, baseLabelStyles, {
|
|
16560
16595
|
padding: 3
|
|
16561
16596
|
}),
|
|
16562
16597
|
q3: {
|
|
16563
16598
|
padding,
|
|
16564
|
-
fill:
|
|
16599
|
+
fill: colorScale[1],
|
|
16565
16600
|
rx: borderRadius
|
|
16566
16601
|
},
|
|
16567
16602
|
q3Labels: Object.assign({}, baseLabelStyles, {
|
|
@@ -16582,8 +16617,8 @@ const clean = {
|
|
|
16582
16617
|
})
|
|
16583
16618
|
},
|
|
16584
16619
|
candleColors: {
|
|
16585
|
-
positive:
|
|
16586
|
-
negative:
|
|
16620
|
+
positive: green["500"],
|
|
16621
|
+
negative: red["500"]
|
|
16587
16622
|
},
|
|
16588
16623
|
wickStrokeWidth: 2
|
|
16589
16624
|
}, baseProps),
|
|
@@ -16602,14 +16637,13 @@ const clean = {
|
|
|
16602
16637
|
}
|
|
16603
16638
|
}, baseProps),
|
|
16604
16639
|
group: Object.assign({
|
|
16605
|
-
colorScale
|
|
16640
|
+
colorScale
|
|
16606
16641
|
}, baseProps),
|
|
16607
16642
|
histogram: Object.assign({
|
|
16608
16643
|
style: {
|
|
16609
16644
|
data: {
|
|
16610
16645
|
fill: cyan["500"],
|
|
16611
|
-
|
|
16612
|
-
strokeWidth: 0
|
|
16646
|
+
fillOpacity: 0.5
|
|
16613
16647
|
},
|
|
16614
16648
|
labels: baseLabelStyles
|
|
16615
16649
|
},
|
|
@@ -16620,21 +16654,23 @@ const clean = {
|
|
|
16620
16654
|
}, baseProps),
|
|
16621
16655
|
label: baseLabelStyles,
|
|
16622
16656
|
legend: {
|
|
16623
|
-
colorScale
|
|
16624
|
-
gutter:
|
|
16625
|
-
|
|
16657
|
+
colorScale,
|
|
16658
|
+
gutter: 24,
|
|
16659
|
+
borderPadding: 10,
|
|
16660
|
+
orientation: "horizontal",
|
|
16626
16661
|
titleOrientation: "top",
|
|
16662
|
+
centerTitle: true,
|
|
16627
16663
|
style: {
|
|
16628
16664
|
data: {
|
|
16629
16665
|
type: "circle"
|
|
16630
16666
|
},
|
|
16631
16667
|
labels: {
|
|
16632
16668
|
...baseLabelStyles,
|
|
16633
|
-
fontSize:
|
|
16669
|
+
fontSize: 12
|
|
16634
16670
|
},
|
|
16635
16671
|
title: Object.assign({}, baseLabelStyles, {
|
|
16636
16672
|
padding,
|
|
16637
|
-
fontSize:
|
|
16673
|
+
fontSize: 16
|
|
16638
16674
|
}),
|
|
16639
16675
|
border: {
|
|
16640
16676
|
stroke: gray["200"],
|
|
@@ -16648,7 +16684,7 @@ const clean = {
|
|
|
16648
16684
|
data: {
|
|
16649
16685
|
fill: "transparent",
|
|
16650
16686
|
opacity: 1,
|
|
16651
|
-
stroke:
|
|
16687
|
+
stroke: defaultColor,
|
|
16652
16688
|
strokeWidth: 2,
|
|
16653
16689
|
strokeLinecap,
|
|
16654
16690
|
strokeLinejoin
|
|
@@ -16658,31 +16694,40 @@ const clean = {
|
|
|
16658
16694
|
}, baseProps),
|
|
16659
16695
|
pie: Object.assign({
|
|
16660
16696
|
style: {
|
|
16697
|
+
parent: {
|
|
16698
|
+
backgroundColor: gray.white
|
|
16699
|
+
},
|
|
16661
16700
|
data: {
|
|
16662
16701
|
padding,
|
|
16663
16702
|
stroke: gray.white,
|
|
16664
16703
|
strokeWidth: 1
|
|
16665
16704
|
},
|
|
16666
|
-
labels:
|
|
16667
|
-
|
|
16668
|
-
|
|
16705
|
+
labels: {
|
|
16706
|
+
...baseLabelStyles,
|
|
16707
|
+
padding: 20,
|
|
16708
|
+
fill: gray["600"],
|
|
16709
|
+
fontSize: 10
|
|
16710
|
+
}
|
|
16669
16711
|
},
|
|
16670
|
-
colorScale
|
|
16712
|
+
colorScale,
|
|
16671
16713
|
cornerRadius: borderRadius
|
|
16672
16714
|
}, baseProps),
|
|
16673
16715
|
scatter: Object.assign({
|
|
16674
16716
|
style: {
|
|
16675
16717
|
data: {
|
|
16676
|
-
fill:
|
|
16718
|
+
fill: defaultColor,
|
|
16677
16719
|
opacity: 1,
|
|
16678
16720
|
stroke: "transparent",
|
|
16679
16721
|
strokeWidth: 0
|
|
16680
16722
|
},
|
|
16681
|
-
labels:
|
|
16723
|
+
labels: {
|
|
16724
|
+
...baseLabelStyles,
|
|
16725
|
+
padding: 20
|
|
16726
|
+
}
|
|
16682
16727
|
}
|
|
16683
16728
|
}, baseProps),
|
|
16684
16729
|
stack: Object.assign({
|
|
16685
|
-
colorScale
|
|
16730
|
+
colorScale
|
|
16686
16731
|
}, baseProps),
|
|
16687
16732
|
tooltip: {
|
|
16688
16733
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -16690,7 +16735,7 @@ const clean = {
|
|
|
16690
16735
|
pointerEvents: "none"
|
|
16691
16736
|
}),
|
|
16692
16737
|
flyoutStyle: {
|
|
16693
|
-
stroke: gray["
|
|
16738
|
+
stroke: gray["300"],
|
|
16694
16739
|
strokeWidth: 2,
|
|
16695
16740
|
fill: gray.white,
|
|
16696
16741
|
pointerEvents: "none"
|
|
@@ -16707,8 +16752,8 @@ const clean = {
|
|
|
16707
16752
|
voronoi: Object.assign({
|
|
16708
16753
|
style: {
|
|
16709
16754
|
data: {
|
|
16710
|
-
fill:
|
|
16711
|
-
stroke:
|
|
16755
|
+
fill: blue["100"],
|
|
16756
|
+
stroke: defaultColor,
|
|
16712
16757
|
strokeWidth: 2
|
|
16713
16758
|
},
|
|
16714
16759
|
labels: Object.assign({}, baseLabelStyles, {
|
|
@@ -16745,9 +16790,28 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
16745
16790
|
// *
|
|
16746
16791
|
// * Colors
|
|
16747
16792
|
// *
|
|
16748
|
-
const colors =
|
|
16793
|
+
const colors = {
|
|
16794
|
+
blue: "#4F7DA1",
|
|
16795
|
+
pink: "#E2A37F",
|
|
16796
|
+
teal: "#00796B",
|
|
16797
|
+
purple: "#DF948A",
|
|
16798
|
+
green: "#8BC34A",
|
|
16799
|
+
orange: "#F4511E",
|
|
16800
|
+
cyan: "#006064",
|
|
16801
|
+
red: "#DF5A49",
|
|
16802
|
+
yellow: "#FFF59D"
|
|
16803
|
+
};
|
|
16804
|
+
const colorScale = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
|
|
16749
16805
|
const charcoal = "#252525";
|
|
16750
16806
|
const grey = "#969696";
|
|
16807
|
+
const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
|
|
16808
|
+
const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
|
|
16809
|
+
const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
|
|
16810
|
+
const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
|
|
16811
|
+
const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
|
|
16812
|
+
const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
|
|
16813
|
+
const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
|
|
16814
|
+
|
|
16751
16815
|
// *
|
|
16752
16816
|
// * Typography
|
|
16753
16817
|
// *
|
|
@@ -16761,7 +16825,7 @@ const baseProps = {
|
|
|
16761
16825
|
width: 450,
|
|
16762
16826
|
height: 300,
|
|
16763
16827
|
padding: 50,
|
|
16764
|
-
colorScale
|
|
16828
|
+
colorScale
|
|
16765
16829
|
};
|
|
16766
16830
|
// *
|
|
16767
16831
|
// * Labels
|
|
@@ -16783,6 +16847,17 @@ const centeredLabelStyles = Object.assign({
|
|
|
16783
16847
|
const strokeLinecap = "round";
|
|
16784
16848
|
const strokeLinejoin = "round";
|
|
16785
16849
|
const grayscale = {
|
|
16850
|
+
palette: {
|
|
16851
|
+
colors,
|
|
16852
|
+
grayscale: colorScale,
|
|
16853
|
+
qualitative,
|
|
16854
|
+
heatmap,
|
|
16855
|
+
warm,
|
|
16856
|
+
cool,
|
|
16857
|
+
red,
|
|
16858
|
+
green,
|
|
16859
|
+
blue
|
|
16860
|
+
},
|
|
16786
16861
|
area: Object.assign({
|
|
16787
16862
|
style: {
|
|
16788
16863
|
data: {
|
|
@@ -16897,7 +16972,7 @@ const grayscale = {
|
|
|
16897
16972
|
}
|
|
16898
16973
|
}, baseProps),
|
|
16899
16974
|
group: Object.assign({
|
|
16900
|
-
colorScale
|
|
16975
|
+
colorScale
|
|
16901
16976
|
}, baseProps),
|
|
16902
16977
|
histogram: Object.assign({
|
|
16903
16978
|
style: {
|
|
@@ -16910,7 +16985,7 @@ const grayscale = {
|
|
|
16910
16985
|
}
|
|
16911
16986
|
}, baseProps),
|
|
16912
16987
|
legend: {
|
|
16913
|
-
colorScale
|
|
16988
|
+
colorScale,
|
|
16914
16989
|
gutter: 10,
|
|
16915
16990
|
orientation: "vertical",
|
|
16916
16991
|
titleOrientation: "top",
|
|
@@ -16945,7 +17020,7 @@ const grayscale = {
|
|
|
16945
17020
|
padding: 20
|
|
16946
17021
|
})
|
|
16947
17022
|
},
|
|
16948
|
-
colorScale
|
|
17023
|
+
colorScale,
|
|
16949
17024
|
width: 400,
|
|
16950
17025
|
height: 400,
|
|
16951
17026
|
padding: 50
|
|
@@ -16961,7 +17036,7 @@ const grayscale = {
|
|
|
16961
17036
|
}
|
|
16962
17037
|
}, baseProps),
|
|
16963
17038
|
stack: Object.assign({
|
|
16964
|
-
colorScale
|
|
17039
|
+
colorScale
|
|
16965
17040
|
}, baseProps),
|
|
16966
17041
|
tooltip: {
|
|
16967
17042
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -17021,11 +17096,31 @@ const lime300 = "#DCE775";
|
|
|
17021
17096
|
const lightGreen500 = "#8BC34A";
|
|
17022
17097
|
const teal700 = "#00796B";
|
|
17023
17098
|
const cyan900 = "#006064";
|
|
17024
|
-
const
|
|
17099
|
+
const colorScale = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
|
|
17025
17100
|
const blueGrey50 = "#ECEFF1";
|
|
17026
17101
|
const blueGrey300 = "#90A4AE";
|
|
17027
17102
|
const blueGrey700 = "#455A64";
|
|
17028
17103
|
const grey900 = "#212121";
|
|
17104
|
+
const colors = {
|
|
17105
|
+
blue: "#4F7DA1",
|
|
17106
|
+
pink: "#E2A37F",
|
|
17107
|
+
teal: teal700,
|
|
17108
|
+
purple: "#DF948A",
|
|
17109
|
+
green: lightGreen500,
|
|
17110
|
+
orange: deepOrange600,
|
|
17111
|
+
cyan: cyan900,
|
|
17112
|
+
red: "#DF5A49",
|
|
17113
|
+
yellow: yellow200
|
|
17114
|
+
};
|
|
17115
|
+
const grayscale = [blueGrey50, blueGrey300, blueGrey700, grey900];
|
|
17116
|
+
const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
|
|
17117
|
+
const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
|
|
17118
|
+
const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
|
|
17119
|
+
const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
|
|
17120
|
+
const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
|
|
17121
|
+
const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
|
|
17122
|
+
const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
|
|
17123
|
+
|
|
17029
17124
|
// *
|
|
17030
17125
|
// * Typography
|
|
17031
17126
|
// *
|
|
@@ -17063,6 +17158,17 @@ const strokeDasharray = "10, 5";
|
|
|
17063
17158
|
const strokeLinecap = "round";
|
|
17064
17159
|
const strokeLinejoin = "round";
|
|
17065
17160
|
const material = {
|
|
17161
|
+
palette: {
|
|
17162
|
+
colors,
|
|
17163
|
+
grayscale,
|
|
17164
|
+
qualitative,
|
|
17165
|
+
heatmap,
|
|
17166
|
+
warm,
|
|
17167
|
+
cool,
|
|
17168
|
+
red,
|
|
17169
|
+
green,
|
|
17170
|
+
blue
|
|
17171
|
+
},
|
|
17066
17172
|
area: Object.assign({
|
|
17067
17173
|
style: {
|
|
17068
17174
|
data: {
|
|
@@ -17195,7 +17301,7 @@ const material = {
|
|
|
17195
17301
|
}
|
|
17196
17302
|
}, baseProps),
|
|
17197
17303
|
group: Object.assign({
|
|
17198
|
-
colorScale
|
|
17304
|
+
colorScale
|
|
17199
17305
|
}, baseProps),
|
|
17200
17306
|
histogram: Object.assign({
|
|
17201
17307
|
style: {
|
|
@@ -17208,7 +17314,7 @@ const material = {
|
|
|
17208
17314
|
}
|
|
17209
17315
|
}, baseProps),
|
|
17210
17316
|
legend: {
|
|
17211
|
-
colorScale
|
|
17317
|
+
colorScale,
|
|
17212
17318
|
gutter: 10,
|
|
17213
17319
|
orientation: "vertical",
|
|
17214
17320
|
titleOrientation: "top",
|
|
@@ -17234,7 +17340,7 @@ const material = {
|
|
|
17234
17340
|
}
|
|
17235
17341
|
}, baseProps),
|
|
17236
17342
|
pie: Object.assign({
|
|
17237
|
-
colorScale
|
|
17343
|
+
colorScale,
|
|
17238
17344
|
style: {
|
|
17239
17345
|
data: {
|
|
17240
17346
|
padding,
|
|
@@ -17258,7 +17364,7 @@ const material = {
|
|
|
17258
17364
|
}
|
|
17259
17365
|
}, baseProps),
|
|
17260
17366
|
stack: Object.assign({
|
|
17261
|
-
colorScale
|
|
17367
|
+
colorScale
|
|
17262
17368
|
}, baseProps),
|
|
17263
17369
|
tooltip: {
|
|
17264
17370
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -21206,6 +21312,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
21206
21312
|
/* harmony export */ "getColorScale": function() { return /* binding */ getColorScale; },
|
|
21207
21313
|
/* harmony export */ "toTransformString": function() { return /* binding */ toTransformString; }
|
|
21208
21314
|
/* harmony export */ });
|
|
21315
|
+
/* 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");
|
|
21316
|
+
|
|
21317
|
+
|
|
21209
21318
|
/**
|
|
21210
21319
|
* Given an object with CSS/SVG transform definitions, return the string value
|
|
21211
21320
|
* for use with the `transform` CSS property or SVG attribute. Note that we
|
|
@@ -21242,20 +21351,37 @@ const toTransformString = function (obj) {
|
|
|
21242
21351
|
* of 5 hex string values in that color scale. If no 'name' parameter
|
|
21243
21352
|
* is given, it will return the Victory default grayscale.
|
|
21244
21353
|
* @param {String} name The name of the color scale to return (optional).
|
|
21354
|
+
* @param {Object} theme The theme object to retrieve the color scale from (optional).
|
|
21245
21355
|
* @returns {Array} An array of 5 hex string values composing a color scale.
|
|
21246
21356
|
*/
|
|
21247
|
-
function getColorScale(name) {
|
|
21357
|
+
function getColorScale(name, theme) {
|
|
21358
|
+
if (theme === void 0) {
|
|
21359
|
+
theme = _victory_theme_victory_theme__WEBPACK_IMPORTED_MODULE_0__.VictoryTheme.material;
|
|
21360
|
+
}
|
|
21361
|
+
const {
|
|
21362
|
+
palette: {
|
|
21363
|
+
grayscale = ["#cccccc", "#969696", "#636363", "#252525"],
|
|
21364
|
+
qualitative = [],
|
|
21365
|
+
heatmap = [],
|
|
21366
|
+
warm = [],
|
|
21367
|
+
cool = [],
|
|
21368
|
+
red = [],
|
|
21369
|
+
blue = [],
|
|
21370
|
+
green = []
|
|
21371
|
+
} = {}
|
|
21372
|
+
} = theme;
|
|
21248
21373
|
const scales = {
|
|
21249
|
-
grayscale
|
|
21250
|
-
qualitative
|
|
21251
|
-
heatmap
|
|
21252
|
-
warm
|
|
21253
|
-
cool
|
|
21254
|
-
red
|
|
21255
|
-
blue
|
|
21256
|
-
green
|
|
21374
|
+
grayscale,
|
|
21375
|
+
qualitative,
|
|
21376
|
+
heatmap,
|
|
21377
|
+
warm,
|
|
21378
|
+
cool,
|
|
21379
|
+
red,
|
|
21380
|
+
blue,
|
|
21381
|
+
green
|
|
21257
21382
|
};
|
|
21258
|
-
|
|
21383
|
+
const selectedScale = name && scales[name]?.length ? scales[name] : scales.grayscale;
|
|
21384
|
+
return selectedScale;
|
|
21259
21385
|
}
|
|
21260
21386
|
|
|
21261
21387
|
/***/ }),
|
|
@@ -22214,34 +22340,31 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22214
22340
|
/* harmony export */ "getDomain": function() { return /* binding */ getDomain; },
|
|
22215
22341
|
/* harmony export */ "getDomainFromChildren": function() { return /* binding */ getDomainFromChildren; },
|
|
22216
22342
|
/* harmony export */ "getScale": function() { return /* binding */ getScale; },
|
|
22217
|
-
/* harmony export */ "getStringsFromCategories": function() { return /* binding */ getStringsFromCategories; },
|
|
22218
22343
|
/* harmony export */ "getStringsFromChildren": function() { return /* binding */ getStringsFromChildren; },
|
|
22344
|
+
/* harmony export */ "getStringsFromChildrenCategories": function() { return /* binding */ getStringsFromChildrenCategories; },
|
|
22219
22345
|
/* harmony export */ "getStringsFromData": function() { return /* binding */ getStringsFromData; },
|
|
22220
22346
|
/* harmony export */ "getStyle": function() { return /* binding */ getStyle; },
|
|
22221
22347
|
/* harmony export */ "getWidth": function() { return /* binding */ getWidth; }
|
|
22222
22348
|
/* harmony export */ });
|
|
22223
|
-
/* harmony import */ var
|
|
22224
|
-
/* harmony import */ var
|
|
22225
|
-
/* harmony import */ var
|
|
22226
|
-
/* harmony import */ var
|
|
22227
|
-
/* harmony import */ var
|
|
22228
|
-
/* harmony import */ var
|
|
22229
|
-
/* harmony import */ var
|
|
22230
|
-
/* harmony import */ var
|
|
22231
|
-
/* harmony import */ var
|
|
22232
|
-
/* harmony import */ var
|
|
22233
|
-
/* harmony import */ var
|
|
22234
|
-
/* harmony import */ var
|
|
22235
|
-
/* harmony import */ var
|
|
22236
|
-
/* harmony import */ var
|
|
22237
|
-
/* harmony import */ var
|
|
22238
|
-
/* harmony import */ var
|
|
22239
|
-
/* harmony import */ var
|
|
22240
|
-
/* harmony import */ var
|
|
22241
|
-
/* harmony import */ var
|
|
22242
|
-
/* harmony import */ var _scale__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./scale */ "../../victory-core/es/victory-util/scale.js");
|
|
22243
|
-
/* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./log */ "../../victory-core/es/victory-util/log.js");
|
|
22244
|
-
|
|
22349
|
+
/* harmony import */ var lodash_uniqBy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/uniqBy */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/uniqBy.js");
|
|
22350
|
+
/* harmony import */ var lodash_uniqBy__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqBy__WEBPACK_IMPORTED_MODULE_0__);
|
|
22351
|
+
/* harmony import */ var lodash_groupBy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/groupBy */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/groupBy.js");
|
|
22352
|
+
/* harmony import */ var lodash_groupBy__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_groupBy__WEBPACK_IMPORTED_MODULE_1__);
|
|
22353
|
+
/* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash/uniq */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/uniq.js");
|
|
22354
|
+
/* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_uniq__WEBPACK_IMPORTED_MODULE_2__);
|
|
22355
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaults.js");
|
|
22356
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_3__);
|
|
22357
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "react");
|
|
22358
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
|
|
22359
|
+
/* harmony import */ var _axis__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./axis */ "../../victory-core/es/victory-util/axis.js");
|
|
22360
|
+
/* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./style */ "../../victory-core/es/victory-util/style.js");
|
|
22361
|
+
/* harmony import */ var _data__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./data */ "../../victory-core/es/victory-util/data.js");
|
|
22362
|
+
/* harmony import */ var _domain__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./domain */ "../../victory-core/es/victory-util/domain.js");
|
|
22363
|
+
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./events */ "../../victory-core/es/victory-util/events.js");
|
|
22364
|
+
/* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./collection */ "../../victory-core/es/victory-util/collection.js");
|
|
22365
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
22366
|
+
/* harmony import */ var _scale__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./scale */ "../../victory-core/es/victory-util/scale.js");
|
|
22367
|
+
/* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./log */ "../../victory-core/es/victory-util/log.js");
|
|
22245
22368
|
|
|
22246
22369
|
|
|
22247
22370
|
|
|
@@ -22270,7 +22393,7 @@ function addBinsToParentPropsIfHistogram(_ref) {
|
|
|
22270
22393
|
return child.type && child.type.role === "histogram";
|
|
22271
22394
|
});
|
|
22272
22395
|
if (someChildrenAreHistograms && !allChildrenAreHistograms) {
|
|
22273
|
-
|
|
22396
|
+
_log__WEBPACK_IMPORTED_MODULE_5__.warn("VictoryHistogram only supports being stacked with other VictoryHistogram components. Check to make sure that you are only passing VictoryHistogram components to VictoryStack");
|
|
22274
22397
|
}
|
|
22275
22398
|
|
|
22276
22399
|
// if we are stacking histograms, we need to generate explicit bins
|
|
@@ -22283,7 +22406,7 @@ function addBinsToParentPropsIfHistogram(_ref) {
|
|
|
22283
22406
|
// if we have explicit bins then we don't need to calculate them
|
|
22284
22407
|
if (!Array.isArray(childBins)) {
|
|
22285
22408
|
const combinedData = children.reduce((memo, child) => {
|
|
22286
|
-
const xAccessor =
|
|
22409
|
+
const xAccessor = _helpers__WEBPACK_IMPORTED_MODULE_6__.createAccessor(child.props.x || "x");
|
|
22287
22410
|
return memo.concat(child.props.data.map(datum => ({
|
|
22288
22411
|
x: xAccessor(datum)
|
|
22289
22412
|
})));
|
|
@@ -22326,7 +22449,7 @@ function getDataFromChildren(props, childComponents) {
|
|
|
22326
22449
|
maxDomain
|
|
22327
22450
|
};
|
|
22328
22451
|
let stack = 0;
|
|
22329
|
-
const children = childComponents ? childComponents.slice(0) :
|
|
22452
|
+
const children = childComponents ? childComponents.slice(0) : react__WEBPACK_IMPORTED_MODULE_4___default().Children.toArray(props.children);
|
|
22330
22453
|
parentProps = addBinsToParentPropsIfHistogram({
|
|
22331
22454
|
children,
|
|
22332
22455
|
props,
|
|
@@ -22337,13 +22460,13 @@ function getDataFromChildren(props, childComponents) {
|
|
|
22337
22460
|
const childProps = Object.assign({}, child.props, parentProps);
|
|
22338
22461
|
let childData;
|
|
22339
22462
|
let childElement = child;
|
|
22340
|
-
if (!
|
|
22463
|
+
if (!_data__WEBPACK_IMPORTED_MODULE_7__.isDataComponent(child)) {
|
|
22341
22464
|
return null;
|
|
22342
|
-
} else if (child.type &&
|
|
22343
|
-
childElement = parent ? /*#__PURE__*/
|
|
22465
|
+
} else if (child.type && _helpers__WEBPACK_IMPORTED_MODULE_6__.isFunction(child.type.getData)) {
|
|
22466
|
+
childElement = parent ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().cloneElement(child, parent.props) : child;
|
|
22344
22467
|
childData = childElement.type.getData(childProps);
|
|
22345
22468
|
} else {
|
|
22346
|
-
childData =
|
|
22469
|
+
childData = _data__WEBPACK_IMPORTED_MODULE_7__.getData(childProps);
|
|
22347
22470
|
}
|
|
22348
22471
|
stack += 1;
|
|
22349
22472
|
return childData.map((datum, index) => Object.assign({
|
|
@@ -22352,23 +22475,23 @@ function getDataFromChildren(props, childComponents) {
|
|
|
22352
22475
|
}, datum));
|
|
22353
22476
|
};
|
|
22354
22477
|
const stacked = children.filter(c => c.type && c.type.role === "stack").length;
|
|
22355
|
-
const combine = (memo, val) => memo.concat(
|
|
22356
|
-
const datasets =
|
|
22478
|
+
const combine = (memo, val) => memo.concat(lodash_uniqBy__WEBPACK_IMPORTED_MODULE_0___default()(val, "_group"));
|
|
22479
|
+
const datasets = _helpers__WEBPACK_IMPORTED_MODULE_6__.reduceChildren(children, iteratee, props, [], combine);
|
|
22357
22480
|
const group = stacked ? "_group" : "_stack";
|
|
22358
|
-
return Object.values(
|
|
22481
|
+
return Object.values(lodash_groupBy__WEBPACK_IMPORTED_MODULE_1___default()(datasets, group));
|
|
22359
22482
|
}
|
|
22360
22483
|
function getData(props, childComponents) {
|
|
22361
22484
|
if (props.data) {
|
|
22362
|
-
return
|
|
22485
|
+
return _data__WEBPACK_IMPORTED_MODULE_7__.getData(props);
|
|
22363
22486
|
}
|
|
22364
|
-
return getDataFromChildren(props, childComponents ||
|
|
22487
|
+
return getDataFromChildren(props, childComponents || react__WEBPACK_IMPORTED_MODULE_4___default().Children.toArray(props.children));
|
|
22365
22488
|
}
|
|
22366
22489
|
function getWidth(props, groupLength, seriesLength) {
|
|
22367
22490
|
const {
|
|
22368
22491
|
datasets,
|
|
22369
22492
|
horizontal
|
|
22370
22493
|
} = props;
|
|
22371
|
-
const range = horizontal ?
|
|
22494
|
+
const range = horizontal ? _helpers__WEBPACK_IMPORTED_MODULE_6__.getRange(props, "y") : _helpers__WEBPACK_IMPORTED_MODULE_6__.getRange(props, "x");
|
|
22372
22495
|
const extent = Math.abs(range[1] - range[0]);
|
|
22373
22496
|
const seriesLengthValue = seriesLength !== undefined ? seriesLength : Array.isArray(datasets[0]) && datasets[0].length || 1;
|
|
22374
22497
|
const groupLengthValue = groupLength || datasets.length;
|
|
@@ -22414,8 +22537,8 @@ function getDefaultDomainPadding(props, axis, childComponents) {
|
|
|
22414
22537
|
}
|
|
22415
22538
|
function getDomainFromChildren(props, axis, childComponents) {
|
|
22416
22539
|
// eslint-disable-line max-statements, complexity, max-len
|
|
22417
|
-
const children = childComponents ? childComponents.slice(0) :
|
|
22418
|
-
const parentData = props.data ?
|
|
22540
|
+
const children = childComponents ? childComponents.slice(0) : react__WEBPACK_IMPORTED_MODULE_4___default().Children.toArray(props.children);
|
|
22541
|
+
const parentData = props.data ? _data__WEBPACK_IMPORTED_MODULE_7__.getData(props) : undefined;
|
|
22419
22542
|
const {
|
|
22420
22543
|
polar,
|
|
22421
22544
|
startAngle,
|
|
@@ -22439,65 +22562,67 @@ function getDomainFromChildren(props, axis, childComponents) {
|
|
|
22439
22562
|
}) : baseParentProps;
|
|
22440
22563
|
const iteratee = child => {
|
|
22441
22564
|
const sharedProps = Object.assign({}, child.props, parentProps);
|
|
22442
|
-
if (!
|
|
22565
|
+
if (!_domain__WEBPACK_IMPORTED_MODULE_8__.isDomainComponent(child)) {
|
|
22443
22566
|
return null;
|
|
22444
|
-
} else if (child.type &&
|
|
22567
|
+
} else if (child.type && _helpers__WEBPACK_IMPORTED_MODULE_6__.isFunction(child.type.getDomain)) {
|
|
22445
22568
|
return child.props && child.type.getDomain(sharedProps, axis);
|
|
22446
22569
|
}
|
|
22447
|
-
return
|
|
22570
|
+
return _domain__WEBPACK_IMPORTED_MODULE_8__.getDomain(sharedProps, axis);
|
|
22448
22571
|
};
|
|
22449
|
-
const childDomains =
|
|
22450
|
-
const min = childDomains.length === 0 ? 0 :
|
|
22451
|
-
const max = childDomains.length === 0 ? 1 :
|
|
22572
|
+
const childDomains = _helpers__WEBPACK_IMPORTED_MODULE_6__.reduceChildren(children, iteratee, props);
|
|
22573
|
+
const min = childDomains.length === 0 ? 0 : _collection__WEBPACK_IMPORTED_MODULE_9__.getMinValue(childDomains);
|
|
22574
|
+
const max = childDomains.length === 0 ? 1 : _collection__WEBPACK_IMPORTED_MODULE_9__.getMaxValue(childDomains);
|
|
22452
22575
|
return [min, max];
|
|
22453
22576
|
}
|
|
22454
22577
|
function getDomain(props, axis, childComponents) {
|
|
22455
|
-
const children = childComponents ||
|
|
22456
|
-
const propsDomain =
|
|
22578
|
+
const children = childComponents || react__WEBPACK_IMPORTED_MODULE_4___default().Children.toArray(props.children);
|
|
22579
|
+
const propsDomain = _domain__WEBPACK_IMPORTED_MODULE_8__.getDomainFromProps(props, axis);
|
|
22457
22580
|
const domainPadding = getDefaultDomainPadding(props, axis, children);
|
|
22458
22581
|
let domain;
|
|
22459
22582
|
if (propsDomain) {
|
|
22460
22583
|
domain = propsDomain;
|
|
22461
22584
|
} else {
|
|
22462
|
-
const minDomain =
|
|
22463
|
-
const maxDomain =
|
|
22464
|
-
const dataset = (props.data || props.y) &&
|
|
22465
|
-
const dataDomain = dataset ?
|
|
22585
|
+
const minDomain = _domain__WEBPACK_IMPORTED_MODULE_8__.getMinFromProps(props, axis);
|
|
22586
|
+
const maxDomain = _domain__WEBPACK_IMPORTED_MODULE_8__.getMaxFromProps(props, axis);
|
|
22587
|
+
const dataset = (props.data || props.y) && _data__WEBPACK_IMPORTED_MODULE_7__.getData(props);
|
|
22588
|
+
const dataDomain = dataset ? _domain__WEBPACK_IMPORTED_MODULE_8__.getDomainFromData(props, axis, dataset) : [];
|
|
22466
22589
|
const childDomain = getDomainFromChildren(props, axis, children);
|
|
22467
|
-
const min = minDomain ||
|
|
22468
|
-
const max = maxDomain ||
|
|
22469
|
-
domain =
|
|
22590
|
+
const min = minDomain || _collection__WEBPACK_IMPORTED_MODULE_9__.getMinValue([...dataDomain, ...childDomain]);
|
|
22591
|
+
const max = maxDomain || _collection__WEBPACK_IMPORTED_MODULE_9__.getMaxValue([...dataDomain, ...childDomain]);
|
|
22592
|
+
domain = _domain__WEBPACK_IMPORTED_MODULE_8__.getDomainFromMinMax(min, max);
|
|
22470
22593
|
}
|
|
22471
|
-
return
|
|
22594
|
+
return _domain__WEBPACK_IMPORTED_MODULE_8__.formatDomain(domain, Object.assign({
|
|
22472
22595
|
domainPadding
|
|
22473
22596
|
}, props), axis);
|
|
22474
22597
|
}
|
|
22475
22598
|
function getScale(props, axis, childComponents) {
|
|
22476
22599
|
if (props.data) {
|
|
22477
|
-
return
|
|
22600
|
+
return _scale__WEBPACK_IMPORTED_MODULE_10__.getBaseScale(props, axis);
|
|
22478
22601
|
}
|
|
22479
|
-
const children = childComponents ? childComponents.slice(0) :
|
|
22602
|
+
const children = childComponents ? childComponents.slice(0) : react__WEBPACK_IMPORTED_MODULE_4___default().Children.toArray(props.children);
|
|
22480
22603
|
const iteratee = child => {
|
|
22481
22604
|
const sharedProps = Object.assign({}, child.props, {
|
|
22482
22605
|
horizontal: props.horizontal
|
|
22483
22606
|
});
|
|
22484
|
-
return
|
|
22607
|
+
return _scale__WEBPACK_IMPORTED_MODULE_10__.getScaleType(sharedProps, axis);
|
|
22485
22608
|
};
|
|
22486
|
-
const childScale =
|
|
22609
|
+
const childScale = lodash_uniq__WEBPACK_IMPORTED_MODULE_2___default()(_helpers__WEBPACK_IMPORTED_MODULE_6__.reduceChildren(children, iteratee, props));
|
|
22487
22610
|
|
|
22488
22611
|
// default to linear scale if more than one uniq scale type is given by children
|
|
22489
|
-
return childScale.length > 1 ?
|
|
22612
|
+
return childScale.length > 1 ? _scale__WEBPACK_IMPORTED_MODULE_10__.getScaleFromName("linear") : _scale__WEBPACK_IMPORTED_MODULE_10__.getScaleFromName(childScale[0]);
|
|
22490
22613
|
}
|
|
22491
22614
|
function getAllEvents(props) {
|
|
22492
22615
|
const components = ["groupComponent", "containerComponent", "labelComponent"];
|
|
22493
|
-
const componentEvents =
|
|
22616
|
+
const componentEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getComponentEvents(props, components);
|
|
22494
22617
|
let events = props.events;
|
|
22495
22618
|
if (Array.isArray(componentEvents)) {
|
|
22496
22619
|
events = Array.isArray(props.events) ? componentEvents.concat(...props.events) : componentEvents;
|
|
22497
22620
|
}
|
|
22498
22621
|
return events || [];
|
|
22499
22622
|
}
|
|
22500
|
-
|
|
22623
|
+
|
|
22624
|
+
// eslint-disable-next-line max-params
|
|
22625
|
+
function getColor(calculatedProps, child, index, theme) {
|
|
22501
22626
|
// check for styles first
|
|
22502
22627
|
const {
|
|
22503
22628
|
style
|
|
@@ -22514,14 +22639,16 @@ function getColor(calculatedProps, child, index) {
|
|
|
22514
22639
|
if (!colorScale && !color) {
|
|
22515
22640
|
return undefined;
|
|
22516
22641
|
}
|
|
22517
|
-
const colors = Array.isArray(colorScale) ? colorScale :
|
|
22642
|
+
const colors = Array.isArray(colorScale) ? colorScale : _style__WEBPACK_IMPORTED_MODULE_12__.getColorScale(colorScale, theme);
|
|
22518
22643
|
return color || colors[index % colors.length];
|
|
22519
22644
|
}
|
|
22520
22645
|
function getStyle(theme, style, role) {
|
|
22521
22646
|
const defaultStyle = theme && theme[role] && theme[role].style ? theme[role].style : {};
|
|
22522
|
-
return
|
|
22647
|
+
return _helpers__WEBPACK_IMPORTED_MODULE_6__.getStyles(style, defaultStyle);
|
|
22523
22648
|
}
|
|
22524
|
-
|
|
22649
|
+
|
|
22650
|
+
// eslint-disable-next-line max-params
|
|
22651
|
+
function getChildStyle(child, index, calculatedProps, theme) {
|
|
22525
22652
|
const {
|
|
22526
22653
|
style,
|
|
22527
22654
|
role
|
|
@@ -22531,7 +22658,7 @@ function getChildStyle(child, index, calculatedProps) {
|
|
|
22531
22658
|
return childStyle;
|
|
22532
22659
|
}
|
|
22533
22660
|
const childRole = child.type && child.type.role;
|
|
22534
|
-
const defaultFill = childRole === "stack" ? undefined : getColor(calculatedProps, child, index);
|
|
22661
|
+
const defaultFill = childRole === "stack" ? undefined : getColor(calculatedProps, child, index, theme);
|
|
22535
22662
|
const defaultColor = childRole === "line" ? {
|
|
22536
22663
|
fill: "none",
|
|
22537
22664
|
stroke: defaultFill
|
|
@@ -22541,8 +22668,8 @@ function getChildStyle(child, index, calculatedProps) {
|
|
|
22541
22668
|
const dataWidth = role === "stack" ? {} : {
|
|
22542
22669
|
width: getWidth(calculatedProps)
|
|
22543
22670
|
};
|
|
22544
|
-
const dataStyle =
|
|
22545
|
-
const labelsStyle =
|
|
22671
|
+
const dataStyle = lodash_defaults__WEBPACK_IMPORTED_MODULE_3___default()({}, childStyle.data, Object.assign({}, dataWidth, style.data, defaultColor));
|
|
22672
|
+
const labelsStyle = lodash_defaults__WEBPACK_IMPORTED_MODULE_3___default()({}, childStyle.labels, style.labels);
|
|
22546
22673
|
return {
|
|
22547
22674
|
...childStyle,
|
|
22548
22675
|
parent: style.parent,
|
|
@@ -22550,28 +22677,26 @@ function getChildStyle(child, index, calculatedProps) {
|
|
|
22550
22677
|
labels: labelsStyle
|
|
22551
22678
|
};
|
|
22552
22679
|
}
|
|
22553
|
-
function
|
|
22680
|
+
function getStringsFromChildrenCategories(childComponents, axis) {
|
|
22554
22681
|
const iteratee = child => {
|
|
22555
|
-
|
|
22556
|
-
if (!_domain__WEBPACK_IMPORTED_MODULE_9__.isDomainComponent(child) || !childProps.categories) {
|
|
22682
|
+
if (!_domain__WEBPACK_IMPORTED_MODULE_8__.isDomainComponent(child)) {
|
|
22557
22683
|
return null;
|
|
22558
22684
|
}
|
|
22559
|
-
const
|
|
22560
|
-
|
|
22561
|
-
return categoryStrings ? _collection__WEBPACK_IMPORTED_MODULE_10__.removeUndefined(categoryStrings) : [];
|
|
22685
|
+
const childProps = child.props || {};
|
|
22686
|
+
return _data__WEBPACK_IMPORTED_MODULE_7__.getStringsFromCategories(childProps, axis);
|
|
22562
22687
|
};
|
|
22563
|
-
return
|
|
22688
|
+
return _helpers__WEBPACK_IMPORTED_MODULE_6__.reduceChildren(childComponents.slice(0), iteratee);
|
|
22564
22689
|
}
|
|
22565
22690
|
function getStringsFromData(childComponents) {
|
|
22566
22691
|
const iteratee = child => {
|
|
22567
22692
|
const childProps = child.props || {};
|
|
22568
22693
|
let data;
|
|
22569
|
-
if (!
|
|
22694
|
+
if (!_data__WEBPACK_IMPORTED_MODULE_7__.isDataComponent(child)) {
|
|
22570
22695
|
return null;
|
|
22571
|
-
} else if (child.type &&
|
|
22696
|
+
} else if (child.type && _helpers__WEBPACK_IMPORTED_MODULE_6__.isFunction(child.type.getData)) {
|
|
22572
22697
|
data = child.type.getData(childProps);
|
|
22573
22698
|
} else {
|
|
22574
|
-
data =
|
|
22699
|
+
data = _data__WEBPACK_IMPORTED_MODULE_7__.getData(childProps);
|
|
22575
22700
|
}
|
|
22576
22701
|
return data.map(d => ({
|
|
22577
22702
|
x: d.xName,
|
|
@@ -22590,28 +22715,28 @@ function getStringsFromData(childComponents) {
|
|
|
22590
22715
|
y: y !== undefined ? memo.y.concat(y) : memo.y
|
|
22591
22716
|
};
|
|
22592
22717
|
};
|
|
22593
|
-
return
|
|
22718
|
+
return _helpers__WEBPACK_IMPORTED_MODULE_6__.reduceChildren(childComponents.slice(0), iteratee, {}, initialMemo, combine);
|
|
22594
22719
|
}
|
|
22595
22720
|
function getCategoryAndAxisStringsFromChildren(props, axis, childComponents) {
|
|
22596
|
-
const categories =
|
|
22597
|
-
const axisComponent =
|
|
22598
|
-
const axisStrings = axisComponent ?
|
|
22599
|
-
const categoryStrings = categories
|
|
22600
|
-
return
|
|
22721
|
+
const categories = _data__WEBPACK_IMPORTED_MODULE_7__.getStringsFromCategories(props, axis);
|
|
22722
|
+
const axisComponent = _axis__WEBPACK_IMPORTED_MODULE_13__.getAxisComponent(childComponents, axis);
|
|
22723
|
+
const axisStrings = axisComponent ? _data__WEBPACK_IMPORTED_MODULE_7__.getStringsFromAxes(axisComponent.props, axis) : [];
|
|
22724
|
+
const categoryStrings = categories.length ? categories : getStringsFromChildrenCategories(childComponents, axis);
|
|
22725
|
+
return lodash_uniq__WEBPACK_IMPORTED_MODULE_2___default()([...categoryStrings, ...axisStrings].flat());
|
|
22601
22726
|
}
|
|
22602
22727
|
function getStringsFromChildren(props, childComponents) {
|
|
22603
|
-
const children = childComponents ||
|
|
22728
|
+
const children = childComponents || react__WEBPACK_IMPORTED_MODULE_4___default().Children.toArray(props.children);
|
|
22604
22729
|
const xStrings = getCategoryAndAxisStringsFromChildren(props, "x", children);
|
|
22605
22730
|
const yStrings = getCategoryAndAxisStringsFromChildren(props, "y", children);
|
|
22606
22731
|
const dataStrings = getStringsFromData(children);
|
|
22607
22732
|
return {
|
|
22608
|
-
x:
|
|
22609
|
-
y:
|
|
22733
|
+
x: lodash_uniq__WEBPACK_IMPORTED_MODULE_2___default()([...xStrings, ...dataStrings.x].flat()),
|
|
22734
|
+
y: lodash_uniq__WEBPACK_IMPORTED_MODULE_2___default()([...yStrings, ...dataStrings.y].flat())
|
|
22610
22735
|
};
|
|
22611
22736
|
}
|
|
22612
22737
|
function getCategories(props, childComponents, allStrings) {
|
|
22613
|
-
const xPropCategories = props.categories &&
|
|
22614
|
-
const yPropCategories = props.categories &&
|
|
22738
|
+
const xPropCategories = props.categories && _data__WEBPACK_IMPORTED_MODULE_7__.getStringsFromCategories(props, "x");
|
|
22739
|
+
const yPropCategories = props.categories && _data__WEBPACK_IMPORTED_MODULE_7__.getStringsFromCategories(props, "y");
|
|
22615
22740
|
const fallbackRequired = !xPropCategories || !yPropCategories;
|
|
22616
22741
|
const fallbackProps = fallbackRequired ? allStrings || getStringsFromChildren(props, childComponents) : {};
|
|
22617
22742
|
const xCategories = xPropCategories || fallbackProps.x;
|
|
@@ -23851,14 +23976,15 @@ function getChildren(initialProps, childComponents, calculatedProps) {
|
|
|
23851
23976
|
} = newCalculatedProps;
|
|
23852
23977
|
const {
|
|
23853
23978
|
labelComponent,
|
|
23854
|
-
polar
|
|
23979
|
+
polar,
|
|
23980
|
+
theme
|
|
23855
23981
|
} = props;
|
|
23856
23982
|
const childProps = getChildProps(props, newCalculatedProps);
|
|
23857
23983
|
const parentName = props.name || "group";
|
|
23858
23984
|
return children.map((child, index) => {
|
|
23859
23985
|
const role = child.type && child.type.role;
|
|
23860
23986
|
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);
|
|
23987
|
+
const style = role === "voronoi" || role === "tooltip" || role === "label" ? child.props.style : victory_core__WEBPACK_IMPORTED_MODULE_3__.getChildStyle(child, index, newCalculatedProps, theme);
|
|
23862
23988
|
const labels = props.labels ? getLabels(props, datasets, index) : child.props.labels;
|
|
23863
23989
|
const name = child.props.name || `${parentName}-${role}-${index}`;
|
|
23864
23990
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(child, Object.assign({
|
|
@@ -24498,9 +24624,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
24498
24624
|
|
|
24499
24625
|
const getColorScale = props => {
|
|
24500
24626
|
const {
|
|
24501
|
-
colorScale
|
|
24627
|
+
colorScale,
|
|
24628
|
+
theme
|
|
24502
24629
|
} = props;
|
|
24503
|
-
return typeof colorScale === "string" ? victory_core__WEBPACK_IMPORTED_MODULE_3__.getColorScale(colorScale) : colorScale || [];
|
|
24630
|
+
return typeof colorScale === "string" ? victory_core__WEBPACK_IMPORTED_MODULE_3__.getColorScale(colorScale, theme) : colorScale || [];
|
|
24504
24631
|
};
|
|
24505
24632
|
const getLabelStyles = props => {
|
|
24506
24633
|
const {
|
|
@@ -25362,11 +25489,12 @@ const getSlices = (props, data) => {
|
|
|
25362
25489
|
};
|
|
25363
25490
|
const getCalculatedValues = props => {
|
|
25364
25491
|
const {
|
|
25365
|
-
colorScale
|
|
25492
|
+
colorScale,
|
|
25493
|
+
theme
|
|
25366
25494
|
} = props;
|
|
25367
25495
|
const styleObject = victory_core__WEBPACK_IMPORTED_MODULE_3__.getDefaultStyles(props, "pie");
|
|
25368
25496
|
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);
|
|
25497
|
+
const colors = Array.isArray(colorScale) ? colorScale : victory_core__WEBPACK_IMPORTED_MODULE_4__.getColorScale(colorScale, theme);
|
|
25370
25498
|
const padding = victory_core__WEBPACK_IMPORTED_MODULE_3__.getPadding(props);
|
|
25371
25499
|
const defaultRadius = getRadius(props, padding);
|
|
25372
25500
|
const origin = getOrigin(props, padding);
|
|
@@ -27701,10 +27829,13 @@ function getChildren(initialProps, childComponents, calculatedProps) {
|
|
|
27701
27829
|
} = newCalculatedProps;
|
|
27702
27830
|
const childProps = getChildProps(props, newCalculatedProps);
|
|
27703
27831
|
const parentName = props.name || "stack";
|
|
27832
|
+
const {
|
|
27833
|
+
theme
|
|
27834
|
+
} = props;
|
|
27704
27835
|
return children.map((child, index) => {
|
|
27705
27836
|
const role = child.type && child.type.role;
|
|
27706
27837
|
const data = datasets[index];
|
|
27707
|
-
const style = victory_core__WEBPACK_IMPORTED_MODULE_3__.getChildStyle(child, index, newCalculatedProps);
|
|
27838
|
+
const style = victory_core__WEBPACK_IMPORTED_MODULE_3__.getChildStyle(child, index, newCalculatedProps, theme);
|
|
27708
27839
|
const labels = props.labels ? getLabels(props, datasets, index) : child.props.labels;
|
|
27709
27840
|
const name = child.props.name || `${parentName}-${role}-${index}`;
|
|
27710
27841
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(child, Object.assign({
|
|
@@ -29438,6 +29569,7 @@ class VoronoiHelpersClass {
|
|
|
29438
29569
|
}
|
|
29439
29570
|
}
|
|
29440
29571
|
onMouseLeave = (evt, targetProps) => {
|
|
29572
|
+
this.onMouseMove.cancel();
|
|
29441
29573
|
const activePoints = targetProps.activePoints || [];
|
|
29442
29574
|
this.onDeactivated(targetProps, activePoints);
|
|
29443
29575
|
const inactiveMutations = activePoints.length ? activePoints.map(point => this.getInactiveMutations(targetProps, point)) : [];
|