victory-errorbar 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 CHANGED
@@ -1,5 +1,7 @@
1
1
  # victory-errorbar
2
2
 
3
+ ## 37.2.0
4
+
3
5
  ## 37.1.2
4
6
 
5
7
  ### Patch Changes
@@ -6292,31 +6292,34 @@ __webpack_require__.r(__webpack_exports__);
6292
6292
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6293
6293
  /* harmony export */ "VictoryPortal": function() { return /* binding */ VictoryPortal; }
6294
6294
  /* harmony export */ });
6295
- /* 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");
6296
- /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
6297
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
6298
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
6299
- /* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
6300
- /* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
6301
- /* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
6295
+ /* 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");
6296
+ /* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0__);
6297
+ /* 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");
6298
+ /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
6299
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
6300
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
6301
+ /* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
6302
+ /* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
6303
+ /* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
6304
+
6302
6305
 
6303
6306
 
6304
6307
 
6305
6308
 
6306
6309
 
6307
6310
  const defaultProps = {
6308
- groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("g", null)
6311
+ groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement("g", null)
6309
6312
  };
6310
6313
  const VictoryPortal = initialProps => {
6311
6314
  const props = {
6312
6315
  ...defaultProps,
6313
6316
  ...initialProps
6314
6317
  };
6315
- const id = react__WEBPACK_IMPORTED_MODULE_1___default().useId();
6316
- const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_2__.usePortalContext)();
6318
+ const id = lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default()();
6319
+ const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_3__.usePortalContext)();
6317
6320
  if (!portalContext) {
6318
6321
  const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
6319
- _victory_util_log__WEBPACK_IMPORTED_MODULE_3__.warn(msg);
6322
+ _victory_util_log__WEBPACK_IMPORTED_MODULE_4__.warn(msg);
6320
6323
  }
6321
6324
  const children = Array.isArray(props.children) ? props.children[0] : props.children;
6322
6325
  const {
@@ -6327,15 +6330,15 @@ const VictoryPortal = initialProps => {
6327
6330
  groupComponent,
6328
6331
  standalone: false
6329
6332
  } : {};
6330
- const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.omit(props, ["children", "groupComponent"]), {
6333
+ const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__.omit(props, ["children", "groupComponent"]), {
6331
6334
  key: childProps.key ?? id
6332
6335
  });
6333
- const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(children, newProps);
6334
- react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
6336
+ const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().cloneElement(children, newProps);
6337
+ react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
6335
6338
  portalContext?.addChild(id, child);
6336
6339
  // eslint-disable-next-line react-hooks/exhaustive-deps
6337
6340
  }, [props.children]);
6338
- react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
6341
+ react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
6339
6342
  return () => portalContext?.removeChild(id);
6340
6343
  // eslint-disable-next-line react-hooks/exhaustive-deps
6341
6344
  }, []);
@@ -6590,7 +6593,26 @@ const green = {
6590
6593
  "500": "#20C933",
6591
6594
  "900": "#338A17"
6592
6595
  };
6593
- const colors = [blue["500"], pink["500"], teal["500"], purple["500"], green["500"], orange["500"], cyan["500"], red["500"], yellow["500"]];
6596
+ const colors = {
6597
+ blue: blue["500"],
6598
+ pink: pink["500"],
6599
+ teal: teal["500"],
6600
+ purple: purple["500"],
6601
+ green: green["500"],
6602
+ orange: orange["500"],
6603
+ cyan: cyan["500"],
6604
+ red: red["500"],
6605
+ yellow: yellow["500"]
6606
+ };
6607
+ const colorScale = Object.values(colors);
6608
+ const grayscale = [gray["200"], gray["400"], gray["600"], gray["900"]];
6609
+ const warm = [yellow["500"], orange["500"], red["500"], pink["500"]];
6610
+ const cool = [cyan["500"], teal["500"], blue["500"], purple["500"]];
6611
+ const heatmap = [green["500"], yellow["500"], red["500"]];
6612
+ const redPalette = [red["500"], red["300"], red["100"]];
6613
+ const greenPalette = [green["500"], green["300"], green["100"]];
6614
+ const bluePalette = [blue["500"], blue["300"], blue["100"]];
6615
+
6594
6616
  // *
6595
6617
  // * Typography
6596
6618
  // *
@@ -6605,7 +6627,7 @@ const baseProps = {
6605
6627
  width: 450,
6606
6628
  height: 300,
6607
6629
  padding: 50,
6608
- colorScale: colors
6630
+ colorScale
6609
6631
  };
6610
6632
  // *
6611
6633
  // * Labels
@@ -6634,10 +6656,23 @@ const borderRadius = 1;
6634
6656
  // * Theme
6635
6657
  // *
6636
6658
  const clean = {
6659
+ palette: {
6660
+ colors,
6661
+ grayscale,
6662
+ qualitative: colorScale,
6663
+ heatmap,
6664
+ warm,
6665
+ cool,
6666
+ red: redPalette,
6667
+ green: greenPalette,
6668
+ blue: bluePalette
6669
+ },
6637
6670
  area: Object.assign({
6638
6671
  style: {
6639
6672
  data: {
6640
- fill: cyan["500"]
6673
+ fill: blue["500"],
6674
+ strokeWidth: 2,
6675
+ fillOpacity: 0.5
6641
6676
  },
6642
6677
  labels: baseLabelStyles
6643
6678
  }
@@ -6646,7 +6681,7 @@ const clean = {
6646
6681
  style: {
6647
6682
  axis: {
6648
6683
  fill: "transparent",
6649
- stroke: gray["300"],
6684
+ stroke: gray["500"],
6650
6685
  strokeWidth: 1,
6651
6686
  strokeLinecap,
6652
6687
  strokeLinejoin
@@ -6671,10 +6706,10 @@ const clean = {
6671
6706
  polarAxis: Object.assign({
6672
6707
  style: {
6673
6708
  axis: {
6674
- stroke: gray["300"]
6709
+ stroke: gray["500"]
6675
6710
  },
6676
6711
  grid: {
6677
- stroke: gray["200"],
6712
+ stroke: gray["400"],
6678
6713
  strokeDasharray,
6679
6714
  strokeLinecap,
6680
6715
  strokeLinejoin,
@@ -6683,7 +6718,7 @@ const clean = {
6683
6718
  ticks: {
6684
6719
  fill: "transparent",
6685
6720
  size: 5,
6686
- stroke: gray["200"],
6721
+ stroke: gray["400"],
6687
6722
  strokeWidth: 1,
6688
6723
  strokeLinecap,
6689
6724
  strokeLinejoin
@@ -6694,10 +6729,10 @@ const clean = {
6694
6729
  polarDependentAxis: Object.assign({
6695
6730
  style: {
6696
6731
  axis: {
6697
- stroke: gray["300"]
6732
+ stroke: gray["500"]
6698
6733
  },
6699
6734
  grid: {
6700
- stroke: gray["200"],
6735
+ stroke: gray["400"],
6701
6736
  strokeDasharray,
6702
6737
  strokeLinecap,
6703
6738
  strokeLinejoin,
@@ -6706,7 +6741,7 @@ const clean = {
6706
6741
  ticks: {
6707
6742
  fill: "transparent",
6708
6743
  size: 5,
6709
- stroke: gray["200"],
6744
+ stroke: gray["300"],
6710
6745
  strokeWidth: 1,
6711
6746
  strokeLinecap,
6712
6747
  strokeLinejoin
@@ -6719,7 +6754,8 @@ const clean = {
6719
6754
  data: {
6720
6755
  fill: blue["500"],
6721
6756
  padding,
6722
- strokeWidth: 0
6757
+ strokeWidth: 1,
6758
+ fillOpacity: 0.5
6723
6759
  },
6724
6760
  labels: baseLabelStyles
6725
6761
  },
@@ -6756,14 +6792,15 @@ const clean = {
6756
6792
  q1: {
6757
6793
  padding,
6758
6794
  fill: teal["500"],
6759
- rx: borderRadius
6795
+ rx: borderRadius,
6796
+ strokeWidth: 2
6760
6797
  },
6761
6798
  q1Labels: Object.assign({}, baseLabelStyles, {
6762
6799
  padding: 3
6763
6800
  }),
6764
6801
  q3: {
6765
6802
  padding,
6766
- fill: teal["500"],
6803
+ fill: cyan["500"],
6767
6804
  rx: borderRadius
6768
6805
  },
6769
6806
  q3Labels: Object.assign({}, baseLabelStyles, {
@@ -6804,14 +6841,13 @@ const clean = {
6804
6841
  }
6805
6842
  }, baseProps),
6806
6843
  group: Object.assign({
6807
- colorScale: colors
6844
+ colorScale
6808
6845
  }, baseProps),
6809
6846
  histogram: Object.assign({
6810
6847
  style: {
6811
6848
  data: {
6812
6849
  fill: cyan["500"],
6813
- stroke: "transparent",
6814
- strokeWidth: 0
6850
+ fillOpacity: 0.5
6815
6851
  },
6816
6852
  labels: baseLabelStyles
6817
6853
  },
@@ -6822,21 +6858,23 @@ const clean = {
6822
6858
  }, baseProps),
6823
6859
  label: baseLabelStyles,
6824
6860
  legend: {
6825
- colorScale: colors,
6826
- gutter: 10,
6827
- orientation: "vertical",
6861
+ colorScale,
6862
+ gutter: 24,
6863
+ borderPadding: 10,
6864
+ orientation: "horizontal",
6828
6865
  titleOrientation: "top",
6866
+ centerTitle: true,
6829
6867
  style: {
6830
6868
  data: {
6831
6869
  type: "circle"
6832
6870
  },
6833
6871
  labels: {
6834
6872
  ...baseLabelStyles,
6835
- fontSize: 14
6873
+ fontSize: 12
6836
6874
  },
6837
6875
  title: Object.assign({}, baseLabelStyles, {
6838
6876
  padding,
6839
- fontSize: 20
6877
+ fontSize: 16
6840
6878
  }),
6841
6879
  border: {
6842
6880
  stroke: gray["200"],
@@ -6850,7 +6888,7 @@ const clean = {
6850
6888
  data: {
6851
6889
  fill: "transparent",
6852
6890
  opacity: 1,
6853
- stroke: pink["500"],
6891
+ stroke: blue["500"],
6854
6892
  strokeWidth: 2,
6855
6893
  strokeLinecap,
6856
6894
  strokeLinejoin
@@ -6860,16 +6898,22 @@ const clean = {
6860
6898
  }, baseProps),
6861
6899
  pie: Object.assign({
6862
6900
  style: {
6901
+ parent: {
6902
+ backgroundColor: gray.white
6903
+ },
6863
6904
  data: {
6864
6905
  padding,
6865
6906
  stroke: gray.white,
6866
6907
  strokeWidth: 1
6867
6908
  },
6868
- labels: Object.assign({}, baseLabelStyles, {
6869
- padding: 20
6870
- })
6909
+ labels: {
6910
+ ...baseLabelStyles,
6911
+ padding: 20,
6912
+ fill: gray["600"],
6913
+ fontSize: 10
6914
+ }
6871
6915
  },
6872
- colorScale: colors,
6916
+ colorScale,
6873
6917
  cornerRadius: borderRadius
6874
6918
  }, baseProps),
6875
6919
  scatter: Object.assign({
@@ -6880,11 +6924,14 @@ const clean = {
6880
6924
  stroke: "transparent",
6881
6925
  strokeWidth: 0
6882
6926
  },
6883
- labels: baseLabelStyles
6927
+ labels: {
6928
+ ...baseLabelStyles,
6929
+ padding: 20
6930
+ }
6884
6931
  }
6885
6932
  }, baseProps),
6886
6933
  stack: Object.assign({
6887
- colorScale: colors
6934
+ colorScale
6888
6935
  }, baseProps),
6889
6936
  tooltip: {
6890
6937
  style: Object.assign({}, baseLabelStyles, {
@@ -6892,7 +6939,7 @@ const clean = {
6892
6939
  pointerEvents: "none"
6893
6940
  }),
6894
6941
  flyoutStyle: {
6895
- stroke: gray["500"],
6942
+ stroke: gray["300"],
6896
6943
  strokeWidth: 2,
6897
6944
  fill: gray.white,
6898
6945
  pointerEvents: "none"
@@ -6909,9 +6956,10 @@ const clean = {
6909
6956
  voronoi: Object.assign({
6910
6957
  style: {
6911
6958
  data: {
6912
- fill: red["100"],
6913
- stroke: red["500"],
6914
- strokeWidth: 2
6959
+ fill: blue["100"],
6960
+ stroke: blue["500"],
6961
+ strokeWidth: 2,
6962
+ opacity: 0.4
6915
6963
  },
6916
6964
  labels: Object.assign({}, baseLabelStyles, {
6917
6965
  padding: 5,
@@ -6947,9 +6995,28 @@ __webpack_require__.r(__webpack_exports__);
6947
6995
  // *
6948
6996
  // * Colors
6949
6997
  // *
6950
- const colors = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
6998
+ const colors = {
6999
+ blue: "#4F7DA1",
7000
+ pink: "#E2A37F",
7001
+ teal: "#00796B",
7002
+ purple: "#DF948A",
7003
+ green: "#8BC34A",
7004
+ orange: "#F4511E",
7005
+ cyan: "#006064",
7006
+ red: "#DF5A49",
7007
+ yellow: "#FFF59D"
7008
+ };
7009
+ const colorScale = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
6951
7010
  const charcoal = "#252525";
6952
7011
  const grey = "#969696";
7012
+ const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
7013
+ const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
7014
+ const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
7015
+ const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
7016
+ const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
7017
+ const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
7018
+ const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
7019
+
6953
7020
  // *
6954
7021
  // * Typography
6955
7022
  // *
@@ -6963,7 +7030,7 @@ const baseProps = {
6963
7030
  width: 450,
6964
7031
  height: 300,
6965
7032
  padding: 50,
6966
- colorScale: colors
7033
+ colorScale
6967
7034
  };
6968
7035
  // *
6969
7036
  // * Labels
@@ -6985,6 +7052,17 @@ const centeredLabelStyles = Object.assign({
6985
7052
  const strokeLinecap = "round";
6986
7053
  const strokeLinejoin = "round";
6987
7054
  const grayscale = {
7055
+ palette: {
7056
+ colors,
7057
+ grayscale: colorScale,
7058
+ qualitative,
7059
+ heatmap,
7060
+ warm,
7061
+ cool,
7062
+ red,
7063
+ green,
7064
+ blue
7065
+ },
6988
7066
  area: Object.assign({
6989
7067
  style: {
6990
7068
  data: {
@@ -7099,7 +7177,7 @@ const grayscale = {
7099
7177
  }
7100
7178
  }, baseProps),
7101
7179
  group: Object.assign({
7102
- colorScale: colors
7180
+ colorScale
7103
7181
  }, baseProps),
7104
7182
  histogram: Object.assign({
7105
7183
  style: {
@@ -7112,7 +7190,7 @@ const grayscale = {
7112
7190
  }
7113
7191
  }, baseProps),
7114
7192
  legend: {
7115
- colorScale: colors,
7193
+ colorScale,
7116
7194
  gutter: 10,
7117
7195
  orientation: "vertical",
7118
7196
  titleOrientation: "top",
@@ -7147,7 +7225,7 @@ const grayscale = {
7147
7225
  padding: 20
7148
7226
  })
7149
7227
  },
7150
- colorScale: colors,
7228
+ colorScale,
7151
7229
  width: 400,
7152
7230
  height: 400,
7153
7231
  padding: 50
@@ -7163,7 +7241,7 @@ const grayscale = {
7163
7241
  }
7164
7242
  }, baseProps),
7165
7243
  stack: Object.assign({
7166
- colorScale: colors
7244
+ colorScale
7167
7245
  }, baseProps),
7168
7246
  tooltip: {
7169
7247
  style: Object.assign({}, baseLabelStyles, {
@@ -7223,11 +7301,31 @@ const lime300 = "#DCE775";
7223
7301
  const lightGreen500 = "#8BC34A";
7224
7302
  const teal700 = "#00796B";
7225
7303
  const cyan900 = "#006064";
7226
- const colors = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
7304
+ const colorScale = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
7227
7305
  const blueGrey50 = "#ECEFF1";
7228
7306
  const blueGrey300 = "#90A4AE";
7229
7307
  const blueGrey700 = "#455A64";
7230
7308
  const grey900 = "#212121";
7309
+ const colors = {
7310
+ blue: "#4F7DA1",
7311
+ pink: "#E2A37F",
7312
+ teal: teal700,
7313
+ purple: "#DF948A",
7314
+ green: lightGreen500,
7315
+ orange: deepOrange600,
7316
+ cyan: cyan900,
7317
+ red: "#DF5A49",
7318
+ yellow: yellow200
7319
+ };
7320
+ const grayscale = [blueGrey50, blueGrey300, blueGrey700, grey900];
7321
+ const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
7322
+ const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
7323
+ const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
7324
+ const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
7325
+ const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
7326
+ const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
7327
+ const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
7328
+
7231
7329
  // *
7232
7330
  // * Typography
7233
7331
  // *
@@ -7265,6 +7363,17 @@ const strokeDasharray = "10, 5";
7265
7363
  const strokeLinecap = "round";
7266
7364
  const strokeLinejoin = "round";
7267
7365
  const material = {
7366
+ palette: {
7367
+ colors,
7368
+ grayscale,
7369
+ qualitative,
7370
+ heatmap,
7371
+ warm,
7372
+ cool,
7373
+ red,
7374
+ green,
7375
+ blue
7376
+ },
7268
7377
  area: Object.assign({
7269
7378
  style: {
7270
7379
  data: {
@@ -7397,7 +7506,7 @@ const material = {
7397
7506
  }
7398
7507
  }, baseProps),
7399
7508
  group: Object.assign({
7400
- colorScale: colors
7509
+ colorScale
7401
7510
  }, baseProps),
7402
7511
  histogram: Object.assign({
7403
7512
  style: {
@@ -7410,7 +7519,7 @@ const material = {
7410
7519
  }
7411
7520
  }, baseProps),
7412
7521
  legend: {
7413
- colorScale: colors,
7522
+ colorScale,
7414
7523
  gutter: 10,
7415
7524
  orientation: "vertical",
7416
7525
  titleOrientation: "top",
@@ -7436,7 +7545,7 @@ const material = {
7436
7545
  }
7437
7546
  }, baseProps),
7438
7547
  pie: Object.assign({
7439
- colorScale: colors,
7548
+ colorScale,
7440
7549
  style: {
7441
7550
  data: {
7442
7551
  padding,
@@ -7460,7 +7569,7 @@ const material = {
7460
7569
  }
7461
7570
  }, baseProps),
7462
7571
  stack: Object.assign({
7463
- colorScale: colors
7572
+ colorScale
7464
7573
  }, baseProps),
7465
7574
  tooltip: {
7466
7575
  style: Object.assign({}, baseLabelStyles, {
@@ -10426,6 +10535,9 @@ __webpack_require__.r(__webpack_exports__);
10426
10535
  /* harmony export */ "getColorScale": function() { return /* binding */ getColorScale; },
