victory-scatter 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-scatter.js +206 -80
- 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] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(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
|
}, []);
|
|
@@ -6224,20 +6227,16 @@ const orange = {
|
|
|
6224
6227
|
"100": "#FEE2D5",
|
|
6225
6228
|
"300": "#FFA981",
|
|
6226
6229
|
"500": "#FF6F2C",
|
|
6230
|
+
"700": "#FF4E1B",
|
|
6227
6231
|
"900": "#D74D26"
|
|
6228
6232
|
};
|
|
6229
6233
|
const red = {
|
|
6230
6234
|
"100": "#FFDCE5",
|
|
6231
6235
|
"300": "#FF9EB7",
|
|
6232
6236
|
"500": "#F82B60",
|
|
6237
|
+
"700": "#D31A3D",
|
|
6233
6238
|
"900": "#BA1E45"
|
|
6234
6239
|
};
|
|
6235
|
-
const pink = {
|
|
6236
|
-
"100": "#FFDAF6",
|
|
6237
|
-
"300": "#F99DE2",
|
|
6238
|
-
"500": "#FF08C2",
|
|
6239
|
-
"900": "#B2158B"
|
|
6240
|
-
};
|
|
6241
6240
|
const purple = {
|
|
6242
6241
|
"100": "#EDE3FE",
|
|
6243
6242
|
"300": "#CDB0FF",
|
|
@@ -6248,6 +6247,7 @@ const blue = {
|
|
|
6248
6247
|
"100": "#CFDFFF",
|
|
6249
6248
|
"300": "#9CC7FF",
|
|
6250
6249
|
"500": "#2D7FF9",
|
|
6250
|
+
"700": "#0056B3",
|
|
6251
6251
|
"900": "#2750AE"
|
|
6252
6252
|
};
|
|
6253
6253
|
const cyan = {
|
|
@@ -6266,9 +6266,29 @@ const green = {
|
|
|
6266
6266
|
"100": "#D1F7C4",
|
|
6267
6267
|
"300": "#93E088",
|
|
6268
6268
|
"500": "#20C933",
|
|
6269
|
+
"700": "#1B9B2A",
|
|
6269
6270
|
"900": "#338A17"
|
|
6270
6271
|
};
|
|
6271
|
-
const colors =
|
|
6272
|
+
const colors = {
|
|
6273
|
+
blue: blue["500"],
|
|
6274
|
+
cyan: cyan["500"],
|
|
6275
|
+
green: green["500"],
|
|
6276
|
+
yellow: yellow["500"],
|
|
6277
|
+
orange: orange["500"],
|
|
6278
|
+
red: red["500"],
|
|
6279
|
+
purple: purple["500"],
|
|
6280
|
+
teal: teal["500"]
|
|
6281
|
+
};
|
|
6282
|
+
const colorScale = Object.values(colors);
|
|
6283
|
+
const grayscale = [gray["100"], gray["300"], gray["500"], gray["700"], gray["900"]];
|
|
6284
|
+
const warm = [yellow["300"], yellow["500"], orange["500"], orange["900"], red["500"]];
|
|
6285
|
+
const cool = [purple["500"], blue["500"], cyan["500"], teal["500"], green["500"]];
|
|
6286
|
+
const heatmap = [green["900"], green["500"], yellow["500"], orange["500"], red["500"]];
|
|
6287
|
+
const redPalette = Object.values(red);
|
|
6288
|
+
const greenPalette = Object.values(green);
|
|
6289
|
+
const bluePalette = Object.values(blue);
|
|
6290
|
+
const defaultColor = blue["500"];
|
|
6291
|
+
|
|
6272
6292
|
// *
|
|
6273
6293
|
// * Typography
|
|
6274
6294
|
// *
|
|
@@ -6282,8 +6302,8 @@ const padding = 8;
|
|
|
6282
6302
|
const baseProps = {
|
|
6283
6303
|
width: 450,
|
|
6284
6304
|
height: 300,
|
|
6285
|
-
padding:
|
|
6286
|
-
colorScale
|
|
6305
|
+
padding: 60,
|
|
6306
|
+
colorScale
|
|
6287
6307
|
};
|
|
6288
6308
|
// *
|
|
6289
6309
|
// * Labels
|
|
@@ -6312,10 +6332,23 @@ const borderRadius = 1;
|
|
|
6312
6332
|
// * Theme
|
|
6313
6333
|
// *
|
|
6314
6334
|
const clean = {
|
|
6335
|
+
palette: {
|
|
6336
|
+
colors,
|
|
6337
|
+
grayscale,
|
|
6338
|
+
qualitative: colorScale,
|
|
6339
|
+
heatmap,
|
|
6340
|
+
warm,
|
|
6341
|
+
cool,
|
|
6342
|
+
red: redPalette,
|
|
6343
|
+
green: greenPalette,
|
|
6344
|
+
blue: bluePalette
|
|
6345
|
+
},
|
|
6315
6346
|
area: Object.assign({
|
|
6316
6347
|
style: {
|
|
6317
6348
|
data: {
|
|
6318
|
-
fill:
|
|
6349
|
+
fill: defaultColor,
|
|
6350
|
+
strokeWidth: 2,
|
|
6351
|
+
fillOpacity: 0.5
|
|
6319
6352
|
},
|
|
6320
6353
|
labels: baseLabelStyles
|
|
6321
6354
|
}
|
|
@@ -6324,13 +6357,13 @@ const clean = {
|
|
|
6324
6357
|
style: {
|
|
6325
6358
|
axis: {
|
|
6326
6359
|
fill: "transparent",
|
|
6327
|
-
stroke: gray["
|
|
6360
|
+
stroke: gray["500"],
|
|
6328
6361
|
strokeWidth: 1,
|
|
6329
6362
|
strokeLinecap,
|
|
6330
6363
|
strokeLinejoin
|
|
6331
6364
|
},
|
|
6332
6365
|
axisLabel: Object.assign({}, centeredLabelStyles, {
|
|
6333
|
-
padding,
|
|
6366
|
+
padding: 35,
|
|
6334
6367
|
stroke: "transparent"
|
|
6335
6368
|
}),
|
|
6336
6369
|
grid: {
|
|
@@ -6349,10 +6382,10 @@ const clean = {
|
|
|
6349
6382
|
polarAxis: Object.assign({
|
|
6350
6383
|
style: {
|
|
6351
6384
|
axis: {
|
|
6352
|
-
stroke: gray["
|
|
6385
|
+
stroke: gray["500"]
|
|
6353
6386
|
},
|
|
6354
6387
|
grid: {
|
|
6355
|
-
stroke: gray["
|
|
6388
|
+
stroke: gray["400"],
|
|
6356
6389
|
strokeDasharray,
|
|
6357
6390
|
strokeLinecap,
|
|
6358
6391
|
strokeLinejoin,
|
|
@@ -6361,7 +6394,7 @@ const clean = {
|
|
|
6361
6394
|
ticks: {
|
|
6362
6395
|
fill: "transparent",
|
|
6363
6396
|
size: 5,
|
|
6364
|
-
stroke: gray["
|
|
6397
|
+
stroke: gray["400"],
|
|
6365
6398
|
strokeWidth: 1,
|
|
6366
6399
|
strokeLinecap,
|
|
6367
6400
|
strokeLinejoin
|
|
@@ -6372,10 +6405,10 @@ const clean = {
|
|
|
6372
6405
|
polarDependentAxis: Object.assign({
|
|
6373
6406
|
style: {
|
|
6374
6407
|
axis: {
|
|
6375
|
-
stroke: gray["
|
|
6408
|
+
stroke: gray["500"]
|
|
6376
6409
|
},
|
|
6377
6410
|
grid: {
|
|
6378
|
-
stroke: gray["
|
|
6411
|
+
stroke: gray["400"],
|
|
6379
6412
|
strokeDasharray,
|
|
6380
6413
|
strokeLinecap,
|
|
6381
6414
|
strokeLinejoin,
|
|
@@ -6384,7 +6417,7 @@ const clean = {
|
|
|
6384
6417
|
ticks: {
|
|
6385
6418
|
fill: "transparent",
|
|
6386
6419
|
size: 5,
|
|
6387
|
-
stroke: gray["
|
|
6420
|
+
stroke: gray["300"],
|
|
6388
6421
|
strokeWidth: 1,
|
|
6389
6422
|
strokeLinecap,
|
|
6390
6423
|
strokeLinejoin
|
|
@@ -6395,9 +6428,10 @@ const clean = {
|
|
|
6395
6428
|
bar: Object.assign({
|
|
6396
6429
|
style: {
|
|
6397
6430
|
data: {
|
|
6398
|
-
fill:
|
|
6431
|
+
fill: defaultColor,
|
|
6399
6432
|
padding,
|
|
6400
|
-
strokeWidth:
|
|
6433
|
+
strokeWidth: 1,
|
|
6434
|
+
fillOpacity: 0.5
|
|
6401
6435
|
},
|
|
6402
6436
|
labels: baseLabelStyles
|
|
6403
6437
|
},
|
|
@@ -6433,15 +6467,16 @@ const clean = {
|
|
|
6433
6467
|
}),
|
|
6434
6468
|
q1: {
|
|
6435
6469
|
padding,
|
|
6436
|
-
fill:
|
|
6437
|
-
rx: borderRadius
|
|
6470
|
+
fill: colorScale[0],
|
|
6471
|
+
rx: borderRadius,
|
|
6472
|
+
strokeWidth: 2
|
|
6438
6473
|
},
|
|
6439
6474
|
q1Labels: Object.assign({}, baseLabelStyles, {
|
|
6440
6475
|
padding: 3
|
|
6441
6476
|
}),
|
|
6442
6477
|
q3: {
|
|
6443
6478
|
padding,
|
|
6444
|
-
fill:
|
|
6479
|
+
fill: colorScale[1],
|
|
6445
6480
|
rx: borderRadius
|
|
6446
6481
|
},
|
|
6447
6482
|
q3Labels: Object.assign({}, baseLabelStyles, {
|
|
@@ -6462,8 +6497,8 @@ const clean = {
|
|
|
6462
6497
|
})
|
|
6463
6498
|
},
|
|
6464
6499
|
candleColors: {
|
|
6465
|
-
positive:
|
|
6466
|
-
negative:
|
|
6500
|
+
positive: green["500"],
|
|
6501
|
+
negative: red["500"]
|
|
6467
6502
|
},
|
|
6468
6503
|
wickStrokeWidth: 2
|
|
6469
6504
|
}, baseProps),
|
|
@@ -6482,14 +6517,13 @@ const clean = {
|
|
|
6482
6517
|
}
|
|
6483
6518
|
}, baseProps),
|
|
6484
6519
|
group: Object.assign({
|
|
6485
|
-
colorScale
|
|
6520
|
+
colorScale
|
|
6486
6521
|
}, baseProps),
|
|
6487
6522
|
histogram: Object.assign({
|
|
6488
6523
|
style: {
|
|
6489
6524
|
data: {
|
|
6490
6525
|
fill: cyan["500"],
|
|
6491
|
-
|
|
6492
|
-
strokeWidth: 0
|
|
6526
|
+
fillOpacity: 0.5
|
|
6493
6527
|
},
|
|
6494
6528
|
labels: baseLabelStyles
|
|
6495
6529
|
},
|
|
@@ -6500,21 +6534,23 @@ const clean = {
|
|
|
6500
6534
|
}, baseProps),
|
|
6501
6535
|
label: baseLabelStyles,
|
|
6502
6536
|
legend: {
|
|
6503
|
-
colorScale
|
|
6504
|
-
gutter:
|
|
6505
|
-
|
|
6537
|
+
colorScale,
|
|
6538
|
+
gutter: 24,
|
|
6539
|
+
borderPadding: 10,
|
|
6540
|
+
orientation: "horizontal",
|
|
6506
6541
|
titleOrientation: "top",
|
|
6542
|
+
centerTitle: true,
|
|
6507
6543
|
style: {
|
|
6508
6544
|
data: {
|
|
6509
6545
|
type: "circle"
|
|
6510
6546
|
},
|
|
6511
6547
|
labels: {
|
|
6512
6548
|
...baseLabelStyles,
|
|
6513
|
-
fontSize:
|
|
6549
|
+
fontSize: 12
|
|
6514
6550
|
},
|
|
6515
6551
|
title: Object.assign({}, baseLabelStyles, {
|
|
6516
6552
|
padding,
|
|
6517
|
-
fontSize:
|
|
6553
|
+
fontSize: 16
|
|
6518
6554
|
}),
|
|
6519
6555
|
border: {
|
|
6520
6556
|
stroke: gray["200"],
|
|
@@ -6528,7 +6564,7 @@ const clean = {
|
|
|
6528
6564
|
data: {
|
|
6529
6565
|
fill: "transparent",
|
|
6530
6566
|
opacity: 1,
|
|
6531
|
-
stroke:
|
|
6567
|
+
stroke: defaultColor,
|
|
6532
6568
|
strokeWidth: 2,
|
|
6533
6569
|
strokeLinecap,
|
|
6534
6570
|
strokeLinejoin
|
|
@@ -6538,31 +6574,40 @@ const clean = {
|
|
|
6538
6574
|
}, baseProps),
|
|
6539
6575
|
pie: Object.assign({
|
|
6540
6576
|
style: {
|
|
6577
|
+
parent: {
|
|
6578
|
+
backgroundColor: gray.white
|
|
6579
|
+
},
|
|
6541
6580
|
data: {
|
|
6542
6581
|
padding,
|
|
6543
6582
|
stroke: gray.white,
|
|
6544
6583
|
strokeWidth: 1
|
|
6545
6584
|
},
|
|
6546
|
-
labels:
|
|
6547
|
-
|
|
6548
|
-
|
|
6585
|
+
labels: {
|
|
6586
|
+
...baseLabelStyles,
|
|
6587
|
+
padding: 20,
|
|
6588
|
+
fill: gray["600"],
|
|
6589
|
+
fontSize: 10
|
|
6590
|
+
}
|
|
6549
6591
|
},
|
|
6550
|
-
colorScale
|
|
6592
|
+
colorScale,
|
|
6551
6593
|
cornerRadius: borderRadius
|
|
6552
6594
|
}, baseProps),
|
|
6553
6595
|
scatter: Object.assign({
|
|
6554
6596
|
style: {
|
|
6555
6597
|
data: {
|
|
6556
|
-
fill:
|
|
6598
|
+
fill: defaultColor,
|
|
6557
6599
|
opacity: 1,
|
|
6558
6600
|
stroke: "transparent",
|
|
6559
6601
|
strokeWidth: 0
|
|
6560
6602
|
},
|
|
6561
|
-
labels:
|
|
6603
|
+
labels: {
|
|
6604
|
+
...baseLabelStyles,
|
|
6605
|
+
padding: 20
|
|
6606
|
+
}
|
|
6562
6607
|
}
|
|
6563
6608
|
}, baseProps),
|
|
6564
6609
|
stack: Object.assign({
|
|
6565
|
-
colorScale
|
|
6610
|
+
colorScale
|
|
6566
6611
|
}, baseProps),
|
|
6567
6612
|
tooltip: {
|
|
6568
6613
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -6570,7 +6615,7 @@ const clean = {
|
|
|
6570
6615
|
pointerEvents: "none"
|
|
6571
6616
|
}),
|
|
6572
6617
|
flyoutStyle: {
|
|
6573
|
-
stroke: gray["
|
|
6618
|
+
stroke: gray["300"],
|
|
6574
6619
|
strokeWidth: 2,
|
|
6575
6620
|
fill: gray.white,
|
|
6576
6621
|
pointerEvents: "none"
|
|
@@ -6587,8 +6632,8 @@ const clean = {
|
|
|
6587
6632
|
voronoi: Object.assign({
|
|
6588
6633
|
style: {
|
|
6589
6634
|
data: {
|
|
6590
|
-
fill:
|
|
6591
|
-
stroke:
|
|
6635
|
+
fill: blue["100"],
|
|
6636
|
+
stroke: defaultColor,
|
|
6592
6637
|
strokeWidth: 2
|
|
6593
6638
|
},
|
|
6594
6639
|
labels: Object.assign({}, baseLabelStyles, {
|
|
@@ -6625,9 +6670,28 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6625
6670
|
// *
|
|
6626
6671
|
// * Colors
|
|
6627
6672
|
// *
|
|
6628
|
-
const colors =
|
|
6673
|
+
const colors = {
|
|
6674
|
+
blue: "#4F7DA1",
|
|
6675
|
+
pink: "#E2A37F",
|
|
6676
|
+
teal: "#00796B",
|
|
6677
|
+
purple: "#DF948A",
|
|
6678
|
+
green: "#8BC34A",
|
|
6679
|
+
orange: "#F4511E",
|
|
6680
|
+
cyan: "#006064",
|
|
6681
|
+
red: "#DF5A49",
|
|
6682
|
+
yellow: "#FFF59D"
|
|
6683
|
+
};
|
|
6684
|
+
const colorScale = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
|
|
6629
6685
|
const charcoal = "#252525";
|
|
6630
6686
|
const grey = "#969696";
|
|
6687
|
+
const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
|
|
6688
|
+
const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
|
|
6689
|
+
const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
|
|
6690
|
+
const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
|
|
6691
|
+
const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
|
|
6692
|
+
const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
|
|
6693
|
+
const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
|
|
6694
|
+
|
|
6631
6695
|
// *
|
|
6632
6696
|
// * Typography
|
|
6633
6697
|
// *
|
|
@@ -6641,7 +6705,7 @@ const baseProps = {
|
|
|
6641
6705
|
width: 450,
|
|
6642
6706
|
height: 300,
|
|
6643
6707
|
padding: 50,
|
|
6644
|
-
colorScale
|
|
6708
|
+
colorScale
|
|
6645
6709
|
};
|
|
6646
6710
|
// *
|
|
6647
6711
|
// * Labels
|
|
@@ -6663,6 +6727,17 @@ const centeredLabelStyles = Object.assign({
|
|
|
6663
6727
|
const strokeLinecap = "round";
|
|
6664
6728
|
const strokeLinejoin = "round";
|
|
6665
6729
|
const grayscale = {
|
|
6730
|
+
palette: {
|
|
6731
|
+
colors,
|
|
6732
|
+
grayscale: colorScale,
|
|
6733
|
+
qualitative,
|
|
6734
|
+
heatmap,
|
|
6735
|
+
warm,
|
|
6736
|
+
cool,
|
|
6737
|
+
red,
|
|
6738
|
+
green,
|
|
6739
|
+
blue
|
|
6740
|
+
},
|
|
6666
6741
|
area: Object.assign({
|
|
6667
6742
|
style: {
|
|
6668
6743
|
data: {
|
|
@@ -6777,7 +6852,7 @@ const grayscale = {
|
|
|
6777
6852
|
}
|
|
6778
6853
|
}, baseProps),
|
|
6779
6854
|
group: Object.assign({
|
|
6780
|
-
colorScale
|
|
6855
|
+
colorScale
|
|
6781
6856
|
}, baseProps),
|
|
6782
6857
|
histogram: Object.assign({
|
|
6783
6858
|
style: {
|
|
@@ -6790,7 +6865,7 @@ const grayscale = {
|
|
|
6790
6865
|
}
|
|
6791
6866
|
}, baseProps),
|
|
6792
6867
|
legend: {
|
|
6793
|
-
colorScale
|
|
6868
|
+
colorScale,
|
|
6794
6869
|
gutter: 10,
|
|
6795
6870
|
orientation: "vertical",
|
|
6796
6871
|
titleOrientation: "top",
|
|
@@ -6825,7 +6900,7 @@ const grayscale = {
|
|
|
6825
6900
|
padding: 20
|
|
6826
6901
|
})
|
|
6827
6902
|
},
|
|
6828
|
-
colorScale
|
|
6903
|
+
colorScale,
|
|
6829
6904
|
width: 400,
|
|
6830
6905
|
height: 400,
|
|
6831
6906
|
padding: 50
|
|
@@ -6841,7 +6916,7 @@ const grayscale = {
|
|
|
6841
6916
|
}
|
|
6842
6917
|
}, baseProps),
|
|
6843
6918
|
stack: Object.assign({
|
|
6844
|
-
colorScale
|
|
6919
|
+
colorScale
|
|
6845
6920
|
}, baseProps),
|
|
6846
6921
|
tooltip: {
|
|
6847
6922
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -6901,11 +6976,31 @@ const lime300 = "#DCE775";
|
|
|
6901
6976
|
const lightGreen500 = "#8BC34A";
|
|
6902
6977
|
const teal700 = "#00796B";
|
|
6903
6978
|
const cyan900 = "#006064";
|
|
6904
|
-
const
|
|
6979
|
+
const colorScale = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
|
|
6905
6980
|
const blueGrey50 = "#ECEFF1";
|
|
6906
6981
|
const blueGrey300 = "#90A4AE";
|
|
6907
6982
|
const blueGrey700 = "#455A64";
|
|
6908
6983
|
const grey900 = "#212121";
|
|
6984
|
+
const colors = {
|
|
6985
|
+
blue: "#4F7DA1",
|
|
6986
|
+
pink: "#E2A37F",
|
|
6987
|
+
teal: teal700,
|
|
6988
|
+
purple: "#DF948A",
|
|
6989
|
+
green: lightGreen500,
|
|
6990
|
+
orange: deepOrange600,
|
|
6991
|
+
cyan: cyan900,
|
|
6992
|
+
red: "#DF5A49",
|
|
6993
|
+
yellow: yellow200
|
|
6994
|
+
};
|
|
6995
|
+
const grayscale = [blueGrey50, blueGrey300, blueGrey700, grey900];
|
|
6996
|
+
const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
|
|
6997
|
+
const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
|
|
6998
|
+
const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
|
|
6999
|
+
const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
|
|
7000
|
+
const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
|
|
7001
|
+
const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
|
|
7002
|
+
const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
|
|
7003
|
+
|
|
6909
7004
|
// *
|
|
6910
7005
|
// * Typography
|
|
6911
7006
|
// *
|
|
@@ -6943,6 +7038,17 @@ const strokeDasharray = "10, 5";
|
|
|
6943
7038
|
const strokeLinecap = "round";
|
|
6944
7039
|
const strokeLinejoin = "round";
|
|
6945
7040
|
const material = {
|
|
7041
|
+
palette: {
|
|
7042
|
+
colors,
|
|
7043
|
+
grayscale,
|
|
7044
|
+
qualitative,
|
|
7045
|
+
heatmap,
|
|
7046
|
+
warm,
|
|
7047
|
+
cool,
|
|
7048
|
+
red,
|
|
7049
|
+
green,
|
|
7050
|
+
blue
|
|
7051
|
+
},
|
|
6946
7052
|
area: Object.assign({
|
|
6947
7053
|
style: {
|
|
6948
7054
|
data: {
|
|
@@ -7075,7 +7181,7 @@ const material = {
|
|
|
7075
7181
|
}
|
|
7076
7182
|
}, baseProps),
|
|
7077
7183
|
group: Object.assign({
|
|
7078
|
-
colorScale
|
|
7184
|
+
colorScale
|
|
7079
7185
|
}, baseProps),
|
|
7080
7186
|
histogram: Object.assign({
|
|
7081
7187
|
style: {
|
|
@@ -7088,7 +7194,7 @@ const material = {
|
|
|
7088
7194
|
}
|
|
7089
7195
|
}, baseProps),
|
|
7090
7196
|
legend: {
|
|
7091
|
-
colorScale
|
|
7197
|
+
colorScale,
|
|
7092
7198
|
gutter: 10,
|
|
7093
7199
|
orientation: "vertical",
|
|
7094
7200
|
titleOrientation: "top",
|
|
@@ -7114,7 +7220,7 @@ const material = {
|
|
|
7114
7220
|
}
|
|
7115
7221
|
}, baseProps),
|
|
7116
7222
|
pie: Object.assign({
|
|
7117
|
-
colorScale
|
|
7223
|
+
colorScale,
|
|
7118
7224
|
style: {
|
|
7119
7225
|
data: {
|
|
7120
7226
|
padding,
|
|
@@ -7138,7 +7244,7 @@ const material = {
|
|
|
7138
7244
|
}
|
|
7139
7245
|
}, baseProps),
|
|
7140
7246
|
stack: Object.assign({
|
|
7141
|
-
colorScale
|
|
7247
|
+
colorScale
|
|
7142
7248
|
}, baseProps),
|
|
7143
7249
|
tooltip: {
|
|
7144
7250
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -10238,6 +10344,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10238
10344
|
/* harmony export */ "getColorScale": function() { return /* binding */ getColorScale; },
|
|
10239
10345
|
/* harmony export */ "toTransformString": function() { return /* binding */ toTransformString; }
|
|
10240
10346
|
/* harmony export */ });
|
|
10347
|
+
/* 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");
|
|
10348
|
+
|
|
10349
|
+
|
|
10241
10350
|
/**
|
|
10242
10351
|
* Given an object with CSS/SVG transform definitions, return the string value
|
|
10243
10352
|
* for use with the `transform` CSS property or SVG attribute. Note that we
|
|
@@ -10274,20 +10383,37 @@ const toTransformString = function (obj) {
|
|
|
10274
10383
|
* of 5 hex string values in that color scale. If no 'name' parameter
|
|
10275
10384
|
* is given, it will return the Victory default grayscale.
|
|
10276
10385
|
* @param {String} name The name of the color scale to return (optional).
|
|
10386
|
+
* @param {Object} theme The theme object to retrieve the color scale from (optional).
|
|
10277
10387
|
* @returns {Array} An array of 5 hex string values composing a color scale.
|
|
10278
10388
|
*/
|
|
10279
|
-
function getColorScale(name) {
|
|
10389
|
+
function getColorScale(name, theme) {
|
|
10390
|
+
if (theme === void 0) {
|
|
10391
|
+
theme = _victory_theme_victory_theme__WEBPACK_IMPORTED_MODULE_0__.VictoryTheme.material;
|
|
10392
|
+
}
|
|
10393
|
+
const {
|
|
10394
|
+
palette: {
|
|
10395
|
+
grayscale = ["#cccccc", "#969696", "#636363", "#252525"],
|
|
10396
|
+
qualitative = [],
|
|
10397
|
+
heatmap = [],
|
|
10398
|
+
warm = [],
|
|
10399
|
+
cool = [],
|
|
10400
|
+
red = [],
|
|
10401
|
+
blue = [],
|
|
10402
|
+
green = []
|
|
10403
|
+
} = {}
|
|
10404
|
+
} = theme;
|
|
10280
10405
|
const scales = {
|
|
10281
|
-
grayscale
|
|
10282
|
-
qualitative
|
|
10283
|
-
heatmap
|
|
10284
|
-
warm
|
|
10285
|
-
cool
|
|
10286
|
-
red
|
|
10287
|
-
blue
|
|
10288
|
-
green
|
|
10406
|
+
grayscale,
|
|
10407
|
+
qualitative,
|
|
10408
|
+
heatmap,
|
|
10409
|
+
warm,
|
|
10410
|
+
cool,
|
|
10411
|
+
red,
|
|
10412
|
+
blue,
|
|
10413
|
+
green
|
|
10289
10414
|
};
|
|
10290
|
-
|
|
10415
|
+
const selectedScale = name && scales[name]?.length ? scales[name] : scales.grayscale;
|
|
10416
|
+
return selectedScale;
|
|
10291
10417
|
}
|
|
10292
10418
|
|
|
10293
10419
|
/***/ }),
|