victory-pie 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.
@@ -79,11 +79,12 @@ const getSlices = (props, data) => {
79
79
  };
80
80
  const getCalculatedValues = props => {
81
81
  const {
82
- colorScale
82
+ colorScale,
83
+ theme
83
84
  } = props;
84
85
  const styleObject = victory_core__WEBPACK_IMPORTED_MODULE_3__.getDefaultStyles(props, "pie");
85
86
  const style = victory_core__WEBPACK_IMPORTED_MODULE_3__.getStyles(props.style, styleObject);
86
- const colors = Array.isArray(colorScale) ? colorScale : victory_core__WEBPACK_IMPORTED_MODULE_4__.getColorScale(colorScale);
87
+ const colors = Array.isArray(colorScale) ? colorScale : victory_core__WEBPACK_IMPORTED_MODULE_4__.getColorScale(colorScale, theme);
87
88
  const padding = victory_core__WEBPACK_IMPORTED_MODULE_3__.getPadding(props);
88
89
  const defaultRadius = getRadius(props, padding);
89
90
  const origin = getOrigin(props, padding);
@@ -6082,31 +6083,34 @@ __webpack_require__.r(__webpack_exports__);
6082
6083
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6083
6084
  /* harmony export */ "VictoryPortal": function() { return /* binding */ VictoryPortal; }
6084
6085
  /* harmony export */ });
6085
- /* 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");
6086
- /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
6087
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
6088
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
6089
- /* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
6090
- /* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
6091
- /* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
6086
+ /* 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");
6087
+ /* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0__);
6088
+ /* 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");
6089
+ /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
6090
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
6091
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
6092
+ /* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
6093
+ /* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
6094
+ /* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
6095
+
6092
6096
 
6093
6097
 
6094
6098
 
6095
6099
 
6096
6100
 
6097
6101
  const defaultProps = {
6098
- groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("g", null)
6102
+ groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement("g", null)
6099
6103
  };
6100
6104
  const VictoryPortal = initialProps => {
6101
6105
  const props = {
6102
6106
  ...defaultProps,
6103
6107
  ...initialProps
6104
6108
  };
6105
- const id = react__WEBPACK_IMPORTED_MODULE_1___default().useId();
6106
- const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_2__.usePortalContext)();
6109
+ const id = lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default()();
6110
+ const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_3__.usePortalContext)();
6107
6111
  if (!portalContext) {
6108
6112
  const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
6109
- _victory_util_log__WEBPACK_IMPORTED_MODULE_3__.warn(msg);
6113
+ _victory_util_log__WEBPACK_IMPORTED_MODULE_4__.warn(msg);
6110
6114
  }
6111
6115
  const children = Array.isArray(props.children) ? props.children[0] : props.children;
6112
6116
  const {
@@ -6117,15 +6121,15 @@ const VictoryPortal = initialProps => {
6117
6121
  groupComponent,
6118
6122
  standalone: false
6119
6123
  } : {};
6120
- const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.omit(props, ["children", "groupComponent"]), {
6124
+ const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__.omit(props, ["children", "groupComponent"]), {
6121
6125
  key: childProps.key ?? id
6122
6126
  });
6123
- const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(children, newProps);
6124
- react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
6127
+ const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().cloneElement(children, newProps);
6128
+ react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
6125
6129
  portalContext?.addChild(id, child);
6126
6130
  // eslint-disable-next-line react-hooks/exhaustive-deps
6127
6131
  }, [props.children]);
6128
- react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
6132
+ react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
6129
6133
  return () => portalContext?.removeChild(id);
6130
6134
  // eslint-disable-next-line react-hooks/exhaustive-deps
6131
6135
  }, []);
@@ -6411,6 +6415,477 @@ const TSpan = props => {
6411
6415
 
6412
6416
  /***/ }),
6413
6417
 
