victory-bar 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-bar.js +198 -69
- package/dist/victory-bar.min.js +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/dist/victory-bar.js
CHANGED
|
@@ -6685,31 +6685,34 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6685
6685
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6686
6686
|
/* harmony export */ "VictoryPortal": function() { return /* binding */ VictoryPortal; }
|
|
6687
6687
|
/* harmony export */ });
|
|
6688
|
-
/* harmony import */ var
|
|
6689
|
-
/* harmony import */ var
|
|
6690
|
-
/* harmony import */ var
|
|
6691
|
-
/* harmony import */ var
|
|
6692
|
-
/* harmony import */ var
|
|
6693
|
-
/* harmony import */ var
|
|
6694
|
-
/* harmony import */ var
|
|
6688
|
+
/* 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");
|
|
6689
|
+
/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0__);
|
|
6690
|
+
/* 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");
|
|
6691
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
6692
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
|
|
6693
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
|
|
6694
|
+
/* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
|
|
6695
|
+
/* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
6696
|
+
/* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
|
|
6697
|
+
|
|
6695
6698
|
|
|
6696
6699
|
|
|
6697
6700
|
|
|
6698
6701
|
|
|
6699
6702
|
|
|
6700
6703
|
const defaultProps = {
|
|
6701
|
-
groupComponent: /*#__PURE__*/
|
|
6704
|
+
groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement("g", null)
|
|
6702
6705
|
};
|
|
6703
6706
|
const VictoryPortal = initialProps => {
|
|
6704
6707
|
const props = {
|
|
6705
6708
|
...defaultProps,
|
|
6706
6709
|
...initialProps
|
|
6707
6710
|
};
|
|
6708
|
-
const id =
|
|
6709
|
-
const portalContext = (0,
|
|
6711
|
+
const id = lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default()();
|
|
6712
|
+
const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_3__.usePortalContext)();
|
|
6710
6713
|
if (!portalContext) {
|
|
6711
6714
|
const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
|
|
6712
|
-
|
|
6715
|
+
_victory_util_log__WEBPACK_IMPORTED_MODULE_4__.warn(msg);
|
|
6713
6716
|
}
|
|
6714
6717
|
const children = Array.isArray(props.children) ? props.children[0] : props.children;
|
|
6715
6718
|
const {
|
|
@@ -6720,15 +6723,15 @@ const VictoryPortal = initialProps => {
|
|
|
6720
6723
|
groupComponent,
|
|
6721
6724
|
standalone: false
|
|
6722
6725
|
} : {};
|
|
6723
|
-
const newProps =
|
|
6726
|
+
const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__.omit(props, ["children", "groupComponent"]), {
|
|
6724
6727
|
key: childProps.key ?? id
|
|
6725
6728
|
});
|
|
6726
|
-
const child = children && /*#__PURE__*/
|
|
6727
|
-
|
|
6729
|
+
const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().cloneElement(children, newProps);
|
|
6730
|
+
react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
|
|
6728
6731
|
portalContext?.addChild(id, child);
|
|
6729
6732
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6730
6733
|
}, [props.children]);
|
|
6731
|
-
|
|
6734
|
+
react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
|
|
6732
6735
|
return () => portalContext?.removeChild(id);
|
|
6733
6736
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6734
6737
|
}, []);
|
|
@@ -6982,7 +6985,26 @@ const green = {
|
|
|
6982
6985
|
"500": "#20C933",
|
|
6983
6986
|
"900": "#338A17"
|
|
6984
6987
|
};
|
|
6985
|
-
const colors =
|
|
6988
|
+
const colors = {
|
|
6989
|
+
blue: blue["500"],
|
|
6990
|
+
pink: pink["500"],
|
|
6991
|
+
teal: teal["500"],
|
|
6992
|
+
purple: purple["500"],
|
|
6993
|
+
green: green["500"],
|
|
6994
|
+
orange: orange["500"],
|
|
6995
|
+
cyan: cyan["500"],
|
|
6996
|
+
red: red["500"],
|
|
6997
|
+
yellow: yellow["500"]
|
|
6998
|
+
};
|
|
6999
|
+
const colorScale = Object.values(colors);
|
|
7000
|
+
const grayscale = [gray["200"], gray["400"], gray["600"], gray["900"]];
|
|
7001
|
+
const warm = [yellow["500"], orange["500"], red["500"], pink["500"]];
|
|
7002
|
+
const cool = [cyan["500"], teal["500"], blue["500"], purple["500"]];
|
|
7003
|
+
const heatmap = [green["500"], yellow["500"], red["500"]];
|
|
7004
|
+
const redPalette = [red["500"], red["300"], red["100"]];
|
|
7005
|
+
const greenPalette = [green["500"], green["300"], green["100"]];
|
|
7006
|
+
const bluePalette = [blue["500"], blue["300"], blue["100"]];
|
|
7007
|
+
|
|
6986
7008
|
// *
|
|
6987
7009
|
// * Typography
|
|
6988
7010
|
// *
|
|
@@ -6997,7 +7019,7 @@ const baseProps = {
|
|
|
6997
7019
|
width: 450,
|
|
6998
7020
|
height: 300,
|
|
6999
7021
|
padding: 50,
|
|
7000
|
-
colorScale
|
|
7022
|
+
colorScale
|
|
7001
7023
|
};
|
|
7002
7024
|
// *
|
|
7003
7025
|
// * Labels
|
|
@@ -7026,10 +7048,23 @@ const borderRadius = 1;
|
|
|
7026
7048
|
// * Theme
|
|
7027
7049
|
// *
|
|
7028
7050
|
const clean = {
|
|
7051
|
+
palette: {
|
|
7052
|
+
colors,
|
|
7053
|
+
grayscale,
|
|
7054
|
+
qualitative: colorScale,
|
|
7055
|
+
heatmap,
|
|
7056
|
+
warm,
|
|
7057
|
+
cool,
|
|
7058
|
+
red: redPalette,
|
|
7059
|
+
green: greenPalette,
|
|
7060
|
+
blue: bluePalette
|
|
7061
|
+
},
|
|
7029
7062
|
area: Object.assign({
|
|
7030
7063
|
style: {
|
|
7031
7064
|
data: {
|
|
7032
|
-
fill:
|
|
7065
|
+
fill: blue["500"],
|
|
7066
|
+
strokeWidth: 2,
|
|
7067
|
+
fillOpacity: 0.5
|
|
7033
7068
|
},
|
|
7034
7069
|
labels: baseLabelStyles
|
|
7035
7070
|
}
|
|
@@ -7038,7 +7073,7 @@ const clean = {
|
|
|
7038
7073
|
style: {
|
|
7039
7074
|
axis: {
|
|
7040
7075
|
fill: "transparent",
|
|
7041
|
-
stroke: gray["
|
|
7076
|
+
stroke: gray["500"],
|
|
7042
7077
|
strokeWidth: 1,
|
|
7043
7078
|
strokeLinecap,
|
|
7044
7079
|
strokeLinejoin
|
|
@@ -7063,10 +7098,10 @@ const clean = {
|
|
|
7063
7098
|
polarAxis: Object.assign({
|
|
7064
7099
|
style: {
|
|
7065
7100
|
axis: {
|
|
7066
|
-
stroke: gray["
|
|
7101
|
+
stroke: gray["500"]
|
|
7067
7102
|
},
|
|
7068
7103
|
grid: {
|
|
7069
|
-
stroke: gray["
|
|
7104
|
+
stroke: gray["400"],
|
|
7070
7105
|
strokeDasharray,
|
|
7071
7106
|
strokeLinecap,
|
|
7072
7107
|
strokeLinejoin,
|
|
@@ -7075,7 +7110,7 @@ const clean = {
|
|
|
7075
7110
|
ticks: {
|
|
7076
7111
|
fill: "transparent",
|
|
7077
7112
|
size: 5,
|
|
7078
|
-
stroke: gray["
|
|
7113
|
+
stroke: gray["400"],
|
|
7079
7114
|
strokeWidth: 1,
|
|
7080
7115
|
strokeLinecap,
|
|
7081
7116
|
strokeLinejoin
|
|
@@ -7086,10 +7121,10 @@ const clean = {
|
|
|
7086
7121
|
polarDependentAxis: Object.assign({
|
|
7087
7122
|
style: {
|
|
7088
7123
|
axis: {
|
|
7089
|
-
stroke: gray["
|
|
7124
|
+
stroke: gray["500"]
|
|
7090
7125
|
},
|
|
7091
7126
|
grid: {
|
|
7092
|
-
stroke: gray["
|
|
7127
|
+
stroke: gray["400"],
|
|
7093
7128
|
strokeDasharray,
|
|
7094
7129
|
strokeLinecap,
|
|
7095
7130
|
strokeLinejoin,
|
|
@@ -7098,7 +7133,7 @@ const clean = {
|
|
|
7098
7133
|
ticks: {
|
|
7099
7134
|
fill: "transparent",
|
|
7100
7135
|
size: 5,
|
|
7101
|
-
stroke: gray["
|
|
7136
|
+
stroke: gray["300"],
|
|
7102
7137
|
strokeWidth: 1,
|
|
7103
7138
|
strokeLinecap,
|
|
7104
7139
|
strokeLinejoin
|
|
@@ -7111,7 +7146,8 @@ const clean = {
|
|
|
7111
7146
|
data: {
|
|
7112
7147
|
fill: blue["500"],
|
|
7113
7148
|
padding,
|
|
7114
|
-
strokeWidth:
|
|
7149
|
+
strokeWidth: 1,
|
|
7150
|
+
fillOpacity: 0.5
|
|
7115
7151
|
},
|
|
7116
7152
|
labels: baseLabelStyles
|
|
7117
7153
|
},
|
|
@@ -7148,14 +7184,15 @@ const clean = {
|
|
|
7148
7184
|
q1: {
|
|
7149
7185
|
padding,
|
|
7150
7186
|
fill: teal["500"],
|
|
7151
|
-
rx: borderRadius
|
|
7187
|
+
rx: borderRadius,
|
|
7188
|
+
strokeWidth: 2
|
|
7152
7189
|
},
|
|
7153
7190
|
q1Labels: Object.assign({}, baseLabelStyles, {
|
|
7154
7191
|
padding: 3
|
|
7155
7192
|
}),
|
|
7156
7193
|
q3: {
|
|
7157
7194
|
padding,
|
|
7158
|
-
fill:
|
|
7195
|
+
fill: cyan["500"],
|
|
7159
7196
|
rx: borderRadius
|
|
7160
7197
|
},
|
|
7161
7198
|
q3Labels: Object.assign({}, baseLabelStyles, {
|
|
@@ -7196,14 +7233,13 @@ const clean = {
|
|
|
7196
7233
|
}
|
|
7197
7234
|
}, baseProps),
|
|
7198
7235
|
group: Object.assign({
|
|
7199
|
-
colorScale
|
|
7236
|
+
colorScale
|
|
7200
7237
|
}, baseProps),
|
|
7201
7238
|
histogram: Object.assign({
|
|
7202
7239
|
style: {
|
|
7203
7240
|
data: {
|
|
7204
7241
|
fill: cyan["500"],
|
|
7205
|
-
|
|
7206
|
-
strokeWidth: 0
|
|
7242
|
+
fillOpacity: 0.5
|
|
7207
7243
|
},
|
|
7208
7244
|
labels: baseLabelStyles
|
|
7209
7245
|
},
|
|
@@ -7214,21 +7250,23 @@ const clean = {
|
|
|
7214
7250
|
}, baseProps),
|
|
7215
7251
|
label: baseLabelStyles,
|
|
7216
7252
|
legend: {
|
|
7217
|
-
colorScale
|
|
7218
|
-
gutter:
|
|
7219
|
-
|
|
7253
|
+
colorScale,
|
|
7254
|
+
gutter: 24,
|
|
7255
|
+
borderPadding: 10,
|
|
7256
|
+
orientation: "horizontal",
|
|
7220
7257
|
titleOrientation: "top",
|
|
7258
|
+
centerTitle: true,
|
|
7221
7259
|
style: {
|
|
7222
7260
|
data: {
|
|
7223
7261
|
type: "circle"
|
|
7224
7262
|
},
|
|
7225
7263
|
labels: {
|
|
7226
7264
|
...baseLabelStyles,
|
|
7227
|
-
fontSize:
|
|
7265
|
+
fontSize: 12
|
|
7228
7266
|
},
|
|
7229
7267
|
title: Object.assign({}, baseLabelStyles, {
|
|
7230
7268
|
padding,
|
|
7231
|
-
fontSize:
|
|
7269
|
+
fontSize: 16
|
|
7232
7270
|
}),
|
|
7233
7271
|
border: {
|
|
7234
7272
|
stroke: gray["200"],
|
|
@@ -7242,7 +7280,7 @@ const clean = {
|
|
|
7242
7280
|
data: {
|
|
7243
7281
|
fill: "transparent",
|
|
7244
7282
|
opacity: 1,
|
|
7245
|
-
stroke:
|
|
7283
|
+
stroke: blue["500"],
|
|
7246
7284
|
strokeWidth: 2,
|
|
7247
7285
|
strokeLinecap,
|
|
7248
7286
|
strokeLinejoin
|
|
@@ -7252,16 +7290,22 @@ const clean = {
|
|
|
7252
7290
|
}, baseProps),
|
|
7253
7291
|
pie: Object.assign({
|
|
7254
7292
|
style: {
|
|
7293
|
+
parent: {
|
|
7294
|
+
backgroundColor: gray.white
|
|
7295
|
+
},
|
|
7255
7296
|
data: {
|
|
7256
7297
|
padding,
|
|
7257
7298
|
stroke: gray.white,
|
|
7258
7299
|
strokeWidth: 1
|
|
7259
7300
|
},
|
|
7260
|
-
labels:
|
|
7261
|
-
|
|
7262
|
-
|
|
7301
|
+
labels: {
|
|
7302
|
+
...baseLabelStyles,
|
|
7303
|
+
padding: 20,
|
|
7304
|
+
fill: gray["600"],
|
|
7305
|
+
fontSize: 10
|
|
7306
|
+
}
|
|
7263
7307
|
},
|
|
7264
|
-
colorScale
|
|
7308
|
+
colorScale,
|
|
7265
7309
|
cornerRadius: borderRadius
|
|
7266
7310
|
}, baseProps),
|
|
7267
7311
|
scatter: Object.assign({
|
|
@@ -7272,11 +7316,14 @@ const clean = {
|
|
|
7272
7316
|
stroke: "transparent",
|
|
7273
7317
|
strokeWidth: 0
|
|
7274
7318
|
},
|
|
7275
|
-
labels:
|
|
7319
|
+
labels: {
|
|
7320
|
+
...baseLabelStyles,
|
|
7321
|
+
padding: 20
|
|
7322
|
+
}
|
|
7276
7323
|
}
|
|
7277
7324
|
}, baseProps),
|
|
7278
7325
|
stack: Object.assign({
|
|
7279
|
-
colorScale
|
|
7326
|
+
colorScale
|
|
7280
7327
|
}, baseProps),
|
|
7281
7328
|
tooltip: {
|
|
7282
7329
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -7284,7 +7331,7 @@ const clean = {
|
|
|
7284
7331
|
pointerEvents: "none"
|
|
7285
7332
|
}),
|
|
7286
7333
|
flyoutStyle: {
|
|
7287
|
-
stroke: gray["
|
|
7334
|
+
stroke: gray["300"],
|
|
7288
7335
|
strokeWidth: 2,
|
|
7289
7336
|
fill: gray.white,
|
|
7290
7337
|
pointerEvents: "none"
|
|
@@ -7301,9 +7348,10 @@ const clean = {
|
|
|
7301
7348
|
voronoi: Object.assign({
|
|
7302
7349
|
style: {
|
|
7303
7350
|
data: {
|
|
7304
|
-
fill:
|
|
7305
|
-
stroke:
|
|
7306
|
-
strokeWidth: 2
|
|
7351
|
+
fill: blue["100"],
|
|
7352
|
+
stroke: blue["500"],
|
|
7353
|
+
strokeWidth: 2,
|
|
7354
|
+
opacity: 0.4
|
|
7307
7355
|
},
|
|
7308
7356
|
labels: Object.assign({}, baseLabelStyles, {
|
|
7309
7357
|
padding: 5,
|
|
@@ -7339,9 +7387,28 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7339
7387
|
// *
|
|
7340
7388
|
// * Colors
|
|
7341
7389
|
// *
|
|
7342
|
-
const colors =
|
|
7390
|
+
const colors = {
|
|
7391
|
+
blue: "#4F7DA1",
|
|
7392
|
+
pink: "#E2A37F",
|
|
7393
|
+
teal: "#00796B",
|
|
7394
|
+
purple: "#DF948A",
|
|
7395
|
+
green: "#8BC34A",
|
|
7396
|
+
orange: "#F4511E",
|
|
7397
|
+
cyan: "#006064",
|
|
7398
|
+
red: "#DF5A49",
|
|
7399
|
+
yellow: "#FFF59D"
|
|
7400
|
+
};
|
|
7401
|
+
const colorScale = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
|
|
7343
7402
|
const charcoal = "#252525";
|
|
7344
7403
|
const grey = "#969696";
|
|
7404
|
+
const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
|
|
7405
|
+
const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
|
|
7406
|
+
const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
|
|
7407
|
+
const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
|
|
7408
|
+
const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
|
|
7409
|
+
const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
|
|
7410
|
+
const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
|
|
7411
|
+
|
|
7345
7412
|
// *
|
|
7346
7413
|
// * Typography
|
|
7347
7414
|
// *
|
|
@@ -7355,7 +7422,7 @@ const baseProps = {
|
|
|
7355
7422
|
width: 450,
|
|
7356
7423
|
height: 300,
|
|
7357
7424
|
padding: 50,
|
|
7358
|
-
colorScale
|
|
7425
|
+
colorScale
|
|
7359
7426
|
};
|
|
7360
7427
|
// *
|
|
7361
7428
|
// * Labels
|
|
@@ -7377,6 +7444,17 @@ const centeredLabelStyles = Object.assign({
|
|
|
7377
7444
|
const strokeLinecap = "round";
|
|
7378
7445
|
const strokeLinejoin = "round";
|
|
7379
7446
|
const grayscale = {
|
|
7447
|
+
palette: {
|
|
7448
|
+
colors,
|
|
7449
|
+
grayscale: colorScale,
|
|
7450
|
+
qualitative,
|
|
7451
|
+
heatmap,
|
|
7452
|
+
warm,
|
|
7453
|
+
cool,
|
|
7454
|
+
red,
|
|
7455
|
+
green,
|
|
7456
|
+
blue
|
|
7457
|
+
},
|
|
7380
7458
|
area: Object.assign({
|
|
7381
7459
|
style: {
|
|
7382
7460
|
data: {
|
|
@@ -7491,7 +7569,7 @@ const grayscale = {
|
|
|
7491
7569
|
}
|
|
7492
7570
|
}, baseProps),
|
|
7493
7571
|
group: Object.assign({
|
|
7494
|
-
colorScale
|
|
7572
|
+
colorScale
|
|
7495
7573
|
}, baseProps),
|
|
7496
7574
|
histogram: Object.assign({
|
|
7497
7575
|
style: {
|
|
@@ -7504,7 +7582,7 @@ const grayscale = {
|
|
|
7504
7582
|
}
|
|
7505
7583
|
}, baseProps),
|
|
7506
7584
|
legend: {
|
|
7507
|
-
colorScale
|
|
7585
|
+
colorScale,
|
|
7508
7586
|
gutter: 10,
|
|
7509
7587
|
orientation: "vertical",
|
|
7510
7588
|
titleOrientation: "top",
|
|
@@ -7539,7 +7617,7 @@ const grayscale = {
|
|
|
7539
7617
|
padding: 20
|
|
7540
7618
|
})
|
|
7541
7619
|
},
|
|
7542
|
-
colorScale
|
|
7620
|
+
colorScale,
|
|
7543
7621
|
width: 400,
|
|
7544
7622
|
height: 400,
|
|
7545
7623
|
padding: 50
|
|
@@ -7555,7 +7633,7 @@ const grayscale = {
|
|
|
7555
7633
|
}
|
|
7556
7634
|
}, baseProps),
|
|
7557
7635
|
stack: Object.assign({
|
|
7558
|
-
colorScale
|
|
7636
|
+
colorScale
|
|
7559
7637
|
}, baseProps),
|
|
7560
7638
|
tooltip: {
|
|
7561
7639
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -7615,11 +7693,31 @@ const lime300 = "#DCE775";
|
|
|
7615
7693
|
const lightGreen500 = "#8BC34A";
|
|
7616
7694
|
const teal700 = "#00796B";
|
|
7617
7695
|
const cyan900 = "#006064";
|
|
7618
|
-
const
|
|
7696
|
+
const colorScale = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
|
|
7619
7697
|
const blueGrey50 = "#ECEFF1";
|
|
7620
7698
|
const blueGrey300 = "#90A4AE";
|
|
7621
7699
|
const blueGrey700 = "#455A64";
|
|
7622
7700
|
const grey900 = "#212121";
|
|
7701
|
+
const colors = {
|
|
7702
|
+
blue: "#4F7DA1",
|
|
7703
|
+
pink: "#E2A37F",
|
|
7704
|
+
teal: teal700,
|
|
7705
|
+
purple: "#DF948A",
|
|
7706
|
+
green: lightGreen500,
|
|
7707
|
+
orange: deepOrange600,
|
|
7708
|
+
cyan: cyan900,
|
|
7709
|
+
red: "#DF5A49",
|
|
7710
|
+
yellow: yellow200
|
|
7711
|
+
};
|
|
7712
|
+
const grayscale = [blueGrey50, blueGrey300, blueGrey700, grey900];
|
|
7713
|
+
const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
|
|
7714
|
+
const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
|
|
7715
|
+
const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
|
|
7716
|
+
const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
|
|
7717
|
+
const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
|
|
7718
|
+
const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
|
|
7719
|
+
const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
|
|
7720
|
+
|
|
7623
7721
|
// *
|
|
7624
7722
|
// * Typography
|
|
7625
7723
|
// *
|
|
@@ -7657,6 +7755,17 @@ const strokeDasharray = "10, 5";
|
|
|
7657
7755
|
const strokeLinecap = "round";
|
|
7658
7756
|
const strokeLinejoin = "round";
|
|
7659
7757
|
const material = {
|
|
7758
|
+
palette: {
|
|
7759
|
+
colors,
|
|
7760
|
+
grayscale,
|
|
7761
|
+
qualitative,
|
|
7762
|
+
heatmap,
|
|
7763
|
+
warm,
|
|
7764
|
+
cool,
|
|
7765
|
+
red,
|
|
7766
|
+
green,
|
|
7767
|
+
blue
|
|
7768
|
+
},
|
|
7660
7769
|
area: Object.assign({
|
|
7661
7770
|
style: {
|
|
7662
7771
|
data: {
|
|
@@ -7789,7 +7898,7 @@ const material = {
|
|
|
7789
7898
|
}
|
|
7790
7899
|
}, baseProps),
|
|
7791
7900
|
group: Object.assign({
|
|
7792
|
-
colorScale
|
|
7901
|
+
colorScale
|
|
7793
7902
|
}, baseProps),
|
|
7794
7903
|
histogram: Object.assign({
|
|
7795
7904
|
style: {
|
|
@@ -7802,7 +7911,7 @@ const material = {
|
|
|
7802
7911
|
}
|
|
7803
7912
|
}, baseProps),
|
|
7804
7913
|
legend: {
|
|
7805
|
-
colorScale
|
|
7914
|
+
colorScale,
|
|
7806
7915
|
gutter: 10,
|
|
7807
7916
|
orientation: "vertical",
|
|
7808
7917
|
titleOrientation: "top",
|
|
@@ -7828,7 +7937,7 @@ const material = {
|
|
|
7828
7937
|
}
|
|
7829
7938
|
}, baseProps),
|
|
7830
7939
|
pie: Object.assign({
|
|
7831
|
-
colorScale
|
|
7940
|
+
colorScale,
|
|
7832
7941
|
style: {
|
|
7833
7942
|
data: {
|
|
7834
7943
|
padding,
|
|
@@ -7852,7 +7961,7 @@ const material = {
|
|
|
7852
7961
|
}
|
|
7853
7962
|
}, baseProps),
|
|
7854
7963
|
stack: Object.assign({
|
|
7855
|
-
colorScale
|
|
7964
|
+
colorScale
|
|
7856
7965
|
}, baseProps),
|
|
7857
7966
|
tooltip: {
|
|
7858
7967
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -10714,6 +10823,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10714
10823
|
/* harmony export */ "getColorScale": function() { return /* binding */ getColorScale; },
|
|
10715
10824
|
/* harmony export */ "toTransformString": function() { return /* binding */ toTransformString; }
|
|
10716
10825
|
/* harmony export */ });
|
|
10826
|
+
/* 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");
|
|
10827
|
+
|
|
10828
|
+
|
|
10717
10829
|
/**
|
|
10718
10830
|
* Given an object with CSS/SVG transform definitions, return the string value
|
|
10719
10831
|
* for use with the `transform` CSS property or SVG attribute. Note that we
|
|
@@ -10750,20 +10862,37 @@ const toTransformString = function (obj) {
|
|
|
10750
10862
|
* of 5 hex string values in that color scale. If no 'name' parameter
|
|
10751
10863
|
* is given, it will return the Victory default grayscale.
|
|
10752
10864
|
* @param {String} name The name of the color scale to return (optional).
|
|
10865
|
+
* @param {Object} theme The theme object to retrieve the color scale from (optional).
|
|
10753
10866
|
* @returns {Array} An array of 5 hex string values composing a color scale.
|
|
10754
10867
|
*/
|
|
10755
|
-
function getColorScale(name) {
|
|
10868
|
+
function getColorScale(name, theme) {
|
|
10869
|
+
if (theme === void 0) {
|
|
10870
|
+
theme = _victory_theme_victory_theme__WEBPACK_IMPORTED_MODULE_0__.VictoryTheme.material;
|
|
10871
|
+
}
|
|
10872
|
+
const {
|
|
10873
|
+
palette: {
|
|
10874
|
+
grayscale = ["#cccccc", "#969696", "#636363", "#252525"],
|
|
10875
|
+
qualitative = [],
|
|
10876
|
+
heatmap = [],
|
|
10877
|
+
warm = [],
|
|
10878
|
+
cool = [],
|
|
10879
|
+
red = [],
|
|
10880
|
+
blue = [],
|
|
10881
|
+
green = []
|
|
10882
|
+
} = {}
|
|
10883
|
+
} = theme;
|
|
10756
10884
|
const scales = {
|
|
10757
|
-
grayscale
|
|
10758
|
-
qualitative
|
|
10759
|
-
heatmap
|
|
10760
|
-
warm
|
|
10761
|
-
cool
|
|
10762
|
-
red
|
|
10763
|
-
blue
|
|
10764
|
-
green
|
|
10765
|
-
};
|
|
10766
|
-
|
|
10885
|
+
grayscale,
|
|
10886
|
+
qualitative,
|
|
10887
|
+
heatmap,
|
|
10888
|
+
warm,
|
|
10889
|
+
cool,
|
|
10890
|
+
red,
|
|
10891
|
+
blue,
|
|
10892
|
+
green
|
|
10893
|
+
};
|
|
10894
|
+
const selectedScale = name && scales[name]?.length ? scales[name] : scales.grayscale;
|
|
10895
|
+
return selectedScale;
|
|
10767
10896
|
}
|
|
10768
10897
|
|
|
10769
10898
|
/***/ }),
|