victory-chart 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-chart
2
2
 
3
+ ## 37.2.0
4
+
3
5
  ## 37.1.2
4
6
 
5
7
  ### Patch Changes
@@ -7116,31 +7116,34 @@ __webpack_require__.r(__webpack_exports__);
7116
7116
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7117
7117
  /* harmony export */ "VictoryPortal": function() { return /* binding */ VictoryPortal; }
7118
7118
  /* harmony export */ });
7119
- /* 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");
7120
- /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
7121
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
7122
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
7123
- /* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
7124
- /* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
7125
- /* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
7119
+ /* 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");
7120
+ /* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0__);
7121
+ /* 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");
7122
+ /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
7123
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
7124
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
7125
+ /* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
7126
+ /* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
7127
+ /* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
7128
+
7126
7129
 
7127
7130
 
7128
7131
 
7129
7132
 
7130
7133
 
7131
7134
  const defaultProps = {
7132
- groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("g", null)
7135
+ groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement("g", null)
7133
7136
  };
7134
7137
  const VictoryPortal = initialProps => {
7135
7138
  const props = {
7136
7139
  ...defaultProps,
7137
7140
  ...initialProps
7138
7141
  };
7139
- const id = react__WEBPACK_IMPORTED_MODULE_1___default().useId();
7140
- const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_2__.usePortalContext)();
7142
+ const id = lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default()();
7143
+ const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_3__.usePortalContext)();
7141
7144
  if (!portalContext) {
7142
7145
  const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
7143
- _victory_util_log__WEBPACK_IMPORTED_MODULE_3__.warn(msg);
7146
+ _victory_util_log__WEBPACK_IMPORTED_MODULE_4__.warn(msg);
7144
7147
  }
7145
7148
  const children = Array.isArray(props.children) ? props.children[0] : props.children;
7146
7149
  const {
@@ -7151,15 +7154,15 @@ const VictoryPortal = initialProps => {
7151
7154
  groupComponent,
7152
7155
  standalone: false
7153
7156
  } : {};
7154
- const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.omit(props, ["children", "groupComponent"]), {
7157
+ const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__.omit(props, ["children", "groupComponent"]), {
7155
7158
  key: childProps.key ?? id
7156
7159
  });
7157
- const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(children, newProps);
7158
- react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
7160
+ const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().cloneElement(children, newProps);
7161
+ react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
7159
7162
  portalContext?.addChild(id, child);
7160
7163
  // eslint-disable-next-line react-hooks/exhaustive-deps
7161
7164
  }, [props.children]);
7162
- react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
7165
+ react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
7163
7166
  return () => portalContext?.removeChild(id);
7164
7167
  // eslint-disable-next-line react-hooks/exhaustive-deps
7165
7168
  }, []);
@@ -7734,7 +7737,26 @@ const green = {
7734
7737
  "500": "#20C933",
7735
7738
  "900": "#338A17"
7736
7739
  };
7737
- const colors = [blue["500"], pink["500"], teal["500"], purple["500"], green["500"], orange["500"], cyan["500"], red["500"], yellow["500"]];
7740
+ const colors = {
7741
+ blue: blue["500"],
7742
+ pink: pink["500"],
7743
+ teal: teal["500"],
7744
+ purple: purple["500"],
7745
+ green: green["500"],
7746
+ orange: orange["500"],
7747
+ cyan: cyan["500"],
7748
+ red: red["500"],
7749
+ yellow: yellow["500"]
7750
+ };
7751
+ const colorScale = Object.values(colors);
7752
+ const grayscale = [gray["200"], gray["400"], gray["600"], gray["900"]];
7753
+ const warm = [yellow["500"], orange["500"], red["500"], pink["500"]];
7754
+ const cool = [cyan["500"], teal["500"], blue["500"], purple["500"]];
7755
+ const heatmap = [green["500"], yellow["500"], red["500"]];
7756
+ const redPalette = [red["500"], red["300"], red["100"]];
7757
+ const greenPalette = [green["500"], green["300"], green["100"]];
7758
+ const bluePalette = [blue["500"], blue["300"], blue["100"]];
7759
+
7738
7760
  // *
7739
7761
  // * Typography
7740
7762
  // *
@@ -7749,7 +7771,7 @@ const baseProps = {
7749
7771
  width: 450,
7750
7772
  height: 300,
7751
7773
  padding: 50,
7752
- colorScale: colors
7774
+ colorScale
7753
7775
  };
7754
7776
  // *
7755
7777
  // * Labels
@@ -7778,10 +7800,23 @@ const borderRadius = 1;
7778
7800
  // * Theme
7779
7801
  // *
7780
7802
  const clean = {
7803
+ palette: {
7804
+ colors,
7805
+ grayscale,
7806
+ qualitative: colorScale,
7807
+ heatmap,
7808
+ warm,
7809
+ cool,
7810
+ red: redPalette,
7811
+ green: greenPalette,
7812
+ blue: bluePalette
7813
+ },
7781
7814
  area: Object.assign({
7782
7815
  style: {
7783
7816
  data: {
7784
- fill: cyan["500"]
7817
+ fill: blue["500"],
7818
+ strokeWidth: 2,
7819
+ fillOpacity: 0.5
7785
7820
  },
7786
7821
  labels: baseLabelStyles
7787
7822
  }
@@ -7790,7 +7825,7 @@ const clean = {
7790
7825
  style: {
7791
7826
  axis: {
7792
7827
  fill: "transparent",
7793
- stroke: gray["300"],
7828
+ stroke: gray["500"],
7794
7829
  strokeWidth: 1,
7795
7830
  strokeLinecap,
7796
7831
  strokeLinejoin
@@ -7815,10 +7850,10 @@ const clean = {
7815
7850
  polarAxis: Object.assign({
7816
7851
  style: {
7817
7852
  axis: {
7818
- stroke: gray["300"]
7853
+ stroke: gray["500"]
7819
7854
  },
7820
7855
  grid: {
7821
- stroke: gray["200"],
7856
+ stroke: gray["400"],
7822
7857
  strokeDasharray,
7823
7858
  strokeLinecap,
7824
7859
  strokeLinejoin,
@@ -7827,7 +7862,7 @@ const clean = {
7827
7862
  ticks: {
7828
7863
  fill: "transparent",
7829
7864
  size: 5,
7830
- stroke: gray["200"],
7865
+ stroke: gray["400"],
7831
7866
  strokeWidth: 1,
7832
7867
  strokeLinecap,
7833
7868
  strokeLinejoin
@@ -7838,10 +7873,10 @@ const clean = {
7838
7873
  polarDependentAxis: Object.assign({
7839
7874
  style: {
7840
7875
  axis: {
7841
- stroke: gray["300"]
7876
+ stroke: gray["500"]
7842
7877
  },
7843
7878
  grid: {
7844
- stroke: gray["200"],
7879
+ stroke: gray["400"],
7845
7880
  strokeDasharray,
7846
7881
  strokeLinecap,
7847
7882
  strokeLinejoin,
@@ -7850,7 +7885,7 @@ const clean = {
7850
7885
  ticks: {
7851
7886
  fill: "transparent",
7852
7887
  size: 5,
7853
- stroke: gray["200"],
7888
+ stroke: gray["300"],
7854
7889
  strokeWidth: 1,
7855
7890
  strokeLinecap,
7856
7891
  strokeLinejoin
@@ -7863,7 +7898,8 @@ const clean = {
7863
7898
  data: {
7864
7899
  fill: blue["500"],
7865
7900
  padding,
7866
- strokeWidth: 0
7901
+ strokeWidth: 1,
7902
+ fillOpacity: 0.5
7867
7903
  },
7868
7904
  labels: baseLabelStyles
7869
7905
  },
@@ -7900,14 +7936,15 @@ const clean = {
7900
7936
  q1: {
7901
7937
  padding,
7902
7938
  fill: teal["500"],
7903
- rx: borderRadius
7939
+ rx: borderRadius,
7940
+ strokeWidth: 2
7904
7941
  },
7905
7942
  q1Labels: Object.assign({}, baseLabelStyles, {
7906
7943
  padding: 3
7907
7944
  }),
7908
7945
  q3: {
7909
7946
  padding,
7910
- fill: teal["500"],
7947
+ fill: cyan["500"],
7911
7948
  rx: borderRadius
7912
7949
  },
7913
7950
  q3Labels: Object.assign({}, baseLabelStyles, {
@@ -7948,14 +7985,13 @@ const clean = {
7948
7985
  }
7949
7986
  }, baseProps),
7950
7987
  group: Object.assign({
7951
- colorScale: colors
7988
+ colorScale
7952
7989
  }, baseProps),
7953
7990
  histogram: Object.assign({
7954
7991
  style: {
7955
7992
  data: {
7956
7993
  fill: cyan["500"],
7957
- stroke: "transparent",
7958
- strokeWidth: 0
7994
+ fillOpacity: 0.5
7959
7995
  },
7960
7996
  labels: baseLabelStyles
7961
7997
  },
@@ -7966,21 +8002,23 @@ const clean = {
7966
8002
  }, baseProps),
7967
8003
  label: baseLabelStyles,
7968
8004
  legend: {
7969
- colorScale: colors,
7970
- gutter: 10,
7971
- orientation: "vertical",
8005
+ colorScale,
8006
+ gutter: 24,
8007
+ borderPadding: 10,
8008
+ orientation: "horizontal",
7972
8009
  titleOrientation: "top",
8010
+ centerTitle: true,
7973
8011
  style: {
7974
8012
  data: {
7975
8013
  type: "circle"
7976
8014
  },
7977
8015
  labels: {
7978
8016
  ...baseLabelStyles,
7979
- fontSize: 14
8017
+ fontSize: 12
7980
8018
  },
7981
8019
  title: Object.assign({}, baseLabelStyles, {
7982
8020
  padding,
7983
- fontSize: 20
8021
+ fontSize: 16
7984
8022
  }),
7985
8023
  border: {
7986
8024
  stroke: gray["200"],
@@ -7994,7 +8032,7 @@ const clean = {
7994
8032
  data: {
7995
8033
  fill: "transparent",
7996
8034
  opacity: 1,
7997
- stroke: pink["500"],
8035
+ stroke: blue["500"],
7998
8036
  strokeWidth: 2,
7999
8037
  strokeLinecap,
8000
8038
  strokeLinejoin
@@ -8004,16 +8042,22 @@ const clean = {
8004
8042
  }, baseProps),
8005
8043
  pie: Object.assign({
8006
8044
  style: {
8045
+ parent: {
8046
+ backgroundColor: gray.white
8047
+ },
8007
8048
  data: {
8008
8049
  padding,
8009
8050
  stroke: gray.white,
8010
8051
  strokeWidth: 1
8011
8052
  },
8012
- labels: Object.assign({}, baseLabelStyles, {
8013
- padding: 20
8014
- })
8053
+ labels: {
8054
+ ...baseLabelStyles,
8055
+ padding: 20,
8056
+ fill: gray["600"],
8057
+ fontSize: 10
8058
+ }
8015
8059
  },
8016
- colorScale: colors,
8060
+ colorScale,
8017
8061
  cornerRadius: borderRadius
8018
8062
  }, baseProps),
8019
8063
  scatter: Object.assign({
@@ -8024,11 +8068,14 @@ const clean = {
8024
8068
  stroke: "transparent",
8025
8069
  strokeWidth: 0
8026
8070
  },
8027
- labels: baseLabelStyles
8071
+ labels: {
8072
+ ...baseLabelStyles,
8073
+ padding: 20
8074
+ }
8028
8075
  }
8029
8076
  }, baseProps),
8030
8077
  stack: Object.assign({
8031
- colorScale: colors
8078
+ colorScale
8032
8079
  }, baseProps),
8033
8080
  tooltip: {
8034
8081
  style: Object.assign({}, baseLabelStyles, {
@@ -8036,7 +8083,7 @@ const clean = {
8036
8083
  pointerEvents: "none"
8037
8084
  }),
8038
8085
  flyoutStyle: {
8039
- stroke: gray["500"],
8086
+ stroke: gray["300"],
8040
8087
  strokeWidth: 2,
8041
8088
  fill: gray.white,
8042
8089
  pointerEvents: "none"
@@ -8053,9 +8100,10 @@ const clean = {
8053
8100
  voronoi: Object.assign({
8054
8101
  style: {
8055
8102
  data: {
8056
- fill: red["100"],
8057
- stroke: red["500"],
8058
- strokeWidth: 2
8103
+ fill: blue["100"],
8104
+ stroke: blue["500"],
8105
+ strokeWidth: 2,
8106
+ opacity: 0.4
8059
8107
  },
8060
8108
  labels: Object.assign({}, baseLabelStyles, {
8061
8109
  padding: 5,
@@ -8091,9 +8139,28 @@ __webpack_require__.r(__webpack_exports__);
8091
8139
  // *
8092
8140
  // * Colors
8093
8141
  // *
8094
- const colors = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
8142
+ const colors = {
8143
+ blue: "#4F7DA1",
8144
+ pink: "#E2A37F",
8145
+ teal: "#00796B",
8146
+ purple: "#DF948A",
8147
+ green: "#8BC34A",
8148
+ orange: "#F4511E",
8149
+ cyan: "#006064",
8150
+ red: "#DF5A49",
8151
+ yellow: "#FFF59D"
8152
+ };
8153
+ const colorScale = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
8095
8154
  const charcoal = "#252525";
8096
8155
  const grey = "#969696";
8156
+ const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
8157
+ const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
8158
+ const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
8159
+ const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
8160
+ const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
8161
+ const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
8162
+ const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
8163
+
8097
8164
  // *
8098
8165
  // * Typography
8099
8166
  // *
@@ -8107,7 +8174,7 @@ const baseProps = {
8107
8174
  width: 450,
8108
8175
  height: 300,
8109
8176
  padding: 50,
8110
- colorScale: colors
8177
+ colorScale
8111
8178
  };
8112
8179
  // *
8113
8180
  // * Labels
@@ -8129,6 +8196,17 @@ const centeredLabelStyles = Object.assign({
8129
8196
  const strokeLinecap = "round";
8130
8197
  const strokeLinejoin = "round";
8131
8198
  const grayscale = {
8199
+ palette: {
8200
+ colors,
8201
+ grayscale: colorScale,
8202
+ qualitative,
8203
+ heatmap,
8204
+ warm,
8205
+ cool,
8206
+ red,
8207
+ green,
8208
+ blue
8209
+ },
8132
8210
  area: Object.assign({
8133
8211
  style: {
8134
8212
  data: {
@@ -8243,7 +8321,7 @@ const grayscale = {
8243
8321
  }
8244
8322
  }, baseProps),
8245
8323
  group: Object.assign({
8246
- colorScale: colors
8324
+ colorScale
8247
8325
  }, baseProps),
8248
8326
  histogram: Object.assign({
8249
8327
  style: {
@@ -8256,7 +8334,7 @@ const grayscale = {
8256
8334
  }
8257
8335
  }, baseProps),
8258
8336
  legend: {
8259
- colorScale: colors,
8337
+ colorScale,
8260
8338
  gutter: 10,
8261
8339
  orientation: "vertical",
8262
8340
  titleOrientation: "top",
@@ -8291,7 +8369,7 @@ const grayscale = {
8291
8369
  padding: 20
8292
8370
  })
8293
8371
  },
8294
- colorScale: colors,
8372
+ colorScale,
8295
8373
  width: 400,
8296
8374
  height: 400,
8297
8375
  padding: 50
@@ -8307,7 +8385,7 @@ const grayscale = {
8307
8385
  }
8308
8386
  }, baseProps),
8309
8387
  stack: Object.assign({
8310
- colorScale: colors
8388
+ colorScale
8311
8389
  }, baseProps),
8312
8390
  tooltip: {
8313
8391
  style: Object.assign({}, baseLabelStyles, {
@@ -8367,11 +8445,31 @@ const lime300 = "#DCE775";
8367
8445
  const lightGreen500 = "#8BC34A";
8368
8446
  const teal700 = "#00796B";
8369
8447
  const cyan900 = "#006064";
8370
- const colors = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
8448
+ const colorScale = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
8371
8449
  const blueGrey50 = "#ECEFF1";
8372
8450
  const blueGrey300 = "#90A4AE";
8373
8451
  const blueGrey700 = "#455A64";
8374
8452
  const grey900 = "#212121";
8453
+ const colors = {
8454
+ blue: "#4F7DA1",
8455
+ pink: "#E2A37F",
8456
+ teal: teal700,
8457
+ purple: "#DF948A",
8458
+ green: lightGreen500,
8459
+ orange: deepOrange600,
8460
+ cyan: cyan900,
8461
+ red: "#DF5A49",
8462
+ yellow: yellow200
8463
+ };
8464
+ const grayscale = [blueGrey50, blueGrey300, blueGrey700, grey900];
8465
+ const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
8466
+ const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
8467
+ const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
8468
+ const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
8469
+ const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
8470
+ const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
8471
+ const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
8472
+
8375
8473
  // *
8376
8474
  // * Typography
8377
8475
  // *
@@ -8409,6 +8507,17 @@ const strokeDasharray = "10, 5";
8409
8507
  const strokeLinecap = "round";
8410
8508
  const strokeLinejoin = "round";
8411
8509
  const material = {
8510
+ palette: {
8511
+ colors,
8512
+ grayscale,
8513
+ qualitative,
8514
+ heatmap,
8515
+ warm,
8516
+ cool,
8517
+ red,
8518
+ green,
8519
+ blue
8520
+ },
8412
8521
  area: Object.assign({
8413
8522
  style: {
8414
8523
  data: {
@@ -8541,7 +8650,7 @@ const material = {
8541
8650
  }
8542
8651
  }, baseProps),
8543
8652
  group: Object.assign({
8544
- colorScale: colors
8653
+ colorScale
8545
8654
  }, baseProps),
8546
8655
  histogram: Object.assign({
8547
8656
  style: {
@@ -8554,7 +8663,7 @@ const material = {
8554
8663
  }
8555
8664
  }, baseProps),
8556
8665
  legend: {
8557
- colorScale: colors,
8666
+ colorScale,
8558
8667
  gutter: 10,
8559
8668
  orientation: "vertical",
8560
8669
  titleOrientation: "top",
@@ -8580,7 +8689,7 @@ const material = {
8580
8689
  }
8581
8690
  }, baseProps),
8582
8691
  pie: Object.assign({
8583
- colorScale: colors,
8692
+ colorScale,
8584
8693
  style: {
8585
8694
  data: {
8586
8695
  padding,
@@ -8604,7 +8713,7 @@ const material = {
8604
8713
  }
8605
8714
  }, baseProps),
8606
8715
  stack: Object.assign({
8607
- colorScale: colors
8716
+ colorScale
8608
8717
  }, baseProps),
8609
8718
  tooltip: {
8610
8719
  style: Object.assign({}, baseLabelStyles, {
@@ -11992,6 +12101,9 @@ __webpack_require__.r(__webpack_exports__);
11992
12101
  /* harmony export */ "getColorScale": function() { return /* binding */ getColorScale; },