6418
+ /***/ "../../victory-core/es/victory-theme/clean.js":
6419
+ /*!****************************************************!*\
6420
+ !*** ../../victory-core/es/victory-theme/clean.js ***!
6421
+ \****************************************************/
6422
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6423
+
6424
+ "use strict";
6425
+ __webpack_require__.r(__webpack_exports__);
6426
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6427
+ /* harmony export */ "clean": function() { return /* binding */ clean; }
6428
+ /* harmony export */ });
6429
+ // *
6430
+ // * Colors
6431
+ // *
6432
+
6433
+ const gray = {
6434
+ white: "#FFFFFF",
6435
+ "50": "#FAFAFA",
6436
+ "100": "#F2F2F2",
6437
+ "200": "#E8E8E8",
6438
+ "300": "#E0E0E0",
6439
+ "400": "#D1D1D1",
6440
+ "500": "#757575",
6441
+ "600": "#5C5C5C",
6442
+ "700": "#424242",
6443
+ "800": "#333333",
6444
+ "900": "#292929",
6445
+ black: "#0F0F0F"
6446
+ };
6447
+ const yellow = {
6448
+ "100": "#FFEAB6",
6449
+ "300": "#FFD66E",
6450
+ "500": "#FCB400",
6451
+ "900": "#B87503"
6452
+ };
6453
+ const orange = {
6454
+ "100": "#FEE2D5",
6455
+ "300": "#FFA981",
6456
+ "500": "#FF6F2C",
6457
+ "900": "#D74D26"
6458
+ };
6459
+ const red = {
6460
+ "100": "#FFDCE5",
6461
+ "300": "#FF9EB7",
6462
+ "500": "#F82B60",
6463
+ "900": "#BA1E45"
6464
+ };
6465
+ const pink = {
6466
+ "100": "#FFDAF6",
6467
+ "300": "#F99DE2",
6468
+ "500": "#FF08C2",
6469
+ "900": "#B2158B"
6470
+ };
6471
+ const purple = {
6472
+ "100": "#EDE3FE",
6473
+ "300": "#CDB0FF",
6474
+ "500": "#8B46FF",
6475
+ "900": "#6B1CB0"
6476
+ };
6477
+ const blue = {
6478
+ "100": "#CFDFFF",
6479
+ "300": "#9CC7FF",
6480
+ "500": "#2D7FF9",
6481
+ "900": "#2750AE"
6482
+ };
6483
+ const cyan = {
6484
+ "100": "#D0F0FD",
6485
+ "300": "#77D1F3",
6486
+ "500": "#18BFFF",
6487
+ "900": "#0B76B7"
6488
+ };
6489
+ const teal = {
6490
+ "100": "#C2F5E9",
6491
+ "300": "#72DDC3",
6492
+ "500": "#20D9D2",
6493
+ "900": "#06A09B"
6494
+ };
6495
+ const green = {
6496
+ "100": "#D1F7C4",
6497
+ "300": "#93E088",
6498
+ "500": "#20C933",
6499
+ "900": "#338A17"
6500
+ };
6501
+ const colors = {
6502
+ blue: blue["500"],
6503
+ pink: pink["500"],
6504
+ teal: teal["500"],
6505
+ purple: purple["500"],
6506
+ green: green["500"],
6507
+ orange: orange["500"],
6508
+ cyan: cyan["500"],
6509
+ red: red["500"],
6510
+ yellow: yellow["500"]
6511
+ };
6512
+ const colorScale = Object.values(colors);
6513
+ const grayscale = [gray["200"], gray["400"], gray["600"], gray["900"]];
6514
+ const warm = [yellow["500"], orange["500"], red["500"], pink["500"]];
6515
+ const cool = [cyan["500"], teal["500"], blue["500"], purple["500"]];
6516
+ const heatmap = [green["500"], yellow["500"], red["500"]];
6517
+ const redPalette = [red["500"], red["300"], red["100"]];
6518
+ const greenPalette = [green["500"], green["300"], green["100"]];
6519
+ const bluePalette = [blue["500"], blue["300"], blue["100"]];
6520
+
6521
+ // *
6522
+ // * Typography
6523
+ // *
6524
+ const sansSerif = "'Inter', 'Helvetica Neue', 'Seravek', 'Helvetica', sans-serif";
6525
+ const letterSpacing = "normal";
6526
+ const fontSize = 12;
6527
+ // *
6528
+ // * Layout
6529
+ // *
6530
+ const padding = 8;
6531
+ const baseProps = {
6532
+ width: 450,
6533
+ height: 300,
6534
+ padding: 50,
6535
+ colorScale
6536
+ };
6537
+ // *
6538
+ // * Labels
6539
+ // *
6540
+ const baseLabelStyles = {
6541
+ fontFamily: sansSerif,
6542
+ fontSize,
6543
+ fontWeight: 300,
6544
+ letterSpacing,
6545
+ padding,
6546
+ fill: gray["900"],
6547
+ stroke: "transparent"
6548
+ };
6549
+ const centeredLabelStyles = Object.assign({
6550
+ textAnchor: "middle"
6551
+ }, baseLabelStyles);
6552
+
6553
+ // *
6554
+ // * Strokes
6555
+ // *
6556
+ const strokeDasharray = "10, 5";
6557
+ const strokeLinecap = "round";
6558
+ const strokeLinejoin = "round";
6559
+ const borderRadius = 1;
6560
+ // *
6561
+ // * Theme
6562
+ // *
6563
+ const clean = {
6564
+ palette: {
6565
+ colors,
6566
+ grayscale,
6567
+ qualitative: colorScale,
6568
+ heatmap,
6569
+ warm,
6570
+ cool,
6571
+ red: redPalette,
6572
+ green: greenPalette,
6573
+ blue: bluePalette
6574
+ },
6575
+ area: Object.assign({
6576
+ style: {
6577
+ data: {
6578
+ fill: blue["500"],
6579
+ strokeWidth: 2,
6580
+ fillOpacity: 0.5
6581
+ },
6582
+ labels: baseLabelStyles
6583
+ }
6584
+ }, baseProps),
6585
+ axis: Object.assign({
6586
+ style: {
6587
+ axis: {
6588
+ fill: "transparent",
6589
+ stroke: gray["500"],
6590
+ strokeWidth: 1,
6591
+ strokeLinecap,
6592
+ strokeLinejoin
6593
+ },
6594
+ axisLabel: Object.assign({}, centeredLabelStyles, {
6595
+ padding,
6596
+ stroke: "transparent"
6597
+ }),
6598
+ grid: {
6599
+ fill: "none",
6600
+ stroke: "none",
6601
+ painterEvents: "painted"
6602
+ },
6603
+ ticks: {
6604
+ fill: "transparent",
6605
+ size: 5,
6606
+ stroke: "transparent"
6607
+ },
6608
+ tickLabels: baseLabelStyles
6609
+ }
6610
+ }, baseProps),
6611
+ polarAxis: Object.assign({
6612
+ style: {
6613
+ axis: {
6614
+ stroke: gray["500"]
6615
+ },
6616
+ grid: {
6617
+ stroke: gray["400"],
6618
+ strokeDasharray,
6619
+ strokeLinecap,
6620
+ strokeLinejoin,
6621
+ pointerEvents: "painted"
6622
+ },
6623
+ ticks: {
6624
+ fill: "transparent",
6625
+ size: 5,
6626
+ stroke: gray["400"],
6627
+ strokeWidth: 1,
6628
+ strokeLinecap,
6629
+ strokeLinejoin
6630
+ },
6631
+ tickLabels: baseLabelStyles
6632
+ }
6633
+ }),
6634
+ polarDependentAxis: Object.assign({
6635
+ style: {
6636
+ axis: {
6637
+ stroke: gray["500"]
6638
+ },
6639
+ grid: {
6640
+ stroke: gray["400"],
6641
+ strokeDasharray,
6642
+ strokeLinecap,
6643
+ strokeLinejoin,
6644
+ pointerEvents: "painted"
6645
+ },
6646
+ ticks: {
6647
+ fill: "transparent",
6648
+ size: 5,
6649
+ stroke: gray["300"],
6650
+ strokeWidth: 1,
6651
+ strokeLinecap,
6652
+ strokeLinejoin
6653
+ },
6654
+ tickLabels: baseLabelStyles
6655
+ }
6656
+ }),
6657
+ bar: Object.assign({
6658
+ style: {
6659
+ data: {
6660
+ fill: blue["500"],
6661
+ padding,
6662
+ strokeWidth: 1,
6663
+ fillOpacity: 0.5
6664
+ },
6665
+ labels: baseLabelStyles
6666
+ },
6667
+ cornerRadius: {
6668
+ top: borderRadius
6669
+ }
6670
+ }, baseProps),
6671
+ boxplot: Object.assign({
6672
+ style: {
6673
+ max: {
6674
+ padding,
6675
+ stroke: gray["400"],
6676
+ strokeWidth: 2
6677
+ },
6678
+ maxLabels: Object.assign({}, baseLabelStyles, {
6679
+ padding: 3
6680
+ }),
6681
+ median: {
6682
+ padding,
6683
+ stroke: gray.white,
6684
+ strokeWidth: 2
6685
+ },
6686
+ medianLabels: Object.assign({}, baseLabelStyles, {
6687
+ padding: 3
6688
+ }),
6689
+ min: {
6690
+ padding,
6691
+ stroke: gray["400"],
6692
+ strokeWidth: 2
6693
+ },
6694
+ minLabels: Object.assign({}, baseLabelStyles, {
6695
+ padding: 3
6696
+ }),
6697
+ q1: {
6698
+ padding,
6699
+ fill: teal["500"],
6700
+ rx: borderRadius,
6701
+ strokeWidth: 2
6702
+ },
6703
+ q1Labels: Object.assign({}, baseLabelStyles, {
6704
+ padding: 3
6705
+ }),
6706
+ q3: {
6707
+ padding,
6708
+ fill: cyan["500"],
6709
+ rx: borderRadius
6710
+ },
6711
+ q3Labels: Object.assign({}, baseLabelStyles, {
6712
+ padding: 3
6713
+ })
6714
+ },
6715
+ boxWidth: 20
6716
+ }, baseProps),
6717
+ candlestick: Object.assign({
6718
+ style: {
6719
+ data: {
6720
+ stroke: gray["300"],
6721
+ strokeWidth: 0,
6722
+ rx: borderRadius
6723
+ },
6724
+ labels: Object.assign({}, baseLabelStyles, {
6725
+ padding: 5
6726
+ })
6727
+ },
6728
+ candleColors: {
6729
+ positive: teal["500"],
6730
+ negative: orange["500"]
6731
+ },
6732
+ wickStrokeWidth: 2
6733
+ }, baseProps),
6734
+ chart: baseProps,
6735
+ errorbar: Object.assign({
6736
+ borderWidth: 8,
6737
+ style: {
6738
+ data: {
6739
+ fill: "transparent",
6740
+ opacity: 1,
6741
+ stroke: gray["700"],
6742
+ strokeWidth: 2,
6743
+ strokeLinecap
6744
+ },
6745
+ labels: baseLabelStyles
6746
+ }
6747
+ }, baseProps),
6748
+ group: Object.assign({
6749
+ colorScale
6750
+ }, baseProps),
6751
+ histogram: Object.assign({
6752
+ style: {
6753
+ data: {
6754
+ fill: cyan["500"],
6755
+ fillOpacity: 0.5
6756
+ },
6757
+ labels: baseLabelStyles
6758
+ },
6759
+ binSpacing: 4,
6760
+ cornerRadius: {
6761
+ top: borderRadius
6762
+ }
6763
+ }, baseProps),
6764
+ label: baseLabelStyles,
6765
+ legend: {
6766
+ colorScale,
6767
+ gutter: 24,
6768
+ borderPadding: 10,
6769
+ orientation: "horizontal",
6770
+ titleOrientation: "top",
6771
+ centerTitle: true,
6772
+ style: {
6773
+ data: {
6774
+ type: "circle"
6775
+ },
6776
+ labels: {
6777
+ ...baseLabelStyles,
6778
+ fontSize: 12
6779
+ },
6780
+ title: Object.assign({}, baseLabelStyles, {
6781
+ padding,
6782
+ fontSize: 16
6783
+ }),
6784
+ border: {
6785
+ stroke: gray["200"],
6786
+ strokeWidth: 2,
6787
+ padding: 16
6788
+ }
6789
+ }
6790
+ },
6791
+ line: Object.assign({
6792
+ style: {
6793
+ data: {
6794
+ fill: "transparent",
6795
+ opacity: 1,
6796
+ stroke: blue["500"],
6797
+ strokeWidth: 2,
6798
+ strokeLinecap,
6799
+ strokeLinejoin
6800
+ },
6801
+ labels: baseLabelStyles
6802
+ }
6803
+ }, baseProps),
6804
+ pie: Object.assign({
6805
+ style: {
6806
+ parent: {
6807
+ backgroundColor: gray.white
6808
+ },
6809
+ data: {
6810
+ padding,
6811
+ stroke: gray.white,
6812
+ strokeWidth: 1
6813
+ },
6814
+ labels: {
6815
+ ...baseLabelStyles,
6816
+ padding: 20,
6817
+ fill: gray["600"],
6818
+ fontSize: 10
6819
+ }
6820
+ },
6821
+ colorScale,
6822
+ cornerRadius: borderRadius
6823
+ }, baseProps),
6824
+ scatter: Object.assign({
6825
+ style: {
6826
+ data: {
6827
+ fill: purple["500"],
6828
+ opacity: 1,
6829
+ stroke: "transparent",
6830
+ strokeWidth: 0
6831
+ },
6832
+ labels: {
6833
+ ...baseLabelStyles,
6834
+ padding: 20
6835
+ }
6836
+ }
6837
+ }, baseProps),
6838
+ stack: Object.assign({
6839
+ colorScale
6840
+ }, baseProps),
6841
+ tooltip: {
6842
+ style: Object.assign({}, baseLabelStyles, {
6843
+ padding: 0,
6844
+ pointerEvents: "none"
6845
+ }),
6846
+ flyoutStyle: {
6847
+ stroke: gray["300"],
6848
+ strokeWidth: 2,
6849
+ fill: gray.white,
6850
+ pointerEvents: "none"
6851
+ },
6852
+ flyoutPadding: {
6853
+ top: 8,
6854
+ bottom: 8,
6855
+ left: 16,
6856
+ right: 16
6857
+ },
6858
+ cornerRadius: borderRadius,
6859
+ pointerLength: 4
6860
+ },
6861
+ voronoi: Object.assign({
6862
+ style: {
6863
+ data: {
6864
+ fill: blue["100"],
6865
+ stroke: blue["500"],
6866
+ strokeWidth: 2,
6867
+ opacity: 0.4
6868
+ },
6869
+ labels: Object.assign({}, baseLabelStyles, {
6870
+ padding: 5,
6871
+ pointerEvents: "none"
6872
+ }),
6873
+ flyout: {
6874
+ stroke: gray["900"],
6875
+ strokeWidth: 1,
6876
+ fill: gray["100"],
6877
+ pointerEvents: "none"
6878
+ },
6879
+ padding: {
6880
+ left: 2,
6881
+ bottom: 2
6882
+ }
6883
+ }
6884
+ }, baseProps)
6885
+ };
6886
+
6887
+ /***/ }),
6888
+
6414
6889
  /***/ "../../victory-core/es/victory-theme/grayscale.js":
