victory-polar-axis 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-polar-axis
2
2
 
3
+ ## 37.2.0
4
+
3
5
  ## 37.1.2
4
6
 
5
7
  ### Patch Changes
@@ -6286,31 +6286,34 @@ __webpack_require__.r(__webpack_exports__);
6286
6286
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6287
6287
  /* harmony export */ "VictoryPortal": function() { return /* binding */ VictoryPortal; }
6288
6288
  /* harmony export */ });
6289
- /* 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");
6290
- /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
6291
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
6292
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
6293
- /* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
6294
- /* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
6295
- /* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
6289
+ /* 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");
6290
+ /* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0__);
6291
+ /* 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");
6292
+ /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
6293
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
6294
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
6295
+ /* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
6296
+ /* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
6297
+ /* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
6298
+
6296
6299
 
6297
6300
 
6298
6301
 
6299
6302
 
6300
6303
 
6301
6304
  const defaultProps = {
6302
- groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("g", null)
6305
+ groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement("g", null)
6303
6306
  };
6304
6307
  const VictoryPortal = initialProps => {
6305
6308
  const props = {
6306
6309
  ...defaultProps,
6307
6310
  ...initialProps
6308
6311
  };
6309
- const id = react__WEBPACK_IMPORTED_MODULE_1___default().useId();
6310
- const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_2__.usePortalContext)();
6312
+ const id = lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default()();
6313
+ const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_3__.usePortalContext)();
6311
6314
  if (!portalContext) {
6312
6315
  const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
6313
- _victory_util_log__WEBPACK_IMPORTED_MODULE_3__.warn(msg);
6316
+ _victory_util_log__WEBPACK_IMPORTED_MODULE_4__.warn(msg);
6314
6317
  }
6315
6318
  const children = Array.isArray(props.children) ? props.children[0] : props.children;
6316
6319
  const {
@@ -6321,15 +6324,15 @@ const VictoryPortal = initialProps => {
6321
6324
  groupComponent,
6322
6325
  standalone: false
6323
6326
  } : {};
6324
- const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.omit(props, ["children", "groupComponent"]), {
6327
+ const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__.omit(props, ["children", "groupComponent"]), {
6325
6328
  key: childProps.key ?? id
6326
6329
  });
6327
- const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(children, newProps);
6328
- react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
6330
+ const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().cloneElement(children, newProps);
6331
+ react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
6329
6332
  portalContext?.addChild(id, child);
6330
6333
  // eslint-disable-next-line react-hooks/exhaustive-deps
6331
6334
  }, [props.children]);
6332
- react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
6335
+ react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
6333
6336
  return () => portalContext?.removeChild(id);
6334
6337
  // eslint-disable-next-line react-hooks/exhaustive-deps
6335
6338
  }, []);
@@ -6794,7 +6797,26 @@ const green = {
6794
6797
  "500": "#20C933",
6795
6798
  "900": "#338A17"
6796
6799
  };
6797
- const colors = [blue["500"], pink["500"], teal["500"], purple["500"], green["500"], orange["500"], cyan["500"], red["500"], yellow["500"]];
6800
+ const colors = {
6801
+ blue: blue["500"],
6802
+ pink: pink["500"],
6803
+ teal: teal["500"],
6804
+ purple: purple["500"],
6805
+ green: green["500"],
6806
+ orange: orange["500"],
6807
+ cyan: cyan["500"],
6808
+ red: red["500"],
6809
+ yellow: yellow["500"]
6810
+ };
6811
+ const colorScale = Object.values(colors);
6812
+ const grayscale = [gray["200"], gray["400"], gray["600"], gray["900"]];
6813
+ const warm = [yellow["500"], orange["500"], red["500"], pink["500"]];
6814
+ const cool = [cyan["500"], teal["500"], blue["500"], purple["500"]];
6815
+ const heatmap = [green["500"], yellow["500"], red["500"]];
6816
+ const redPalette = [red["500"], red["300"], red["100"]];
6817
+ const greenPalette = [green["500"], green["300"], green["100"]];
6818
+ const bluePalette = [blue["500"], blue["300"], blue["100"]];
6819
+
6798
6820
  // *
6799
6821
  // * Typography
6800
6822
  // *
@@ -6809,7 +6831,7 @@ const baseProps = {
6809
6831
  width: 450,
6810
6832
  height: 300,
6811
6833
  padding: 50,
6812
- colorScale: colors
6834
+ colorScale
6813
6835
  };
6814
6836
  // *
6815
6837
  // * Labels
@@ -6838,10 +6860,23 @@ const borderRadius = 1;
6838
6860
  // * Theme
6839
6861
  // *
6840
6862
  const clean = {
6863
+ palette: {
6864
+ colors,
6865
+ grayscale,
6866
+ qualitative: colorScale,
6867
+ heatmap,
6868
+ warm,
6869
+ cool,
6870
+ red: redPalette,
6871
+ green: greenPalette,
6872
+ blue: bluePalette
6873
+ },
6841
6874
  area: Object.assign({
6842
6875
  style: {
6843
6876
  data: {
6844
- fill: cyan["500"]
6877
+ fill: blue["500"],
6878
+ strokeWidth: 2,
6879
+ fillOpacity: 0.5
6845
6880
  },
6846
6881
  labels: baseLabelStyles
6847
6882
  }
@@ -6850,7 +6885,7 @@ const clean = {
6850
6885
  style: {
6851
6886
  axis: {
6852
6887
  fill: "transparent",
6853
- stroke: gray["300"],
6888
+ stroke: gray["500"],
6854
6889
  strokeWidth: 1,
6855
6890
  strokeLinecap,
6856
6891
  strokeLinejoin
@@ -6875,10 +6910,10 @@ const clean = {
6875
6910
  polarAxis: Object.assign({
6876
6911
  style: {
6877
6912
  axis: {
6878
- stroke: gray["300"]
6913
+ stroke: gray["500"]
6879
6914
  },
6880
6915
  grid: {
6881
- stroke: gray["200"],
6916
+ stroke: gray["400"],
6882
6917
  strokeDasharray,
6883
6918
  strokeLinecap,
6884
6919
  strokeLinejoin,
@@ -6887,7 +6922,7 @@ const clean = {
6887
6922
  ticks: {
6888
6923
  fill: "transparent",
6889
6924
  size: 5,
6890
- stroke: gray["200"],
6925
+ stroke: gray["400"],
6891
6926
  strokeWidth: 1,
6892
6927
  strokeLinecap,
6893
6928
  strokeLinejoin
@@ -6898,10 +6933,10 @@ const clean = {
6898
6933
  polarDependentAxis: Object.assign({
6899
6934
  style: {
6900
6935
  axis: {
6901
- stroke: gray["300"]
6936
+ stroke: gray["500"]
6902
6937
  },
6903
6938
  grid: {
6904
- stroke: gray["200"],
6939
+ stroke: gray["400"],
6905
6940
  strokeDasharray,
6906
6941
  strokeLinecap,
6907
6942
  strokeLinejoin,
@@ -6910,7 +6945,7 @@ const clean = {
6910
6945
  ticks: {
6911
6946
  fill: "transparent",
6912
6947
  size: 5,
6913
- stroke: gray["200"],
6948
+ stroke: gray["300"],
6914
6949
  strokeWidth: 1,
6915
6950
  strokeLinecap,
6916
6951
  strokeLinejoin
@@ -6923,7 +6958,8 @@ const clean = {
6923
6958
  data: {
6924
6959
  fill: blue["500"],
6925
6960
  padding,
6926
- strokeWidth: 0
6961
+ strokeWidth: 1,
6962
+ fillOpacity: 0.5
6927
6963
  },
6928
6964
  labels: baseLabelStyles
6929
6965
  },
@@ -6960,14 +6996,15 @@ const clean = {
6960
6996
  q1: {
6961
6997
  padding,
6962
6998
  fill: teal["500"],
6963
- rx: borderRadius
6999
+ rx: borderRadius,
7000
+ strokeWidth: 2
6964
7001
  },
6965
7002
  q1Labels: Object.assign({}, baseLabelStyles, {
6966
7003
  padding: 3
6967
7004
  }),
6968
7005
  q3: {
6969
7006
  padding,
6970
- fill: teal["500"],
7007
+ fill: cyan["500"],
6971
7008
  rx: borderRadius
6972
7009
  },
6973
7010
  q3Labels: Object.assign({}, baseLabelStyles, {
@@ -7008,14 +7045,13 @@ const clean = {
7008
7045
  }
7009
7046
  }, baseProps),
7010
7047
  group: Object.assign({
7011
- colorScale: colors
7048
+ colorScale
7012
7049
  }, baseProps),
7013
7050
  histogram: Object.assign({
7014
7051
  style: {
7015
7052
  data: {
7016
7053
  fill: cyan["500"],
7017
- stroke: "transparent",
7018
- strokeWidth: 0
7054
+ fillOpacity: 0.5
7019
7055
  },
7020
7056
  labels: baseLabelStyles
7021
7057
  },
@@ -7026,21 +7062,23 @@ const clean = {
7026
7062
  }, baseProps),
7027
7063
  label: baseLabelStyles,
7028
7064
  legend: {
7029
- colorScale: colors,
7030
- gutter: 10,
7031
- orientation: "vertical",
7065
+ colorScale,
7066
+ gutter: 24,
7067
+ borderPadding: 10,
7068
+ orientation: "horizontal",
7032
7069
  titleOrientation: "top",
7070
+ centerTitle: true,
7033
7071
  style: {
7034
7072
  data: {
7035
7073
  type: "circle"
7036
7074
  },
7037
7075
  labels: {
7038
7076
  ...baseLabelStyles,
7039
- fontSize: 14
7077
+ fontSize: 12
7040
7078
  },
7041
7079
  title: Object.assign({}, baseLabelStyles, {
7042
7080
  padding,
7043
- fontSize: 20
7081
+ fontSize: 16
7044
7082
  }),
7045
7083
  border: {
7046
7084
  stroke: gray["200"],
@@ -7054,7 +7092,7 @@ const clean = {
7054
7092
  data: {
7055
7093
  fill: "transparent",
7056
7094
  opacity: 1,
7057
- stroke: pink["500"],
7095
+ stroke: blue["500"],
7058
7096
  strokeWidth: 2,
7059
7097
  strokeLinecap,
7060
7098
  strokeLinejoin
@@ -7064,16 +7102,22 @@ const clean = {
7064
7102
  }, baseProps),
7065
7103
  pie: Object.assign({
7066
7104
  style: {
7105
+ parent: {
7106
+ backgroundColor: gray.white
7107
+ },
7067
7108
  data: {
7068
7109
  padding,
7069
7110
  stroke: gray.white,
7070
7111
  strokeWidth: 1
7071
7112
  },
7072
- labels: Object.assign({}, baseLabelStyles, {
7073
- padding: 20
7074
- })
7113
+ labels: {
7114
+ ...baseLabelStyles,
7115
+ padding: 20,
7116
+ fill: gray["600"],
7117
+ fontSize: 10
7118
+ }
7075
7119
  },
7076
- colorScale: colors,
7120
+ colorScale,
7077
7121
  cornerRadius: borderRadius
7078
7122
  }, baseProps),
7079
7123
  scatter: Object.assign({
@@ -7084,11 +7128,14 @@ const clean = {
7084
7128
  stroke: "transparent",
7085
7129
  strokeWidth: 0
7086
7130
  },
7087
- labels: baseLabelStyles
7131
+ labels: {
7132
+ ...baseLabelStyles,
7133
+ padding: 20
7134
+ }
7088
7135
  }
7089
7136
  }, baseProps),
7090
7137
  stack: Object.assign({
7091
- colorScale: colors
7138
+ colorScale
7092
7139
  }, baseProps),
7093
7140
  tooltip: {
7094
7141
  style: Object.assign({}, baseLabelStyles, {
@@ -7096,7 +7143,7 @@ const clean = {
7096
7143
  pointerEvents: "none"
7097
7144
  }),
7098
7145
  flyoutStyle: {
7099
- stroke: gray["500"],
7146
+ stroke: gray["300"],
7100
7147
  strokeWidth: 2,
7101
7148
  fill: gray.white,
7102
7149
  pointerEvents: "none"
@@ -7113,9 +7160,10 @@ const clean = {
7113
7160
  voronoi: Object.assign({
7114
7161
  style: {
7115
7162
  data: {
7116
- fill: red["100"],
7117
- stroke: red["500"],
7118
- strokeWidth: 2
7163
+ fill: blue["100"],
7164
+ stroke: blue["500"],
7165
+ strokeWidth: 2,
7166
+ opacity: 0.4
7119
7167
  },
7120
7168
  labels: Object.assign({}, baseLabelStyles, {
7121
7169
  padding: 5,
@@ -7151,9 +7199,28 @@ __webpack_require__.r(__webpack_exports__);
7151
7199
  // *
7152
7200
  // * Colors
7153
7201
  // *
7154
- const colors = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
7202
+ const colors = {
7203
+ blue: "#4F7DA1",
7204
+ pink: "#E2A37F",
7205
+ teal: "#00796B",
7206
+ purple: "#DF948A",
7207
+ green: "#8BC34A",
7208
+ orange: "#F4511E",
7209
+ cyan: "#006064",
7210
+ red: "#DF5A49",
7211
+ yellow: "#FFF59D"
7212
+ };
7213
+ const colorScale = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
7155
7214
  const charcoal = "#252525";
7156
7215
  const grey = "#969696";
7216
+ const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
7217
+ const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
7218
+ const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
7219
+ const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
7220
+ const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
7221
+ const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
7222
+ const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
7223
+
7157
7224
  // *
7158
7225
  // * Typography
7159
7226
  // *
@@ -7167,7 +7234,7 @@ const baseProps = {
7167
7234
  width: 450,
7168
7235
  height: 300,
7169
7236
  padding: 50,
7170
- colorScale: colors
7237
+ colorScale
7171
7238
  };
7172
7239
  // *
7173
7240
  // * Labels
@@ -7189,6 +7256,17 @@ const centeredLabelStyles = Object.assign({
7189
7256
  const strokeLinecap = "round";
7190
7257
  const strokeLinejoin = "round";
7191
7258
  const grayscale = {
7259
+ palette: {
7260
+ colors,
7261
+ grayscale: colorScale,
7262
+ qualitative,
7263
+ heatmap,
7264
+ warm,
7265
+ cool,
7266
+ red,
7267
+ green,
7268
+ blue
7269
+ },
7192
7270
  area: Object.assign({
7193
7271
  style: {
7194
7272
  data: {
@@ -7303,7 +7381,7 @@ const grayscale = {
7303
7381
  }
7304
7382
  }, baseProps),
7305
7383
  group: Object.assign({
7306
- colorScale: colors
7384
+ colorScale
7307
7385
  }, baseProps),
7308
7386
  histogram: Object.assign({
7309
7387
  style: {
@@ -7316,7 +7394,7 @@ const grayscale = {
7316
7394
  }
7317
7395
  }, baseProps),
7318
7396
  legend: {
7319
- colorScale: colors,
7397
+ colorScale,
7320
7398
  gutter: 10,
7321
7399
  orientation: "vertical",
7322
7400
  titleOrientation: "top",
@@ -7351,7 +7429,7 @@ const grayscale = {
7351
7429
  padding: 20
7352
7430
  })
7353
7431
  },
7354
- colorScale: colors,
7432
+ colorScale,
7355
7433
  width: 400,
7356
7434
  height: 400,
7357
7435
  padding: 50
@@ -7367,7 +7445,7 @@ const grayscale = {
7367
7445
  }
7368
7446
  }, baseProps),
7369
7447
  stack: Object.assign({
7370
- colorScale: colors
7448
+ colorScale
7371
7449
  }, baseProps),
7372
7450
  tooltip: {
7373
7451
  style: Object.assign({}, baseLabelStyles, {
@@ -7427,11 +7505,31 @@ const lime300 = "#DCE775";
7427
7505
  const lightGreen500 = "#8BC34A";
7428
7506
  const teal700 = "#00796B";
7429
7507
  const cyan900 = "#006064";
7430
- const colors = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
7508
+ const colorScale = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
7431
7509
  const blueGrey50 = "#ECEFF1";
7432
7510
  const blueGrey300 = "#90A4AE";
7433
7511
  const blueGrey700 = "#455A64";
7434
7512
  const grey900 = "#212121";
7513
+ const colors = {
7514
+ blue: "#4F7DA1",
7515
+ pink: "#E2A37F",
7516
+ teal: teal700,
7517
+ purple: "#DF948A",
7518
+ green: lightGreen500,
7519
+ orange: deepOrange600,
7520
+ cyan: cyan900,
7521
+ red: "#DF5A49",
7522
+ yellow: yellow200
7523
+ };
7524
+ const grayscale = [blueGrey50, blueGrey300, blueGrey700, grey900];
7525
+ const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
7526
+ const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
7527
+ const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
7528
+ const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
7529
+ const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
7530
+ const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
7531
+ const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
7532
+
7435
7533
  // *
7436
7534
  // * Typography
7437
7535
  // *
@@ -7469,6 +7567,17 @@ const strokeDasharray = "10, 5";
7469
7567
  const strokeLinecap = "round";
7470
7568
  const strokeLinejoin = "round";
7471
7569
  const material = {
7570
+ palette: {
7571
+ colors,
7572
+ grayscale,
7573
+ qualitative,
7574
+ heatmap,
7575
+ warm,
7576
+ cool,
7577
+ red,
7578
+ green,
7579
+ blue
7580
+ },
7472
7581
  area: Object.assign({
7473
7582
  style: {
7474
7583
  data: {
@@ -7601,7 +7710,7 @@ const material = {
7601
7710
  }
7602
7711
  }, baseProps),
7603
7712
  group: Object.assign({
7604
- colorScale: colors
7713
+ colorScale
7605
7714
  }, baseProps),
7606
7715
  histogram: Object.assign({
7607
7716
  style: {
@@ -7614,7 +7723,7 @@ const material = {
7614
7723
  }
7615
7724
  }, baseProps),
7616
7725
  legend: {
7617
- colorScale: colors,
7726
+ colorScale,
7618
7727
  gutter: 10,
7619
7728
  orientation: "vertical",
7620
7729
  titleOrientation: "top",
@@ -7640,7 +7749,7 @@ const material = {
7640
7749
  }
7641
7750
  }, baseProps),
7642
7751
  pie: Object.assign({
7643
- colorScale: colors,
7752
+ colorScale,
7644
7753
  style: {
7645
7754
  data: {
7646
7755
  padding,
@@ -7664,7 +7773,7 @@ const material = {
7664
7773
  }
7665
7774
  }, baseProps),
7666
7775
  stack: Object.assign({
7667
- colorScale: colors
7776
+ colorScale
7668
7777
  }, baseProps),
7669
7778
  tooltip: {
7670
7779
  style: Object.assign({}, baseLabelStyles, {
@@ -10909,6 +11018,9 @@ __webpack_require__.r(__webpack_exports__);
10909
11018
  /* harmony export */ "getColorScale": function() { return /* binding */ getColorScale; },
