victory-stack 37.1.1 → 37.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -253,10 +253,13 @@ function getChildren(initialProps, childComponents, calculatedProps) {
253
253
  } = newCalculatedProps;
254
254
  const childProps = getChildProps(props, newCalculatedProps);
255
255
  const parentName = props.name || "stack";
256
+ const {
257
+ theme
258
+ } = props;
256
259
  return children.map((child, index) => {
257
260
  const role = child.type && child.type.role;
258
261
  const data = datasets[index];
259
- const style = victory_core__WEBPACK_IMPORTED_MODULE_3__.getChildStyle(child, index, newCalculatedProps);
262
+ const style = victory_core__WEBPACK_IMPORTED_MODULE_3__.getChildStyle(child, index, newCalculatedProps, theme);
260
263
  const labels = props.labels ? getLabels(props, datasets, index) : child.props.labels;
261
264
  const name = child.props.name || `${parentName}-${role}-${index}`;
262
265
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(child, Object.assign({
@@ -5299,6 +5302,477 @@ const Portal = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().forward
5299
5302
 
5300
5303
  /***/ }),
5301
5304
 
5305
+ /***/ "../../victory-core/es/victory-theme/clean.js":
5306
+ /*!****************************************************!*\
5307
+ !*** ../../victory-core/es/victory-theme/clean.js ***!
5308
+ \****************************************************/
5309
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
5310
+
5311
+ "use strict";
5312
+ __webpack_require__.r(__webpack_exports__);
5313
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
5314
+ /* harmony export */ "clean": function() { return /* binding */ clean; }
5315
+ /* harmony export */ });
5316
+ // *
5317
+ // * Colors
5318
+ // *
5319
+
5320
+ const gray = {
5321
+ white: "#FFFFFF",
5322
+ "50": "#FAFAFA",
5323
+ "100": "#F2F2F2",
5324
+ "200": "#E8E8E8",
5325
+ "300": "#E0E0E0",
5326
+ "400": "#D1D1D1",
5327
+ "500": "#757575",
5328
+ "600": "#5C5C5C",
5329
+ "700": "#424242",
5330
+ "800": "#333333",
5331
+ "900": "#292929",
5332
+ black: "#0F0F0F"
5333
+ };
5334
+ const yellow = {
5335
+ "100": "#FFEAB6",
5336
+ "300": "#FFD66E",
5337
+ "500": "#FCB400",
5338
+ "900": "#B87503"
5339
+ };
5340
+ const orange = {
5341
+ "100": "#FEE2D5",
5342
+ "300": "#FFA981",
5343
+ "500": "#FF6F2C",
5344
+ "900": "#D74D26"
5345
+ };
5346
+ const red = {
5347
+ "100": "#FFDCE5",
5348
+ "300": "#FF9EB7",
5349
+ "500": "#F82B60",
5350
+ "900": "#BA1E45"
5351
+ };
5352
+ const pink = {
5353
+ "100": "#FFDAF6",
5354
+ "300": "#F99DE2",
5355
+ "500": "#FF08C2",
5356
+ "900": "#B2158B"
5357
+ };
5358
+ const purple = {
5359
+ "100": "#EDE3FE",
5360
+ "300": "#CDB0FF",
5361
+ "500": "#8B46FF",
5362
+ "900": "#6B1CB0"
5363
+ };
5364
+ const blue = {
5365
+ "100": "#CFDFFF",
5366
+ "300": "#9CC7FF",
5367
+ "500": "#2D7FF9",
5368
+ "900": "#2750AE"
5369
+ };
5370
+ const cyan = {
5371
+ "100": "#D0F0FD",
5372
+ "300": "#77D1F3",
5373
+ "500": "#18BFFF",
5374
+ "900": "#0B76B7"
5375
+ };
5376
+ const teal = {
5377
+ "100": "#C2F5E9",
5378
+ "300": "#72DDC3",
5379
+ "500": "#20D9D2",
5380
+ "900": "#06A09B"
5381
+ };
5382
+ const green = {
5383
+ "100": "#D1F7C4",
5384
+ "300": "#93E088",
5385
+ "500": "#20C933",
5386
+ "900": "#338A17"
5387
+ };
5388
+ const colors = {
5389
+ blue: blue["500"],
5390
+ pink: pink["500"],
5391
+ teal: teal["500"],
5392
+ purple: purple["500"],
5393
+ green: green["500"],
5394
+ orange: orange["500"],
5395
+ cyan: cyan["500"],
5396
+ red: red["500"],
5397
+ yellow: yellow["500"]
5398
+ };
5399
+ const colorScale = Object.values(colors);
5400
+ const grayscale = [gray["200"], gray["400"], gray["600"], gray["900"]];
5401
+ const warm = [yellow["500"], orange["500"], red["500"], pink["500"]];
5402
+ const cool = [cyan["500"], teal["500"], blue["500"], purple["500"]];
5403
+ const heatmap = [green["500"], yellow["500"], red["500"]];
5404
+ const redPalette = [red["500"], red["300"], red["100"]];
5405
+ const greenPalette = [green["500"], green["300"], green["100"]];
5406
+ const bluePalette = [blue["500"], blue["300"], blue["100"]];
5407
+
5408
+ // *
5409
+ // * Typography
5410
+ // *
5411
+ const sansSerif = "'Inter', 'Helvetica Neue', 'Seravek', 'Helvetica', sans-serif";
5412
+ const letterSpacing = "normal";
5413
+ const fontSize = 12;
5414
+ // *
5415
+ // * Layout
5416
+ // *
5417
+ const padding = 8;
5418
+ const baseProps = {
5419
+ width: 450,
5420
+ height: 300,
5421
+ padding: 50,
5422
+ colorScale
5423
+ };
5424
+ // *
5425
+ // * Labels
5426
+ // *
5427
+ const baseLabelStyles = {
5428
+ fontFamily: sansSerif,
5429
+ fontSize,
5430
+ fontWeight: 300,
5431
+ letterSpacing,
5432
+ padding,
5433
+ fill: gray["900"],
5434
+ stroke: "transparent"
5435
+ };
5436
+ const centeredLabelStyles = Object.assign({
5437
+ textAnchor: "middle"
5438
+ }, baseLabelStyles);
5439
+
5440
+ // *
5441
+ // * Strokes
5442
+ // *
5443
+ const strokeDasharray = "10, 5";
5444
+ const strokeLinecap = "round";
5445
+ const strokeLinejoin = "round";
5446
+ const borderRadius = 1;
5447
+ // *
5448
+ // * Theme
5449
+ // *
5450
+ const clean = {
5451
+ palette: {
5452
+ colors,
5453
+ grayscale,
5454
+ qualitative: colorScale,
5455
+ heatmap,
5456
+ warm,
5457
+ cool,
5458
+ red: redPalette,
5459
+ green: greenPalette,
5460
+ blue: bluePalette
5461
+ },
5462
+ area: Object.assign({
5463
+ style: {
5464
+ data: {
5465
+ fill: blue["500"],
5466
+ strokeWidth: 2,
5467
+ fillOpacity: 0.5
5468
+ },
5469
+ labels: baseLabelStyles
5470
+ }
5471
+ }, baseProps),
5472
+ axis: Object.assign({
5473
+ style: {
5474
+ axis: {
5475
+ fill: "transparent",
5476
+ stroke: gray["500"],
5477
+ strokeWidth: 1,
5478
+ strokeLinecap,
5479
+ strokeLinejoin
5480
+ },
5481
+ axisLabel: Object.assign({}, centeredLabelStyles, {
5482
+ padding,
5483
+ stroke: "transparent"
5484
+ }),
5485
+ grid: {
5486
+ fill: "none",
5487
+ stroke: "none",
5488
+ painterEvents: "painted"
5489
+ },
5490
+ ticks: {
5491
+ fill: "transparent",
5492
+ size: 5,
5493
+ stroke: "transparent"
5494
+ },
5495
+ tickLabels: baseLabelStyles
5496
+ }
5497
+ }, baseProps),
5498
+ polarAxis: Object.assign({
5499
+ style: {
5500
+ axis: {
5501
+ stroke: gray["500"]
5502
+ },
5503
+ grid: {
5504
+ stroke: gray["400"],
5505
+ strokeDasharray,
5506
+ strokeLinecap,
5507
+ strokeLinejoin,
5508
+ pointerEvents: "painted"
5509
+ },
5510
+ ticks: {
5511
+ fill: "transparent",
5512
+ size: 5,
5513
+ stroke: gray["400"],
5514
+ strokeWidth: 1,
5515
+ strokeLinecap,
5516
+ strokeLinejoin
5517
+ },
5518
+ tickLabels: baseLabelStyles
5519
+ }
5520
+ }),
5521
+ polarDependentAxis: Object.assign({
5522
+ style: {
5523
+ axis: {
5524
+ stroke: gray["500"]
5525
+ },
5526
+ grid: {
5527
+ stroke: gray["400"],
5528
+ strokeDasharray,
5529
+ strokeLinecap,
5530
+ strokeLinejoin,
5531
+ pointerEvents: "painted"
5532
+ },
5533
+ ticks: {
5534
+ fill: "transparent",
5535
+ size: 5,
5536
+ stroke: gray["300"],
5537
+ strokeWidth: 1,
5538
+ strokeLinecap,
5539
+ strokeLinejoin
5540
+ },
5541
+ tickLabels: baseLabelStyles
5542
+ }
5543
+ }),
5544
+ bar: Object.assign({
5545
+ style: {
5546
+ data: {
5547
+ fill: blue["500"],
5548
+ padding,
5549
+ strokeWidth: 1,
5550
+ fillOpacity: 0.5
5551
+ },
5552
+ labels: baseLabelStyles
5553
+ },
5554
+ cornerRadius: {
5555
+ top: borderRadius
5556
+ }
5557
+ }, baseProps),
5558
+ boxplot: Object.assign({
5559
+ style: {
5560
+ max: {
5561
+ padding,
5562
+ stroke: gray["400"],
5563
+ strokeWidth: 2
5564
+ },
5565
+ maxLabels: Object.assign({}, baseLabelStyles, {
5566
+ padding: 3
5567
+ }),
5568
+ median: {
5569
+ padding,
5570
+ stroke: gray.white,
5571
+ strokeWidth: 2
5572
+ },
5573
+ medianLabels: Object.assign({}, baseLabelStyles, {
5574
+ padding: 3
5575
+ }),
5576
+ min: {
5577
+ padding,
5578
+ stroke: gray["400"],
5579
+ strokeWidth: 2
5580
+ },
5581
+ minLabels: Object.assign({}, baseLabelStyles, {
5582
+ padding: 3
5583
+ }),
5584
+ q1: {
5585
+ padding,
5586
+ fill: teal["500"],
5587
+ rx: borderRadius,
5588
+ strokeWidth: 2
5589
+ },
5590
+ q1Labels: Object.assign({}, baseLabelStyles, {
5591
+ padding: 3
5592
+ }),
5593
+ q3: {
5594
+ padding,
5595
+ fill: cyan["500"],
5596
+ rx: borderRadius
5597
+ },
5598
+ q3Labels: Object.assign({}, baseLabelStyles, {
5599
+ padding: 3
5600
+ })
5601
+ },
5602
+ boxWidth: 20
5603
+ }, baseProps),
5604
+ candlestick: Object.assign({
5605
+ style: {
5606
+ data: {
5607
+ stroke: gray["300"],
5608
+ strokeWidth: 0,
5609
+ rx: borderRadius
5610
+ },
5611
+ labels: Object.assign({}, baseLabelStyles, {
5612
+ padding: 5
5613
+ })
5614
+ },
5615
+ candleColors: {
5616
+ positive: teal["500"],
5617
+ negative: orange["500"]
5618
+ },
5619
+ wickStrokeWidth: 2
5620
+ }, baseProps),
5621
+ chart: baseProps,
5622
+ errorbar: Object.assign({
5623
+ borderWidth: 8,
5624
+ style: {
5625
+ data: {
5626
+ fill: "transparent",
5627
+ opacity: 1,
5628
+ stroke: gray["700"],
5629
+ strokeWidth: 2,
5630
+ strokeLinecap
5631
+ },
5632
+ labels: baseLabelStyles
5633
+ }
5634
+ }, baseProps),
5635
+ group: Object.assign({
5636
+ colorScale
5637
+ }, baseProps),
5638
+ histogram: Object.assign({
5639
+ style: {
5640
+ data: {
5641
+ fill: cyan["500"],
5642
+ fillOpacity: 0.5
5643
+ },
5644
+ labels: baseLabelStyles
5645
+ },
5646
+ binSpacing: 4,
5647
+ cornerRadius: {
5648
+ top: borderRadius
5649
+ }
5650
+ }, baseProps),
5651
+ label: baseLabelStyles,
5652
+ legend: {
5653
+ colorScale,
5654
+ gutter: 24,
5655
+ borderPadding: 10,
5656
+ orientation: "horizontal",
5657
+ titleOrientation: "top",
5658
+ centerTitle: true,
5659
+ style: {
5660
+ data: {
5661
+ type: "circle"
5662
+ },
5663
+ labels: {
5664
+ ...baseLabelStyles,
5665
+ fontSize: 12
5666
+ },
5667
+ title: Object.assign({}, baseLabelStyles, {
5668
+ padding,
5669
+ fontSize: 16
5670
+ }),
5671
+ border: {
5672
+ stroke: gray["200"],
5673
+ strokeWidth: 2,
5674
+ padding: 16
5675
+ }
5676
+ }
5677
+ },
5678
+ line: Object.assign({
5679
+ style: {
5680
+ data: {
5681
+ fill: "transparent",
5682
+ opacity: 1,
5683
+ stroke: blue["500"],
5684
+ strokeWidth: 2,
5685
+ strokeLinecap,
5686
+ strokeLinejoin
5687
+ },
5688
+ labels: baseLabelStyles
5689
+ }
5690
+ }, baseProps),
5691
+ pie: Object.assign({
5692
+ style: {
5693
+ parent: {
5694
+ backgroundColor: gray.white
5695
+ },
5696
+ data: {
5697
+ padding,
5698
+ stroke: gray.white,
5699
+ strokeWidth: 1
5700
+ },
5701
+ labels: {
5702
+ ...baseLabelStyles,
5703
+ padding: 20,
5704
+ fill: gray["600"],
5705
+ fontSize: 10
5706
+ }
5707
+ },
5708
+ colorScale,
5709
+ cornerRadius: borderRadius
5710
+ }, baseProps),
5711
+ scatter: Object.assign({
5712
+ style: {
5713
+ data: {
5714
+ fill: purple["500"],
5715
+ opacity: 1,
5716
+ stroke: "transparent",
5717
+ strokeWidth: 0
5718
+ },
5719
+ labels: {
5720
+ ...baseLabelStyles,
5721
+ padding: 20
5722
+ }
5723
+ }
5724
+ }, baseProps),
5725
+ stack: Object.assign({
5726
+ colorScale
5727
+ }, baseProps),
5728
+ tooltip: {
5729
+ style: Object.assign({}, baseLabelStyles, {
5730
+ padding: 0,
5731
+ pointerEvents: "none"
5732
+ }),
5733
+ flyoutStyle: {
5734
+ stroke: gray["300"],
5735
+ strokeWidth: 2,
5736
+ fill: gray.white,
5737
+ pointerEvents: "none"
5738
+ },
5739
+ flyoutPadding: {
5740
+ top: 8,
5741
+ bottom: 8,
5742
+ left: 16,
5743
+ right: 16
5744
+ },
5745
+ cornerRadius: borderRadius,
5746
+ pointerLength: 4
5747
+ },
5748
+ voronoi: Object.assign({
5749
+ style: {
5750
+ data: {
5751
+ fill: blue["100"],
5752
+ stroke: blue["500"],
5753
+ strokeWidth: 2,
5754
+ opacity: 0.4
5755
+ },
5756
+ labels: Object.assign({}, baseLabelStyles, {
5757
+ padding: 5,
5758
+ pointerEvents: "none"
5759
+ }),
5760
+ flyout: {
5761
+ stroke: gray["900"],
5762
+ strokeWidth: 1,
5763
+ fill: gray["100"],
5764
+ pointerEvents: "none"
5765
+ },
5766
+ padding: {
5767
+ left: 2,
5768
+ bottom: 2
5769
+ }
5770
+ }
5771
+ }, baseProps)
5772
+ };
5773
+
5774
+ /***/ }),
5775
+
5302
5776
  /***/ "../../victory-core/es/victory-theme/grayscale.js":
