victory-histogram 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 CHANGED
@@ -1,5 +1,9 @@
1
1
  # victory-histogram
2
2
 
3
+ ## 37.3.0
4
+
5
+ ## 37.2.0
6
+
3
7
  ## 37.1.2
4
8
 
5
9
  ### Patch Changes
@@ -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 lodash_defaults__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaults.js");
6972
- /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
6973
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
6974
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
6975
- /* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
6976
- /* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
6977
- /* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
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__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("g", null)
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 = react__WEBPACK_IMPORTED_MODULE_1___default().useId();
6992
- const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_2__.usePortalContext)();
6994
+ const [id] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(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
- _victory_util_log__WEBPACK_IMPORTED_MODULE_3__.warn(msg);
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 = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.omit(props, ["children", "groupComponent"]), {
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__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(children, newProps);
7010
- react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
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
- react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
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
  }, []);
@@ -7221,20 +7224,16 @@ const orange = {
7221
7224
  "100": "#FEE2D5",
7222
7225
  "300": "#FFA981",
7223
7226
  "500": "#FF6F2C",
7227
+ "700": "#FF4E1B",
7224
7228
  "900": "#D74D26"
7225
7229
  };
7226
7230
  const red = {
7227
7231
  "100": "#FFDCE5",
7228
7232
  "300": "#FF9EB7",
7229
7233
  "500": "#F82B60",
7234
+ "700": "#D31A3D",
7230
7235
  "900": "#BA1E45"
7231
7236
  };
7232
- const pink = {
7233
- "100": "#FFDAF6",
7234
- "300": "#F99DE2",
7235
- "500": "#FF08C2",
7236
- "900": "#B2158B"
7237
- };
7238
7237
  const purple = {
7239
7238
  "100": "#EDE3FE",
7240
7239
  "300": "#CDB0FF",
@@ -7245,6 +7244,7 @@ const blue = {
7245
7244
  "100": "#CFDFFF",
7246
7245
  "300": "#9CC7FF",
7247
7246
  "500": "#2D7FF9",
7247
+ "700": "#0056B3",
7248
7248
  "900": "#2750AE"
7249
7249
  };
7250
7250
  const cyan = {
@@ -7263,9 +7263,29 @@ const green = {
7263
7263
  "100": "#D1F7C4",
7264
7264
  "300": "#93E088",
7265
7265
  "500": "#20C933",
7266
+ "700": "#1B9B2A",
7266
7267
  "900": "#338A17"
7267
7268
  };
7268
- const colors = [blue["500"], pink["500"], teal["500"], purple["500"], green["500"], orange["500"], cyan["500"], red["500"], yellow["500"]];
7269
+ const colors = {
7270
+ blue: blue["500"],
7271
+ cyan: cyan["500"],
7272
+ green: green["500"],
7273
+ yellow: yellow["500"],
7274
+ orange: orange["500"],
7275
+ red: red["500"],
7276
+ purple: purple["500"],
7277
+ teal: teal["500"]
7278
+ };
7279
+ const colorScale = Object.values(colors);
7280
+ const grayscale = [gray["100"], gray["300"], gray["500"], gray["700"], gray["900"]];
7281
+ const warm = [yellow["300"], yellow["500"], orange["500"], orange["900"], red["500"]];
7282
+ const cool = [purple["500"], blue["500"], cyan["500"], teal["500"], green["500"]];
7283
+ const heatmap = [green["900"], green["500"], yellow["500"], orange["500"], red["500"]];
7284
+ const redPalette = Object.values(red);
7285
+ const greenPalette = Object.values(green);
7286
+ const bluePalette = Object.values(blue);
7287
+ const defaultColor = blue["500"];
7288
+
7269
7289
  // *
7270
7290
  // * Typography
7271
7291
  // *
@@ -7279,8 +7299,8 @@ const padding = 8;
7279
7299
  const baseProps = {
7280
7300
  width: 450,
7281
7301
  height: 300,
7282
- padding: 50,
7283
- colorScale: colors
7302
+ padding: 60,
7303
+ colorScale
7284
7304
  };
7285
7305
  // *
7286
7306
  // * Labels
@@ -7309,10 +7329,23 @@ const borderRadius = 1;
7309
7329
  // * Theme
7310
7330
  // *
7311
7331
  const clean = {
7332
+ palette: {
7333
+ colors,
7334
+ grayscale,
7335
+ qualitative: colorScale,
7336
+ heatmap,
7337
+ warm,
7338
+ cool,
7339
+ red: redPalette,
7340
+ green: greenPalette,
7341
+ blue: bluePalette
7342
+ },
7312
7343
  area: Object.assign({
7313
7344
  style: {
7314
7345
  data: {
7315
- fill: cyan["500"]
7346
+ fill: defaultColor,
7347
+ strokeWidth: 2,
7348
+ fillOpacity: 0.5
7316
7349
  },
7317
7350
  labels: baseLabelStyles
7318
7351
  }
@@ -7321,13 +7354,13 @@ const clean = {
7321
7354
  style: {
7322
7355
  axis: {
7323
7356
  fill: "transparent",
7324
- stroke: gray["300"],
7357
+ stroke: gray["500"],
7325
7358
  strokeWidth: 1,
7326
7359
  strokeLinecap,
7327
7360
  strokeLinejoin
7328
7361
  },
7329
7362
  axisLabel: Object.assign({}, centeredLabelStyles, {
7330
- padding,
7363
+ padding: 35,
7331
7364
  stroke: "transparent"
7332
7365
  }),
7333
7366
  grid: {
@@ -7346,10 +7379,10 @@ const clean = {
7346
7379
  polarAxis: Object.assign({
7347
7380
  style: {
7348
7381
  axis: {
7349
- stroke: gray["300"]
7382
+ stroke: gray["500"]
7350
7383
  },
7351
7384
  grid: {
7352
- stroke: gray["200"],
7385
+ stroke: gray["400"],
7353
7386
  strokeDasharray,
7354
7387
  strokeLinecap,
7355
7388
  strokeLinejoin,
@@ -7358,7 +7391,7 @@ const clean = {
7358
7391
  ticks: {
7359
7392
  fill: "transparent",
7360
7393
  size: 5,
7361
- stroke: gray["200"],
7394
+ stroke: gray["400"],
7362
7395
  strokeWidth: 1,
7363
7396
  strokeLinecap,
7364
7397
  strokeLinejoin
@@ -7369,10 +7402,10 @@ const clean = {
7369
7402
  polarDependentAxis: Object.assign({
7370
7403
  style: {
7371
7404
  axis: {
7372
- stroke: gray["300"]
7405
+ stroke: gray["500"]
7373
7406
  },
7374
7407
  grid: {
7375
- stroke: gray["200"],
7408
+ stroke: gray["400"],
7376
7409
  strokeDasharray,
7377
7410
  strokeLinecap,
7378
7411
  strokeLinejoin,
@@ -7381,7 +7414,7 @@ const clean = {
7381
7414
  ticks: {
7382
7415
  fill: "transparent",
7383
7416
  size: 5,
7384
- stroke: gray["200"],
7417
+ stroke: gray["300"],
7385
7418
  strokeWidth: 1,
7386
7419
  strokeLinecap,
7387
7420
  strokeLinejoin
@@ -7392,9 +7425,10 @@ const clean = {
7392
7425
  bar: Object.assign({
7393
7426
  style: {
7394
7427
  data: {
7395
- fill: blue["500"],
7428
+ fill: defaultColor,
7396
7429
  padding,
7397
- strokeWidth: 0
7430
+ strokeWidth: 1,
7431
+ fillOpacity: 0.5
7398
7432
  },
7399
7433
  labels: baseLabelStyles
7400
7434
  },
@@ -7430,15 +7464,16 @@ const clean = {
7430
7464
  }),
7431
7465
  q1: {
7432
7466
  padding,
7433
- fill: teal["500"],
7434
- rx: borderRadius
7467
+ fill: colorScale[0],
7468
+ rx: borderRadius,
7469
+ strokeWidth: 2
7435
7470
  },
7436
7471
  q1Labels: Object.assign({}, baseLabelStyles, {
7437
7472
  padding: 3
7438
7473
  }),
7439
7474
  q3: {
7440
7475
  padding,
7441
- fill: teal["500"],
7476
+ fill: colorScale[1],
7442
7477
  rx: borderRadius
7443
7478
  },
7444
7479
  q3Labels: Object.assign({}, baseLabelStyles, {
@@ -7459,8 +7494,8 @@ const clean = {
7459
7494
  })
7460
7495
  },
7461
7496
  candleColors: {
7462
- positive: teal["500"],
7463
- negative: orange["500"]
7497
+ positive: green["500"],
7498
+ negative: red["500"]
7464
7499
  },
7465
7500
  wickStrokeWidth: 2
7466
7501
  }, baseProps),
@@ -7479,14 +7514,13 @@ const clean = {
7479
7514
  }
7480
7515
  }, baseProps),
7481
7516
  group: Object.assign({
7482
- colorScale: colors
7517
+ colorScale
7483
7518
  }, baseProps),
7484
7519
  histogram: Object.assign({
7485
7520
  style: {
7486
7521
  data: {
7487
7522
  fill: cyan["500"],
7488
- stroke: "transparent",
7489
- strokeWidth: 0
7523
+ fillOpacity: 0.5
7490
7524
  },
7491
7525
  labels: baseLabelStyles
7492
7526
  },
@@ -7497,21 +7531,23 @@ const clean = {
7497
7531
  }, baseProps),
7498
7532
  label: baseLabelStyles,
7499
7533
  legend: {
7500
- colorScale: colors,
7501
- gutter: 10,
7502
- orientation: "vertical",
7534
+ colorScale,
7535
+ gutter: 24,
7536
+ borderPadding: 10,
7537
+ orientation: "horizontal",
7503
7538
  titleOrientation: "top",
7539
+ centerTitle: true,
7504
7540
  style: {
7505
7541
  data: {
7506
7542
  type: "circle"
7507
7543
  },
7508
7544
  labels: {
7509
7545
  ...baseLabelStyles,
7510
- fontSize: 14
7546
+ fontSize: 12
7511
7547
  },
7512
7548
  title: Object.assign({}, baseLabelStyles, {
7513
7549
  padding,
7514
- fontSize: 20
7550
+ fontSize: 16
7515
7551
  }),
7516
7552
  border: {
7517
7553
  stroke: gray["200"],
@@ -7525,7 +7561,7 @@ const clean = {
7525
7561
  data: {
7526
7562
  fill: "transparent",
7527
7563
  opacity: 1,
7528
- stroke: pink["500"],
7564
+ stroke: defaultColor,
7529
7565
  strokeWidth: 2,
7530
7566
  strokeLinecap,
7531
7567
  strokeLinejoin
@@ -7535,31 +7571,40 @@ const clean = {
7535
7571
  }, baseProps),
7536
7572
  pie: Object.assign({
7537
7573
  style: {
7574
+ parent: {
7575
+ backgroundColor: gray.white
7576
+ },
7538
7577
  data: {
7539
7578
  padding,
7540
7579
  stroke: gray.white,
7541
7580
  strokeWidth: 1
7542
7581
  },
7543
- labels: Object.assign({}, baseLabelStyles, {
7544
- padding: 20
7545
- })
7582
+ labels: {
7583
+ ...baseLabelStyles,
7584
+ padding: 20,
7585
+ fill: gray["600"],
7586
+ fontSize: 10
7587
+ }
7546
7588
  },
7547
- colorScale: colors,
7589
+ colorScale,
7548
7590
  cornerRadius: borderRadius
7549
7591
  }, baseProps),
7550
7592
  scatter: Object.assign({
7551
7593
  style: {
7552
7594
  data: {
7553
- fill: purple["500"],
7595
+ fill: defaultColor,
7554
7596
  opacity: 1,
7555
7597
  stroke: "transparent",
7556
7598
  strokeWidth: 0
7557
7599
  },
7558
- labels: baseLabelStyles
7600
+ labels: {
7601
+ ...baseLabelStyles,
7602
+ padding: 20
7603
+ }
7559
7604
  }
7560
7605
  }, baseProps),
7561
7606
  stack: Object.assign({
7562
- colorScale: colors
7607
+ colorScale
7563
7608
  }, baseProps),
7564
7609
  tooltip: {
7565
7610
  style: Object.assign({}, baseLabelStyles, {
@@ -7567,7 +7612,7 @@ const clean = {
7567
7612
  pointerEvents: "none"
7568
7613
  }),
7569
7614
  flyoutStyle: {
7570
- stroke: gray["500"],
7615
+ stroke: gray["300"],
7571
7616
  strokeWidth: 2,
7572
7617
  fill: gray.white,
7573
7618
  pointerEvents: "none"
@@ -7584,8 +7629,8 @@ const clean = {
7584
7629
  voronoi: Object.assign({
7585
7630
  style: {
7586
7631
  data: {
7587
- fill: red["100"],
7588
- stroke: red["500"],
7632
+ fill: blue["100"],
7633
+ stroke: defaultColor,
7589
7634
  strokeWidth: 2
7590
7635
  },
7591
7636
  labels: Object.assign({}, baseLabelStyles, {
@@ -7622,9 +7667,28 @@ __webpack_require__.r(__webpack_exports__);
7622
7667
  // *
7623
7668
  // * Colors
7624
7669
  // *
7625
- const colors = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
7670
+ const colors = {
7671
+ blue: "#4F7DA1",
7672
+ pink: "#E2A37F",
7673
+ teal: "#00796B",
7674
+ purple: "#DF948A",
7675
+ green: "#8BC34A",
7676
+ orange: "#F4511E",
7677
+ cyan: "#006064",
7678
+ red: "#DF5A49",
7679
+ yellow: "#FFF59D"
7680
+ };
7681
+ const colorScale = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
7626
7682
  const charcoal = "#252525";
7627
7683
  const grey = "#969696";
7684
+ const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
7685
+ const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
7686
+ const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
7687
+ const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
7688
+ const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
7689
+ const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
7690
+ const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
7691
+
7628
7692
  // *
7629
7693
  // * Typography
7630
7694
  // *
@@ -7638,7 +7702,7 @@ const baseProps = {
7638
7702
  width: 450,
7639
7703
  height: 300,
7640
7704
  padding: 50,
7641
- colorScale: colors
7705
+ colorScale
7642
7706
  };
7643
7707
  // *
7644
7708
  // * Labels
@@ -7660,6 +7724,17 @@ const centeredLabelStyles = Object.assign({
7660
7724
  const strokeLinecap = "round";
7661
7725
  const strokeLinejoin = "round";
7662
7726
  const grayscale = {
7727
+ palette: {
7728
+ colors,
7729
+ grayscale: colorScale,
7730
+ qualitative,
7731
+ heatmap,
7732
+ warm,
7733
+ cool,
7734
+ red,
7735
+ green,
7736
+ blue
7737
+ },
7663
7738
  area: Object.assign({
7664
7739
  style: {
7665
7740
  data: {
@@ -7774,7 +7849,7 @@ const grayscale = {
7774
7849
  }
7775
7850
  }, baseProps),
7776
7851
  group: Object.assign({
7777
- colorScale: colors
7852
+ colorScale
7778
7853
  }, baseProps),
7779
7854
  histogram: Object.assign({
7780
7855
  style: {
@@ -7787,7 +7862,7 @@ const grayscale = {
7787
7862
  }
7788
7863
  }, baseProps),
7789
7864
  legend: {
7790
- colorScale: colors,
7865
+ colorScale,
7791
7866
  gutter: 10,
7792
7867
  orientation: "vertical",
7793
7868
  titleOrientation: "top",
@@ -7822,7 +7897,7 @@ const grayscale = {
7822
7897
  padding: 20
7823
7898
  })
7824
7899
  },
7825
- colorScale: colors,
7900
+ colorScale,
7826
7901
  width: 400,
7827
7902
  height: 400,
7828
7903
  padding: 50
@@ -7838,7 +7913,7 @@ const grayscale = {
7838
7913
  }
7839
7914
  }, baseProps),
7840
7915
  stack: Object.assign({
7841
- colorScale: colors
7916
+ colorScale
7842
7917
  }, baseProps),
7843
7918
  tooltip: {
7844
7919
  style: Object.assign({}, baseLabelStyles, {
@@ -7898,11 +7973,31 @@ const lime300 = "#DCE775";
7898
7973
  const lightGreen500 = "#8BC34A";
7899
7974
  const teal700 = "#00796B";
7900
7975
  const cyan900 = "#006064";
7901
- const colors = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
7976
+ const colorScale = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
7902
7977
  const blueGrey50 = "#ECEFF1";
7903
7978
  const blueGrey300 = "#90A4AE";
7904
7979
  const blueGrey700 = "#455A64";
7905
7980
  const grey900 = "#212121";
7981
+ const colors = {
7982
+ blue: "#4F7DA1",
7983
+ pink: "#E2A37F",
7984
+ teal: teal700,
7985
+ purple: "#DF948A",
7986
+ green: lightGreen500,
7987
+ orange: deepOrange600,
7988
+ cyan: cyan900,
7989
+ red: "#DF5A49",
7990
+ yellow: yellow200
7991
+ };
7992
+ const grayscale = [blueGrey50, blueGrey300, blueGrey700, grey900];
7993
+ const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
7994
+ const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
7995
+ const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
7996
+ const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
7997
+ const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
7998
+ const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
7999
+ const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
8000
+
7906
8001
  // *
7907
8002
  // * Typography
7908
8003
  // *
@@ -7940,6 +8035,17 @@ const strokeDasharray = "10, 5";
7940
8035
  const strokeLinecap = "round";
7941
8036
  const strokeLinejoin = "round";
7942
8037
  const material = {
8038
+ palette: {
8039
+ colors,
8040
+ grayscale,
8041
+ qualitative,
8042
+ heatmap,
8043
+ warm,
8044
+ cool,
8045
+ red,
8046
+ green,
8047
+ blue
8048
+ },
7943
8049
  area: Object.assign({
7944
8050
  style: {
7945
8051
  data: {
@@ -8072,7 +8178,7 @@ const material = {
8072
8178
  }
8073
8179
  }, baseProps),
8074
8180
  group: Object.assign({
8075
- colorScale: colors
8181
+ colorScale
8076
8182
  }, baseProps),
8077
8183
  histogram: Object.assign({
8078
8184
  style: {
@@ -8085,7 +8191,7 @@ const material = {
8085
8191
  }
8086
8192
  }, baseProps),
8087
8193
  legend: {
8088
- colorScale: colors,
8194
+ colorScale,
8089
8195
  gutter: 10,
8090
8196
  orientation: "vertical",
8091
8197
  titleOrientation: "top",
@@ -8111,7 +8217,7 @@ const material = {
8111
8217
  }
8112
8218
  }, baseProps),
8113
8219
  pie: Object.assign({
8114
- colorScale: colors,
8220
+ colorScale,
8115
8221
  style: {
8116
8222
  data: {
8117
8223
  padding,
@@ -8135,7 +8241,7 @@ const material = {
8135
8241
  }
8136
8242
  }, baseProps),
8137
8243
  stack: Object.assign({
8138
- colorScale: colors
8244
+ colorScale
8139
8245
  }, baseProps),
8140
8246
  tooltip: {
8141
8247
  style: Object.assign({}, baseLabelStyles, {
@@ -10997,6 +11103,9 @@ __webpack_require__.r(__webpack_exports__);
10997
11103
  /* harmony export */ "getColorScale": function() { return /* binding */ getColorScale; },
