victory-voronoi-container 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,13 @@
1
1
  # victory-voronoi-container
2
2
 
3
+ ## 37.3.0
4
+
5
+ ## 37.2.0
6
+
7
+ ### Patch Changes
8
+
9
+ - Fix: #2369 `<VictoryVoronoiContainer/>` tooltip breaks when mouse moves quickly between different charts ([#2911](https://github.com/FormidableLabs/victory/pull/2911))
10
+
3
11
  ## 37.1.2
4
12
 
5
13
  ### Patch Changes
@@ -478,6 +478,7 @@ class VoronoiHelpersClass {
478
478
  }
479
479
  }
480
480
  onMouseLeave = (evt, targetProps) => {
481
+ this.onMouseMove.cancel();
481
482
  const activePoints = targetProps.activePoints || [];
482
483
  this.onDeactivated(targetProps, activePoints);
483
484
  const inactiveMutations = activePoints.length ? activePoints.map(point => this.getInactiveMutations(targetProps, point)) : [];
@@ -6788,31 +6789,34 @@ __webpack_require__.r(__webpack_exports__);
6788
6789
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6789
6790
  /* harmony export */ "VictoryPortal": function() { return /* binding */ VictoryPortal; }
6790
6791
  /* harmony export */ });
6791
- /* 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");
6792
- /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
6793
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
6794
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
6795
- /* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
6796
- /* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
6797
- /* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
6792
+ /* 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");
6793
+ /* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0__);
6794
+ /* 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");
6795
+ /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
6796
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
6797
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
6798
+ /* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
6799
+ /* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
6800
+ /* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
6801
+
6798
6802
 
6799
6803
 
6800
6804
 
6801
6805
 
6802
6806
 
6803
6807
  const defaultProps = {
6804
- groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("g", null)
6808
+ groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement("g", null)
6805
6809
  };
6806
6810
  const VictoryPortal = initialProps => {
6807
6811
  const props = {
6808
6812
  ...defaultProps,
6809
6813
  ...initialProps
6810
6814
  };
6811
- const id = react__WEBPACK_IMPORTED_MODULE_1___default().useId();
6812
- const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_2__.usePortalContext)();
6815
+ const [id] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default()());
6816
+ const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_3__.usePortalContext)();
6813
6817
  if (!portalContext) {
6814
6818
  const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
6815
- _victory_util_log__WEBPACK_IMPORTED_MODULE_3__.warn(msg);
6819
+ _victory_util_log__WEBPACK_IMPORTED_MODULE_4__.warn(msg);
6816
6820
  }
6817
6821
  const children = Array.isArray(props.children) ? props.children[0] : props.children;
6818
6822
  const {
@@ -6823,15 +6827,15 @@ const VictoryPortal = initialProps => {
6823
6827
  groupComponent,
6824
6828
  standalone: false
6825
6829
  } : {};
6826
- const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.omit(props, ["children", "groupComponent"]), {
6830
+ const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__.omit(props, ["children", "groupComponent"]), {
6827
6831
  key: childProps.key ?? id
6828
6832
  });
6829
- const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(children, newProps);
6830
- react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
6833
+ const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().cloneElement(children, newProps);
6834
+ react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
6831
6835
  portalContext?.addChild(id, child);
6832
6836
  // eslint-disable-next-line react-hooks/exhaustive-deps
6833
6837
  }, [props.children]);
6834
- react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
6838
+ react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
6835
6839
  return () => portalContext?.removeChild(id);
6836
6840
  // eslint-disable-next-line react-hooks/exhaustive-deps
6837
6841
  }, []);
@@ -7041,20 +7045,16 @@ const orange = {
7041
7045
  "100": "#FEE2D5",
7042
7046
  "300": "#FFA981",
7043
7047
  "500": "#FF6F2C",
7048
+ "700": "#FF4E1B",
7044
7049
  "900": "#D74D26"
7045
7050
  };
7046
7051
  const red = {
7047
7052
  "100": "#FFDCE5",
7048
7053
  "300": "#FF9EB7",
7049
7054
  "500": "#F82B60",
7055
+ "700": "#D31A3D",
7050
7056
  "900": "#BA1E45"
7051
7057
  };
7052
- const pink = {
7053
- "100": "#FFDAF6",
7054
- "300": "#F99DE2",
7055
- "500": "#FF08C2",
7056
- "900": "#B2158B"
7057
- };
7058
7058
  const purple = {
7059
7059
  "100": "#EDE3FE",
7060
7060
  "300": "#CDB0FF",
@@ -7065,6 +7065,7 @@ const blue = {
7065
7065
  "100": "#CFDFFF",
7066
7066
  "300": "#9CC7FF",
7067
7067
  "500": "#2D7FF9",
7068
+ "700": "#0056B3",
7068
7069
  "900": "#2750AE"
7069
7070
  };
7070
7071
  const cyan = {
@@ -7083,9 +7084,29 @@ const green = {
7083
7084
  "100": "#D1F7C4",
7084
7085
  "300": "#93E088",
7085
7086
  "500": "#20C933",
7087
+ "700": "#1B9B2A",
7086
7088
  "900": "#338A17"
7087
7089
  };
7088
- const colors = [blue["500"], pink["500"], teal["500"], purple["500"], green["500"], orange["500"], cyan["500"], red["500"], yellow["500"]];
7090
+ const colors = {
7091
+ blue: blue["500"],
7092
+ cyan: cyan["500"],
7093
+ green: green["500"],
7094
+ yellow: yellow["500"],
7095
+ orange: orange["500"],
7096
+ red: red["500"],
7097
+ purple: purple["500"],
7098
+ teal: teal["500"]
7099
+ };
7100
+ const colorScale = Object.values(colors);
7101
+ const grayscale = [gray["100"], gray["300"], gray["500"], gray["700"], gray["900"]];
7102
+ const warm = [yellow["300"], yellow["500"], orange["500"], orange["900"], red["500"]];
7103
+ const cool = [purple["500"], blue["500"], cyan["500"], teal["500"], green["500"]];
7104
+ const heatmap = [green["900"], green["500"], yellow["500"], orange["500"], red["500"]];
7105
+ const redPalette = Object.values(red);
7106
+ const greenPalette = Object.values(green);
7107
+ const bluePalette = Object.values(blue);
7108
+ const defaultColor = blue["500"];
7109
+
7089
7110
  // *
7090
7111
  // * Typography
7091
7112
  // *
@@ -7099,8 +7120,8 @@ const padding = 8;
7099
7120
  const baseProps = {
7100
7121
  width: 450,
7101
7122
  height: 300,
7102
- padding: 50,
7103
- colorScale: colors
7123
+ padding: 60,
7124
+ colorScale
7104
7125
  };
7105
7126
  // *
7106
7127
  // * Labels
@@ -7129,10 +7150,23 @@ const borderRadius = 1;
7129
7150
  // * Theme
7130
7151
  // *
7131
7152
  const clean = {
7153
+ palette: {
7154
+ colors,
7155
+ grayscale,
7156
+ qualitative: colorScale,
7157
+ heatmap,
7158
+ warm,
7159
+ cool,
7160
+ red: redPalette,
7161
+ green: greenPalette,
7162
+ blue: bluePalette
7163
+ },
7132
7164
  area: Object.assign({
7133
7165
  style: {
7134
7166
  data: {
7135
- fill: cyan["500"]
7167
+ fill: defaultColor,
7168
+ strokeWidth: 2,
7169
+ fillOpacity: 0.5
7136
7170
  },
7137
7171
  labels: baseLabelStyles
7138
7172
  }
@@ -7141,13 +7175,13 @@ const clean = {
7141
7175
  style: {
7142
7176
  axis: {
7143
7177
  fill: "transparent",
7144
- stroke: gray["300"],
7178
+ stroke: gray["500"],
7145
7179
  strokeWidth: 1,
7146
7180
  strokeLinecap,
7147
7181
  strokeLinejoin
7148
7182
  },
7149
7183
  axisLabel: Object.assign({}, centeredLabelStyles, {
7150
- padding,
7184
+ padding: 35,
7151
7185
  stroke: "transparent"
7152
7186
  }),
7153
7187
  grid: {
@@ -7166,10 +7200,10 @@ const clean = {
7166
7200
  polarAxis: Object.assign({
7167
7201
  style: {
7168
7202
  axis: {
7169
- stroke: gray["300"]
7203
+ stroke: gray["500"]
7170
7204
  },
7171
7205
  grid: {
7172
- stroke: gray["200"],
7206
+ stroke: gray["400"],
7173
7207
  strokeDasharray,
7174
7208
  strokeLinecap,
7175
7209
  strokeLinejoin,
@@ -7178,7 +7212,7 @@ const clean = {
7178
7212
  ticks: {
7179
7213
  fill: "transparent",
7180
7214
  size: 5,
7181
- stroke: gray["200"],
7215
+ stroke: gray["400"],
7182
7216
  strokeWidth: 1,
7183
7217
  strokeLinecap,
7184
7218
  strokeLinejoin
@@ -7189,10 +7223,10 @@ const clean = {
7189
7223
  polarDependentAxis: Object.assign({
7190
7224
  style: {
7191
7225
  axis: {
7192
- stroke: gray["300"]
7226
+ stroke: gray["500"]
7193
7227
  },
7194
7228
  grid: {
7195
- stroke: gray["200"],
7229
+ stroke: gray["400"],
7196
7230
  strokeDasharray,
7197
7231
  strokeLinecap,
7198
7232
  strokeLinejoin,
@@ -7201,7 +7235,7 @@ const clean = {
7201
7235
  ticks: {
7202
7236
  fill: "transparent",
7203
7237
  size: 5,
7204
- stroke: gray["200"],
7238
+ stroke: gray["300"],
7205
7239
  strokeWidth: 1,
7206
7240
  strokeLinecap,
7207
7241
  strokeLinejoin
@@ -7212,9 +7246,10 @@ const clean = {
7212
7246
  bar: Object.assign({
7213
7247
  style: {
7214
7248
  data: {
7215
- fill: blue["500"],
7249
+ fill: defaultColor,
7216
7250
  padding,
7217
- strokeWidth: 0
7251
+ strokeWidth: 1,
7252
+ fillOpacity: 0.5
7218
7253
  },
7219
7254
  labels: baseLabelStyles
7220
7255
  },
@@ -7250,15 +7285,16 @@ const clean = {
7250
7285
  }),
7251
7286
  q1: {
7252
7287
  padding,
7253
- fill: teal["500"],
7254
- rx: borderRadius
7288
+ fill: colorScale[0],
7289
+ rx: borderRadius,
7290
+ strokeWidth: 2
7255
7291
  },
7256
7292
  q1Labels: Object.assign({}, baseLabelStyles, {
7257
7293
  padding: 3
7258
7294
  }),
7259
7295
  q3: {
7260
7296
  padding,
7261
- fill: teal["500"],
7297
+ fill: colorScale[1],
7262
7298
  rx: borderRadius
7263
7299
  },
7264
7300
  q3Labels: Object.assign({}, baseLabelStyles, {
@@ -7279,8 +7315,8 @@ const clean = {
7279
7315
  })
7280
7316
  },
7281
7317
  candleColors: {
7282
- positive: teal["500"],
7283
- negative: orange["500"]
7318
+ positive: green["500"],
7319
+ negative: red["500"]
7284
7320
  },
7285
7321
  wickStrokeWidth: 2
7286
7322
  }, baseProps),
@@ -7299,14 +7335,13 @@ const clean = {
7299
7335
  }
7300
7336
  }, baseProps),
7301
7337
  group: Object.assign({
7302
- colorScale: colors
7338
+ colorScale
7303
7339
  }, baseProps),
7304
7340
  histogram: Object.assign({
7305
7341
  style: {
7306
7342
  data: {
7307
7343
  fill: cyan["500"],
7308
- stroke: "transparent",
7309
- strokeWidth: 0
7344
+ fillOpacity: 0.5
7310
7345
  },
7311
7346
  labels: baseLabelStyles
7312
7347
  },
@@ -7317,21 +7352,23 @@ const clean = {
7317
7352
  }, baseProps),
7318
7353
  label: baseLabelStyles,
7319
7354
  legend: {
7320
- colorScale: colors,
7321
- gutter: 10,
7322
- orientation: "vertical",
7355
+ colorScale,
7356
+ gutter: 24,
7357
+ borderPadding: 10,
7358
+ orientation: "horizontal",
7323
7359
  titleOrientation: "top",
7360
+ centerTitle: true,
7324
7361
  style: {
7325
7362
  data: {
7326
7363
  type: "circle"
7327
7364
  },
7328
7365
  labels: {
7329
7366
  ...baseLabelStyles,
7330
- fontSize: 14
7367
+ fontSize: 12
7331
7368
  },
7332
7369
  title: Object.assign({}, baseLabelStyles, {
7333
7370
  padding,
7334
- fontSize: 20
7371
+ fontSize: 16
7335
7372
  }),
7336
7373
  border: {
7337
7374
  stroke: gray["200"],
@@ -7345,7 +7382,7 @@ const clean = {
7345
7382
  data: {
7346
7383
  fill: "transparent",
7347
7384
  opacity: 1,
7348
- stroke: pink["500"],
7385
+ stroke: defaultColor,
7349
7386
  strokeWidth: 2,
7350
7387
  strokeLinecap,
7351
7388
  strokeLinejoin
@@ -7355,31 +7392,40 @@ const clean = {
7355
7392
  }, baseProps),
7356
7393
  pie: Object.assign({
7357
7394
  style: {
7395
+ parent: {
7396
+ backgroundColor: gray.white
7397
+ },
7358
7398
  data: {
7359
7399
  padding,
7360
7400
  stroke: gray.white,
7361
7401
  strokeWidth: 1
7362
7402
  },
7363
- labels: Object.assign({}, baseLabelStyles, {
7364
- padding: 20
7365
- })
7403
+ labels: {
7404
+ ...baseLabelStyles,
7405
+ padding: 20,
7406
+ fill: gray["600"],
7407
+ fontSize: 10
7408
+ }
7366
7409
  },
7367
- colorScale: colors,
7410
+ colorScale,
7368
7411
  cornerRadius: borderRadius
7369
7412
  }, baseProps),
7370
7413
  scatter: Object.assign({
7371
7414
  style: {
7372
7415
  data: {
7373
- fill: purple["500"],
7416
+ fill: defaultColor,
7374
7417
  opacity: 1,
7375
7418
  stroke: "transparent",
7376
7419
  strokeWidth: 0
7377
7420
  },
7378
- labels: baseLabelStyles
7421
+ labels: {
7422
+ ...baseLabelStyles,
7423
+ padding: 20
7424
+ }
7379
7425
  }
7380
7426
  }, baseProps),
7381
7427
  stack: Object.assign({
7382
- colorScale: colors
7428
+ colorScale
7383
7429
  }, baseProps),
7384
7430
  tooltip: {
7385
7431
  style: Object.assign({}, baseLabelStyles, {
@@ -7387,7 +7433,7 @@ const clean = {
7387
7433
  pointerEvents: "none"
7388
7434
  }),
7389
7435
  flyoutStyle: {
7390
- stroke: gray["500"],
7436
+ stroke: gray["300"],
7391
7437
  strokeWidth: 2,
7392
7438
  fill: gray.white,
7393
7439
  pointerEvents: "none"
@@ -7404,8 +7450,8 @@ const clean = {
7404
7450
  voronoi: Object.assign({
7405
7451
  style: {
7406
7452
  data: {
7407
- fill: red["100"],
7408
- stroke: red["500"],
7453
+ fill: blue["100"],
7454
+ stroke: defaultColor,
7409
7455
  strokeWidth: 2
7410
7456
  },
7411
7457
  labels: Object.assign({}, baseLabelStyles, {
@@ -7442,9 +7488,28 @@ __webpack_require__.r(__webpack_exports__);
7442
7488
  // *
7443
7489
  // * Colors
7444
7490
  // *
7445
- const colors = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
7491
+ const colors = {
7492
+ blue: "#4F7DA1",
7493
+ pink: "#E2A37F",
7494
+ teal: "#00796B",
7495
+ purple: "#DF948A",
7496
+ green: "#8BC34A",
7497
+ orange: "#F4511E",
7498
+ cyan: "#006064",
7499
+ red: "#DF5A49",
7500
+ yellow: "#FFF59D"
7501
+ };
7502
+ const colorScale = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
7446
7503
  const charcoal = "#252525";
7447
7504
  const grey = "#969696";
7505
+ const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
7506
+ const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
7507
+ const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
7508
+ const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
7509
+ const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
7510
+ const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
7511
+ const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
7512
+
7448
7513
  // *
7449
7514
  // * Typography
7450
7515
  // *
@@ -7458,7 +7523,7 @@ const baseProps = {
7458
7523
  width: 450,
7459
7524
  height: 300,
7460
7525
  padding: 50,
7461
- colorScale: colors
7526
+ colorScale
7462
7527
  };
7463
7528
  // *
7464
7529
  // * Labels
@@ -7480,6 +7545,17 @@ const centeredLabelStyles = Object.assign({
7480
7545
  const strokeLinecap = "round";
7481
7546
  const strokeLinejoin = "round";
7482
7547
  const grayscale = {
7548
+ palette: {
7549
+ colors,
7550
+ grayscale: colorScale,
7551
+ qualitative,
7552
+ heatmap,
7553
+ warm,
7554
+ cool,
7555
+ red,
7556
+ green,
7557
+ blue
7558
+ },
7483
7559
  area: Object.assign({
7484
7560
  style: {
7485
7561
  data: {
@@ -7594,7 +7670,7 @@ const grayscale = {
7594
7670
  }
7595
7671
  }, baseProps),
7596
7672
  group: Object.assign({
7597
- colorScale: colors
7673
+ colorScale
7598
7674
  }, baseProps),
7599
7675
  histogram: Object.assign({
7600
7676
  style: {
@@ -7607,7 +7683,7 @@ const grayscale = {
7607
7683
  }
7608
7684
  }, baseProps),
7609
7685
  legend: {
7610
- colorScale: colors,
7686
+ colorScale,
7611
7687
  gutter: 10,
7612
7688
  orientation: "vertical",
7613
7689
  titleOrientation: "top",
@@ -7642,7 +7718,7 @@ const grayscale = {
7642
7718
  padding: 20
7643
7719
  })
7644
7720
  },
7645
- colorScale: colors,
7721
+ colorScale,
7646
7722
  width: 400,
7647
7723
  height: 400,
7648
7724
  padding: 50
@@ -7658,7 +7734,7 @@ const grayscale = {
7658
7734
  }
7659
7735
  }, baseProps),
7660
7736
  stack: Object.assign({
7661
- colorScale: colors
7737
+ colorScale
7662
7738
  }, baseProps),
7663
7739
  tooltip: {
7664
7740
  style: Object.assign({}, baseLabelStyles, {
@@ -7718,11 +7794,31 @@ const lime300 = "#DCE775";
7718
7794
  const lightGreen500 = "#8BC34A";
7719
7795
  const teal700 = "#00796B";
7720
7796
  const cyan900 = "#006064";
7721
- const colors = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
7797
+ const colorScale = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
7722
7798
  const blueGrey50 = "#ECEFF1";
7723
7799
  const blueGrey300 = "#90A4AE";
7724
7800
  const blueGrey700 = "#455A64";
7725
7801
  const grey900 = "#212121";
7802
+ const colors = {
7803
+ blue: "#4F7DA1",
7804
+ pink: "#E2A37F",
7805
+ teal: teal700,
7806
+ purple: "#DF948A",
7807
+ green: lightGreen500,
7808
+ orange: deepOrange600,
7809
+ cyan: cyan900,
7810
+ red: "#DF5A49",
7811
+ yellow: yellow200
7812
+ };
7813
+ const grayscale = [blueGrey50, blueGrey300, blueGrey700, grey900];
7814
+ const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
7815
+ const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
7816
+ const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
7817
+ const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
7818
+ const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
7819
+ const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
7820
+ const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
7821
+
7726
7822
  // *
7727
7823
  // * Typography
7728
7824
  // *
@@ -7760,6 +7856,17 @@ const strokeDasharray = "10, 5";
7760
7856
  const strokeLinecap = "round";
7761
7857
  const strokeLinejoin = "round";
7762
7858
  const material = {
7859
+ palette: {
7860
+ colors,
7861
+ grayscale,
7862
+ qualitative,
7863
+ heatmap,
7864
+ warm,
7865
+ cool,
7866
+ red,
7867
+ green,
7868
+ blue
7869
+ },
7763
7870
  area: Object.assign({
7764
7871
  style: {
7765
7872
  data: {
@@ -7892,7 +7999,7 @@ const material = {
7892
7999
  }
7893
8000
  }, baseProps),
7894
8001
  group: Object.assign({
7895
- colorScale: colors
8002
+ colorScale
7896
8003
  }, baseProps),
7897
8004
  histogram: Object.assign({
7898
8005
  style: {
@@ -7905,7 +8012,7 @@ const material = {
7905
8012
  }
7906
8013
  }, baseProps),
7907
8014
  legend: {
7908
- colorScale: colors,
8015
+ colorScale,
7909
8016
  gutter: 10,
7910
8017
  orientation: "vertical",
7911
8018
  titleOrientation: "top",
@@ -7931,7 +8038,7 @@ const material = {
7931
8038
  }
7932
8039
  }, baseProps),
7933
8040
  pie: Object.assign({
7934
- colorScale: colors,
8041
+ colorScale,
7935
8042
  style: {
7936
8043
  data: {
7937
8044
  padding,
@@ -7955,7 +8062,7 @@ const material = {
7955
8062
  }
7956
8063
  }, baseProps),
7957
8064
  stack: Object.assign({
7958
- colorScale: colors
8065
+ colorScale
7959
8066
  }, baseProps),
7960
8067
  tooltip: {
7961
8068
  style: Object.assign({}, baseLabelStyles, {
@@ -9639,6 +9746,9 @@ __webpack_require__.r(__webpack_exports__);
9639
9746
  /* harmony export */ "getColorScale": function() { return /* binding */ getColorScale; },