5303
5777
  /*!********************************************************!*\
5304
5778
  !*** ../../victory-core/es/victory-theme/grayscale.js ***!
@@ -5313,9 +5787,28 @@ __webpack_require__.r(__webpack_exports__);
5313
5787
  // *
5314
5788
  // * Colors
5315
5789
  // *
5316
- const colors = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
5790
+ const colors = {
5791
+ blue: "#4F7DA1",
5792
+ pink: "#E2A37F",
5793
+ teal: "#00796B",
5794
+ purple: "#DF948A",
5795
+ green: "#8BC34A",
5796
+ orange: "#F4511E",
5797
+ cyan: "#006064",
5798
+ red: "#DF5A49",
5799
+ yellow: "#FFF59D"
5800
+ };
5801
+ const colorScale = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
5317
5802
  const charcoal = "#252525";
5318
5803
  const grey = "#969696";
5804
+ const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
5805
+ const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
5806
+ const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
5807
+ const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
5808
+ const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
5809
+ const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
5810
+ const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
5811
+
5319
5812
  // *
5320
5813
  // * Typography
5321
5814
  // *
@@ -5329,7 +5822,7 @@ const baseProps = {
5329
5822
  width: 450,
5330
5823
  height: 300,
5331
5824
  padding: 50,
5332
- colorScale: colors
5825
+ colorScale
5333
5826
  };
5334
5827
  // *
5335
5828
  // * Labels
@@ -5351,6 +5844,17 @@ const centeredLabelStyles = Object.assign({
5351
5844
  const strokeLinecap = "round";
5352
5845
  const strokeLinejoin = "round";
5353
5846
  const grayscale = {
5847
+ palette: {
5848
+ colors,
5849
+ grayscale: colorScale,
5850
+ qualitative,
5851
+ heatmap,
5852
+ warm,
5853
+ cool,
5854
+ red,
5855
+ green,
5856
+ blue
5857
+ },
5354
5858
  area: Object.assign({
5355
5859
  style: {
5356
5860
  data: {
@@ -5465,7 +5969,7 @@ const grayscale = {
5465
5969
  }
5466
5970
  }, baseProps),
5467
5971
  group: Object.assign({
5468
- colorScale: colors
5972
+ colorScale
5469
5973
  }, baseProps),
5470
5974
  histogram: Object.assign({
5471
5975
  style: {
@@ -5478,7 +5982,7 @@ const grayscale = {
5478
5982
  }
5479
5983
  }, baseProps),
5480
5984
  legend: {
5481
- colorScale: colors,
5985
+ colorScale,
5482
5986
  gutter: 10,
5483
5987
  orientation: "vertical",
5484
5988
  titleOrientation: "top",
@@ -5513,7 +6017,7 @@ const grayscale = {
5513
6017
  padding: 20
5514
6018
  })
5515
6019
  },
5516
- colorScale: colors,
6020
+ colorScale,
5517
6021
  width: 400,
5518
6022
  height: 400,
5519
6023
  padding: 50
@@ -5529,7 +6033,7 @@ const grayscale = {
5529
6033
  }
5530
6034
  }, baseProps),
5531
6035
  stack: Object.assign({
5532
- colorScale: colors
6036
+ colorScale
5533
6037
  }, baseProps),
5534
6038
  tooltip: {
5535
6039
  style: Object.assign({}, baseLabelStyles, {
@@ -5589,11 +6093,31 @@ const lime300 = "#DCE775";
5589
6093
  const lightGreen500 = "#8BC34A";
5590
6094
  const teal700 = "#00796B";
5591
6095
  const cyan900 = "#006064";
5592
- const colors = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
6096
+ const colorScale = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
5593
6097
  const blueGrey50 = "#ECEFF1";
5594
6098
  const blueGrey300 = "#90A4AE";
5595
6099
  const blueGrey700 = "#455A64";
5596
6100
  const grey900 = "#212121";
6101
+ const colors = {
6102
+ blue: "#4F7DA1",
6103
+ pink: "#E2A37F",
6104
+ teal: teal700,
6105
+ purple: "#DF948A",
6106
+ green: lightGreen500,
6107
+ orange: deepOrange600,
6108
+ cyan: cyan900,
6109
+ red: "#DF5A49",
6110
+ yellow: yellow200
6111
+ };
6112
+ const grayscale = [blueGrey50, blueGrey300, blueGrey700, grey900];
6113
+ const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
6114
+ const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
6115
+ const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
6116
+ const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
6117
+ const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
6118
+ const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
6119
+ const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
6120
+
5597
6121
  // *
5598
6122
  // * Typography
5599
6123
  // *
@@ -5631,6 +6155,17 @@ const strokeDasharray = "10, 5";
5631
6155
  const strokeLinecap = "round";
5632
6156
  const strokeLinejoin = "round";
5633
6157
  const material = {
6158
+ palette: {
6159
+ colors,
6160
+ grayscale,
6161
+ qualitative,
6162
+ heatmap,
6163
+ warm,
6164
+ cool,
6165
+ red,
6166
+ green,
6167
+ blue
6168
+ },
5634
6169
  area: Object.assign({
5635
6170
  style: {
5636
6171
  data: {
@@ -5763,7 +6298,7 @@ const material = {
5763
6298
  }
5764
6299
  }, baseProps),
5765
6300
  group: Object.assign({
5766
- colorScale: colors
6301
+ colorScale
5767
6302
  }, baseProps),
5768
6303
  histogram: Object.assign({
5769
6304
  style: {
@@ -5776,7 +6311,7 @@ const material = {
5776
6311
  }
5777
6312
  }, baseProps),
5778
6313
  legend: {
5779
- colorScale: colors,
6314
+ colorScale,
5780
6315
  gutter: 10,
5781
6316
  orientation: "vertical",
5782
6317
  titleOrientation: "top",
@@ -5802,7 +6337,7 @@ const material = {
5802
6337
  }
5803
6338
  }, baseProps),
5804
6339
  pie: Object.assign({
5805
- colorScale: colors,
6340
+ colorScale,
5806
6341
  style: {
5807
6342
  data: {
5808
6343
  padding,
@@ -5826,7 +6361,7 @@ const material = {
5826
6361
  }
5827
6362
  }, baseProps),
5828
6363
  stack: Object.assign({
5829
- colorScale: colors
6364
+ colorScale
5830
6365
  }, baseProps),
5831
6366
  tooltip: {
5832
6367
  style: Object.assign({}, baseLabelStyles, {
@@ -5879,12 +6414,15 @@ __webpack_require__.r(__webpack_exports__);
5879
6414
  /* harmony export */ });
