victory-scatter 37.1.1 → 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.
@@ -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 lodash_defaults__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaults.js");
5882
- /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
5883
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
5884
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
5885
- /* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
5886
- /* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
5887
- /* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
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__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("g", null)
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 = react__WEBPACK_IMPORTED_MODULE_1___default().useId();
5902
- const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_2__.usePortalContext)();
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
- _victory_util_log__WEBPACK_IMPORTED_MODULE_3__.warn(msg);
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 = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.omit(props, ["children", "groupComponent"]), {
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__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(children, newProps);
5920
- react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
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
- react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
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
  }, []);
@@ -6185,6 +6188,477 @@ const TSpan = props => {
6185
6188
 
6186
6189
  /***/ }),
6187
6190
 
6191
+ /***/ "../../victory-core/es/victory-theme/clean.js":
6192
+ /*!****************************************************!*\
6193
+ !*** ../../victory-core/es/victory-theme/clean.js ***!
6194
+ \****************************************************/
6195
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6196
+
6197
+ "use strict";
6198
+ __webpack_require__.r(__webpack_exports__);
6199
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6200
+ /* harmony export */ "clean": function() { return /* binding */ clean; }
6201
+ /* harmony export */ });
6202
+ // *
6203
+ // * Colors
6204
+ // *
6205
+
6206
+ const gray = {
6207
+ white: "#FFFFFF",
6208
+ "50": "#FAFAFA",
6209
+ "100": "#F2F2F2",
6210
+ "200": "#E8E8E8",
6211
+ "300": "#E0E0E0",
6212
+ "400": "#D1D1D1",
6213
+ "500": "#757575",
6214
+ "600": "#5C5C5C",
6215
+ "700": "#424242",
6216
+ "800": "#333333",
6217
+ "900": "#292929",
6218
+ black: "#0F0F0F"
6219
+ };
6220
+ const yellow = {
6221
+ "100": "#FFEAB6",
6222
+ "300": "#FFD66E",
6223
+ "500": "#FCB400",
6224
+ "900": "#B87503"
6225
+ };
6226
+ const orange = {
6227
+ "100": "#FEE2D5",
6228
+ "300": "#FFA981",
6229
+ "500": "#FF6F2C",
6230
+ "900": "#D74D26"
6231
+ };
6232
+ const red = {
6233
+ "100": "#FFDCE5",
6234
+ "300": "#FF9EB7",
6235
+ "500": "#F82B60",
6236
+ "900": "#BA1E45"
6237
+ };
6238
+ const pink = {
6239
+ "100": "#FFDAF6",
6240
+ "300": "#F99DE2",
6241
+ "500": "#FF08C2",
6242
+ "900": "#B2158B"
6243
+ };
6244
+ const purple = {
6245
+ "100": "#EDE3FE",
6246
+ "300": "#CDB0FF",
6247
+ "500": "#8B46FF",
6248
+ "900": "#6B1CB0"
6249
+ };
6250
+ const blue = {
6251
+ "100": "#CFDFFF",
6252
+ "300": "#9CC7FF",
6253
+ "500": "#2D7FF9",
6254
+ "900": "#2750AE"
6255
+ };
6256
+ const cyan = {
6257
+ "100": "#D0F0FD",
6258
+ "300": "#77D1F3",
6259
+ "500": "#18BFFF",
6260
+ "900": "#0B76B7"
6261
+ };
6262
+ const teal = {
6263
+ "100": "#C2F5E9",
6264
+ "300": "#72DDC3",
6265
+ "500": "#20D9D2",
6266
+ "900": "#06A09B"
6267
+ };
6268
+ const green = {
6269
+ "100": "#D1F7C4",
6270
+ "300": "#93E088",
6271
+ "500": "#20C933",
6272
+ "900": "#338A17"
6273
+ };
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
+
6294
+ // *
6295
+ // * Typography
6296
+ // *
6297
+ const sansSerif = "'Inter', 'Helvetica Neue', 'Seravek', 'Helvetica', sans-serif";
6298
+ const letterSpacing = "normal";
6299
+ const fontSize = 12;
6300
+ // *
6301
+ // * Layout
6302
+ // *
6303
+ const padding = 8;
6304
+ const baseProps = {
6305
+ width: 450,
6306
+ height: 300,
6307
+ padding: 50,
6308
+ colorScale
6309
+ };
6310
+ // *
6311
+ // * Labels
6312
+ // *
6313
+ const baseLabelStyles = {
6314
+ fontFamily: sansSerif,
6315
+ fontSize,
6316
+ fontWeight: 300,
6317
+ letterSpacing,
6318
+ padding,
6319
+ fill: gray["900"],
6320
+ stroke: "transparent"
6321
+ };
6322
+ const centeredLabelStyles = Object.assign({
6323
+ textAnchor: "middle"
6324
+ }, baseLabelStyles);
6325
+
6326
+ // *
6327
+ // * Strokes
6328
+ // *
6329
+ const strokeDasharray = "10, 5";
6330
+ const strokeLinecap = "round";
6331
+ const strokeLinejoin = "round";
6332
+ const borderRadius = 1;
6333
+ // *
6334
+ // * Theme
6335
+ // *
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
+ },
6348
+ area: Object.assign({
6349
+ style: {
6350
+ data: {
6351
+ fill: blue["500"],
6352
+ strokeWidth: 2,
6353
+ fillOpacity: 0.5
6354
+ },
6355
+ labels: baseLabelStyles
6356
+ }
6357
+ }, baseProps),
6358
+ axis: Object.assign({
6359
+ style: {
6360
+ axis: {
6361
+ fill: "transparent",
6362
+ stroke: gray["500"],
6363
+ strokeWidth: 1,
6364
+ strokeLinecap,
6365
+ strokeLinejoin
6366
+ },
6367
+ axisLabel: Object.assign({}, centeredLabelStyles, {
6368
+ padding,
6369
+ stroke: "transparent"
6370
+ }),
6371
+ grid: {
6372
+ fill: "none",
6373
+ stroke: "none",
6374
+ painterEvents: "painted"
6375
+ },
6376
+ ticks: {
6377
+ fill: "transparent",
6378
+ size: 5,
6379
+ stroke: "transparent"
6380
+ },
6381
+ tickLabels: baseLabelStyles
6382
+ }
6383
+ }, baseProps),
6384
+ polarAxis: Object.assign({
6385
+ style: {
6386
+ axis: {
6387
+ stroke: gray["500"]
6388
+ },
6389
+ grid: {
6390
+ stroke: gray["400"],
6391
+ strokeDasharray,
6392
+ strokeLinecap,
6393
+ strokeLinejoin,
6394
+ pointerEvents: "painted"
6395
+ },
6396
+ ticks: {
6397
+ fill: "transparent",
6398
+ size: 5,
6399
+ stroke: gray["400"],
6400
+ strokeWidth: 1,
6401
+ strokeLinecap,
6402
+ strokeLinejoin
6403
+ },
6404
+ tickLabels: baseLabelStyles
6405
+ }
6406
+ }),
6407
+ polarDependentAxis: Object.assign({
6408
+ style: {
6409
+ axis: {
6410
+ stroke: gray["500"]
6411
+ },
6412
+ grid: {
6413
+ stroke: gray["400"],
6414
+ strokeDasharray,
6415
+ strokeLinecap,
6416
+ strokeLinejoin,
6417
+ pointerEvents: "painted"
6418
+ },
6419
+ ticks: {
6420
+ fill: "transparent",
6421
+ size: 5,
6422
+ stroke: gray["300"],
6423
+ strokeWidth: 1,
6424
+ strokeLinecap,
6425
+ strokeLinejoin
6426
+ },
6427
+ tickLabels: baseLabelStyles
6428
+ }
6429
+ }),
6430
+ bar: Object.assign({
6431
+ style: {
6432
+ data: {
6433
+ fill: blue["500"],
6434
+ padding,
6435
+ strokeWidth: 1,
6436
+ fillOpacity: 0.5
6437
+ },
6438
+ labels: baseLabelStyles
6439
+ },
6440
+ cornerRadius: {
6441
+ top: borderRadius
6442
+ }
6443
+ }, baseProps),
6444
+ boxplot: Object.assign({
6445
+ style: {
6446
+ max: {
6447
+ padding,
6448
+ stroke: gray["400"],
6449
+ strokeWidth: 2
6450
+ },
6451
+ maxLabels: Object.assign({}, baseLabelStyles, {
6452
+ padding: 3
6453
+ }),
6454
+ median: {
6455
+ padding,
6456
+ stroke: gray.white,
6457
+ strokeWidth: 2
6458
+ },
6459
+ medianLabels: Object.assign({}, baseLabelStyles, {
6460
+ padding: 3
6461
+ }),
6462
+ min: {
6463
+ padding,
6464
+ stroke: gray["400"],
6465
+ strokeWidth: 2
6466
+ },
6467
+ minLabels: Object.assign({}, baseLabelStyles, {
6468
+ padding: 3
6469
+ }),
6470
+ q1: {
6471
+ padding,
6472
+ fill: teal["500"],
6473
+ rx: borderRadius,
6474
+ strokeWidth: 2
6475
+ },
6476
+ q1Labels: Object.assign({}, baseLabelStyles, {
6477
+ padding: 3
6478
+ }),
6479
+ q3: {
6480
+ padding,
6481
+ fill: cyan["500"],
6482
+ rx: borderRadius
6483
+ },
6484
+ q3Labels: Object.assign({}, baseLabelStyles, {
6485
+ padding: 3
6486
+ })
6487
+ },
6488
+ boxWidth: 20
6489
+ }, baseProps),
6490
+ candlestick: Object.assign({
6491
+ style: {
6492
+ data: {
6493
+ stroke: gray["300"],
6494
+ strokeWidth: 0,
6495
+ rx: borderRadius
6496
+ },
6497
+ labels: Object.assign({}, baseLabelStyles, {
6498
+ padding: 5
6499
+ })
6500
+ },
6501
+ candleColors: {
6502
+ positive: teal["500"],
6503
+ negative: orange["500"]
6504
+ },
6505
+ wickStrokeWidth: 2
6506
+ }, baseProps),
6507
+ chart: baseProps,
6508
+ errorbar: Object.assign({
6509
+ borderWidth: 8,
6510
+ style: {
6511
+ data: {
6512
+ fill: "transparent",
6513
+ opacity: 1,
6514
+ stroke: gray["700"],
6515
+ strokeWidth: 2,
6516
+ strokeLinecap
6517
+ },
6518
+ labels: baseLabelStyles
6519
+ }
6520
+ }, baseProps),
6521
+ group: Object.assign({
6522
+ colorScale
6523
+ }, baseProps),
6524
+ histogram: Object.assign({
6525
+ style: {
6526
+ data: {
6527
+ fill: cyan["500"],
6528
+ fillOpacity: 0.5
6529
+ },
6530
+ labels: baseLabelStyles
6531
+ },
6532
+ binSpacing: 4,
6533
+ cornerRadius: {
6534
+ top: borderRadius
6535
+ }
6536
+ }, baseProps),
6537
+ label: baseLabelStyles,
6538
+ legend: {
6539
+ colorScale,
6540
+ gutter: 24,
6541
+ borderPadding: 10,
6542
+ orientation: "horizontal",
6543
+ titleOrientation: "top",
6544
+ centerTitle: true,
6545
+ style: {
6546
+ data: {
6547
+ type: "circle"
6548
+ },
6549
+ labels: {
6550
+ ...baseLabelStyles,
6551
+ fontSize: 12
6552
+ },
6553
+ title: Object.assign({}, baseLabelStyles, {
6554
+ padding,
6555
+ fontSize: 16
6556
+ }),
6557
+ border: {
6558
+ stroke: gray["200"],
6559
+ strokeWidth: 2,
6560
+ padding: 16
6561
+ }
6562
+ }
6563
+ },
6564
+ line: Object.assign({
6565
+ style: {
6566
+ data: {
6567
+ fill: "transparent",
6568
+ opacity: 1,
6569
+ stroke: blue["500"],
6570
+ strokeWidth: 2,
6571
+ strokeLinecap,
6572
+ strokeLinejoin
6573
+ },
6574
+ labels: baseLabelStyles
6575
+ }
6576
+ }, baseProps),
6577
+ pie: Object.assign({
6578
+ style: {
6579
+ parent: {
6580
+ backgroundColor: gray.white
6581
+ },
6582
+ data: {
6583
+ padding,
6584
+ stroke: gray.white,
6585
+ strokeWidth: 1
6586
+ },
6587
+ labels: {
6588
+ ...baseLabelStyles,
6589
+ padding: 20,
6590
+ fill: gray["600"],
6591
+ fontSize: 10
6592
+ }
6593
+ },
6594
+ colorScale,
6595
+ cornerRadius: borderRadius
6596
+ }, baseProps),
6597
+ scatter: Object.assign({
6598
+ style: {
6599
+ data: {
6600
+ fill: purple["500"],
6601
+ opacity: 1,
6602
+ stroke: "transparent",
6603
+ strokeWidth: 0
6604
+ },
6605
+ labels: {
6606
+ ...baseLabelStyles,
6607
+ padding: 20
6608
+ }
6609
+ }
6610
+ }, baseProps),
6611
+ stack: Object.assign({
6612
+ colorScale
6613
+ }, baseProps),
6614
+ tooltip: {
6615
+ style: Object.assign({}, baseLabelStyles, {
6616
+ padding: 0,
6617
+ pointerEvents: "none"
6618
+ }),
6619
+ flyoutStyle: {
6620
+ stroke: gray["300"],
6621
+ strokeWidth: 2,
6622
+ fill: gray.white,
6623
+ pointerEvents: "none"
6624
+ },
6625
+ flyoutPadding: {
6626
+ top: 8,
6627
+ bottom: 8,
6628
+ left: 16,
6629
+ right: 16
6630
+ },
6631
+ cornerRadius: borderRadius,
6632
+ pointerLength: 4
6633
+ },
6634
+ voronoi: Object.assign({
6635
+ style: {
6636
+ data: {
6637
+ fill: blue["100"],
6638
+ stroke: blue["500"],
6639
+ strokeWidth: 2,
6640
+ opacity: 0.4
6641
+ },
6642
+ labels: Object.assign({}, baseLabelStyles, {
6643
+ padding: 5,
6644
+ pointerEvents: "none"
6645
+ }),
6646
+ flyout: {
6647
+ stroke: gray["900"],
6648
+ strokeWidth: 1,
6649
+ fill: gray["100"],
6650
+ pointerEvents: "none"
6651
+ },
6652
+ padding: {
6653
+ left: 2,
6654
+ bottom: 2
6655
+ }
6656
+ }
6657
+ }, baseProps)
6658
+ };
6659
+
6660
+ /***/ }),
6661
+
6188
6662
  /***/ "../../victory-core/es/victory-theme/grayscale.js":