9640
9747
  /* harmony export */ "toTransformString": function() { return /* binding */ toTransformString; }
9641
9748
  /* harmony export */ });
9749
+ /* 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");
9750
+
9751
+
9642
9752
  /**
9643
9753
  * Given an object with CSS/SVG transform definitions, return the string value
9644
9754
  * for use with the `transform` CSS property or SVG attribute. Note that we
@@ -9675,20 +9785,37 @@ const toTransformString = function (obj) {
9675
9785
  * of 5 hex string values in that color scale. If no 'name' parameter
9676
9786
  * is given, it will return the Victory default grayscale.
9677
9787
  * @param {String} name The name of the color scale to return (optional).
9788
+ * @param {Object} theme The theme object to retrieve the color scale from (optional).
9678
9789
  * @returns {Array} An array of 5 hex string values composing a color scale.
9679
9790
  */
9680
- function getColorScale(name) {
9791
+ function getColorScale(name, theme) {
9792
+ if (theme === void 0) {
9793
+ theme = _victory_theme_victory_theme__WEBPACK_IMPORTED_MODULE_0__.VictoryTheme.material;
9794
+ }
9795
+ const {
9796
+ palette: {
9797
+ grayscale = ["#cccccc", "#969696", "#636363", "#252525"],
9798
+ qualitative = [],
9799
+ heatmap = [],
9800
+ warm = [],
9801
+ cool = [],
9802
+ red = [],
9803
+ blue = [],
9804
+ green = []
9805
+ } = {}
9806
+ } = theme;
9681
9807
  const scales = {
9682
- grayscale: ["#cccccc", "#969696", "#636363", "#252525"],
9683
- qualitative: ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"],
9684
- heatmap: ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"],
9685
- warm: ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"],
9686
- cool: ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"],
9687
- red: ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"],
9688
- blue: ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"],
9689
- green: ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"]
9808
+ grayscale,
9809
+ qualitative,
9810
+ heatmap,
9811
+ warm,
9812
+ cool,
9813
+ red,
9814
+ blue,
9815
+ green
9690
9816
  };
9691
- return name ? scales[name] : scales.grayscale;
9817
+ const selectedScale = name && scales[name]?.length ? scales[name] : scales.grayscale;
9818
+ return selectedScale;
9692
9819
  }
9693
9820
 
9694
9821
  /***/ }),