10910
11019
  /* harmony export */ "toTransformString": function() { return /* binding */ toTransformString; }
10911
11020
  /* harmony export */ });
11021
+ /* 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");
11022
+
11023
+
10912
11024
  /**
10913
11025
  * Given an object with CSS/SVG transform definitions, return the string value
10914
11026
  * for use with the `transform` CSS property or SVG attribute. Note that we
@@ -10945,20 +11057,37 @@ const toTransformString = function (obj) {
10945
11057
  * of 5 hex string values in that color scale. If no 'name' parameter
10946
11058
  * is given, it will return the Victory default grayscale.
10947
11059
  * @param {String} name The name of the color scale to return (optional).
11060
+ * @param {Object} theme The theme object to retrieve the color scale from (optional).
10948
11061
  * @returns {Array} An array of 5 hex string values composing a color scale.
10949
11062
  */
10950
- function getColorScale(name) {
11063
+ function getColorScale(name, theme) {
11064
+ if (theme === void 0) {
11065
+ theme = _victory_theme_victory_theme__WEBPACK_IMPORTED_MODULE_0__.VictoryTheme.material;
11066
+ }
11067
+ const {
11068
+ palette: {
11069
+ grayscale = ["#cccccc", "#969696", "#636363", "#252525"],
11070
+ qualitative = [],
11071
+ heatmap = [],
11072
+ warm = [],
11073
+ cool = [],
11074
+ red = [],
11075
+ blue = [],
11076
+ green = []
11077
+ } = {}
11078
+ } = theme;
10951
11079
  const scales = {
10952
- grayscale: ["#cccccc", "#969696", "#636363", "#252525"],
10953
- qualitative: ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"],
10954
- heatmap: ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"],
10955
- warm: ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"],
10956
- cool: ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"],
10957
- red: ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"],
10958
- blue: ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"],
10959
- green: ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"]
11080
+ grayscale,
11081
+ qualitative,
11082
+ heatmap,
11083
+ warm,
11084
+ cool,
11085
+ red,
11086
+ blue,
11087
+ green
10960
11088
  };
10961
- return name ? scales[name] : scales.grayscale;
11089
+ const selectedScale = name && scales[name]?.length ? scales[name] : scales.grayscale;
11090
+ return selectedScale;
10962
11091
  }
10963
11092
 
10964
11093
  /***/ }),