victory-errorbar 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-errorbar
2
2
 
3
+ ## 37.3.0
4
+
5
+ ## 37.2.0
6
+
3
7
  ## 37.1.2
4
8
 
5
9
  ### 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] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(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
  }, []);
@@ -6546,20 +6549,16 @@ const orange = {
6546
6549
  "100": "#FEE2D5",
6547
6550
  "300": "#FFA981",
6548
6551
  "500": "#FF6F2C",
6552
+ "700": "#FF4E1B",
6549
6553
  "900": "#D74D26"
6550
6554
  };
6551
6555
  const red = {
6552
6556
  "100": "#FFDCE5",
6553
6557
  "300": "#FF9EB7",
6554
6558
  "500": "#F82B60",
6559
+ "700": "#D31A3D",
6555
6560
  "900": "#BA1E45"
6556
6561
  };
6557
- const pink = {
6558
- "100": "#FFDAF6",
6559
- "300": "#F99DE2",
6560
- "500": "#FF08C2",
6561
- "900": "#B2158B"
6562
- };
6563
6562
  const purple = {
6564
6563
  "100": "#EDE3FE",
6565
6564
  "300": "#CDB0FF",
@@ -6570,6 +6569,7 @@ const blue = {
6570
6569
  "100": "#CFDFFF",
6571
6570
  "300": "#9CC7FF",
6572
6571
  "500": "#2D7FF9",
6572
+ "700": "#0056B3",
6573
6573
  "900": "#2750AE"
6574
6574
  };
6575
6575
  const cyan = {
@@ -6588,9 +6588,29 @@ const green = {
6588
6588
  "100": "#D1F7C4",
6589
6589
  "300": "#93E088",
6590
6590
  "500": "#20C933",
6591
+ "700": "#1B9B2A",
6591
6592
  "900": "#338A17"
6592
6593
  };
6593
- const colors = [blue["500"], pink["500"], teal["500"], purple["500"], green["500"], orange["500"], cyan["500"], red["500"], yellow["500"]];
6594
+ const colors = {
6595
+ blue: blue["500"],
6596
+ cyan: cyan["500"],
6597
+ green: green["500"],
6598
+ yellow: yellow["500"],
6599
+ orange: orange["500"],
6600
+ red: red["500"],
6601
+ purple: purple["500"],
6602
+ teal: teal["500"]
6603
+ };
6604
+ const colorScale = Object.values(colors);
6605
+ const grayscale = [gray["100"], gray["300"], gray["500"], gray["700"], gray["900"]];
6606
+ const warm = [yellow["300"], yellow["500"], orange["500"], orange["900"], red["500"]];
6607
+ const cool = [purple["500"], blue["500"], cyan["500"], teal["500"], green["500"]];
6608
+ const heatmap = [green["900"], green["500"], yellow["500"], orange["500"], red["500"]];
6609
+ const redPalette = Object.values(red);
6610
+ const greenPalette = Object.values(green);
6611
+ const bluePalette = Object.values(blue);
6612
+ const defaultColor = blue["500"];
6613
+
6594
6614
  // *
6595
6615
  // * Typography
6596
6616
  // *
@@ -6604,8 +6624,8 @@ const padding = 8;
6604
6624
  const baseProps = {
6605
6625
  width: 450,
6606
6626
  height: 300,
6607
- padding: 50,
6608
- colorScale: colors
6627
+ padding: 60,
6628
+ colorScale
6609
6629
  };
6610
6630
  // *
6611
6631
  // * Labels
@@ -6634,10 +6654,23 @@ const borderRadius = 1;
6634
6654
  // * Theme
6635
6655
  // *
6636
6656
  const clean = {
6657
+ palette: {
6658
+ colors,
6659
+ grayscale,
6660
+ qualitative: colorScale,
6661
+ heatmap,
6662
+ warm,
6663
+ cool,
6664
+ red: redPalette,
6665
+ green: greenPalette,
6666
+ blue: bluePalette
6667
+ },
6637
6668
  area: Object.assign({
6638
6669
  style: {
6639
6670
  data: {
6640
- fill: cyan["500"]
6671
+ fill: defaultColor,
6672
+ strokeWidth: 2,
6673
+ fillOpacity: 0.5
6641
6674
  },
6642
6675
  labels: baseLabelStyles
6643
6676
  }
@@ -6646,13 +6679,13 @@ const clean = {
6646
6679
  style: {
6647
6680
  axis: {
6648
6681
  fill: "transparent",
6649
- stroke: gray["300"],
6682
+ stroke: gray["500"],
6650
6683
  strokeWidth: 1,
6651
6684
  strokeLinecap,
6652
6685
  strokeLinejoin
6653
6686
  },
6654
6687
  axisLabel: Object.assign({}, centeredLabelStyles, {
6655
- padding,
6688
+ padding: 35,
6656
6689
  stroke: "transparent"
6657
6690
  }),
6658
6691
  grid: {
@@ -6671,10 +6704,10 @@ const clean = {
6671
6704
  polarAxis: Object.assign({
6672
6705
  style: {
6673
6706
  axis: {
6674
- stroke: gray["300"]
6707
+ stroke: gray["500"]
6675
6708
  },
6676
6709
  grid: {
6677
- stroke: gray["200"],
6710
+ stroke: gray["400"],
6678
6711
  strokeDasharray,
6679
6712
  strokeLinecap,
6680
6713
  strokeLinejoin,
@@ -6683,7 +6716,7 @@ const clean = {
6683
6716
  ticks: {
6684
6717
  fill: "transparent",
6685
6718
  size: 5,
6686
- stroke: gray["200"],
6719
+ stroke: gray["400"],
6687
6720
  strokeWidth: 1,
6688
6721
  strokeLinecap,
6689
6722
  strokeLinejoin
@@ -6694,10 +6727,10 @@ const clean = {
6694
6727
  polarDependentAxis: Object.assign({
6695
6728
  style: {
6696
6729
  axis: {
6697
- stroke: gray["300"]
6730
+ stroke: gray["500"]
6698
6731
  },
6699
6732
  grid: {
6700
- stroke: gray["200"],
6733
+ stroke: gray["400"],
6701
6734
  strokeDasharray,
6702
6735
  strokeLinecap,
6703
6736
  strokeLinejoin,
@@ -6706,7 +6739,7 @@ const clean = {
6706
6739
  ticks: {
6707
6740
  fill: "transparent",
6708
6741
  size: 5,
6709
- stroke: gray["200"],
6742
+ stroke: gray["300"],
6710
6743
  strokeWidth: 1,
6711
6744
  strokeLinecap,
6712
6745
  strokeLinejoin
@@ -6717,9 +6750,10 @@ const clean = {
6717
6750
  bar: Object.assign({
6718
6751
  style: {
6719
6752
  data: {
6720
- fill: blue["500"],
6753
+ fill: defaultColor,
6721
6754
  padding,
6722
- strokeWidth: 0
6755
+ strokeWidth: 1,
6756
+ fillOpacity: 0.5
6723
6757
  },
6724
6758
  labels: baseLabelStyles
6725
6759
  },
@@ -6755,15 +6789,16 @@ const clean = {
6755
6789
  }),
6756
6790
  q1: {
6757
6791
  padding,
6758
- fill: teal["500"],
6759
- rx: borderRadius
6792
+ fill: colorScale[0],
6793
+ rx: borderRadius,
6794
+ strokeWidth: 2
6760
6795
  },
6761
6796
  q1Labels: Object.assign({}, baseLabelStyles, {
6762
6797
  padding: 3
6763
6798
  }),
6764
6799
  q3: {
6765
6800
  padding,
6766
- fill: teal["500"],
6801
+ fill: colorScale[1],
6767
6802
  rx: borderRadius
6768
6803
  },
6769
6804
  q3Labels: Object.assign({}, baseLabelStyles, {
@@ -6784,8 +6819,8 @@ const clean = {
6784
6819
  })
6785
6820
  },
6786
6821
  candleColors: {
6787
- positive: teal["500"],
6788
- negative: orange["500"]
6822
+ positive: green["500"],
6823
+ negative: red["500"]
6789
6824
  },
6790
6825
  wickStrokeWidth: 2
6791
6826
  }, baseProps),
@@ -6804,14 +6839,13 @@ const clean = {
6804
6839
  }
6805
6840
  }, baseProps),
6806
6841
  group: Object.assign({
6807
- colorScale: colors
6842
+ colorScale
6808
6843
  }, baseProps),
6809
6844
  histogram: Object.assign({
6810
6845
  style: {
6811
6846
  data: {
6812
6847
  fill: cyan["500"],
6813
- stroke: "transparent",
6814
- strokeWidth: 0
6848
+ fillOpacity: 0.5
6815
6849
  },
6816
6850
  labels: baseLabelStyles
6817
6851
  },
@@ -6822,21 +6856,23 @@ const clean = {
6822
6856
  }, baseProps),
6823
6857
  label: baseLabelStyles,
6824
6858
  legend: {
6825
- colorScale: colors,
6826
- gutter: 10,
6827
- orientation: "vertical",
6859
+ colorScale,
6860
+ gutter: 24,
6861
+ borderPadding: 10,
6862
+ orientation: "horizontal",
6828
6863
  titleOrientation: "top",
6864
+ centerTitle: true,
6829
6865
  style: {
6830
6866
  data: {
6831
6867
  type: "circle"
6832
6868
  },
6833
6869
  labels: {
6834
6870
  ...baseLabelStyles,
6835
- fontSize: 14
6871
+ fontSize: 12
6836
6872
  },
6837
6873
  title: Object.assign({}, baseLabelStyles, {
6838
6874
  padding,
6839
- fontSize: 20
6875
+ fontSize: 16
6840
6876
  }),
6841
6877
  border: {
6842
6878
  stroke: gray["200"],
@@ -6850,7 +6886,7 @@ const clean = {
6850
6886
  data: {
6851
6887
  fill: "transparent",
6852
6888
  opacity: 1,
6853
- stroke: pink["500"],
6889
+ stroke: defaultColor,
6854
6890
  strokeWidth: 2,
6855
6891
  strokeLinecap,
6856
6892
  strokeLinejoin
@@ -6860,31 +6896,40 @@ const clean = {
6860
6896
  }, baseProps),
6861
6897
  pie: Object.assign({
6862
6898
  style: {
6899
+ parent: {
6900
+ backgroundColor: gray.white
6901
+ },
6863
6902
  data: {
6864
6903
  padding,
6865
6904
  stroke: gray.white,
6866
6905
  strokeWidth: 1
6867
6906
  },
6868
- labels: Object.assign({}, baseLabelStyles, {
6869
- padding: 20
6870
- })
6907
+ labels: {
6908
+ ...baseLabelStyles,
6909
+ padding: 20,
6910
+ fill: gray["600"],
6911
+ fontSize: 10
6912
+ }
6871
6913
  },
6872
- colorScale: colors,
6914
+ colorScale,
6873
6915
  cornerRadius: borderRadius
6874
6916
  }, baseProps),
6875
6917
  scatter: Object.assign({
6876
6918
  style: {
6877
6919
  data: {
6878
- fill: purple["500"],
6920
+ fill: defaultColor,
6879
6921
  opacity: 1,
6880
6922
  stroke: "transparent",
6881
6923
  strokeWidth: 0
6882
6924
  },
6883
- labels: baseLabelStyles
6925
+ labels: {
6926
+ ...baseLabelStyles,
6927
+ padding: 20
6928
+ }
6884
6929
  }
6885
6930
  }, baseProps),
6886
6931
  stack: Object.assign({
6887
- colorScale: colors
6932
+ colorScale
6888
6933
  }, baseProps),
6889
6934
  tooltip: {
6890
6935
  style: Object.assign({}, baseLabelStyles, {
@@ -6892,7 +6937,7 @@ const clean = {
6892
6937
  pointerEvents: "none"
6893
6938
  }),
6894
6939
  flyoutStyle: {
6895
- stroke: gray["500"],
6940
+ stroke: gray["300"],
6896
6941
  strokeWidth: 2,
6897
6942
  fill: gray.white,
6898
6943
  pointerEvents: "none"
@@ -6909,8 +6954,8 @@ const clean = {
6909
6954
  voronoi: Object.assign({
6910
6955
  style: {
6911
6956
  data: {
6912
- fill: red["100"],
6913
- stroke: red["500"],
6957
+ fill: blue["100"],
6958
+ stroke: defaultColor,
6914
6959
  strokeWidth: 2
6915
6960
  },
6916
6961
  labels: Object.assign({}, baseLabelStyles, {
@@ -6947,9 +6992,28 @@ __webpack_require__.r(__webpack_exports__);
6947
6992
  // *
6948
6993
  // * Colors
6949
6994
  // *
6950
- const colors = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
6995
+ const colors = {
6996
+ blue: "#4F7DA1",
6997
+ pink: "#E2A37F",
6998
+ teal: "#00796B",
6999
+ purple: "#DF948A",
7000
+ green: "#8BC34A",
7001
+ orange: "#F4511E",
7002
+ cyan: "#006064",
7003
+ red: "#DF5A49",
7004
+ yellow: "#FFF59D"
7005
+ };
7006
+ const colorScale = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
6951
7007
  const charcoal = "#252525";
6952
7008
  const grey = "#969696";
7009
+ const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
7010
+ const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
7011
+ const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
7012
+ const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
7013
+ const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
7014
+ const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
7015
+ const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
7016
+
6953
7017
  // *
6954
7018
  // * Typography
6955
7019
  // *
@@ -6963,7 +7027,7 @@ const baseProps = {
6963
7027
  width: 450,
6964
7028
  height: 300,
6965
7029
  padding: 50,
6966
- colorScale: colors
7030
+ colorScale
6967
7031
  };
6968
7032
  // *
6969
7033
  // * Labels
@@ -6985,6 +7049,17 @@ const centeredLabelStyles = Object.assign({
6985
7049
  const strokeLinecap = "round";
6986
7050
  const strokeLinejoin = "round";
6987
7051
  const grayscale = {
7052
+ palette: {
7053
+ colors,
7054
+ grayscale: colorScale,
7055
+ qualitative,
7056
+ heatmap,
7057
+ warm,
7058
+ cool,
7059
+ red,
7060
+ green,
7061
+ blue
7062
+ },
6988
7063
  area: Object.assign({
6989
7064
  style: {
6990
7065
  data: {
@@ -7099,7 +7174,7 @@ const grayscale = {
7099
7174
  }
7100
7175
  }, baseProps),
7101
7176
  group: Object.assign({
7102
- colorScale: colors
7177
+ colorScale
7103
7178
  }, baseProps),
7104
7179
  histogram: Object.assign({
7105
7180
  style: {
@@ -7112,7 +7187,7 @@ const grayscale = {
7112
7187
  }
7113
7188
  }, baseProps),
7114
7189
  legend: {
7115
- colorScale: colors,
7190
+ colorScale,
7116
7191
  gutter: 10,
7117
7192
  orientation: "vertical",
7118
7193
  titleOrientation: "top",
@@ -7147,7 +7222,7 @@ const grayscale = {
7147
7222
  padding: 20
7148
7223
  })
7149
7224
  },
7150
- colorScale: colors,
7225
+ colorScale,
7151
7226
  width: 400,
7152
7227
  height: 400,
7153
7228
  padding: 50
@@ -7163,7 +7238,7 @@ const grayscale = {
7163
7238
  }
7164
7239
  }, baseProps),
7165
7240
  stack: Object.assign({
7166
- colorScale: colors
7241
+ colorScale
7167
7242
  }, baseProps),
7168
7243
  tooltip: {
7169
7244
  style: Object.assign({}, baseLabelStyles, {
@@ -7223,11 +7298,31 @@ const lime300 = "#DCE775";
7223
7298
  const lightGreen500 = "#8BC34A";
7224
7299
  const teal700 = "#00796B";
7225
7300
  const cyan900 = "#006064";
7226
- const colors = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
7301
+ const colorScale = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
7227
7302
  const blueGrey50 = "#ECEFF1";
7228
7303
  const blueGrey300 = "#90A4AE";
7229
7304
  const blueGrey700 = "#455A64";
7230
7305
  const grey900 = "#212121";
7306
+ const colors = {
7307
+ blue: "#4F7DA1",
7308
+ pink: "#E2A37F",
7309
+ teal: teal700,
7310
+ purple: "#DF948A",
7311
+ green: lightGreen500,
7312
+ orange: deepOrange600,
7313
+ cyan: cyan900,
7314
+ red: "#DF5A49",
7315
+ yellow: yellow200
7316
+ };
7317
+ const grayscale = [blueGrey50, blueGrey300, blueGrey700, grey900];
7318
+ const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
7319
+ const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
7320
+ const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
7321
+ const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
7322
+ const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
7323
+ const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
7324
+ const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
7325
+
7231
7326
  // *
7232
7327
  // * Typography
7233
7328
  // *
@@ -7265,6 +7360,17 @@ const strokeDasharray = "10, 5";
7265
7360
  const strokeLinecap = "round";
7266
7361
  const strokeLinejoin = "round";
7267
7362
  const material = {
7363
+ palette: {
7364
+ colors,
7365
+ grayscale,
7366
+ qualitative,
7367
+ heatmap,
7368
+ warm,
7369
+ cool,
7370
+ red,
7371
+ green,
7372
+ blue
7373
+ },
7268
7374
  area: Object.assign({
7269
7375
  style: {
7270
7376
  data: {
@@ -7397,7 +7503,7 @@ const material = {
7397
7503
  }
7398
7504
  }, baseProps),
7399
7505
  group: Object.assign({
7400
- colorScale: colors
7506
+ colorScale
7401
7507
  }, baseProps),
7402
7508
  histogram: Object.assign({
7403
7509
  style: {
@@ -7410,7 +7516,7 @@ const material = {
7410
7516
  }
7411
7517
  }, baseProps),
7412
7518
  legend: {
7413
- colorScale: colors,
7519
+ colorScale,
7414
7520
  gutter: 10,
7415
7521
  orientation: "vertical",
7416
7522
  titleOrientation: "top",
@@ -7436,7 +7542,7 @@ const material = {
7436
7542
  }
7437
7543
  }, baseProps),
7438
7544
  pie: Object.assign({
7439
- colorScale: colors,
7545
+ colorScale,
7440
7546
  style: {
7441
7547
  data: {
7442
7548
  padding,
@@ -7460,7 +7566,7 @@ const material = {
7460
7566
  }
7461
7567
  }, baseProps),
7462
7568
  stack: Object.assign({
7463
- colorScale: colors
7569
+ colorScale
7464
7570
  }, baseProps),
7465
7571
  tooltip: {
7466
7572
  style: Object.assign({}, baseLabelStyles, {
@@ -10426,6 +10532,9 @@ __webpack_require__.r(__webpack_exports__);
10426
10532
  /* harmony export */ "getColorScale": function() { return /* binding */ getColorScale; },
10427
10533
  /* harmony export */ "toTransformString": function() { return /* binding */ toTransformString; }
10428
10534
  /* harmony export */ });
10535
+ /* 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");
10536
+
10537
+
10429
10538
  /**
10430
10539
  * Given an object with CSS/SVG transform definitions, return the string value
10431
10540
  * for use with the `transform` CSS property or SVG attribute. Note that we
@@ -10462,20 +10571,37 @@ const toTransformString = function (obj) {
10462
10571
  * of 5 hex string values in that color scale. If no 'name' parameter
10463
10572
  * is given, it will return the Victory default grayscale.
10464
10573
  * @param {String} name The name of the color scale to return (optional).
10574
+ * @param {Object} theme The theme object to retrieve the color scale from (optional).
10465
10575
  * @returns {Array} An array of 5 hex string values composing a color scale.
10466
10576
  */
10467
- function getColorScale(name) {
10577
+ function getColorScale(name, theme) {
10578
+ if (theme === void 0) {
10579
+ theme = _victory_theme_victory_theme__WEBPACK_IMPORTED_MODULE_0__.VictoryTheme.material;
10580
+ }
10581
+ const {
10582
+ palette: {
10583
+ grayscale = ["#cccccc", "#969696", "#636363", "#252525"],
10584
+ qualitative = [],
10585
+ heatmap = [],
10586
+ warm = [],
10587
+ cool = [],
10588
+ red = [],
10589
+ blue = [],
10590
+ green = []
10591
+ } = {}
10592
+ } = theme;
10468
10593
  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"]
10594
+ grayscale,
10595
+ qualitative,
10596
+ heatmap,
10597
+ warm,
10598
+ cool,
10599
+ red,
10600
+ blue,
10601
+ green
10477
10602
  };
10478
- return name ? scales[name] : scales.grayscale;
10603
+ const selectedScale = name && scales[name]?.length ? scales[name] : scales.grayscale;
10604
+ return selectedScale;
10479
10605
  }
10480
10606
 
10481
10607
  /***/ }),