victory-bar 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-bar
2
2
 
3
+ ## 37.3.0
4
+
5
+ ## 37.2.0
6
+
3
7
  ## 37.1.2
4
8
 
5
9
  ### Patch Changes
@@ -6685,31 +6685,34 @@ __webpack_require__.r(__webpack_exports__);
6685
6685
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6686
6686
  /* harmony export */ "VictoryPortal": function() { return /* binding */ VictoryPortal; }
6687
6687
  /* harmony export */ });
6688
- /* 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");
6689
- /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
6690
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
6691
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
6692
- /* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
6693
- /* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
6694
- /* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
6688
+ /* 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");
6689
+ /* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0__);
6690
+ /* 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");
6691
+ /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
6692
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
6693
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
6694
+ /* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
6695
+ /* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
6696
+ /* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
6697
+
6695
6698
 
6696
6699
 
6697
6700
 
6698
6701
 
6699
6702
 
6700
6703
  const defaultProps = {
6701
- groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("g", null)
6704
+ groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement("g", null)
6702
6705
  };
6703
6706
  const VictoryPortal = initialProps => {
6704
6707
  const props = {
6705
6708
  ...defaultProps,
6706
6709
  ...initialProps
6707
6710
  };
6708
- const id = react__WEBPACK_IMPORTED_MODULE_1___default().useId();
6709
- const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_2__.usePortalContext)();
6711
+ const [id] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default()());
6712
+ const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_3__.usePortalContext)();
6710
6713
  if (!portalContext) {
6711
6714
  const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
6712
- _victory_util_log__WEBPACK_IMPORTED_MODULE_3__.warn(msg);
6715
+ _victory_util_log__WEBPACK_IMPORTED_MODULE_4__.warn(msg);
6713
6716
  }
6714
6717
  const children = Array.isArray(props.children) ? props.children[0] : props.children;
6715
6718
  const {
@@ -6720,15 +6723,15 @@ const VictoryPortal = initialProps => {
6720
6723
  groupComponent,
6721
6724
  standalone: false
6722
6725
  } : {};
6723
- const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.omit(props, ["children", "groupComponent"]), {
6726
+ const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__.omit(props, ["children", "groupComponent"]), {
6724
6727
  key: childProps.key ?? id
6725
6728
  });
6726
- const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(children, newProps);
6727
- react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
6729
+ const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().cloneElement(children, newProps);
6730
+ react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
6728
6731
  portalContext?.addChild(id, child);
6729
6732
  // eslint-disable-next-line react-hooks/exhaustive-deps
6730
6733
  }, [props.children]);
6731
- react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
6734
+ react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
6732
6735
  return () => portalContext?.removeChild(id);
6733
6736
  // eslint-disable-next-line react-hooks/exhaustive-deps
6734
6737
  }, []);
@@ -6938,20 +6941,16 @@ const orange = {
6938
6941
  "100": "#FEE2D5",
6939
6942
  "300": "#FFA981",
6940
6943
  "500": "#FF6F2C",
6944
+ "700": "#FF4E1B",
6941
6945
  "900": "#D74D26"
6942
6946
  };
6943
6947
  const red = {
6944
6948
  "100": "#FFDCE5",
6945
6949
  "300": "#FF9EB7",
6946
6950
  "500": "#F82B60",
6951
+ "700": "#D31A3D",
6947
6952
  "900": "#BA1E45"
6948
6953
  };
6949
- const pink = {
6950
- "100": "#FFDAF6",
6951
- "300": "#F99DE2",
6952
- "500": "#FF08C2",
6953
- "900": "#B2158B"
6954
- };
6955
6954
  const purple = {
6956
6955
  "100": "#EDE3FE",
6957
6956
  "300": "#CDB0FF",
@@ -6962,6 +6961,7 @@ const blue = {
6962
6961
  "100": "#CFDFFF",
6963
6962
  "300": "#9CC7FF",
6964
6963
  "500": "#2D7FF9",
6964
+ "700": "#0056B3",
6965
6965
  "900": "#2750AE"
6966
6966
  };
6967
6967
  const cyan = {
@@ -6980,9 +6980,29 @@ const green = {
6980
6980
  "100": "#D1F7C4",
6981
6981
  "300": "#93E088",
6982
6982
  "500": "#20C933",
6983
+ "700": "#1B9B2A",
6983
6984
  "900": "#338A17"
6984
6985
  };
6985
- const colors = [blue["500"], pink["500"], teal["500"], purple["500"], green["500"], orange["500"], cyan["500"], red["500"], yellow["500"]];
6986
+ const colors = {
6987
+ blue: blue["500"],
6988
+ cyan: cyan["500"],
6989
+ green: green["500"],
6990
+ yellow: yellow["500"],
6991
+ orange: orange["500"],
6992
+ red: red["500"],
6993
+ purple: purple["500"],
6994
+ teal: teal["500"]
6995
+ };
6996
+ const colorScale = Object.values(colors);
6997
+ const grayscale = [gray["100"], gray["300"], gray["500"], gray["700"], gray["900"]];
6998
+ const warm = [yellow["300"], yellow["500"], orange["500"], orange["900"], red["500"]];
6999
+ const cool = [purple["500"], blue["500"], cyan["500"], teal["500"], green["500"]];
7000
+ const heatmap = [green["900"], green["500"], yellow["500"], orange["500"], red["500"]];
7001
+ const redPalette = Object.values(red);
7002
+ const greenPalette = Object.values(green);
7003
+ const bluePalette = Object.values(blue);
7004
+ const defaultColor = blue["500"];
7005
+
6986
7006
  // *
6987
7007
  // * Typography
6988
7008
  // *
@@ -6996,8 +7016,8 @@ const padding = 8;
6996
7016
  const baseProps = {
6997
7017
  width: 450,
6998
7018
  height: 300,
6999
- padding: 50,
7000
- colorScale: colors
7019
+ padding: 60,
7020
+ colorScale
7001
7021
  };
7002
7022
  // *
7003
7023
  // * Labels
@@ -7026,10 +7046,23 @@ const borderRadius = 1;
7026
7046
  // * Theme
7027
7047
  // *
7028
7048
  const clean = {
7049
+ palette: {
7050
+ colors,
7051
+ grayscale,
7052
+ qualitative: colorScale,
7053
+ heatmap,
7054
+ warm,
7055
+ cool,
7056
+ red: redPalette,
7057
+ green: greenPalette,
7058
+ blue: bluePalette
7059
+ },
7029
7060
  area: Object.assign({
7030
7061
  style: {
7031
7062
  data: {
7032
- fill: cyan["500"]
7063
+ fill: defaultColor,
7064
+ strokeWidth: 2,
7065
+ fillOpacity: 0.5
7033
7066
  },
7034
7067
  labels: baseLabelStyles
7035
7068
  }
@@ -7038,13 +7071,13 @@ const clean = {
7038
7071
  style: {
7039
7072
  axis: {
7040
7073
  fill: "transparent",
7041
- stroke: gray["300"],
7074
+ stroke: gray["500"],
7042
7075
  strokeWidth: 1,
7043
7076
  strokeLinecap,
7044
7077
  strokeLinejoin
7045
7078
  },
7046
7079
  axisLabel: Object.assign({}, centeredLabelStyles, {
7047
- padding,
7080
+ padding: 35,
7048
7081
  stroke: "transparent"
7049
7082
  }),
7050
7083
  grid: {
@@ -7063,10 +7096,10 @@ const clean = {
7063
7096
  polarAxis: Object.assign({
7064
7097
  style: {
7065
7098
  axis: {
7066
- stroke: gray["300"]
7099
+ stroke: gray["500"]
7067
7100
  },
7068
7101
  grid: {
7069
- stroke: gray["200"],
7102
+ stroke: gray["400"],
7070
7103
  strokeDasharray,
7071
7104
  strokeLinecap,
7072
7105
  strokeLinejoin,
@@ -7075,7 +7108,7 @@ const clean = {
7075
7108
  ticks: {
7076
7109
  fill: "transparent",
7077
7110
  size: 5,
7078
- stroke: gray["200"],
7111
+ stroke: gray["400"],
7079
7112
  strokeWidth: 1,
7080
7113
  strokeLinecap,
7081
7114
  strokeLinejoin
@@ -7086,10 +7119,10 @@ const clean = {
7086
7119
  polarDependentAxis: Object.assign({
7087
7120
  style: {
7088
7121
  axis: {
7089
- stroke: gray["300"]
7122
+ stroke: gray["500"]
7090
7123
  },
7091
7124
  grid: {
7092
- stroke: gray["200"],
7125
+ stroke: gray["400"],
7093
7126
  strokeDasharray,
7094
7127
  strokeLinecap,
7095
7128
  strokeLinejoin,
@@ -7098,7 +7131,7 @@ const clean = {
7098
7131
  ticks: {
7099
7132
  fill: "transparent",
7100
7133
  size: 5,
7101
- stroke: gray["200"],
7134
+ stroke: gray["300"],
7102
7135
  strokeWidth: 1,
7103
7136
  strokeLinecap,
7104
7137
  strokeLinejoin
@@ -7109,9 +7142,10 @@ const clean = {
7109
7142
  bar: Object.assign({
7110
7143
  style: {
7111
7144
  data: {
7112
- fill: blue["500"],
7145
+ fill: defaultColor,
7113
7146
  padding,
7114
- strokeWidth: 0
7147
+ strokeWidth: 1,
7148
+ fillOpacity: 0.5
7115
7149
  },
7116
7150
  labels: baseLabelStyles
7117
7151
  },
@@ -7147,15 +7181,16 @@ const clean = {
7147
7181
  }),
7148
7182
  q1: {
7149
7183
  padding,
7150
- fill: teal["500"],
7151
- rx: borderRadius
7184
+ fill: colorScale[0],
7185
+ rx: borderRadius,
7186
+ strokeWidth: 2
7152
7187
  },
7153
7188
  q1Labels: Object.assign({}, baseLabelStyles, {
7154
7189
  padding: 3
7155
7190
  }),
7156
7191
  q3: {
7157
7192
  padding,
7158
- fill: teal["500"],
7193
+ fill: colorScale[1],
7159
7194
  rx: borderRadius
7160
7195
  },
7161
7196
  q3Labels: Object.assign({}, baseLabelStyles, {
@@ -7176,8 +7211,8 @@ const clean = {
7176
7211
  })
7177
7212
  },
7178
7213
  candleColors: {
7179
- positive: teal["500"],
7180
- negative: orange["500"]
7214
+ positive: green["500"],
7215
+ negative: red["500"]
7181
7216
  },
7182
7217
  wickStrokeWidth: 2
7183
7218
  }, baseProps),
@@ -7196,14 +7231,13 @@ const clean = {
7196
7231
  }
7197
7232
  }, baseProps),
7198
7233
  group: Object.assign({
7199
- colorScale: colors
7234
+ colorScale
7200
7235
  }, baseProps),
7201
7236
  histogram: Object.assign({
7202
7237
  style: {
7203
7238
  data: {
7204
7239
  fill: cyan["500"],
7205
- stroke: "transparent",
7206
- strokeWidth: 0
7240
+ fillOpacity: 0.5
7207
7241
  },
7208
7242
  labels: baseLabelStyles
7209
7243
  },
@@ -7214,21 +7248,23 @@ const clean = {
7214
7248
  }, baseProps),
7215
7249
  label: baseLabelStyles,
7216
7250
  legend: {
7217
- colorScale: colors,
7218
- gutter: 10,
7219
- orientation: "vertical",
7251
+ colorScale,
7252
+ gutter: 24,
7253
+ borderPadding: 10,
7254
+ orientation: "horizontal",
7220
7255
  titleOrientation: "top",
7256
+ centerTitle: true,
7221
7257
  style: {
7222
7258
  data: {
7223
7259
  type: "circle"
7224
7260
  },
7225
7261
  labels: {
7226
7262
  ...baseLabelStyles,
7227
- fontSize: 14
7263
+ fontSize: 12
7228
7264
  },
7229
7265
  title: Object.assign({}, baseLabelStyles, {
7230
7266
  padding,
7231
- fontSize: 20
7267
+ fontSize: 16
7232
7268
  }),
7233
7269
  border: {
7234
7270
  stroke: gray["200"],
@@ -7242,7 +7278,7 @@ const clean = {
7242
7278
  data: {
7243
7279
  fill: "transparent",
7244
7280
  opacity: 1,
7245
- stroke: pink["500"],
7281
+ stroke: defaultColor,
7246
7282
  strokeWidth: 2,
7247
7283
  strokeLinecap,
7248
7284
  strokeLinejoin
@@ -7252,31 +7288,40 @@ const clean = {
7252
7288
  }, baseProps),
7253
7289
  pie: Object.assign({
7254
7290
  style: {
7291
+ parent: {
7292
+ backgroundColor: gray.white
7293
+ },
7255
7294
  data: {
7256
7295
  padding,
7257
7296
  stroke: gray.white,
7258
7297
  strokeWidth: 1
7259
7298
  },
7260
- labels: Object.assign({}, baseLabelStyles, {
7261
- padding: 20
7262
- })
7299
+ labels: {
7300
+ ...baseLabelStyles,
7301
+ padding: 20,
7302
+ fill: gray["600"],
7303
+ fontSize: 10
7304
+ }
7263
7305
  },
7264
- colorScale: colors,
7306
+ colorScale,
7265
7307
  cornerRadius: borderRadius
7266
7308
  }, baseProps),
7267
7309
  scatter: Object.assign({
7268
7310
  style: {
7269
7311
  data: {
7270
- fill: purple["500"],
7312
+ fill: defaultColor,
7271
7313
  opacity: 1,
7272
7314
  stroke: "transparent",
7273
7315
  strokeWidth: 0
7274
7316
  },
7275
- labels: baseLabelStyles
7317
+ labels: {
7318
+ ...baseLabelStyles,
7319
+ padding: 20
7320
+ }
7276
7321
  }
7277
7322
  }, baseProps),
7278
7323
  stack: Object.assign({
7279
- colorScale: colors
7324
+ colorScale
7280
7325
  }, baseProps),
7281
7326
  tooltip: {
7282
7327
  style: Object.assign({}, baseLabelStyles, {
@@ -7284,7 +7329,7 @@ const clean = {
7284
7329
  pointerEvents: "none"
7285
7330
  }),
7286
7331
  flyoutStyle: {
7287
- stroke: gray["500"],
7332
+ stroke: gray["300"],
7288
7333
  strokeWidth: 2,
7289
7334
  fill: gray.white,
7290
7335
  pointerEvents: "none"
@@ -7301,8 +7346,8 @@ const clean = {
7301
7346
  voronoi: Object.assign({
7302
7347
  style: {
7303
7348
  data: {
7304
- fill: red["100"],
7305
- stroke: red["500"],
7349
+ fill: blue["100"],
7350
+ stroke: defaultColor,
7306
7351
  strokeWidth: 2
7307
7352
  },
7308
7353
  labels: Object.assign({}, baseLabelStyles, {
@@ -7339,9 +7384,28 @@ __webpack_require__.r(__webpack_exports__);
7339
7384
  // *
7340
7385
  // * Colors
7341
7386
  // *
7342
- const colors = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
7387
+ const colors = {
7388
+ blue: "#4F7DA1",
7389
+ pink: "#E2A37F",
7390
+ teal: "#00796B",
7391
+ purple: "#DF948A",
7392
+ green: "#8BC34A",
7393
+ orange: "#F4511E",
7394
+ cyan: "#006064",
7395
+ red: "#DF5A49",
7396
+ yellow: "#FFF59D"
7397
+ };
7398
+ const colorScale = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
7343
7399
  const charcoal = "#252525";
7344
7400
  const grey = "#969696";
7401
+ const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
7402
+ const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
7403
+ const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
7404
+ const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
7405
+ const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
7406
+ const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
7407
+ const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
7408
+
7345
7409
  // *
7346
7410
  // * Typography
7347
7411
  // *
@@ -7355,7 +7419,7 @@ const baseProps = {
7355
7419
  width: 450,
7356
7420
  height: 300,
7357
7421
  padding: 50,
7358
- colorScale: colors
7422
+ colorScale
7359
7423
  };
7360
7424
  // *
7361
7425
  // * Labels
@@ -7377,6 +7441,17 @@ const centeredLabelStyles = Object.assign({
7377
7441
  const strokeLinecap = "round";
7378
7442
  const strokeLinejoin = "round";
7379
7443
  const grayscale = {
7444
+ palette: {
7445
+ colors,
7446
+ grayscale: colorScale,
7447
+ qualitative,
7448
+ heatmap,
7449
+ warm,
7450
+ cool,
7451
+ red,
7452
+ green,
7453
+ blue
7454
+ },
7380
7455
  area: Object.assign({
7381
7456
  style: {
7382
7457
  data: {
@@ -7491,7 +7566,7 @@ const grayscale = {
7491
7566
  }
7492
7567
  }, baseProps),
7493
7568
  group: Object.assign({
7494
- colorScale: colors
7569
+ colorScale
7495
7570
  }, baseProps),
7496
7571
  histogram: Object.assign({
7497
7572
  style: {
@@ -7504,7 +7579,7 @@ const grayscale = {
7504
7579
  }
7505
7580
  }, baseProps),
7506
7581
  legend: {
7507
- colorScale: colors,
7582
+ colorScale,
7508
7583
  gutter: 10,
7509
7584
  orientation: "vertical",
7510
7585
  titleOrientation: "top",
@@ -7539,7 +7614,7 @@ const grayscale = {
7539
7614
  padding: 20
7540
7615
  })
7541
7616
  },
7542
- colorScale: colors,
7617
+ colorScale,
7543
7618
  width: 400,
7544
7619
  height: 400,
7545
7620
  padding: 50
@@ -7555,7 +7630,7 @@ const grayscale = {
7555
7630
  }
7556
7631
  }, baseProps),
7557
7632
  stack: Object.assign({
7558
- colorScale: colors
7633
+ colorScale
7559
7634
  }, baseProps),
7560
7635
  tooltip: {
7561
7636
  style: Object.assign({}, baseLabelStyles, {
@@ -7615,11 +7690,31 @@ const lime300 = "#DCE775";
7615
7690
  const lightGreen500 = "#8BC34A";
7616
7691
  const teal700 = "#00796B";
7617
7692
  const cyan900 = "#006064";
7618
- const colors = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
7693
+ const colorScale = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
7619
7694
  const blueGrey50 = "#ECEFF1";
7620
7695
  const blueGrey300 = "#90A4AE";
7621
7696
  const blueGrey700 = "#455A64";
7622
7697
  const grey900 = "#212121";
7698
+ const colors = {
7699
+ blue: "#4F7DA1",
7700
+ pink: "#E2A37F",
7701
+ teal: teal700,
7702
+ purple: "#DF948A",
7703
+ green: lightGreen500,
7704
+ orange: deepOrange600,
7705
+ cyan: cyan900,
7706
+ red: "#DF5A49",
7707
+ yellow: yellow200
7708
+ };
7709
+ const grayscale = [blueGrey50, blueGrey300, blueGrey700, grey900];
7710
+ const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
7711
+ const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
7712
+ const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
7713
+ const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
7714
+ const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
7715
+ const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
7716
+ const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
7717
+
7623
7718
  // *
7624
7719
  // * Typography
7625
7720
  // *
@@ -7657,6 +7752,17 @@ const strokeDasharray = "10, 5";
7657
7752
  const strokeLinecap = "round";
7658
7753
  const strokeLinejoin = "round";
7659
7754
  const material = {
7755
+ palette: {
7756
+ colors,
7757
+ grayscale,
7758
+ qualitative,
7759
+ heatmap,
7760
+ warm,
7761
+ cool,
7762
+ red,
7763
+ green,
7764
+ blue
7765
+ },
7660
7766
  area: Object.assign({
7661
7767
  style: {
7662
7768
  data: {
@@ -7789,7 +7895,7 @@ const material = {
7789
7895
  }
7790
7896
  }, baseProps),
7791
7897
  group: Object.assign({
7792
- colorScale: colors
7898
+ colorScale
7793
7899
  }, baseProps),
7794
7900
  histogram: Object.assign({
7795
7901
  style: {
@@ -7802,7 +7908,7 @@ const material = {
7802
7908
  }
7803
7909
  }, baseProps),
7804
7910
  legend: {
7805
- colorScale: colors,
7911
+ colorScale,
7806
7912
  gutter: 10,
7807
7913
  orientation: "vertical",
7808
7914
  titleOrientation: "top",
@@ -7828,7 +7934,7 @@ const material = {
7828
7934
  }
7829
7935
  }, baseProps),
7830
7936
  pie: Object.assign({
7831
- colorScale: colors,
7937
+ colorScale,
7832
7938
  style: {
7833
7939
  data: {
7834
7940
  padding,
@@ -7852,7 +7958,7 @@ const material = {
7852
7958
  }
7853
7959
  }, baseProps),
7854
7960
  stack: Object.assign({
7855
- colorScale: colors
7961
+ colorScale
7856
7962
  }, baseProps),
7857
7963
  tooltip: {
7858
7964
  style: Object.assign({}, baseLabelStyles, {
@@ -10714,6 +10820,9 @@ __webpack_require__.r(__webpack_exports__);
10714
10820
  /* harmony export */ "getColorScale": function() { return /* binding */ getColorScale; },