5880
6415
  /* harmony import */ var _grayscale__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./grayscale */ "../../victory-core/es/victory-theme/grayscale.js");
5881
6416
  /* harmony import */ var _material__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./material */ "../../victory-core/es/victory-theme/material.js");
6417
+ /* harmony import */ var _clean__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./clean */ "../../victory-core/es/victory-theme/clean.js");
6418
+
5882
6419
 
5883
6420
 
5884
6421
 
5885
6422
  const VictoryTheme = {
5886
6423
  grayscale: _grayscale__WEBPACK_IMPORTED_MODULE_0__.grayscale,
5887
- material: _material__WEBPACK_IMPORTED_MODULE_1__.material
6424
+ material: _material__WEBPACK_IMPORTED_MODULE_1__.material,
6425
+ clean: _clean__WEBPACK_IMPORTED_MODULE_2__.clean
5888
6426
  };
5889
6427
 
5890
6428
  /***/ }),
@@ -8446,6 +8984,9 @@ __webpack_require__.r(__webpack_exports__);
8446
8984
  /* harmony export */ "getColorScale": function() { return /* binding */ getColorScale; },
8447
8985
  /* harmony export */ "toTransformString": function() { return /* binding */ toTransformString; }
8448
8986
  /* harmony export */ });
8987
+ /* 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");
8988
+
8989
+
8449
8990
  /**
8450
8991
  * Given an object with CSS/SVG transform definitions, return the string value
8451
8992
  * for use with the `transform` CSS property or SVG attribute. Note that we
@@ -8482,20 +9023,37 @@ const toTransformString = function (obj) {
8482
9023
  * of 5 hex string values in that color scale. If no 'name' parameter
8483
9024
  * is given, it will return the Victory default grayscale.
8484
9025
  * @param {String} name The name of the color scale to return (optional).
9026
+ * @param {Object} theme The theme object to retrieve the color scale from (optional).
8485
9027
  * @returns {Array} An array of 5 hex string values composing a color scale.
8486
9028
  */