6189
6663
  /*!********************************************************!*\
6190
6664
  !*** ../../victory-core/es/victory-theme/grayscale.js ***!
@@ -6199,9 +6673,28 @@ __webpack_require__.r(__webpack_exports__);
6199
6673
  // *
6200
6674
  // * Colors
6201
6675
  // *
6202
- const colors = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
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"];
6203
6688
  const charcoal = "#252525";
6204
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
+
6205
6698
  // *
6206
6699
  // * Typography
6207
6700
  // *
@@ -6215,7 +6708,7 @@ const baseProps = {
6215
6708
  width: 450,
6216
6709
  height: 300,
6217
6710
  padding: 50,
6218
- colorScale: colors
6711
+ colorScale
6219
6712
  };
6220
6713
  // *
6221
6714
  // * Labels
@@ -6237,6 +6730,17 @@ const centeredLabelStyles = Object.assign({
6237
6730
  const strokeLinecap = "round";
6238
6731
  const strokeLinejoin = "round";
6239
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
+ },
6240
6744
  area: Object.assign({
6241
6745
  style: {
6242
6746
  data: {
@@ -6351,7 +6855,7 @@ const grayscale = {
6351
6855
  }
6352
6856
  }, baseProps),
6353
6857
  group: Object.assign({
6354
- colorScale: colors
6858
+ colorScale
6355
6859
  }, baseProps),
6356
6860
  histogram: Object.assign({
6357
6861
  style: {
@@ -6364,7 +6868,7 @@ const grayscale = {
6364
6868
  }
6365
6869
  }, baseProps),
6366
6870
  legend: {
6367
- colorScale: colors,
6871
+ colorScale,
6368
6872
  gutter: 10,
6369
6873
  orientation: "vertical",
6370
6874
  titleOrientation: "top",
@@ -6399,7 +6903,7 @@ const grayscale = {
6399
6903
  padding: 20
6400
6904
  })
6401
6905
  },
6402
- colorScale: colors,
6906
+ colorScale,
6403
6907
  width: 400,
6404
6908
  height: 400,
6405
6909
  padding: 50
@@ -6415,7 +6919,7 @@ const grayscale = {
6415
6919
  }
6416
6920
  }, baseProps),
6417
6921
  stack: Object.assign({
6418
- colorScale: colors
6922
+ colorScale
6419
6923
  }, baseProps),
6420
6924
  tooltip: {
6421
6925
  style: Object.assign({}, baseLabelStyles, {
@@ -6475,11 +6979,31 @@ const lime300 = "#DCE775";
6475
6979
  const lightGreen500 = "#8BC34A";
6476
6980
  const teal700 = "#00796B";
6477
6981
  const cyan900 = "#006064";
6478
- const colors = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
6982
+ const colorScale = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
6479
6983
  const blueGrey50 = "#ECEFF1";
6480
6984
  const blueGrey300 = "#90A4AE";
6481
6985
  const blueGrey700 = "#455A64";
6482
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
+
6483
7007
  // *
6484
7008
  // * Typography
6485
7009
  // *
@@ -6517,6 +7041,17 @@ const strokeDasharray = "10, 5";
6517
7041
  const strokeLinecap = "round";
6518
7042
  const strokeLinejoin = "round";
6519
7043
  const material = {
7044
+ palette: {
7045
+ colors,
7046
+ grayscale,
7047
+ qualitative,
7048
+ heatmap,
7049
+ warm,
7050
+ cool,
7051
+ red,
7052
+ green,
7053
+ blue
7054
+ },
6520
7055
  area: Object.assign({
6521
7056
  style: {
6522
7057
  data: {
@@ -6649,7 +7184,7 @@ const material = {
6649
7184
  }
6650
7185
  }, baseProps),
6651
7186
  group: Object.assign({
6652
- colorScale: colors
7187
+ colorScale
6653
7188
  }, baseProps),
6654
7189
  histogram: Object.assign({
6655
7190
  style: {
@@ -6662,7 +7197,7 @@ const material = {
6662
7197
  }
6663
7198
  }, baseProps),
6664
7199
  legend: {
6665
- colorScale: colors,
7200
+ colorScale,
6666
7201
  gutter: 10,
6667
7202
  orientation: "vertical",
6668
7203
  titleOrientation: "top",
@@ -6688,7 +7223,7 @@ const material = {
6688
7223
  }
6689
7224
  }, baseProps),
6690
7225
  pie: Object.assign({
6691
- colorScale: colors,
7226
+ colorScale,
6692
7227
  style: {
6693
7228
  data: {
6694
7229
  padding,
@@ -6712,7 +7247,7 @@ const material = {
6712
7247
  }
6713
7248
  }, baseProps),
6714
7249
  stack: Object.assign({
6715
- colorScale: colors
7250
+ colorScale
6716
7251
  }, baseProps),
6717
7252
  tooltip: {
6718
7253
  style: Object.assign({}, baseLabelStyles, {
@@ -6765,12 +7300,15 @@ __webpack_require__.r(__webpack_exports__);
6765
7300
  /* harmony export */ });