6415
6890
  /*!********************************************************!*\
6416
6891
  !*** ../../victory-core/es/victory-theme/grayscale.js ***!
@@ -6425,9 +6900,28 @@ __webpack_require__.r(__webpack_exports__);
6425
6900
  // *
6426
6901
  // * Colors
6427
6902
  // *
6428
- const colors = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
6903
+ const colors = {
6904
+ blue: "#4F7DA1",
6905
+ pink: "#E2A37F",
6906
+ teal: "#00796B",
6907
+ purple: "#DF948A",
6908
+ green: "#8BC34A",
6909
+ orange: "#F4511E",
6910
+ cyan: "#006064",
6911
+ red: "#DF5A49",
6912
+ yellow: "#FFF59D"
6913
+ };
6914
+ const colorScale = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
6429
6915
  const charcoal = "#252525";
6430
6916
  const grey = "#969696";
6917
+ const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
6918
+ const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
6919
+ const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
6920
+ const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
6921
+ const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
6922
+ const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
6923
+ const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
6924
+
6431
6925
  // *
6432
6926
  // * Typography
6433
6927
  // *
@@ -6441,7 +6935,7 @@ const baseProps = {
6441
6935
  width: 450,
6442
6936
  height: 300,
6443
6937
  padding: 50,
6444
- colorScale: colors
6938
+ colorScale
6445
6939
  };
6446
6940
  // *
6447
6941
  // * Labels
@@ -6463,6 +6957,17 @@ const centeredLabelStyles = Object.assign({
6463
6957
  const strokeLinecap = "round";
6464
6958
  const strokeLinejoin = "round";
6465
6959
  const grayscale = {
6960
+ palette: {
6961
+ colors,
6962
+ grayscale: colorScale,
6963
+ qualitative,
6964
+ heatmap,
6965
+ warm,
6966
+ cool,
6967
+ red,
6968
+ green,
6969
+ blue
6970
+ },
6466
6971
  area: Object.assign({
6467
6972
  style: {
6468
6973
  data: {
@@ -6577,7 +7082,7 @@ const grayscale = {
6577
7082
  }
6578
7083
  }, baseProps),
6579
7084
  group: Object.assign({
6580
- colorScale: colors
7085
+ colorScale
6581
7086
  }, baseProps),
6582
7087
  histogram: Object.assign({
6583
7088
  style: {
@@ -6590,7 +7095,7 @@ const grayscale = {
6590
7095
  }
6591
7096
  }, baseProps),
6592
7097
  legend: {
6593
- colorScale: colors,
7098
+ colorScale,
6594
7099
  gutter: 10,
6595
7100
  orientation: "vertical",
6596
7101
  titleOrientation: "top",
@@ -6625,7 +7130,7 @@ const grayscale = {
6625
7130
  padding: 20
6626
7131
  })
6627
7132
  },
6628
- colorScale: colors,
7133
+ colorScale,
6629
7134
  width: 400,
6630
7135
  height: 400,
6631
7136
  padding: 50
@@ -6641,7 +7146,7 @@ const grayscale = {
6641
7146
  }
6642
7147
  }, baseProps),
6643
7148
  stack: Object.assign({
6644
- colorScale: colors
7149
+ colorScale
6645
7150
  }, baseProps),
6646
7151
  tooltip: {
6647
7152
  style: Object.assign({}, baseLabelStyles, {
@@ -6701,11 +7206,31 @@ const lime300 = "#DCE775";
6701
7206
  const lightGreen500 = "#8BC34A";
6702
7207
  const teal700 = "#00796B";
6703
7208
  const cyan900 = "#006064";
6704
- const colors = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
7209
+ const colorScale = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
6705
7210
  const blueGrey50 = "#ECEFF1";
6706
7211
  const blueGrey300 = "#90A4AE";
6707
7212
  const blueGrey700 = "#455A64";
6708
7213
  const grey900 = "#212121";
7214
+ const colors = {
7215
+ blue: "#4F7DA1",
7216
+ pink: "#E2A37F",
7217
+ teal: teal700,
7218
+ purple: "#DF948A",
7219
+ green: lightGreen500,
7220
+ orange: deepOrange600,
7221
+ cyan: cyan900,
7222
+ red: "#DF5A49",
7223
+ yellow: yellow200
7224
+ };
7225
+ const grayscale = [blueGrey50, blueGrey300, blueGrey700, grey900];
7226
+ const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
7227
+ const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
7228
+ const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
7229
+ const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
7230
+ const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
7231
+ const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
7232
+ const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
7233
+
6709
7234
  // *
6710
7235
  // * Typography
6711
7236
  // *
@@ -6743,6 +7268,17 @@ const strokeDasharray = "10, 5";
6743
7268
  const strokeLinecap = "round";
6744
7269
  const strokeLinejoin = "round";
6745
7270
  const material = {
7271
+ palette: {
7272
+ colors,
7273
+ grayscale,
7274
+ qualitative,
7275
+ heatmap,
7276
+ warm,
7277
+ cool,
7278
+ red,
7279
+ green,
7280
+ blue
7281
+ },
6746
7282
  area: Object.assign({
6747
7283
  style: {
6748
7284
  data: {
@@ -6875,7 +7411,7 @@ const material = {
6875
7411
  }
6876
7412
  }, baseProps),
6877
7413
  group: Object.assign({
6878
- colorScale: colors
7414
+ colorScale
6879
7415
  }, baseProps),
6880
7416
  histogram: Object.assign({
6881
7417
  style: {
@@ -6888,7 +7424,7 @@ const material = {
6888
7424
  }
6889
7425
  }, baseProps),
6890
7426
  legend: {
6891
- colorScale: colors,
7427
+ colorScale,
6892
7428
  gutter: 10,
6893
7429
  orientation: "vertical",
6894
7430
  titleOrientation: "top",
@@ -6914,7 +7450,7 @@ const material = {
6914
7450
  }
6915
7451
  }, baseProps),
6916
7452
  pie: Object.assign({
6917
- colorScale: colors,
7453
+ colorScale,
6918
7454
  style: {
6919
7455
  data: {
6920
7456
  padding,
@@ -6938,7 +7474,7 @@ const material = {
6938
7474
  }
6939
7475
  }, baseProps),
6940
7476
  stack: Object.assign({
6941
- colorScale: colors
7477
+ colorScale
6942
7478
  }, baseProps),
6943
7479
  tooltip: {
6944
7480
  style: Object.assign({}, baseLabelStyles, {
@@ -6991,12 +7527,15 @@ __webpack_require__.r(__webpack_exports__);
6991
7527
  /* harmony export */ });