10998
11104
  /* harmony export */ "toTransformString": function() { return /* binding */ toTransformString; }
10999
11105
  /* harmony export */ });
11106
+ /* 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");
11107
+
11108
+
11000
11109
  /**
11001
11110
  * Given an object with CSS/SVG transform definitions, return the string value
11002
11111
  * for use with the `transform` CSS property or SVG attribute. Note that we
@@ -11033,20 +11142,37 @@ const toTransformString = function (obj) {
11033
11142
  * of 5 hex string values in that color scale. If no 'name' parameter
11034
11143
  * is given, it will return the Victory default grayscale.
11035
11144
  * @param {String} name The name of the color scale to return (optional).
11145
+ * @param {Object} theme The theme object to retrieve the color scale from (optional).
11036
11146
  * @returns {Array} An array of 5 hex string values composing a color scale.
11037
11147
  */
11038
- function getColorScale(name) {
11148
+ function getColorScale(name, theme) {
11149
+ if (theme === void 0) {
11150
+ theme = _victory_theme_victory_theme__WEBPACK_IMPORTED_MODULE_0__.VictoryTheme.material;
11151
+ }
11152
+ const {
11153
+ palette: {
11154
+ grayscale = ["#cccccc", "#969696", "#636363", "#252525"],
11155
+ qualitative = [],
11156
+ heatmap = [],
11157
+ warm = [],
11158
+ cool = [],
11159
+ red = [],
11160
+ blue = [],
11161
+ green = []
11162
+ } = {}
11163
+ } = theme;
11039
11164
  const scales = {
11040
- grayscale: ["#cccccc", "#969696", "#636363", "#252525"],
11041
- qualitative: ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"],
11042
- heatmap: ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"],
11043
- warm: ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"],
11044
- cool: ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"],
11045
- red: ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"],
11046
- blue: ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"],
11047
- green: ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"]
11048
- };
11049
- return name ? scales[name] : scales.grayscale;
11165
+ grayscale,
11166
+ qualitative,
11167
+ heatmap,
11168
+ warm,
11169
+ cool,
11170
+ red,
11171
+ blue,
11172
+ green
11173
+ };
11174
+ const selectedScale = name && scales[name]?.length ? scales[name] : scales.grayscale;
11175
+ return selectedScale;
11050
11176
  }
11051
11177
 
11052
11178
  /***/ }),