6766
7301
  /* harmony import */ var _grayscale__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./grayscale */ "../../victory-core/es/victory-theme/grayscale.js");
6767
7302
  /* harmony import */ var _material__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./material */ "../../victory-core/es/victory-theme/material.js");
7303
+ /* harmony import */ var _clean__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./clean */ "../../victory-core/es/victory-theme/clean.js");
7304
+
6768
7305
 
6769
7306
 
6770
7307
 
6771
7308
  const VictoryTheme = {
6772
7309
  grayscale: _grayscale__WEBPACK_IMPORTED_MODULE_0__.grayscale,
6773
- material: _material__WEBPACK_IMPORTED_MODULE_1__.material
7310
+ material: _material__WEBPACK_IMPORTED_MODULE_1__.material,
7311
+ clean: _clean__WEBPACK_IMPORTED_MODULE_2__.clean
6774
7312
  };
6775
7313
 
6776
7314
  /***/ }),
@@ -9809,6 +10347,9 @@ __webpack_require__.r(__webpack_exports__);
9809
10347
  /* harmony export */ "getColorScale": function() { return /* binding */ getColorScale; },
9810
10348
  /* harmony export */ "toTransformString": function() { return /* binding */ toTransformString; }
9811
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
+
9812
10353
  /**
9813
10354
  * Given an object with CSS/SVG transform definitions, return the string value
9814
10355
  * for use with the `transform` CSS property or SVG attribute. Note that we
@@ -9845,20 +10386,37 @@ const toTransformString = function (obj) {
9845
10386
  * of 5 hex string values in that color scale. If no 'name' parameter
9846
10387
  * is given, it will return the Victory default grayscale.
9847
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).
9848
10390
  * @returns {Array} An array of 5 hex string values composing a color scale.
9849
10391
  */