11993
12102
  /* harmony export */ "toTransformString": function() { return /* binding */ toTransformString; }
11994
12103
  /* harmony export */ });
12104
+ /* 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");
12105
+
12106
+
11995
12107
  /**
11996
12108
  * Given an object with CSS/SVG transform definitions, return the string value
11997
12109
  * for use with the `transform` CSS property or SVG attribute. Note that we
@@ -12028,20 +12140,37 @@ const toTransformString = function (obj) {
12028
12140
  * of 5 hex string values in that color scale. If no 'name' parameter
12029
12141
  * is given, it will return the Victory default grayscale.
12030
12142
  * @param {String} name The name of the color scale to return (optional).
12143
+ * @param {Object} theme The theme object to retrieve the color scale from (optional).
12031
12144
  * @returns {Array} An array of 5 hex string values composing a color scale.
12032
12145
  */
12033
- function getColorScale(name) {
12146
+ function getColorScale(name, theme) {
12147
+ if (theme === void 0) {
12148
+ theme = _victory_theme_victory_theme__WEBPACK_IMPORTED_MODULE_0__.VictoryTheme.material;
12149
+ }
12150
+ const {
12151
+ palette: {
12152
+ grayscale = ["#cccccc", "#969696", "#636363", "#252525"],
12153
+ qualitative = [],
12154
+ heatmap = [],
12155
+ warm = [],
12156
+ cool = [],
12157
+ red = [],
12158
+ blue = [],
12159
+ green = []
12160
+ } = {}
12161
+ } = theme;
12034
12162
  const scales = {
12035
- grayscale: ["#cccccc", "#969696", "#636363", "#252525"],
12036
- qualitative: ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"],
12037
- heatmap: ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"],
12038
- warm: ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"],
12039
- cool: ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"],
12040
- red: ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"],
12041
- blue: ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"],
12042
- green: ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"]
12163
+ grayscale,
12164
+ qualitative,
12165
+ heatmap,
12166
+ warm,
12167
+ cool,
12168
+ red,
12169
+ blue,
12170
+ green
12043
12171
  };
12044
- return name ? scales[name] : scales.grayscale;
12172
+ const selectedScale = name && scales[name]?.length ? scales[name] : scales.grayscale;
12173
+ return selectedScale;
12045
12174
  }
12046
12175
 
12047
12176
  /***/ }),
