victory-voronoi 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-voronoi
2
2
 
3
+ ## 37.3.0
4
+
5
+ ## 37.2.0
6
+
3
7
  ## 37.1.2
4
8
 
5
9
  ### Patch Changes
@@ -7158,31 +7158,34 @@ __webpack_require__.r(__webpack_exports__);
7158
7158
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7159
7159
  /* harmony export */ "VictoryPortal": function() { return /* binding */ VictoryPortal; }
7160
7160
  /* harmony export */ });
7161
- /* 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");
7162
- /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
7163
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
7164
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
7165
- /* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
7166
- /* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
7167
- /* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
7161
+ /* 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");
7162
+ /* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0__);
7163
+ /* 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");
7164
+ /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
7165
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
7166
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
7167
+ /* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
7168
+ /* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
7169
+ /* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
7170
+
7168
7171
 
7169
7172
 
7170
7173
 
7171
7174
 
7172
7175
 
7173
7176
  const defaultProps = {
7174
- groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("g", null)
7177
+ groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement("g", null)
7175
7178
  };
7176
7179
  const VictoryPortal = initialProps => {
7177
7180
  const props = {
7178
7181
  ...defaultProps,
7179
7182
  ...initialProps
7180
7183
  };
7181
- const id = react__WEBPACK_IMPORTED_MODULE_1___default().useId();
7182
- const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_2__.usePortalContext)();
7184
+ const [id] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default()());
7185
+ const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_3__.usePortalContext)();
7183
7186
  if (!portalContext) {
7184
7187
  const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
7185
- _victory_util_log__WEBPACK_IMPORTED_MODULE_3__.warn(msg);
7188
+ _victory_util_log__WEBPACK_IMPORTED_MODULE_4__.warn(msg);
7186
7189
  }
7187
7190
  const children = Array.isArray(props.children) ? props.children[0] : props.children;
7188
7191
  const {
@@ -7193,15 +7196,15 @@ const VictoryPortal = initialProps => {
7193
7196
  groupComponent,
7194
7197
  standalone: false
7195
7198
  } : {};
7196
- const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.omit(props, ["children", "groupComponent"]), {
7199
+ const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__.omit(props, ["children", "groupComponent"]), {
7197
7200
  key: childProps.key ?? id
7198
7201
  });
7199
- const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(children, newProps);
7200
- react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
7202
+ const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().cloneElement(children, newProps);
7203
+ react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
7201
7204
  portalContext?.addChild(id, child);
7202
7205
  // eslint-disable-next-line react-hooks/exhaustive-deps
7203
7206
  }, [props.children]);
7204
- react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
7207
+ react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
7205
7208
  return () => portalContext?.removeChild(id);
7206
7209
  // eslint-disable-next-line react-hooks/exhaustive-deps
7207
7210
  }, []);
@@ -7474,20 +7477,16 @@ const orange = {
7474
7477
  "100": "#FEE2D5",
7475
7478
  "300": "#FFA981",
7476
7479
  "500": "#FF6F2C",
7480
+ "700": "#FF4E1B",
7477
7481
  "900": "#D74D26"
7478
7482
  };
7479
7483
  const red = {
7480
7484
  "100": "#FFDCE5",
7481
7485
  "300": "#FF9EB7",
7482
7486
  "500": "#F82B60",
7487
+ "700": "#D31A3D",
7483
7488
  "900": "#BA1E45"
7484
7489
  };
7485
- const pink = {
7486
- "100": "#FFDAF6",
7487
- "300": "#F99DE2",
7488
- "500": "#FF08C2",
7489
- "900": "#B2158B"
7490
- };
7491
7490
  const purple = {
7492
7491
  "100": "#EDE3FE",
7493
7492
  "300": "#CDB0FF",
@@ -7498,6 +7497,7 @@ const blue = {
7498
7497
  "100": "#CFDFFF",
7499
7498
  "300": "#9CC7FF",
7500
7499
  "500": "#2D7FF9",
7500
+ "700": "#0056B3",
7501
7501
  "900": "#2750AE"
7502
7502
  };
7503
7503
  const cyan = {
@@ -7516,9 +7516,29 @@ const green = {
7516
7516
  "100": "#D1F7C4",
7517
7517
  "300": "#93E088",
7518
7518
  "500": "#20C933",
7519
+ "700": "#1B9B2A",
7519
7520
  "900": "#338A17"
7520
7521
  };
7521
- const colors = [blue["500"], pink["500"], teal["500"], purple["500"], green["500"], orange["500"], cyan["500"], red["500"], yellow["500"]];
7522
+ const colors = {
7523
+ blue: blue["500"],
7524
+ cyan: cyan["500"],
7525
+ green: green["500"],
7526
+ yellow: yellow["500"],
7527
+ orange: orange["500"],
7528
+ red: red["500"],
7529
+ purple: purple["500"],
7530
+ teal: teal["500"]
7531
+ };
7532
+ const colorScale = Object.values(colors);
7533
+ const grayscale = [gray["100"], gray["300"], gray["500"], gray["700"], gray["900"]];
7534
+ const warm = [yellow["300"], yellow["500"], orange["500"], orange["900"], red["500"]];
7535
+ const cool = [purple["500"], blue["500"], cyan["500"], teal["500"], green["500"]];
7536
+ const heatmap = [green["900"], green["500"], yellow["500"], orange["500"], red["500"]];
7537
+ const redPalette = Object.values(red);
7538
+ const greenPalette = Object.values(green);
7539
+ const bluePalette = Object.values(blue);
7540
+ const defaultColor = blue["500"];
7541
+
7522
7542
  // *
7523
7543
  // * Typography
7524
7544
  // *
@@ -7532,8 +7552,8 @@ const padding = 8;
7532
7552
  const baseProps = {
7533
7553
  width: 450,
7534
7554
  height: 300,
7535
- padding: 50,
7536
- colorScale: colors
7555
+ padding: 60,
7556
+ colorScale
7537
7557
  };
7538
7558
  // *
7539
7559
  // * Labels
@@ -7562,10 +7582,23 @@ const borderRadius = 1;
7562
7582
  // * Theme
7563
7583
  // *
7564
7584
  const clean = {
7585
+ palette: {
7586
+ colors,
7587
+ grayscale,
7588
+ qualitative: colorScale,
7589
+ heatmap,
7590
+ warm,
7591
+ cool,
7592
+ red: redPalette,
7593
+ green: greenPalette,
7594
+ blue: bluePalette
7595
+ },
7565
7596
  area: Object.assign({
7566
7597
  style: {
7567
7598
  data: {
7568
- fill: cyan["500"]
7599
+ fill: defaultColor,
7600
+ strokeWidth: 2,
7601
+ fillOpacity: 0.5
7569
7602
  },
7570
7603
  labels: baseLabelStyles
7571
7604
  }
@@ -7574,13 +7607,13 @@ const clean = {
7574
7607
  style: {
7575
7608
  axis: {
7576
7609
  fill: "transparent",
7577
- stroke: gray["300"],
7610
+ stroke: gray["500"],
7578
7611
  strokeWidth: 1,
7579
7612
  strokeLinecap,
7580
7613
  strokeLinejoin
7581
7614
  },
7582
7615
  axisLabel: Object.assign({}, centeredLabelStyles, {
7583
- padding,
7616
+ padding: 35,
7584
7617
  stroke: "transparent"
7585
7618
  }),
7586
7619
  grid: {
@@ -7599,10 +7632,10 @@ const clean = {
7599
7632
  polarAxis: Object.assign({
7600
7633
  style: {
7601
7634
  axis: {
7602
- stroke: gray["300"]
7635
+ stroke: gray["500"]
7603
7636
  },
7604
7637
  grid: {
7605
- stroke: gray["200"],
7638
+ stroke: gray["400"],
7606
7639
  strokeDasharray,
7607
7640
  strokeLinecap,
7608
7641
  strokeLinejoin,
@@ -7611,7 +7644,7 @@ const clean = {
7611
7644
  ticks: {
7612
7645
  fill: "transparent",
7613
7646
  size: 5,
7614
- stroke: gray["200"],
7647
+ stroke: gray["400"],
7615
7648
  strokeWidth: 1,
7616
7649
  strokeLinecap,
7617
7650
  strokeLinejoin
@@ -7622,10 +7655,10 @@ const clean = {
7622
7655
  polarDependentAxis: Object.assign({
7623
7656
  style: {
7624
7657
  axis: {
7625
- stroke: gray["300"]
7658
+ stroke: gray["500"]
7626
7659
  },
7627
7660
  grid: {
7628
- stroke: gray["200"],
7661
+ stroke: gray["400"],
7629
7662
  strokeDasharray,
7630
7663
  strokeLinecap,
7631
7664
  strokeLinejoin,
@@ -7634,7 +7667,7 @@ const clean = {
7634
7667
  ticks: {
7635
7668
  fill: "transparent",
7636
7669
  size: 5,
7637
- stroke: gray["200"],
7670
+ stroke: gray["300"],
7638
7671
  strokeWidth: 1,
7639
7672
  strokeLinecap,
7640
7673
  strokeLinejoin
@@ -7645,9 +7678,10 @@ const clean = {
7645
7678
  bar: Object.assign({
7646
7679
  style: {
7647
7680
  data: {
7648
- fill: blue["500"],
7681
+ fill: defaultColor,
7649
7682
  padding,
7650
- strokeWidth: 0
7683
+ strokeWidth: 1,
7684
+ fillOpacity: 0.5
7651
7685
  },
7652
7686
  labels: baseLabelStyles
7653
7687
  },
@@ -7683,15 +7717,16 @@ const clean = {
7683
7717
  }),
7684
7718
  q1: {
7685
7719
  padding,
7686
- fill: teal["500"],
7687
- rx: borderRadius
7720
+ fill: colorScale[0],
7721
+ rx: borderRadius,
7722
+ strokeWidth: 2
7688
7723
  },
7689
7724
  q1Labels: Object.assign({}, baseLabelStyles, {
7690
7725
  padding: 3
7691
7726
  }),
7692
7727
  q3: {
7693
7728
  padding,
7694
- fill: teal["500"],
7729
+ fill: colorScale[1],
7695
7730
  rx: borderRadius
7696
7731
  },
7697
7732
  q3Labels: Object.assign({}, baseLabelStyles, {
@@ -7712,8 +7747,8 @@ const clean = {
7712
7747
  })
7713
7748
  },
7714
7749
  candleColors: {
7715
- positive: teal["500"],
7716
- negative: orange["500"]
7750
+ positive: green["500"],
7751
+ negative: red["500"]
7717
7752
  },
7718
7753
  wickStrokeWidth: 2
7719
7754
  }, baseProps),
@@ -7732,14 +7767,13 @@ const clean = {
7732
7767
  }
7733
7768
  }, baseProps),
7734
7769
  group: Object.assign({
7735
- colorScale: colors
7770
+ colorScale
7736
7771
  }, baseProps),
7737
7772
  histogram: Object.assign({
7738
7773
  style: {
7739
7774
  data: {
7740
7775
  fill: cyan["500"],
7741
- stroke: "transparent",
7742
- strokeWidth: 0
7776
+ fillOpacity: 0.5
7743
7777
  },
7744
7778
  labels: baseLabelStyles
7745
7779
  },
@@ -7750,21 +7784,23 @@ const clean = {
7750
7784
  }, baseProps),
7751
7785
  label: baseLabelStyles,
7752
7786
  legend: {
7753
- colorScale: colors,
7754
- gutter: 10,
7755
- orientation: "vertical",
7787
+ colorScale,
7788
+ gutter: 24,
7789
+ borderPadding: 10,
7790
+ orientation: "horizontal",
7756
7791
  titleOrientation: "top",
7792
+ centerTitle: true,
7757
7793
  style: {
7758
7794
  data: {
7759
7795
  type: "circle"
7760
7796
  },
7761
7797
  labels: {
7762
7798
  ...baseLabelStyles,
7763
- fontSize: 14
7799
+ fontSize: 12
7764
7800
  },
7765
7801
  title: Object.assign({}, baseLabelStyles, {
7766
7802
  padding,
7767
- fontSize: 20
7803
+ fontSize: 16
7768
7804
  }),
7769
7805
  border: {
7770
7806
  stroke: gray["200"],
@@ -7778,7 +7814,7 @@ const clean = {
7778
7814
  data: {
7779
7815
  fill: "transparent",
7780
7816
  opacity: 1,
7781
- stroke: pink["500"],
7817
+ stroke: defaultColor,
7782
7818
  strokeWidth: 2,
7783
7819
  strokeLinecap,
7784
7820
  strokeLinejoin
@@ -7788,31 +7824,40 @@ const clean = {
7788
7824
  }, baseProps),
7789
7825
  pie: Object.assign({
7790
7826
  style: {
7827
+ parent: {
7828
+ backgroundColor: gray.white
7829
+ },
7791
7830
  data: {
7792
7831
  padding,
7793
7832
  stroke: gray.white,
7794
7833
  strokeWidth: 1
7795
7834
  },
7796
- labels: Object.assign({}, baseLabelStyles, {
7797
- padding: 20
7798
- })
7835
+ labels: {
7836
+ ...baseLabelStyles,
7837
+ padding: 20,
7838
+ fill: gray["600"],
7839
+ fontSize: 10
7840
+ }
7799
7841
  },
7800
- colorScale: colors,
7842
+ colorScale,
7801
7843
  cornerRadius: borderRadius
7802
7844
  }, baseProps),
7803
7845
  scatter: Object.assign({
7804
7846
  style: {
7805
7847
  data: {
7806
- fill: purple["500"],
7848
+ fill: defaultColor,
7807
7849
  opacity: 1,
7808
7850
  stroke: "transparent",
7809
7851
  strokeWidth: 0
7810
7852
  },
7811
- labels: baseLabelStyles
7853
+ labels: {
7854
+ ...baseLabelStyles,
7855
+ padding: 20
7856
+ }
7812
7857
  }
7813
7858
  }, baseProps),
7814
7859
  stack: Object.assign({
7815
- colorScale: colors
7860
+ colorScale
7816
7861
  }, baseProps),
7817
7862
  tooltip: {
7818
7863
  style: Object.assign({}, baseLabelStyles, {
@@ -7820,7 +7865,7 @@ const clean = {
7820
7865
  pointerEvents: "none"
7821
7866
  }),
7822
7867
  flyoutStyle: {
7823
- stroke: gray["500"],
7868
+ stroke: gray["300"],
7824
7869
  strokeWidth: 2,
7825
7870
  fill: gray.white,
7826
7871
  pointerEvents: "none"
@@ -7837,8 +7882,8 @@ const clean = {
7837
7882
  voronoi: Object.assign({
7838
7883
  style: {
7839
7884
  data: {
7840
- fill: red["100"],
7841
- stroke: red["500"],
7885
+ fill: blue["100"],
7886
+ stroke: defaultColor,
7842
7887
  strokeWidth: 2
7843
7888
  },
7844
7889
  labels: Object.assign({}, baseLabelStyles, {
@@ -7875,9 +7920,28 @@ __webpack_require__.r(__webpack_exports__);
7875
7920
  // *
7876
7921
  // * Colors
7877
7922
  // *
7878
- const colors = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
7923
+ const colors = {
7924
+ blue: "#4F7DA1",
7925
+ pink: "#E2A37F",
7926
+ teal: "#00796B",
7927
+ purple: "#DF948A",
7928
+ green: "#8BC34A",
7929
+ orange: "#F4511E",
7930
+ cyan: "#006064",
7931
+ red: "#DF5A49",
7932
+ yellow: "#FFF59D"
7933
+ };
7934
+ const colorScale = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
7879
7935
  const charcoal = "#252525";
7880
7936
  const grey = "#969696";
7937
+ const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
7938
+ const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
7939
+ const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
7940
+ const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
7941
+ const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
7942
+ const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
7943
+ const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
7944
+
7881
7945
  // *
7882
7946
  // * Typography
7883
7947
  // *
@@ -7891,7 +7955,7 @@ const baseProps = {
7891
7955
  width: 450,
7892
7956
  height: 300,
7893
7957
  padding: 50,
7894
- colorScale: colors
7958
+ colorScale
7895
7959
  };
7896
7960
  // *
7897
7961
  // * Labels
@@ -7913,6 +7977,17 @@ const centeredLabelStyles = Object.assign({
7913
7977
  const strokeLinecap = "round";
7914
7978
  const strokeLinejoin = "round";
7915
7979
  const grayscale = {
7980
+ palette: {
7981
+ colors,
7982
+ grayscale: colorScale,
7983
+ qualitative,
7984
+ heatmap,
7985
+ warm,
7986
+ cool,
7987
+ red,
7988
+ green,
7989
+ blue
7990
+ },
7916
7991
  area: Object.assign({
7917
7992
  style: {
7918
7993
  data: {
@@ -8027,7 +8102,7 @@ const grayscale = {
8027
8102
  }
8028
8103
  }, baseProps),
8029
8104
  group: Object.assign({
8030
- colorScale: colors
8105
+ colorScale
8031
8106
  }, baseProps),
8032
8107
  histogram: Object.assign({
8033
8108
  style: {
@@ -8040,7 +8115,7 @@ const grayscale = {
8040
8115
  }
8041
8116
  }, baseProps),
8042
8117
  legend: {
8043
- colorScale: colors,
8118
+ colorScale,
8044
8119
  gutter: 10,
8045
8120
  orientation: "vertical",
8046
8121
  titleOrientation: "top",
@@ -8075,7 +8150,7 @@ const grayscale = {
8075
8150
  padding: 20
8076
8151
  })
8077
8152
  },
8078
- colorScale: colors,
8153
+ colorScale,
8079
8154
  width: 400,
8080
8155
  height: 400,
8081
8156
  padding: 50
@@ -8091,7 +8166,7 @@ const grayscale = {
8091
8166
  }
8092
8167
  }, baseProps),
8093
8168
  stack: Object.assign({
8094
- colorScale: colors
8169
+ colorScale
8095
8170
  }, baseProps),
8096
8171
  tooltip: {
8097
8172
  style: Object.assign({}, baseLabelStyles, {
@@ -8151,11 +8226,31 @@ const lime300 = "#DCE775";
8151
8226
  const lightGreen500 = "#8BC34A";
8152
8227
  const teal700 = "#00796B";
8153
8228
  const cyan900 = "#006064";
8154
- const colors = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
8229
+ const colorScale = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
8155
8230
  const blueGrey50 = "#ECEFF1";
8156
8231
  const blueGrey300 = "#90A4AE";
8157
8232
  const blueGrey700 = "#455A64";
8158
8233
  const grey900 = "#212121";
8234
+ const colors = {
8235
+ blue: "#4F7DA1",
8236
+ pink: "#E2A37F",
8237
+ teal: teal700,
8238
+ purple: "#DF948A",
8239
+ green: lightGreen500,
8240
+ orange: deepOrange600,
8241
+ cyan: cyan900,
8242
+ red: "#DF5A49",
8243
+ yellow: yellow200
8244
+ };
8245
+ const grayscale = [blueGrey50, blueGrey300, blueGrey700, grey900];
8246
+ const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
8247
+ const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
8248
+ const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
8249
+ const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
8250
+ const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
8251
+ const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
8252
+ const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
8253
+
8159
8254
  // *
8160
8255
  // * Typography
8161
8256
  // *
@@ -8193,6 +8288,17 @@ const strokeDasharray = "10, 5";
8193
8288
  const strokeLinecap = "round";
8194
8289
  const strokeLinejoin = "round";
8195
8290
  const material = {
8291
+ palette: {
8292
+ colors,
8293
+ grayscale,
8294
+ qualitative,
8295
+ heatmap,
8296
+ warm,
8297
+ cool,
8298
+ red,
8299
+ green,
8300
+ blue
8301
+ },
8196
8302
  area: Object.assign({
8197
8303
  style: {
8198
8304
  data: {
@@ -8325,7 +8431,7 @@ const material = {
8325
8431
  }
8326
8432
  }, baseProps),
8327
8433
  group: Object.assign({
8328
- colorScale: colors
8434
+ colorScale
8329
8435
  }, baseProps),
8330
8436
  histogram: Object.assign({
8331
8437
  style: {
@@ -8338,7 +8444,7 @@ const material = {
8338
8444
  }
8339
8445
  }, baseProps),
8340
8446
  legend: {
8341
- colorScale: colors,
8447
+ colorScale,
8342
8448
  gutter: 10,
8343
8449
  orientation: "vertical",
8344
8450
  titleOrientation: "top",
@@ -8364,7 +8470,7 @@ const material = {
8364
8470
  }
8365
8471
  }, baseProps),
8366
8472
  pie: Object.assign({
8367
- colorScale: colors,
8473
+ colorScale,
8368
8474
  style: {
8369
8475
  data: {
8370
8476
  padding,
@@ -8388,7 +8494,7 @@ const material = {
8388
8494
  }
8389
8495
  }, baseProps),
8390
8496
  stack: Object.assign({
8391
- colorScale: colors
8497
+ colorScale
8392
8498
  }, baseProps),
8393
8499
  tooltip: {
8394
8500
  style: Object.assign({}, baseLabelStyles, {
@@ -11354,6 +11460,9 @@ __webpack_require__.r(__webpack_exports__);
11354
11460
  /* harmony export */ "getColorScale": function() { return /* binding */ getColorScale; },