10427
10536
  /* harmony export */ "toTransformString": function() { return /* binding */ toTransformString; }
10428
10537
  /* harmony export */ });
10538
+ /* 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");
10539
+
10540
+
10429
10541
  /**
10430
10542
  * Given an object with CSS/SVG transform definitions, return the string value
10431
10543
  * for use with the `transform` CSS property or SVG attribute. Note that we
@@ -10462,20 +10574,37 @@ const toTransformString = function (obj) {
10462
10574
  * of 5 hex string values in that color scale. If no 'name' parameter
10463
10575
  * is given, it will return the Victory default grayscale.
10464
10576
  * @param {String} name The name of the color scale to return (optional).
10577
+ * @param {Object} theme The theme object to retrieve the color scale from (optional).
10465
10578
  * @returns {Array} An array of 5 hex string values composing a color scale.
10466
10579
  */
10467
- function getColorScale(name) {
10580
+ function getColorScale(name, theme) {
10581
+ if (theme === void 0) {
10582
+ theme = _victory_theme_victory_theme__WEBPACK_IMPORTED_MODULE_0__.VictoryTheme.material;
10583
+ }
10584
+ const {
10585
+ palette: {
10586
+ grayscale = ["#cccccc", "#969696", "#636363", "#252525"],
10587
+ qualitative = [],
10588
+ heatmap = [],
10589
+ warm = [],
10590
+ cool = [],
10591
+ red = [],
10592
+ blue = [],
10593
+ green = []
10594
+ } = {}
10595
+ } = theme;
10468
10596
  const scales = {
10469
- grayscale: ["#cccccc", "#969696", "#636363", "#252525"],
10470
- qualitative: ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"],
10471
- heatmap: ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"],
10472
- warm: ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"],
10473
- cool: ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"],
10474
- red: ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"],
10475
- blue: ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"],
10476
- green: ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"]
10597
+ grayscale,
10598
+ qualitative,
10599
+ heatmap,
10600
+ warm,
10601
+ cool,
10602
+ red,
10603
+ blue,
10604
+ green
10477
10605
  };
10478
- return name ? scales[name] : scales.grayscale;
10606
+ const selectedScale = name && scales[name]?.length ? scales[name] : scales.grayscale;
10607
+ return selectedScale;
10479
10608
  }
10480
10609
 
10481
10610
  /***/ }),