@@ -13283,7 +13412,9 @@ function getAllEvents(props) {
13283
13412
  }
13284
13413
  return events || [];
13285
13414
  }
13286
- function getColor(calculatedProps, child, index) {
13415
+
13416
+ // eslint-disable-next-line max-params
13417
+ function getColor(calculatedProps, child, index, theme) {
13287
13418
  // check for styles first
13288
13419
  const {
13289
13420
  style
@@ -13300,14 +13431,16 @@ function getColor(calculatedProps, child, index) {
13300
13431
  if (!colorScale && !color) {
13301
13432
  return undefined;
13302
13433
  }
13303
- const colors = Array.isArray(colorScale) ? colorScale : _style__WEBPACK_IMPORTED_MODULE_13__.getColorScale(colorScale);
13434
+ const colors = Array.isArray(colorScale) ? colorScale : _style__WEBPACK_IMPORTED_MODULE_13__.getColorScale(colorScale, theme);
13304
13435
  return color || colors[index % colors.length];
13305
13436
  }
13306
13437
  function getStyle(theme, style, role) {
13307
13438
  const defaultStyle = theme && theme[role] && theme[role].style ? theme[role].style : {};
13308
13439
  return _helpers__WEBPACK_IMPORTED_MODULE_7__.getStyles(style, defaultStyle);
13309
13440
  }
13310
- function getChildStyle(child, index, calculatedProps) {
13441
+
13442
+ // eslint-disable-next-line max-params
13443
+ function getChildStyle(child, index, calculatedProps, theme) {
13311
13444
  const {
13312
13445
  style,
13313
13446
  role
@@ -13317,7 +13450,7 @@ function getChildStyle(child, index, calculatedProps) {
13317
13450
  return childStyle;
13318
13451
  }
13319
13452
  const childRole = child.type && child.type.role;
13320
- const defaultFill = childRole === "stack" ? undefined : getColor(calculatedProps, child, index);
13453
+ const defaultFill = childRole === "stack" ? undefined : getColor(calculatedProps, child, index, theme);
13321
13454
  const defaultColor = childRole === "line" ? {
13322
13455
  fill: "none",
13323
13456
  stroke: defaultFill