6992
7528
  /* harmony import */ var _grayscale__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./grayscale */ "../../victory-core/es/victory-theme/grayscale.js");
6993
7529
  /* harmony import */ var _material__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./material */ "../../victory-core/es/victory-theme/material.js");
7530
+ /* harmony import */ var _clean__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./clean */ "../../victory-core/es/victory-theme/clean.js");
7531
+
6994
7532
 
6995
7533
 
6996
7534
 
6997
7535
  const VictoryTheme = {
6998
7536
  grayscale: _grayscale__WEBPACK_IMPORTED_MODULE_0__.grayscale,
6999
- material: _material__WEBPACK_IMPORTED_MODULE_1__.material
7537
+ material: _material__WEBPACK_IMPORTED_MODULE_1__.material,
7538
+ clean: _clean__WEBPACK_IMPORTED_MODULE_2__.clean
7000
7539
  };
7001
7540
 
7002
7541
  /***/ }),
@@ -9402,6 +9941,9 @@ __webpack_require__.r(__webpack_exports__);
9402
9941
  /* harmony export */ "getColorScale": function() { return /* binding */ getColorScale; },
9403
9942
  /* harmony export */ "toTransformString": function() { return /* binding */ toTransformString; }
9404
9943
  /* harmony export */ });
9944
+ /* 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");
9945
+
9946
+
9405
9947
  /**
9406
9948
  * Given an object with CSS/SVG transform definitions, return the string value
9407
9949
  * for use with the `transform` CSS property or SVG attribute. Note that we
@@ -9438,20 +9980,37 @@ const toTransformString = function (obj) {
9438
9980
  * of 5 hex string values in that color scale. If no 'name' parameter
9439
9981
  * is given, it will return the Victory default grayscale.
9440
9982
  * @param {String} name The name of the color scale to return (optional).
9983
+ * @param {Object} theme The theme object to retrieve the color scale from (optional).
9441
9984
  * @returns {Array} An array of 5 hex string values composing a color scale.
9442
9985
  */