9850
- 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;
9851
10408
  const scales = {
9852
- grayscale: ["#cccccc", "#969696", "#636363", "#252525"],
9853
- qualitative: ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"],
9854
- heatmap: ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"],
9855
- warm: ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"],
9856
- cool: ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"],
9857
- red: ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"],
9858
- blue: ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"],
9859
- green: ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"]
10409
+ grayscale,
10410
+ qualitative,
10411
+ heatmap,
10412
+ warm,
10413
+ cool,
10414
+ red,
10415
+ blue,
10416
+ green
9860
10417
  };
9861
- return name ? scales[name] : scales.grayscale;
10418
+ const selectedScale = name && scales[name]?.length ? scales[name] : scales.grayscale;
10419
+ return selectedScale;
9862
10420
  }
9863
10421
 
9864
10422
  /***/ }),
@@ -9885,6 +10443,7 @@ __webpack_require__.r(__webpack_exports__);
9885
10443
  /* eslint-disable no-magic-numbers */
9886
10444
  // Based on measuring specific character widths
9887
10445
  // as in the following example https://bl.ocks.org/tophtucker/62f93a4658387bb61e4510c37e2e97cf
10446
+ // For new fonts: pull gist, open index.html locally, add font files (if not generic), enter font name in `font-family` input
9888
10447
  // prettier-ignore