11355
11461
  /* harmony export */ "toTransformString": function() { return /* binding */ toTransformString; }
11356
11462
  /* harmony export */ });
11463
+ /* 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");
11464
+
11465
+
11357
11466
  /**
11358
11467
  * Given an object with CSS/SVG transform definitions, return the string value
11359
11468
  * for use with the `transform` CSS property or SVG attribute. Note that we
@@ -11390,20 +11499,37 @@ const toTransformString = function (obj) {
11390
11499
  * of 5 hex string values in that color scale. If no 'name' parameter
11391
11500
  * is given, it will return the Victory default grayscale.
11392
11501
  * @param {String} name The name of the color scale to return (optional).
11502
+ * @param {Object} theme The theme object to retrieve the color scale from (optional).
11393
11503
  * @returns {Array} An array of 5 hex string values composing a color scale.
11394
11504
  */
11395
- function getColorScale(name) {
11505
+ function getColorScale(name, theme) {
11506
+ if (theme === void 0) {
11507
+ theme = _victory_theme_victory_theme__WEBPACK_IMPORTED_MODULE_0__.VictoryTheme.material;
11508
+ }
11509
+ const {
11510
+ palette: {
11511
+ grayscale = ["#cccccc", "#969696", "#636363", "#252525"],
11512
+ qualitative = [],
11513
+ heatmap = [],
11514
+ warm = [],
11515
+ cool = [],
11516
+ red = [],
11517
+ blue = [],
11518
+ green = []
11519
+ } = {}
11520
+ } = theme;
11396
11521
  const scales = {
11397
- grayscale: ["#cccccc", "#969696", "#636363", "#252525"],
11398
- qualitative: ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"],
11399
- heatmap: ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"],
11400
- warm: ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"],
11401
- cool: ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"],
11402
- red: ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"],
11403
- blue: ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"],
11404
- green: ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"]
11522
+ grayscale,
11523
+ qualitative,
11524
+ heatmap,
11525
+ warm,
11526
+ cool,
11527
+ red,
11528
+ blue,
11529
+ green
11405
11530
  };
11406
- return name ? scales[name] : scales.grayscale;
11531
+ const selectedScale = name && scales[name]?.length ? scales[name] : scales.grayscale;
11532
+ return selectedScale;
11407
11533
  }
11408
11534
 
11409
11535
  /***/ }),