10715
10821
  /* harmony export */ "toTransformString": function() { return /* binding */ toTransformString; }
10716
10822
  /* harmony export */ });
10823
+ /* 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");
10824
+
10825
+
10717
10826
  /**
10718
10827
  * Given an object with CSS/SVG transform definitions, return the string value
10719
10828
  * for use with the `transform` CSS property or SVG attribute. Note that we
@@ -10750,20 +10859,37 @@ const toTransformString = function (obj) {
10750
10859
  * of 5 hex string values in that color scale. If no 'name' parameter
10751
10860
  * is given, it will return the Victory default grayscale.
10752
10861
  * @param {String} name The name of the color scale to return (optional).
10862
+ * @param {Object} theme The theme object to retrieve the color scale from (optional).
10753
10863
  * @returns {Array} An array of 5 hex string values composing a color scale.
10754
10864
  */
10755
- function getColorScale(name) {
10865
+ function getColorScale(name, theme) {
10866
+ if (theme === void 0) {
10867
+ theme = _victory_theme_victory_theme__WEBPACK_IMPORTED_MODULE_0__.VictoryTheme.material;
10868
+ }
10869
+ const {
10870
+ palette: {
10871
+ grayscale = ["#cccccc", "#969696", "#636363", "#252525"],
10872
+ qualitative = [],
10873
+ heatmap = [],
10874
+ warm = [],
10875
+ cool = [],
10876
+ red = [],
10877
+ blue = [],
10878
+ green = []
10879
+ } = {}
10880
+ } = theme;
10756
10881
  const scales = {
10757
- grayscale: ["#cccccc", "#969696", "#636363", "#252525"],
10758
- qualitative: ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"],
10759
- heatmap: ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"],
10760
- warm: ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"],
10761
- cool: ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"],
10762
- red: ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"],
10763
- blue: ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"],
10764
- green: ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"]
10765
- };
10766
- return name ? scales[name] : scales.grayscale;
10882
+ grayscale,
10883
+ qualitative,
10884
+ heatmap,
10885
+ warm,
10886
+ cool,
10887
+ red,
10888
+ blue,
10889
+ green
10890
+ };
10891
+ const selectedScale = name && scales[name]?.length ? scales[name] : scales.grayscale;
10892
+ return selectedScale;
10767
10893
  }
10768
10894
 
10769
10895
  /***/ }),