8487
- function getColorScale(name) {
9029
+ function getColorScale(name, theme) {
9030
+ if (theme === void 0) {
9031
+ theme = _victory_theme_victory_theme__WEBPACK_IMPORTED_MODULE_0__.VictoryTheme.material;
9032
+ }
9033
+ const {
9034
+ palette: {
9035
+ grayscale = ["#cccccc", "#969696", "#636363", "#252525"],
9036
+ qualitative = [],
9037
+ heatmap = [],
9038
+ warm = [],
9039
+ cool = [],
9040
+ red = [],
9041
+ blue = [],
9042
+ green = []
9043
+ } = {}
9044
+ } = theme;
8488
9045
  const scales = {
8489
- grayscale: ["#cccccc", "#969696", "#636363", "#252525"],
8490
- qualitative: ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"],
8491
- heatmap: ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"],
8492
- warm: ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"],
8493
- cool: ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"],
8494
- red: ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"],
8495
- blue: ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"],
8496
- green: ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"]
9046
+ grayscale,
9047
+ qualitative,
9048
+ heatmap,
9049
+ warm,
9050
+ cool,
9051
+ red,
9052
+ blue,
9053
+ green
8497
9054
  };
8498
- return name ? scales[name] : scales.grayscale;
9055
+ const selectedScale = name && scales[name]?.length ? scales[name] : scales.grayscale;
9056
+ return selectedScale;
8499
9057
  }
8500
9058
 
8501
9059
  /***/ }),
