victory-scatter 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-scatter.js +197 -68
- package/dist/victory-scatter.min.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/dist/victory-scatter.js
CHANGED
|
@@ -5878,31 +5878,34 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5878
5878
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5879
5879
|
/* harmony export */ "VictoryPortal": function() { return /* binding */ VictoryPortal; }
|
|
5880
5880
|
/* harmony export */ });
|
|
5881
|
-
/* harmony import */ var
|
|
5882
|
-
/* harmony import */ var
|
|
5883
|
-
/* harmony import */ var
|
|
5884
|
-
/* harmony import */ var
|
|
5885
|
-
/* harmony import */ var
|
|
5886
|
-
/* harmony import */ var
|
|
5887
|
-
/* harmony import */ var
|
|
5881
|
+
/* 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");
|
|
5882
|
+
/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0__);
|
|
5883
|
+
/* 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");
|
|
5884
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
5885
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
|
|
5886
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
|
|
5887
|
+
/* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
|
|
5888
|
+
/* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
5889
|
+
/* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
|
|
5890
|
+
|
|
5888
5891
|
|
|
5889
5892
|
|
|
5890
5893
|
|
|
5891
5894
|
|
|
5892
5895
|
|
|
5893
5896
|
const defaultProps = {
|
|
5894
|
-
groupComponent: /*#__PURE__*/
|
|
5897
|
+
groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement("g", null)
|
|
5895
5898
|
};
|
|
5896
5899
|
const VictoryPortal = initialProps => {
|
|
5897
5900
|
const props = {
|
|
5898
5901
|
...defaultProps,
|
|
5899
5902
|
...initialProps
|
|
5900
5903
|
};
|
|
5901
|
-
const id =
|
|
5902
|
-
const portalContext = (0,
|
|
5904
|
+
const id = lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default()();
|
|
5905
|
+
const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_3__.usePortalContext)();
|
|
5903
5906
|
if (!portalContext) {
|
|
5904
5907
|
const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
|
|
5905
|
-
|
|
5908
|
+
_victory_util_log__WEBPACK_IMPORTED_MODULE_4__.warn(msg);
|
|
5906
5909
|
}
|
|
5907
5910
|
const children = Array.isArray(props.children) ? props.children[0] : props.children;
|
|
5908
5911
|
const {
|
|
@@ -5913,15 +5916,15 @@ const VictoryPortal = initialProps => {
|
|
|
5913
5916
|
groupComponent,
|
|
5914
5917
|
standalone: false
|
|
5915
5918
|
} : {};
|
|
5916
|
-
const newProps =
|
|
5919
|
+
const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__.omit(props, ["children", "groupComponent"]), {
|
|
5917
5920
|
key: childProps.key ?? id
|
|
5918
5921
|
});
|
|
5919
|
-
const child = children && /*#__PURE__*/
|
|
5920
|
-
|
|
5922
|
+
const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().cloneElement(children, newProps);
|
|
5923
|
+
react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
|
|
5921
5924
|
portalContext?.addChild(id, child);
|
|
5922
5925
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5923
5926
|
}, [props.children]);
|
|
5924
|
-
|
|
5927
|
+
react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
|
|
5925
5928
|
return () => portalContext?.removeChild(id);
|
|
5926
5929
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5927
5930
|
}, []);
|
|
@@ -6268,7 +6271,26 @@ const green = {
|
|
|
6268
6271
|
"500": "#20C933",
|
|
6269
6272
|
"900": "#338A17"
|
|
6270
6273
|
};
|
|
6271
|
-
const colors =
|
|
6274
|
+
const colors = {
|
|
6275
|
+
blue: blue["500"],
|
|
6276
|
+
pink: pink["500"],
|
|
6277
|
+
teal: teal["500"],
|
|
6278
|
+
purple: purple["500"],
|
|
6279
|
+
green: green["500"],
|
|
6280
|
+
orange: orange["500"],
|
|
6281
|
+
cyan: cyan["500"],
|
|
6282
|
+
red: red["500"],
|
|
6283
|
+
yellow: yellow["500"]
|
|
6284
|
+
};
|
|
6285
|
+
const colorScale = Object.values(colors);
|
|
6286
|
+
const grayscale = [gray["200"], gray["400"], gray["600"], gray["900"]];
|
|
6287
|
+
const warm = [yellow["500"], orange["500"], red["500"], pink["500"]];
|
|
6288
|
+
const cool = [cyan["500"], teal["500"], blue["500"], purple["500"]];
|
|
6289
|
+
const heatmap = [green["500"], yellow["500"], red["500"]];
|
|
6290
|
+
const redPalette = [red["500"], red["300"], red["100"]];
|
|
6291
|
+
const greenPalette = [green["500"], green["300"], green["100"]];
|
|
6292
|
+
const bluePalette = [blue["500"], blue["300"], blue["100"]];
|
|
6293
|
+
|
|
6272
6294
|
// *
|
|
6273
6295
|
// * Typography
|
|
6274
6296
|
// *
|
|
@@ -6283,7 +6305,7 @@ const baseProps = {
|
|
|
6283
6305
|
width: 450,
|
|
6284
6306
|
height: 300,
|
|
6285
6307
|
padding: 50,
|
|
6286
|
-
colorScale
|
|
6308
|
+
colorScale
|
|
6287
6309
|
};
|
|
6288
6310
|
// *
|
|
6289
6311
|
// * Labels
|
|
@@ -6312,10 +6334,23 @@ const borderRadius = 1;
|
|
|
6312
6334
|
// * Theme
|
|
6313
6335
|
// *
|
|
6314
6336
|
const clean = {
|
|
6337
|
+
palette: {
|
|
6338
|
+
colors,
|
|
6339
|
+
grayscale,
|
|
6340
|
+
qualitative: colorScale,
|
|
6341
|
+
heatmap,
|
|
6342
|
+
warm,
|
|
6343
|
+
cool,
|
|
6344
|
+
red: redPalette,
|
|
6345
|
+
green: greenPalette,
|
|
6346
|
+
blue: bluePalette
|
|
6347
|
+
},
|
|
6315
6348
|
area: Object.assign({
|
|
6316
6349
|
style: {
|
|
6317
6350
|
data: {
|
|
6318
|
-
fill:
|
|
6351
|
+
fill: blue["500"],
|
|
6352
|
+
strokeWidth: 2,
|
|
6353
|
+
fillOpacity: 0.5
|
|
6319
6354
|
},
|
|
6320
6355
|
labels: baseLabelStyles
|
|
6321
6356
|
}
|
|
@@ -6324,7 +6359,7 @@ const clean = {
|
|
|
6324
6359
|
style: {
|
|
6325
6360
|
axis: {
|
|
6326
6361
|
fill: "transparent",
|
|
6327
|
-
stroke: gray["
|
|
6362
|
+
stroke: gray["500"],
|
|
6328
6363
|
strokeWidth: 1,
|
|
6329
6364
|
strokeLinecap,
|
|
6330
6365
|
strokeLinejoin
|
|
@@ -6349,10 +6384,10 @@ const clean = {
|
|
|
6349
6384
|
polarAxis: Object.assign({
|
|
6350
6385
|
style: {
|
|
6351
6386
|
axis: {
|
|
6352
|
-
stroke: gray["
|
|
6387
|
+
stroke: gray["500"]
|
|
6353
6388
|
},
|
|
6354
6389
|
grid: {
|
|
6355
|
-
stroke: gray["
|
|
6390
|
+
stroke: gray["400"],
|
|
6356
6391
|
strokeDasharray,
|
|
6357
6392
|
strokeLinecap,
|
|
6358
6393
|
strokeLinejoin,
|
|
@@ -6361,7 +6396,7 @@ const clean = {
|
|
|
6361
6396
|
ticks: {
|
|
6362
6397
|
fill: "transparent",
|
|
6363
6398
|
size: 5,
|
|
6364
|
-
stroke: gray["
|
|
6399
|
+
stroke: gray["400"],
|
|
6365
6400
|
strokeWidth: 1,
|
|
6366
6401
|
strokeLinecap,
|
|
6367
6402
|
strokeLinejoin
|
|
@@ -6372,10 +6407,10 @@ const clean = {
|
|
|
6372
6407
|
polarDependentAxis: Object.assign({
|
|
6373
6408
|
style: {
|
|
6374
6409
|
axis: {
|
|
6375
|
-
stroke: gray["
|
|
6410
|
+
stroke: gray["500"]
|
|
6376
6411
|
},
|
|
6377
6412
|
grid: {
|
|
6378
|
-
stroke: gray["
|
|
6413
|
+
stroke: gray["400"],
|
|
6379
6414
|
strokeDasharray,
|
|
6380
6415
|
strokeLinecap,
|
|
6381
6416
|
strokeLinejoin,
|
|
@@ -6384,7 +6419,7 @@ const clean = {
|
|
|
6384
6419
|
ticks: {
|
|
6385
6420
|
fill: "transparent",
|
|
6386
6421
|
size: 5,
|
|
6387
|
-
stroke: gray["
|
|
6422
|
+
stroke: gray["300"],
|
|
6388
6423
|
strokeWidth: 1,
|
|
6389
6424
|
strokeLinecap,
|
|
6390
6425
|
strokeLinejoin
|
|
@@ -6397,7 +6432,8 @@ const clean = {
|
|
|
6397
6432
|
data: {
|
|
6398
6433
|
fill: blue["500"],
|
|
6399
6434
|
padding,
|
|
6400
|
-
strokeWidth:
|
|
6435
|
+
strokeWidth: 1,
|
|
6436
|
+
fillOpacity: 0.5
|
|
6401
6437
|
},
|
|
6402
6438
|
labels: baseLabelStyles
|
|
6403
6439
|
},
|
|
@@ -6434,14 +6470,15 @@ const clean = {
|
|
|
6434
6470
|
q1: {
|
|
6435
6471
|
padding,
|
|
6436
6472
|
fill: teal["500"],
|
|
6437
|
-
rx: borderRadius
|
|
6473
|
+
rx: borderRadius,
|
|
6474
|
+
strokeWidth: 2
|
|
6438
6475
|
},
|
|
6439
6476
|
q1Labels: Object.assign({}, baseLabelStyles, {
|
|
6440
6477
|
padding: 3
|
|
6441
6478
|
}),
|
|
6442
6479
|
q3: {
|
|
6443
6480
|
padding,
|
|
6444
|
-
fill:
|
|
6481
|
+
fill: cyan["500"],
|
|
6445
6482
|
rx: borderRadius
|
|
6446
6483
|
},
|
|
6447
6484
|
q3Labels: Object.assign({}, baseLabelStyles, {
|
|
@@ -6482,14 +6519,13 @@ const clean = {
|
|
|
6482
6519
|
}
|
|
6483
6520
|
}, baseProps),
|
|
6484
6521
|
group: Object.assign({
|
|
6485
|
-
colorScale
|
|
6522
|
+
colorScale
|
|
6486
6523
|
}, baseProps),
|
|
6487
6524
|
histogram: Object.assign({
|
|
6488
6525
|
style: {
|
|
6489
6526
|
data: {
|
|
6490
6527
|
fill: cyan["500"],
|
|
6491
|
-
|
|
6492
|
-
strokeWidth: 0
|
|
6528
|
+
fillOpacity: 0.5
|
|
6493
6529
|
},
|
|
6494
6530
|
labels: baseLabelStyles
|
|
6495
6531
|
},
|
|
@@ -6500,21 +6536,23 @@ const clean = {
|
|
|
6500
6536
|
}, baseProps),
|
|
6501
6537
|
label: baseLabelStyles,
|
|
6502
6538
|
legend: {
|
|
6503
|
-
colorScale
|
|
6504
|
-
gutter:
|
|
6505
|
-
|
|
6539
|
+
colorScale,
|
|
6540
|
+
gutter: 24,
|
|
6541
|
+
borderPadding: 10,
|
|
6542
|
+
orientation: "horizontal",
|
|
6506
6543
|
titleOrientation: "top",
|
|
6544
|
+
centerTitle: true,
|
|
6507
6545
|
style: {
|
|
6508
6546
|
data: {
|
|
6509
6547
|
type: "circle"
|
|
6510
6548
|
},
|
|
6511
6549
|
labels: {
|
|
6512
6550
|
...baseLabelStyles,
|
|
6513
|
-
fontSize:
|
|
6551
|
+
fontSize: 12
|
|
6514
6552
|
},
|
|
6515
6553
|
title: Object.assign({}, baseLabelStyles, {
|
|
6516
6554
|
padding,
|
|
6517
|
-
fontSize:
|
|
6555
|
+
fontSize: 16
|
|
6518
6556
|
}),
|
|
6519
6557
|
border: {
|
|
6520
6558
|
stroke: gray["200"],
|
|
@@ -6528,7 +6566,7 @@ const clean = {
|
|
|
6528
6566
|
data: {
|
|
6529
6567
|
fill: "transparent",
|
|
6530
6568
|
opacity: 1,
|
|
6531
|
-
stroke:
|
|
6569
|
+
stroke: blue["500"],
|
|
6532
6570
|
strokeWidth: 2,
|
|
6533
6571
|
strokeLinecap,
|
|
6534
6572
|
strokeLinejoin
|
|
@@ -6538,16 +6576,22 @@ const clean = {
|
|
|
6538
6576
|
}, baseProps),
|
|
6539
6577
|
pie: Object.assign({
|
|
6540
6578
|
style: {
|
|
6579
|
+
parent: {
|
|
6580
|
+
backgroundColor: gray.white
|
|
6581
|
+
},
|
|
6541
6582
|
data: {
|
|
6542
6583
|
padding,
|
|
6543
6584
|
stroke: gray.white,
|
|
6544
6585
|
strokeWidth: 1
|
|
6545
6586
|
},
|
|
6546
|
-
labels:
|
|
6547
|
-
|
|
6548
|
-
|
|
6587
|
+
labels: {
|
|
6588
|
+
...baseLabelStyles,
|
|
6589
|
+
padding: 20,
|
|
6590
|
+
fill: gray["600"],
|
|
6591
|
+
fontSize: 10
|
|
6592
|
+
}
|
|
6549
6593
|
},
|
|
6550
|
-
colorScale
|
|
6594
|
+
colorScale,
|
|
6551
6595
|
cornerRadius: borderRadius
|
|
6552
6596
|
}, baseProps),
|
|
6553
6597
|
scatter: Object.assign({
|
|
@@ -6558,11 +6602,14 @@ const clean = {
|
|
|
6558
6602
|
stroke: "transparent",
|
|
6559
6603
|
strokeWidth: 0
|
|
6560
6604
|
},
|
|
6561
|
-
labels:
|
|
6605
|
+
labels: {
|
|
6606
|
+
...baseLabelStyles,
|
|
6607
|
+
padding: 20
|
|
6608
|
+
}
|
|
6562
6609
|
}
|
|
6563
6610
|
}, baseProps),
|
|
6564
6611
|
stack: Object.assign({
|
|
6565
|
-
colorScale
|
|
6612
|
+
colorScale
|
|
6566
6613
|
}, baseProps),
|
|
6567
6614
|
tooltip: {
|
|
6568
6615
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -6570,7 +6617,7 @@ const clean = {
|
|
|
6570
6617
|
pointerEvents: "none"
|
|
6571
6618
|
}),
|
|
6572
6619
|
flyoutStyle: {
|
|
6573
|
-
stroke: gray["
|
|
6620
|
+
stroke: gray["300"],
|
|
6574
6621
|
strokeWidth: 2,
|
|
6575
6622
|
fill: gray.white,
|
|
6576
6623
|
pointerEvents: "none"
|
|
@@ -6587,9 +6634,10 @@ const clean = {
|
|
|
6587
6634
|
voronoi: Object.assign({
|
|
6588
6635
|
style: {
|
|
6589
6636
|
data: {
|
|
6590
|
-
fill:
|
|
6591
|
-
stroke:
|
|
6592
|
-
strokeWidth: 2
|
|
6637
|
+
fill: blue["100"],
|
|
6638
|
+
stroke: blue["500"],
|
|
6639
|
+
strokeWidth: 2,
|
|
6640
|
+
opacity: 0.4
|
|
6593
6641
|
},
|
|
6594
6642
|
labels: Object.assign({}, baseLabelStyles, {
|
|
6595
6643
|
padding: 5,
|
|
@@ -6625,9 +6673,28 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6625
6673
|
// *
|
|
6626
6674
|
// * Colors
|
|
6627
6675
|
// *
|
|
6628
|
-
const colors =
|
|
6676
|
+
const colors = {
|
|
6677
|
+
blue: "#4F7DA1",
|
|
6678
|
+
pink: "#E2A37F",
|
|
6679
|
+
teal: "#00796B",
|
|
6680
|
+
purple: "#DF948A",
|
|
6681
|
+
green: "#8BC34A",
|
|
6682
|
+
orange: "#F4511E",
|
|
6683
|
+
cyan: "#006064",
|
|
6684
|
+
red: "#DF5A49",
|
|
6685
|
+
yellow: "#FFF59D"
|
|
6686
|
+
};
|
|
6687
|
+
const colorScale = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
|
|
6629
6688
|
const charcoal = "#252525";
|
|
6630
6689
|
const grey = "#969696";
|
|
6690
|
+
const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
|
|
6691
|
+
const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
|
|
6692
|
+
const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
|
|
6693
|
+
const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
|
|
6694
|
+
const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
|
|
6695
|
+
const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
|
|
6696
|
+
const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
|
|
6697
|
+
|
|
6631
6698
|
// *
|
|
6632
6699
|
// * Typography
|
|
6633
6700
|
// *
|
|
@@ -6641,7 +6708,7 @@ const baseProps = {
|
|
|
6641
6708
|
width: 450,
|
|
6642
6709
|
height: 300,
|
|
6643
6710
|
padding: 50,
|
|
6644
|
-
colorScale
|
|
6711
|
+
colorScale
|
|
6645
6712
|
};
|
|
6646
6713
|
// *
|
|
6647
6714
|
// * Labels
|
|
@@ -6663,6 +6730,17 @@ const centeredLabelStyles = Object.assign({
|
|
|
6663
6730
|
const strokeLinecap = "round";
|
|
6664
6731
|
const strokeLinejoin = "round";
|
|
6665
6732
|
const grayscale = {
|
|
6733
|
+
palette: {
|
|
6734
|
+
colors,
|
|
6735
|
+
grayscale: colorScale,
|
|
6736
|
+
qualitative,
|
|
6737
|
+
heatmap,
|
|
6738
|
+
warm,
|
|
6739
|
+
cool,
|
|
6740
|
+
red,
|
|
6741
|
+
green,
|
|
6742
|
+
blue
|
|
6743
|
+
},
|
|
6666
6744
|
area: Object.assign({
|
|
6667
6745
|
style: {
|
|
6668
6746
|
data: {
|
|
@@ -6777,7 +6855,7 @@ const grayscale = {
|
|
|
6777
6855
|
}
|
|
6778
6856
|
}, baseProps),
|
|
6779
6857
|
group: Object.assign({
|
|
6780
|
-
colorScale
|
|
6858
|
+
colorScale
|
|
6781
6859
|
}, baseProps),
|
|
6782
6860
|
histogram: Object.assign({
|
|
6783
6861
|
style: {
|
|
@@ -6790,7 +6868,7 @@ const grayscale = {
|
|
|
6790
6868
|
}
|
|
6791
6869
|
}, baseProps),
|
|
6792
6870
|
legend: {
|
|
6793
|
-
colorScale
|
|
6871
|
+
colorScale,
|
|
6794
6872
|
gutter: 10,
|
|
6795
6873
|
orientation: "vertical",
|
|
6796
6874
|
titleOrientation: "top",
|
|
@@ -6825,7 +6903,7 @@ const grayscale = {
|
|
|
6825
6903
|
padding: 20
|
|
6826
6904
|
})
|
|
6827
6905
|
},
|
|
6828
|
-
colorScale
|
|
6906
|
+
colorScale,
|
|
6829
6907
|
width: 400,
|
|
6830
6908
|
height: 400,
|
|
6831
6909
|
padding: 50
|
|
@@ -6841,7 +6919,7 @@ const grayscale = {
|
|
|
6841
6919
|
}
|
|
6842
6920
|
}, baseProps),
|
|
6843
6921
|
stack: Object.assign({
|
|
6844
|
-
colorScale
|
|
6922
|
+
colorScale
|
|
6845
6923
|
}, baseProps),
|
|
6846
6924
|
tooltip: {
|
|
6847
6925
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -6901,11 +6979,31 @@ const lime300 = "#DCE775";
|
|
|
6901
6979
|
const lightGreen500 = "#8BC34A";
|
|
6902
6980
|
const teal700 = "#00796B";
|
|
6903
6981
|
const cyan900 = "#006064";
|
|
6904
|
-
const
|
|
6982
|
+
const colorScale = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
|
|
6905
6983
|
const blueGrey50 = "#ECEFF1";
|
|
6906
6984
|
const blueGrey300 = "#90A4AE";
|
|
6907
6985
|
const blueGrey700 = "#455A64";
|
|
6908
6986
|
const grey900 = "#212121";
|
|
6987
|
+
const colors = {
|
|
6988
|
+
blue: "#4F7DA1",
|
|
6989
|
+
pink: "#E2A37F",
|
|
6990
|
+
teal: teal700,
|
|
6991
|
+
purple: "#DF948A",
|
|
6992
|
+
green: lightGreen500,
|
|
6993
|
+
orange: deepOrange600,
|
|
6994
|
+
cyan: cyan900,
|
|
6995
|
+
red: "#DF5A49",
|
|
6996
|
+
yellow: yellow200
|
|
6997
|
+
};
|
|
6998
|
+
const grayscale = [blueGrey50, blueGrey300, blueGrey700, grey900];
|
|
6999
|
+
const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
|
|
7000
|
+
const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
|
|
7001
|
+
const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
|
|
7002
|
+
const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
|
|
7003
|
+
const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
|
|
7004
|
+
const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
|
|
7005
|
+
const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
|
|
7006
|
+
|
|
6909
7007
|
// *
|
|
6910
7008
|
// * Typography
|
|
6911
7009
|
// *
|
|
@@ -6943,6 +7041,17 @@ const strokeDasharray = "10, 5";
|
|
|
6943
7041
|
const strokeLinecap = "round";
|
|
6944
7042
|
const strokeLinejoin = "round";
|
|
6945
7043
|
const material = {
|
|
7044
|
+
palette: {
|
|
7045
|
+
colors,
|
|
7046
|
+
grayscale,
|
|
7047
|
+
qualitative,
|
|
7048
|
+
heatmap,
|
|
7049
|
+
warm,
|
|
7050
|
+
cool,
|
|
7051
|
+
red,
|
|
7052
|
+
green,
|
|
7053
|
+
blue
|
|
7054
|
+
},
|
|
6946
7055
|
area: Object.assign({
|
|
6947
7056
|
style: {
|
|
6948
7057
|
data: {
|
|
@@ -7075,7 +7184,7 @@ const material = {
|
|
|
7075
7184
|
}
|
|
7076
7185
|
}, baseProps),
|
|
7077
7186
|
group: Object.assign({
|
|
7078
|
-
colorScale
|
|
7187
|
+
colorScale
|
|
7079
7188
|
}, baseProps),
|
|
7080
7189
|
histogram: Object.assign({
|
|
7081
7190
|
style: {
|
|
@@ -7088,7 +7197,7 @@ const material = {
|
|
|
7088
7197
|
}
|
|
7089
7198
|
}, baseProps),
|
|
7090
7199
|
legend: {
|
|
7091
|
-
colorScale
|
|
7200
|
+
colorScale,
|
|
7092
7201
|
gutter: 10,
|
|
7093
7202
|
orientation: "vertical",
|
|
7094
7203
|
titleOrientation: "top",
|
|
@@ -7114,7 +7223,7 @@ const material = {
|
|
|
7114
7223
|
}
|
|
7115
7224
|
}, baseProps),
|
|
7116
7225
|
pie: Object.assign({
|
|
7117
|
-
colorScale
|
|
7226
|
+
colorScale,
|
|
7118
7227
|
style: {
|
|
7119
7228
|
data: {
|
|
7120
7229
|
padding,
|
|
@@ -7138,7 +7247,7 @@ const material = {
|
|
|
7138
7247
|
}
|
|
7139
7248
|
}, baseProps),
|
|
7140
7249
|
stack: Object.assign({
|
|
7141
|
-
colorScale
|
|
7250
|
+
colorScale
|
|
7142
7251
|
}, baseProps),
|
|
7143
7252
|
tooltip: {
|
|
7144
7253
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -10238,6 +10347,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10238
10347
|
/* harmony export */ "getColorScale": function() { return /* binding */ getColorScale; },
|
|
10239
10348
|
/* harmony export */ "toTransformString": function() { return /* binding */ toTransformString; }
|
|
10240
10349
|
/* harmony export */ });
|
|
10350
|
+
/* 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");
|
|
10351
|
+
|
|
10352
|
+
|
|
10241
10353
|
/**
|
|
10242
10354
|
* Given an object with CSS/SVG transform definitions, return the string value
|
|
10243
10355
|
* for use with the `transform` CSS property or SVG attribute. Note that we
|
|
@@ -10274,20 +10386,37 @@ const toTransformString = function (obj) {
|
|
|
10274
10386
|
* of 5 hex string values in that color scale. If no 'name' parameter
|
|
10275
10387
|
* is given, it will return the Victory default grayscale.
|
|
10276
10388
|
* @param {String} name The name of the color scale to return (optional).
|
|
10389
|
+
* @param {Object} theme The theme object to retrieve the color scale from (optional).
|
|
10277
10390
|
* @returns {Array} An array of 5 hex string values composing a color scale.
|
|
10278
10391
|
*/
|
|
10279
|
-
function getColorScale(name) {
|
|
10392
|
+
function getColorScale(name, theme) {
|
|
10393
|
+
if (theme === void 0) {
|
|
10394
|
+
theme = _victory_theme_victory_theme__WEBPACK_IMPORTED_MODULE_0__.VictoryTheme.material;
|
|
10395
|
+
}
|
|
10396
|
+
const {
|
|
10397
|
+
palette: {
|
|
10398
|
+
grayscale = ["#cccccc", "#969696", "#636363", "#252525"],
|
|
10399
|
+
qualitative = [],
|
|
10400
|
+
heatmap = [],
|
|
10401
|
+
warm = [],
|
|
10402
|
+
cool = [],
|
|
10403
|
+
red = [],
|
|
10404
|
+
blue = [],
|
|
10405
|
+
green = []
|
|
10406
|
+
} = {}
|
|
10407
|
+
} = theme;
|
|
10280
10408
|
const scales = {
|
|
10281
|
-
grayscale
|
|
10282
|
-
qualitative
|
|
10283
|
-
heatmap
|
|
10284
|
-
warm
|
|
10285
|
-
cool
|
|
10286
|
-
red
|
|
10287
|
-
blue
|
|
10288
|
-
green
|
|
10409
|
+
grayscale,
|
|
10410
|
+
qualitative,
|
|
10411
|
+
heatmap,
|
|
10412
|
+
warm,
|
|
10413
|
+
cool,
|
|
10414
|
+
red,
|
|
10415
|
+
blue,
|
|
10416
|
+
green
|
|
10289
10417
|
};
|
|
10290
|
-
|
|
10418
|
+
const selectedScale = name && scales[name]?.length ? scales[name] : scales.grayscale;
|
|
10419
|
+
return selectedScale;
|
|
10291
10420
|
}
|
|
10292
10421
|
|
|
10293
10422
|
/***/ }),
|