9443
- function getColorScale(name) {
9986
+ function getColorScale(name, theme) {
9987
+ if (theme === void 0) {
9988
+ theme = _victory_theme_victory_theme__WEBPACK_IMPORTED_MODULE_0__.VictoryTheme.material;
9989
+ }
9990
+ const {
9991
+ palette: {
9992
+ grayscale = ["#cccccc", "#969696", "#636363", "#252525"],
9993
+ qualitative = [],
9994
+ heatmap = [],
9995
+ warm = [],
9996
+ cool = [],
9997
+ red = [],
9998
+ blue = [],
9999
+ green = []
10000
+ } = {}
10001
+ } = theme;
9444
10002
  const scales = {
9445
- grayscale: ["#cccccc", "#969696", "#636363", "#252525"],
9446
- qualitative: ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"],
9447
- heatmap: ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"],
9448
- warm: ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"],
9449
- cool: ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"],
9450
- red: ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"],
9451
- blue: ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"],
9452
- green: ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"]
10003
+ grayscale,
10004
+ qualitative,
10005
+ heatmap,
10006
+ warm,
10007
+ cool,
10008
+ red,
10009
+ blue,
10010
+ green
9453
10011
  };
9454
- return name ? scales[name] : scales.grayscale;
10012
+ const selectedScale = name && scales[name]?.length ? scales[name] : scales.grayscale;
10013
+ return selectedScale;
9455
10014
  }
9456
10015
 
9457
10016
  /***/ }),
