victory-histogram 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-histogram.js +198 -69
- package/dist/victory-histogram.min.js +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -6968,31 +6968,34 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6968
6968
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6969
6969
|
/* harmony export */ "VictoryPortal": function() { return /* binding */ VictoryPortal; }
|
|
6970
6970
|
/* harmony export */ });
|
|
6971
|
-
/* harmony import */ var
|
|
6972
|
-
/* harmony import */ var
|
|
6973
|
-
/* harmony import */ var
|
|
6974
|
-
/* harmony import */ var
|
|
6975
|
-
/* harmony import */ var
|
|
6976
|
-
/* harmony import */ var
|
|
6977
|
-
/* harmony import */ var
|
|
6971
|
+
/* 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");
|
|
6972
|
+
/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0__);
|
|
6973
|
+
/* 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");
|
|
6974
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
6975
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
|
|
6976
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
|
|
6977
|
+
/* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
|
|
6978
|
+
/* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
6979
|
+
/* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
|
|
6980
|
+
|
|
6978
6981
|
|
|
6979
6982
|
|
|
6980
6983
|
|
|
6981
6984
|
|
|
6982
6985
|
|
|
6983
6986
|
const defaultProps = {
|
|
6984
|
-
groupComponent: /*#__PURE__*/
|
|
6987
|
+
groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement("g", null)
|
|
6985
6988
|
};
|
|
6986
6989
|
const VictoryPortal = initialProps => {
|
|
6987
6990
|
const props = {
|
|
6988
6991
|
...defaultProps,
|
|
6989
6992
|
...initialProps
|
|
6990
6993
|
};
|
|
6991
|
-
const id =
|
|
6992
|
-
const portalContext = (0,
|
|
6994
|
+
const id = lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default()();
|
|
6995
|
+
const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_3__.usePortalContext)();
|
|
6993
6996
|
if (!portalContext) {
|
|
6994
6997
|
const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
|
|
6995
|
-
|
|
6998
|
+
_victory_util_log__WEBPACK_IMPORTED_MODULE_4__.warn(msg);
|
|
6996
6999
|
}
|
|
6997
7000
|
const children = Array.isArray(props.children) ? props.children[0] : props.children;
|
|
6998
7001
|
const {
|
|
@@ -7003,15 +7006,15 @@ const VictoryPortal = initialProps => {
|
|
|
7003
7006
|
groupComponent,
|
|
7004
7007
|
standalone: false
|
|
7005
7008
|
} : {};
|
|
7006
|
-
const newProps =
|
|
7009
|
+
const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__.omit(props, ["children", "groupComponent"]), {
|
|
7007
7010
|
key: childProps.key ?? id
|
|
7008
7011
|
});
|
|
7009
|
-
const child = children && /*#__PURE__*/
|
|
7010
|
-
|
|
7012
|
+
const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().cloneElement(children, newProps);
|
|
7013
|
+
react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
|
|
7011
7014
|
portalContext?.addChild(id, child);
|
|
7012
7015
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7013
7016
|
}, [props.children]);
|
|
7014
|
-
|
|
7017
|
+
react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
|
|
7015
7018
|
return () => portalContext?.removeChild(id);
|
|
7016
7019
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7017
7020
|
}, []);
|
|
@@ -7265,7 +7268,26 @@ const green = {
|
|
|
7265
7268
|
"500": "#20C933",
|
|
7266
7269
|
"900": "#338A17"
|
|
7267
7270
|
};
|
|
7268
|
-
const colors =
|
|
7271
|
+
const colors = {
|
|
7272
|
+
blue: blue["500"],
|
|
7273
|
+
pink: pink["500"],
|
|
7274
|
+
teal: teal["500"],
|
|
7275
|
+
purple: purple["500"],
|
|
7276
|
+
green: green["500"],
|
|
7277
|
+
orange: orange["500"],
|
|
7278
|
+
cyan: cyan["500"],
|
|
7279
|
+
red: red["500"],
|
|
7280
|
+
yellow: yellow["500"]
|
|
7281
|
+
};
|
|
7282
|
+
const colorScale = Object.values(colors);
|
|
7283
|
+
const grayscale = [gray["200"], gray["400"], gray["600"], gray["900"]];
|
|
7284
|
+
const warm = [yellow["500"], orange["500"], red["500"], pink["500"]];
|
|
7285
|
+
const cool = [cyan["500"], teal["500"], blue["500"], purple["500"]];
|
|
7286
|
+
const heatmap = [green["500"], yellow["500"], red["500"]];
|
|
7287
|
+
const redPalette = [red["500"], red["300"], red["100"]];
|
|
7288
|
+
const greenPalette = [green["500"], green["300"], green["100"]];
|
|
7289
|
+
const bluePalette = [blue["500"], blue["300"], blue["100"]];
|
|
7290
|
+
|
|
7269
7291
|
// *
|
|
7270
7292
|
// * Typography
|
|
7271
7293
|
// *
|
|
@@ -7280,7 +7302,7 @@ const baseProps = {
|
|
|
7280
7302
|
width: 450,
|
|
7281
7303
|
height: 300,
|
|
7282
7304
|
padding: 50,
|
|
7283
|
-
colorScale
|
|
7305
|
+
colorScale
|
|
7284
7306
|
};
|
|
7285
7307
|
// *
|
|
7286
7308
|
// * Labels
|
|
@@ -7309,10 +7331,23 @@ const borderRadius = 1;
|
|
|
7309
7331
|
// * Theme
|
|
7310
7332
|
// *
|
|
7311
7333
|
const clean = {
|
|
7334
|
+
palette: {
|
|
7335
|
+
colors,
|
|
7336
|
+
grayscale,
|
|
7337
|
+
qualitative: colorScale,
|
|
7338
|
+
heatmap,
|
|
7339
|
+
warm,
|
|
7340
|
+
cool,
|
|
7341
|
+
red: redPalette,
|
|
7342
|
+
green: greenPalette,
|
|
7343
|
+
blue: bluePalette
|
|
7344
|
+
},
|
|
7312
7345
|
area: Object.assign({
|
|
7313
7346
|
style: {
|
|
7314
7347
|
data: {
|
|
7315
|
-
fill:
|
|
7348
|
+
fill: blue["500"],
|
|
7349
|
+
strokeWidth: 2,
|
|
7350
|
+
fillOpacity: 0.5
|
|
7316
7351
|
},
|
|
7317
7352
|
labels: baseLabelStyles
|
|
7318
7353
|
}
|
|
@@ -7321,7 +7356,7 @@ const clean = {
|
|
|
7321
7356
|
style: {
|
|
7322
7357
|
axis: {
|
|
7323
7358
|
fill: "transparent",
|
|
7324
|
-
stroke: gray["
|
|
7359
|
+
stroke: gray["500"],
|
|
7325
7360
|
strokeWidth: 1,
|
|
7326
7361
|
strokeLinecap,
|
|
7327
7362
|
strokeLinejoin
|
|
@@ -7346,10 +7381,10 @@ const clean = {
|
|
|
7346
7381
|
polarAxis: Object.assign({
|
|
7347
7382
|
style: {
|
|
7348
7383
|
axis: {
|
|
7349
|
-
stroke: gray["
|
|
7384
|
+
stroke: gray["500"]
|
|
7350
7385
|
},
|
|
7351
7386
|
grid: {
|
|
7352
|
-
stroke: gray["
|
|
7387
|
+
stroke: gray["400"],
|
|
7353
7388
|
strokeDasharray,
|
|
7354
7389
|
strokeLinecap,
|
|
7355
7390
|
strokeLinejoin,
|
|
@@ -7358,7 +7393,7 @@ const clean = {
|
|
|
7358
7393
|
ticks: {
|
|
7359
7394
|
fill: "transparent",
|
|
7360
7395
|
size: 5,
|
|
7361
|
-
stroke: gray["
|
|
7396
|
+
stroke: gray["400"],
|
|
7362
7397
|
strokeWidth: 1,
|
|
7363
7398
|
strokeLinecap,
|
|
7364
7399
|
strokeLinejoin
|
|
@@ -7369,10 +7404,10 @@ const clean = {
|
|
|
7369
7404
|
polarDependentAxis: Object.assign({
|
|
7370
7405
|
style: {
|
|
7371
7406
|
axis: {
|
|
7372
|
-
stroke: gray["
|
|
7407
|
+
stroke: gray["500"]
|
|
7373
7408
|
},
|
|
7374
7409
|
grid: {
|
|
7375
|
-
stroke: gray["
|
|
7410
|
+
stroke: gray["400"],
|
|
7376
7411
|
strokeDasharray,
|
|
7377
7412
|
strokeLinecap,
|
|
7378
7413
|
strokeLinejoin,
|
|
@@ -7381,7 +7416,7 @@ const clean = {
|
|
|
7381
7416
|
ticks: {
|
|
7382
7417
|
fill: "transparent",
|
|
7383
7418
|
size: 5,
|
|
7384
|
-
stroke: gray["
|
|
7419
|
+
stroke: gray["300"],
|
|
7385
7420
|
strokeWidth: 1,
|
|
7386
7421
|
strokeLinecap,
|
|
7387
7422
|
strokeLinejoin
|
|
@@ -7394,7 +7429,8 @@ const clean = {
|
|
|
7394
7429
|
data: {
|
|
7395
7430
|
fill: blue["500"],
|
|
7396
7431
|
padding,
|
|
7397
|
-
strokeWidth:
|
|
7432
|
+
strokeWidth: 1,
|
|
7433
|
+
fillOpacity: 0.5
|
|
7398
7434
|
},
|
|
7399
7435
|
labels: baseLabelStyles
|
|
7400
7436
|
},
|
|
@@ -7431,14 +7467,15 @@ const clean = {
|
|
|
7431
7467
|
q1: {
|
|
7432
7468
|
padding,
|
|
7433
7469
|
fill: teal["500"],
|
|
7434
|
-
rx: borderRadius
|
|
7470
|
+
rx: borderRadius,
|
|
7471
|
+
strokeWidth: 2
|
|
7435
7472
|
},
|
|
7436
7473
|
q1Labels: Object.assign({}, baseLabelStyles, {
|
|
7437
7474
|
padding: 3
|
|
7438
7475
|
}),
|
|
7439
7476
|
q3: {
|
|
7440
7477
|
padding,
|
|
7441
|
-
fill:
|
|
7478
|
+
fill: cyan["500"],
|
|
7442
7479
|
rx: borderRadius
|
|
7443
7480
|
},
|
|
7444
7481
|
q3Labels: Object.assign({}, baseLabelStyles, {
|
|
@@ -7479,14 +7516,13 @@ const clean = {
|
|
|
7479
7516
|
}
|
|
7480
7517
|
}, baseProps),
|
|
7481
7518
|
group: Object.assign({
|
|
7482
|
-
colorScale
|
|
7519
|
+
colorScale
|
|
7483
7520
|
}, baseProps),
|
|
7484
7521
|
histogram: Object.assign({
|
|
7485
7522
|
style: {
|
|
7486
7523
|
data: {
|
|
7487
7524
|
fill: cyan["500"],
|
|
7488
|
-
|
|
7489
|
-
strokeWidth: 0
|
|
7525
|
+
fillOpacity: 0.5
|
|
7490
7526
|
},
|
|
7491
7527
|
labels: baseLabelStyles
|
|
7492
7528
|
},
|
|
@@ -7497,21 +7533,23 @@ const clean = {
|
|
|
7497
7533
|
}, baseProps),
|
|
7498
7534
|
label: baseLabelStyles,
|
|
7499
7535
|
legend: {
|
|
7500
|
-
colorScale
|
|
7501
|
-
gutter:
|
|
7502
|
-
|
|
7536
|
+
colorScale,
|
|
7537
|
+
gutter: 24,
|
|
7538
|
+
borderPadding: 10,
|
|
7539
|
+
orientation: "horizontal",
|
|
7503
7540
|
titleOrientation: "top",
|
|
7541
|
+
centerTitle: true,
|
|
7504
7542
|
style: {
|
|
7505
7543
|
data: {
|
|
7506
7544
|
type: "circle"
|
|
7507
7545
|
},
|
|
7508
7546
|
labels: {
|
|
7509
7547
|
...baseLabelStyles,
|
|
7510
|
-
fontSize:
|
|
7548
|
+
fontSize: 12
|
|
7511
7549
|
},
|
|
7512
7550
|
title: Object.assign({}, baseLabelStyles, {
|
|
7513
7551
|
padding,
|
|
7514
|
-
fontSize:
|
|
7552
|
+
fontSize: 16
|
|
7515
7553
|
}),
|
|
7516
7554
|
border: {
|
|
7517
7555
|
stroke: gray["200"],
|
|
@@ -7525,7 +7563,7 @@ const clean = {
|
|
|
7525
7563
|
data: {
|
|
7526
7564
|
fill: "transparent",
|
|
7527
7565
|
opacity: 1,
|
|
7528
|
-
stroke:
|
|
7566
|
+
stroke: blue["500"],
|
|
7529
7567
|
strokeWidth: 2,
|
|
7530
7568
|
strokeLinecap,
|
|
7531
7569
|
strokeLinejoin
|
|
@@ -7535,16 +7573,22 @@ const clean = {
|
|
|
7535
7573
|
}, baseProps),
|
|
7536
7574
|
pie: Object.assign({
|
|
7537
7575
|
style: {
|
|
7576
|
+
parent: {
|
|
7577
|
+
backgroundColor: gray.white
|
|
7578
|
+
},
|
|
7538
7579
|
data: {
|
|
7539
7580
|
padding,
|
|
7540
7581
|
stroke: gray.white,
|
|
7541
7582
|
strokeWidth: 1
|
|
7542
7583
|
},
|
|
7543
|
-
labels:
|
|
7544
|
-
|
|
7545
|
-
|
|
7584
|
+
labels: {
|
|
7585
|
+
...baseLabelStyles,
|
|
7586
|
+
padding: 20,
|
|
7587
|
+
fill: gray["600"],
|
|
7588
|
+
fontSize: 10
|
|
7589
|
+
}
|
|
7546
7590
|
},
|
|
7547
|
-
colorScale
|
|
7591
|
+
colorScale,
|
|
7548
7592
|
cornerRadius: borderRadius
|
|
7549
7593
|
}, baseProps),
|
|
7550
7594
|
scatter: Object.assign({
|
|
@@ -7555,11 +7599,14 @@ const clean = {
|
|
|
7555
7599
|
stroke: "transparent",
|
|
7556
7600
|
strokeWidth: 0
|
|
7557
7601
|
},
|
|
7558
|
-
labels:
|
|
7602
|
+
labels: {
|
|
7603
|
+
...baseLabelStyles,
|
|
7604
|
+
padding: 20
|
|
7605
|
+
}
|
|
7559
7606
|
}
|
|
7560
7607
|
}, baseProps),
|
|
7561
7608
|
stack: Object.assign({
|
|
7562
|
-
colorScale
|
|
7609
|
+
colorScale
|
|
7563
7610
|
}, baseProps),
|
|
7564
7611
|
tooltip: {
|
|
7565
7612
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -7567,7 +7614,7 @@ const clean = {
|
|
|
7567
7614
|
pointerEvents: "none"
|
|
7568
7615
|
}),
|
|
7569
7616
|
flyoutStyle: {
|
|
7570
|
-
stroke: gray["
|
|
7617
|
+
stroke: gray["300"],
|
|
7571
7618
|
strokeWidth: 2,
|
|
7572
7619
|
fill: gray.white,
|
|
7573
7620
|
pointerEvents: "none"
|
|
@@ -7584,9 +7631,10 @@ const clean = {
|
|
|
7584
7631
|
voronoi: Object.assign({
|
|
7585
7632
|
style: {
|
|
7586
7633
|
data: {
|
|
7587
|
-
fill:
|
|
7588
|
-
stroke:
|
|
7589
|
-
strokeWidth: 2
|
|
7634
|
+
fill: blue["100"],
|
|
7635
|
+
stroke: blue["500"],
|
|
7636
|
+
strokeWidth: 2,
|
|
7637
|
+
opacity: 0.4
|
|
7590
7638
|
},
|
|
7591
7639
|
labels: Object.assign({}, baseLabelStyles, {
|
|
7592
7640
|
padding: 5,
|
|
@@ -7622,9 +7670,28 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7622
7670
|
// *
|
|
7623
7671
|
// * Colors
|
|
7624
7672
|
// *
|
|
7625
|
-
const colors =
|
|
7673
|
+
const colors = {
|
|
7674
|
+
blue: "#4F7DA1",
|
|
7675
|
+
pink: "#E2A37F",
|
|
7676
|
+
teal: "#00796B",
|
|
7677
|
+
purple: "#DF948A",
|
|
7678
|
+
green: "#8BC34A",
|
|
7679
|
+
orange: "#F4511E",
|
|
7680
|
+
cyan: "#006064",
|
|
7681
|
+
red: "#DF5A49",
|
|
7682
|
+
yellow: "#FFF59D"
|
|
7683
|
+
};
|
|
7684
|
+
const colorScale = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
|
|
7626
7685
|
const charcoal = "#252525";
|
|
7627
7686
|
const grey = "#969696";
|
|
7687
|
+
const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
|
|
7688
|
+
const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
|
|
7689
|
+
const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
|
|
7690
|
+
const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
|
|
7691
|
+
const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
|
|
7692
|
+
const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
|
|
7693
|
+
const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
|
|
7694
|
+
|
|
7628
7695
|
// *
|
|
7629
7696
|
// * Typography
|
|
7630
7697
|
// *
|
|
@@ -7638,7 +7705,7 @@ const baseProps = {
|
|
|
7638
7705
|
width: 450,
|
|
7639
7706
|
height: 300,
|
|
7640
7707
|
padding: 50,
|
|
7641
|
-
colorScale
|
|
7708
|
+
colorScale
|
|
7642
7709
|
};
|
|
7643
7710
|
// *
|
|
7644
7711
|
// * Labels
|
|
@@ -7660,6 +7727,17 @@ const centeredLabelStyles = Object.assign({
|
|
|
7660
7727
|
const strokeLinecap = "round";
|
|
7661
7728
|
const strokeLinejoin = "round";
|
|
7662
7729
|
const grayscale = {
|
|
7730
|
+
palette: {
|
|
7731
|
+
colors,
|
|
7732
|
+
grayscale: colorScale,
|
|
7733
|
+
qualitative,
|
|
7734
|
+
heatmap,
|
|
7735
|
+
warm,
|
|
7736
|
+
cool,
|
|
7737
|
+
red,
|
|
7738
|
+
green,
|
|
7739
|
+
blue
|
|
7740
|
+
},
|
|
7663
7741
|
area: Object.assign({
|
|
7664
7742
|
style: {
|
|
7665
7743
|
data: {
|
|
@@ -7774,7 +7852,7 @@ const grayscale = {
|
|
|
7774
7852
|
}
|
|
7775
7853
|
}, baseProps),
|
|
7776
7854
|
group: Object.assign({
|
|
7777
|
-
colorScale
|
|
7855
|
+
colorScale
|
|
7778
7856
|
}, baseProps),
|
|
7779
7857
|
histogram: Object.assign({
|
|
7780
7858
|
style: {
|
|
@@ -7787,7 +7865,7 @@ const grayscale = {
|
|
|
7787
7865
|
}
|
|
7788
7866
|
}, baseProps),
|
|
7789
7867
|
legend: {
|
|
7790
|
-
colorScale
|
|
7868
|
+
colorScale,
|
|
7791
7869
|
gutter: 10,
|
|
7792
7870
|
orientation: "vertical",
|
|
7793
7871
|
titleOrientation: "top",
|
|
@@ -7822,7 +7900,7 @@ const grayscale = {
|
|
|
7822
7900
|
padding: 20
|
|
7823
7901
|
})
|
|
7824
7902
|
},
|
|
7825
|
-
colorScale
|
|
7903
|
+
colorScale,
|
|
7826
7904
|
width: 400,
|
|
7827
7905
|
height: 400,
|
|
7828
7906
|
padding: 50
|
|
@@ -7838,7 +7916,7 @@ const grayscale = {
|
|
|
7838
7916
|
}
|
|
7839
7917
|
}, baseProps),
|
|
7840
7918
|
stack: Object.assign({
|
|
7841
|
-
colorScale
|
|
7919
|
+
colorScale
|
|
7842
7920
|
}, baseProps),
|
|
7843
7921
|
tooltip: {
|
|
7844
7922
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -7898,11 +7976,31 @@ const lime300 = "#DCE775";
|
|
|
7898
7976
|
const lightGreen500 = "#8BC34A";
|
|
7899
7977
|
const teal700 = "#00796B";
|
|
7900
7978
|
const cyan900 = "#006064";
|
|
7901
|
-
const
|
|
7979
|
+
const colorScale = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
|
|
7902
7980
|
const blueGrey50 = "#ECEFF1";
|
|
7903
7981
|
const blueGrey300 = "#90A4AE";
|
|
7904
7982
|
const blueGrey700 = "#455A64";
|
|
7905
7983
|
const grey900 = "#212121";
|
|
7984
|
+
const colors = {
|
|
7985
|
+
blue: "#4F7DA1",
|
|
7986
|
+
pink: "#E2A37F",
|
|
7987
|
+
teal: teal700,
|
|
7988
|
+
purple: "#DF948A",
|
|
7989
|
+
green: lightGreen500,
|
|
7990
|
+
orange: deepOrange600,
|
|
7991
|
+
cyan: cyan900,
|
|
7992
|
+
red: "#DF5A49",
|
|
7993
|
+
yellow: yellow200
|
|
7994
|
+
};
|
|
7995
|
+
const grayscale = [blueGrey50, blueGrey300, blueGrey700, grey900];
|
|
7996
|
+
const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
|
|
7997
|
+
const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
|
|
7998
|
+
const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
|
|
7999
|
+
const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
|
|
8000
|
+
const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
|
|
8001
|
+
const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
|
|
8002
|
+
const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
|
|
8003
|
+
|
|
7906
8004
|
// *
|
|
7907
8005
|
// * Typography
|
|
7908
8006
|
// *
|
|
@@ -7940,6 +8038,17 @@ const strokeDasharray = "10, 5";
|
|
|
7940
8038
|
const strokeLinecap = "round";
|
|
7941
8039
|
const strokeLinejoin = "round";
|
|
7942
8040
|
const material = {
|
|
8041
|
+
palette: {
|
|
8042
|
+
colors,
|
|
8043
|
+
grayscale,
|
|
8044
|
+
qualitative,
|
|
8045
|
+
heatmap,
|
|
8046
|
+
warm,
|
|
8047
|
+
cool,
|
|
8048
|
+
red,
|
|
8049
|
+
green,
|
|
8050
|
+
blue
|
|
8051
|
+
},
|
|
7943
8052
|
area: Object.assign({
|
|
7944
8053
|
style: {
|
|
7945
8054
|
data: {
|
|
@@ -8072,7 +8181,7 @@ const material = {
|
|
|
8072
8181
|
}
|
|
8073
8182
|
}, baseProps),
|
|
8074
8183
|
group: Object.assign({
|
|
8075
|
-
colorScale
|
|
8184
|
+
colorScale
|
|
8076
8185
|
}, baseProps),
|
|
8077
8186
|
histogram: Object.assign({
|
|
8078
8187
|
style: {
|
|
@@ -8085,7 +8194,7 @@ const material = {
|
|
|
8085
8194
|
}
|
|
8086
8195
|
}, baseProps),
|
|
8087
8196
|
legend: {
|
|
8088
|
-
colorScale
|
|
8197
|
+
colorScale,
|
|
8089
8198
|
gutter: 10,
|
|
8090
8199
|
orientation: "vertical",
|
|
8091
8200
|
titleOrientation: "top",
|
|
@@ -8111,7 +8220,7 @@ const material = {
|
|
|
8111
8220
|
}
|
|
8112
8221
|
}, baseProps),
|
|
8113
8222
|
pie: Object.assign({
|
|
8114
|
-
colorScale
|
|
8223
|
+
colorScale,
|
|
8115
8224
|
style: {
|
|
8116
8225
|
data: {
|
|
8117
8226
|
padding,
|
|
@@ -8135,7 +8244,7 @@ const material = {
|
|
|
8135
8244
|
}
|
|
8136
8245
|
}, baseProps),
|
|
8137
8246
|
stack: Object.assign({
|
|
8138
|
-
colorScale
|
|
8247
|
+
colorScale
|
|
8139
8248
|
}, baseProps),
|
|
8140
8249
|
tooltip: {
|
|
8141
8250
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -10997,6 +11106,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10997
11106
|
/* harmony export */ "getColorScale": function() { return /* binding */ getColorScale; },
|
|
10998
11107
|
/* harmony export */ "toTransformString": function() { return /* binding */ toTransformString; }
|
|
10999
11108
|
/* harmony export */ });
|
|
11109
|
+
/* 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");
|
|
11110
|
+
|
|
11111
|
+
|
|
11000
11112
|
/**
|
|
11001
11113
|
* Given an object with CSS/SVG transform definitions, return the string value
|
|
11002
11114
|
* for use with the `transform` CSS property or SVG attribute. Note that we
|
|
@@ -11033,20 +11145,37 @@ const toTransformString = function (obj) {
|
|
|
11033
11145
|
* of 5 hex string values in that color scale. If no 'name' parameter
|
|
11034
11146
|
* is given, it will return the Victory default grayscale.
|
|
11035
11147
|
* @param {String} name The name of the color scale to return (optional).
|
|
11148
|
+
* @param {Object} theme The theme object to retrieve the color scale from (optional).
|
|
11036
11149
|
* @returns {Array} An array of 5 hex string values composing a color scale.
|
|
11037
11150
|
*/
|
|
11038
|
-
function getColorScale(name) {
|
|
11151
|
+
function getColorScale(name, theme) {
|
|
11152
|
+
if (theme === void 0) {
|
|
11153
|
+
theme = _victory_theme_victory_theme__WEBPACK_IMPORTED_MODULE_0__.VictoryTheme.material;
|
|
11154
|
+
}
|
|
11155
|
+
const {
|
|
11156
|
+
palette: {
|
|
11157
|
+
grayscale = ["#cccccc", "#969696", "#636363", "#252525"],
|
|
11158
|
+
qualitative = [],
|
|
11159
|
+
heatmap = [],
|
|
11160
|
+
warm = [],
|
|
11161
|
+
cool = [],
|
|
11162
|
+
red = [],
|
|
11163
|
+
blue = [],
|
|
11164
|
+
green = []
|
|
11165
|
+
} = {}
|
|
11166
|
+
} = theme;
|
|
11039
11167
|
const scales = {
|
|
11040
|
-
grayscale
|
|
11041
|
-
qualitative
|
|
11042
|
-
heatmap
|
|
11043
|
-
warm
|
|
11044
|
-
cool
|
|
11045
|
-
red
|
|
11046
|
-
blue
|
|
11047
|
-
green
|
|
11048
|
-
};
|
|
11049
|
-
|
|
11168
|
+
grayscale,
|
|
11169
|
+
qualitative,
|
|
11170
|
+
heatmap,
|
|
11171
|
+
warm,
|
|
11172
|
+
cool,
|
|
11173
|
+
red,
|
|
11174
|
+
blue,
|
|
11175
|
+
green
|
|
11176
|
+
};
|
|
11177
|
+
const selectedScale = name && scales[name]?.length ? scales[name] : scales.grayscale;
|
|
11178
|
+
return selectedScale;
|
|
11050
11179
|
}
|
|
11051
11180
|
|
|
11052
11181
|
/***/ }),
|