9889
10448
  const fonts = {
9890
10449
  "American Typewriter": {
@@ -9943,6 +10502,10 @@ const fonts = {
9943
10502
  widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2359375, 0.2234375, 0.3921875, 0.7125, 0.49375, 0.8859375, 0.771875, 0.2125, 0.3078125, 0.309375, 0.375, 0.4234375, 0.234375, 0.3125, 0.234375, 0.3, 0.5828125, 0.365625, 0.434375, 0.3921875, 0.5234375, 0.3984375, 0.5125, 0.4328125, 0.46875, 0.5125, 0.234375, 0.234375, 0.515625, 0.4234375, 0.515625, 0.340625, 0.7609375, 0.7359375, 0.6359375, 0.721875, 0.8125, 0.6375, 0.5875, 0.8078125, 0.853125, 0.4296875, 0.503125, 0.78125, 0.609375, 0.9609375, 0.8515625, 0.8140625, 0.6125, 0.8140625, 0.71875, 0.49375, 0.7125, 0.76875, 0.771875, 1.125, 0.7765625, 0.7734375, 0.65625, 0.321875, 0.3078125, 0.321875, 0.3546875, 0.5, 0.3375, 0.446875, 0.5359375, 0.45, 0.5296875, 0.4546875, 0.425, 0.4921875, 0.54375, 0.2671875, 0.240625, 0.5390625, 0.25, 0.815625, 0.5375, 0.5234375, 0.5390625, 0.5421875, 0.365625, 0.36875, 0.35625, 0.5171875, 0.5015625, 0.75, 0.5, 0.509375, 0.44375, 0.2421875, 0.14375, 0.2421875, 0.35],
9944
10503
  avg: 0.5116447368421051
9945
10504
  },
10505
+ "Inter": {
10506
+ widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2796875, 0.2890625, 0.4671875, 0.634375, 0.6421875, 0.9828125, 0.6453125, 0.3, 0.365625, 0.365625, 0.5015625, 0.6625, 0.2890625, 0.4609375, 0.2890625, 0.3609375, 0.63125, 0.4078125, 0.6109375, 0.61875, 0.646875, 0.59375, 0.6203125, 0.5671875, 0.61875, 0.6203125, 0.2890625, 0.303125, 0.6625, 0.6625, 0.6625, 0.5125, 0.9671875, 0.690625, 0.6546875, 0.73125, 0.721875, 0.6015625, 0.590625, 0.746875, 0.74375, 0.26875, 0.571875, 0.671875, 0.565625, 0.9046875, 0.7546875, 0.765625, 0.6390625, 0.765625, 0.64375, 0.6421875, 0.646875, 0.7453125, 0.690625, 0.9859375, 0.6828125, 0.6796875, 0.6296875, 0.365625, 0.3609375, 0.365625, 0.471875, 0.45625, 0.3234375, 0.5625, 0.6125, 0.571875, 0.6125, 0.584375, 0.3703125, 0.6140625, 0.5921875, 0.2421875, 0.2548828125, 0.55, 0.2421875, 0.8765625, 0.5921875, 0.6, 0.6125, 0.6125, 0.3765625, 0.528125, 0.328125, 0.5921875, 0.5625, 0.81875, 0.546875, 0.5625, 0.553125, 0.4265625, 0.3328125, 0.4265625, 0.6625],
10507
+ avg: 0.5624362664473683
10508
+ },
9946
10509
  "Montserrat": {
9947
10510
  widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2625, 0.2609375, 0.3734375, 0.696875, 0.615625, 0.8296875, 0.6703125, 0.203125, 0.3296875, 0.3296875, 0.3875, 0.575, 0.2125, 0.3828125, 0.2125, 0.3953125, 0.6625, 0.3625, 0.56875, 0.5640625, 0.6625, 0.5671875, 0.609375, 0.5890625, 0.6390625, 0.609375, 0.2125, 0.2125, 0.575, 0.575, 0.575, 0.5671875, 1.034375, 0.7171875, 0.7546875, 0.7203125, 0.8265625, 0.6703125, 0.634375, 0.7734375, 0.8140625, 0.303125, 0.5078125, 0.7125, 0.5890625, 0.95625, 0.8140625, 0.8390625, 0.71875, 0.8390625, 0.7234375, 0.615625, 0.575, 0.7921875, 0.6984375, 1.1125, 0.65625, 0.6359375, 0.6515625, 0.31875, 0.396875, 0.31875, 0.5765625, 0.5, 0.6, 0.590625, 0.678125, 0.5640625, 0.678125, 0.6046875, 0.375, 0.6875, 0.678125, 0.2703125, 0.365625, 0.6015625, 0.2703125, 1.0625, 0.678125, 0.628125, 0.678125, 0.678125, 0.4015625, 0.4890625, 0.40625, 0.6734375, 0.5421875, 0.8796875, 0.534375, 0.5671875, 0.5125, 0.334375, 0.2953125, 0.334375, 0.575],
9948
10511
  avg: 0.571792763157895