@@ -9404,7 +9962,9 @@ function getAllEvents(props) {
9404
9962
  }
9405
9963
  return events || [];
9406
9964
  }
9407
- function getColor(calculatedProps, child, index) {
9965
+
9966
+ // eslint-disable-next-line max-params
9967
+ function getColor(calculatedProps, child, index, theme) {
9408
9968
  // check for styles first
9409
9969
  const {
9410
9970
  style
@@ -9421,14 +9981,16 @@ function getColor(calculatedProps, child, index) {
9421
9981
  if (!colorScale && !color) {
9422
9982
  return undefined;
9423
9983
  }
9424
- const colors = Array.isArray(colorScale) ? colorScale : _style__WEBPACK_IMPORTED_MODULE_13__.getColorScale(colorScale);
9984
+ const colors = Array.isArray(colorScale) ? colorScale : _style__WEBPACK_IMPORTED_MODULE_13__.getColorScale(colorScale, theme);
9425
9985
  return color || colors[index % colors.length];
9426
9986
  }
9427
9987
  function getStyle(theme, style, role) {
9428
9988
  const defaultStyle = theme && theme[role] && theme[role].style ? theme[role].style : {};
9429
9989
  return _helpers__WEBPACK_IMPORTED_MODULE_7__.getStyles(style, defaultStyle);
9430
9990
  }
9431
- function getChildStyle(child, index, calculatedProps) {
9991
+
9992
+ // eslint-disable-next-line max-params
9993
+ function getChildStyle(child, index, calculatedProps, theme) {
9432
9994
  const {
9433
9995
  style,
9434
9996
  role
@@ -9438,7 +10000,7 @@ function getChildStyle(child, index, calculatedProps) {
9438
10000
  return childStyle;
9439
10001
  }
9440
10002
  const childRole = child.type && child.type.role;
9441
- const defaultFill = childRole === "stack" ? undefined : getColor(calculatedProps, child, index);
10003
+ const defaultFill = childRole === "stack" ? undefined : getColor(calculatedProps, child, index, theme);
9442
10004
  const defaultColor = childRole === "line" ? {
9443
10005
  fill: "none",
9444
10006
  stroke: defaultFill