@@ -9478,6 +10037,7 @@ __webpack_require__.r(__webpack_exports__);
9478
10037
  /* eslint-disable no-magic-numbers */
9479
10038
  // Based on measuring specific character widths
9480
10039
  // as in the following example https://bl.ocks.org/tophtucker/62f93a4658387bb61e4510c37e2e97cf
10040
+ // For new fonts: pull gist, open index.html locally, add font files (if not generic), enter font name in `font-family` input
9481
10041
  // prettier-ignore
9482
10042
  const fonts = {
9483
10043
  "American Typewriter": {
@@ -9536,6 +10096,10 @@ const fonts = {
9536
10096
  widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2359375, 0.2234375, 0.3921875, 0.7125, 0.49375, 0.8859375, 0.771875, 0.2125, 0.3078125, 0.309375, 0.375, 0.4234375, 0.234375, 0.3125, 0.234375, 0.3, 0.5828125, 0.365625, 0.434375, 0.3921875, 0.5234375, 0.3984375, 0.5125, 0.4328125, 0.46875, 0.5125, 0.234375, 0.234375, 0.515625, 0.4234375, 0.515625, 0.340625, 0.7609375, 0.7359375, 0.6359375, 0.721875, 0.8125, 0.6375, 0.5875, 0.8078125, 0.853125, 0.4296875, 0.503125, 0.78125, 0.609375, 0.9609375, 0.8515625, 0.8140625, 0.6125, 0.8140625, 0.71875, 0.49375, 0.7125, 0.76875, 0.771875, 1.125, 0.7765625, 0.7734375, 0.65625, 0.321875, 0.3078125, 0.321875, 0.3546875, 0.5, 0.3375, 0.446875, 0.5359375, 0.45, 0.5296875, 0.4546875, 0.425, 0.4921875, 0.54375, 0.2671875, 0.240625, 0.5390625, 0.25, 0.815625, 0.5375, 0.5234375, 0.5390625, 0.5421875, 0.365625, 0.36875, 0.35625, 0.5171875, 0.5015625, 0.75, 0.5, 0.509375, 0.44375, 0.2421875, 0.14375, 0.2421875, 0.35],
9537
10097
  avg: 0.5116447368421051
9538
10098
  },
10099
+ "Inter": {
10100
+ widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2796875, 0.2890625, 0.4671875, 0.634375, 0.6421875, 0.9828125, 0.6453125, 0.3, 0.365625, 0.365625, 0.5015625, 0.6625, 0.2890625, 0.4609375, 0.2890625, 0.3609375, 0.63125, 0.4078125, 0.6109375, 0.61875, 0.646875, 0.59375, 0.6203125, 0.5671875, 0.61875, 0.6203125, 0.2890625, 0.303125, 0.6625, 0.6625, 0.6625, 0.5125, 0.9671875, 0.690625, 0.6546875, 0.73125, 0.721875, 0.6015625, 0.590625, 0.746875, 0.74375, 0.26875, 0.571875, 0.671875, 0.565625, 0.9046875, 0.7546875, 0.765625, 0.6390625, 0.765625, 0.64375, 0.6421875, 0.646875, 0.7453125, 0.690625, 0.9859375, 0.6828125, 0.6796875, 0.6296875, 0.365625, 0.3609375, 0.365625, 0.471875, 0.45625, 0.3234375, 0.5625, 0.6125, 0.571875, 0.6125, 0.584375, 0.3703125, 0.6140625, 0.5921875, 0.2421875, 0.2548828125, 0.55, 0.2421875, 0.8765625, 0.5921875, 0.6, 0.6125, 0.6125, 0.3765625, 0.528125, 0.328125, 0.5921875, 0.5625, 0.81875, 0.546875, 0.5625, 0.553125, 0.4265625, 0.3328125, 0.4265625, 0.6625],
10101
+ avg: 0.5624362664473683
10102
+ },
9539
10103
  "Montserrat": {
9540
10104
  widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2625, 0.2609375, 0.3734375, 0.696875, 0.615625, 0.8296875, 0.6703125, 0.203125, 0.3296875, 0.3296875, 0.3875, 0.575, 0.2125, 0.3828125, 0.2125, 0.3953125, 0.6625, 0.3625, 0.56875, 0.5640625, 0.6625, 0.5671875, 0.609375, 0.5890625, 0.6390625, 0.609375, 0.2125, 0.2125, 0.575, 0.575, 0.575, 0.5671875, 1.034375, 0.7171875, 0.7546875, 0.7203125, 0.8265625, 0.6703125, 0.634375, 0.7734375, 0.8140625, 0.303125, 0.5078125, 0.7125, 0.5890625, 0.95625, 0.8140625, 0.8390625, 0.71875, 0.8390625, 0.7234375, 0.615625, 0.575, 0.7921875, 0.6984375, 1.1125, 0.65625, 0.6359375, 0.6515625, 0.31875, 0.396875, 0.31875, 0.5765625, 0.5, 0.6, 0.590625, 0.678125, 0.5640625, 0.678125, 0.6046875, 0.375, 0.6875, 0.678125, 0.2703125, 0.365625, 0.6015625, 0.2703125, 1.0625, 0.678125, 0.628125, 0.678125, 0.678125, 0.4015625, 0.4890625, 0.40625, 0.6734375, 0.5421875, 0.8796875, 0.534375, 0.5671875, 0.5125, 0.334375, 0.2953125, 0.334375, 0.575],
9541
10105
  avg: 0.571792763157895