victory-area 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.
@@ -6220,31 +6220,34 @@ __webpack_require__.r(__webpack_exports__);
6220
6220
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6221
6221
  /* harmony export */ "VictoryPortal": function() { return /* binding */ VictoryPortal; }
6222
6222
  /* harmony export */ });
6223
- /* 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");
6224
- /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
6225
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
6226
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
6227
- /* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
6228
- /* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
6229
- /* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
6223
+ /* 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");
6224
+ /* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0__);
6225
+ /* 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");
6226
+ /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
6227
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
6228
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
6229
+ /* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
6230
+ /* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
6231
+ /* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
6232
+
6230
6233
 
6231
6234
 
6232
6235
 
6233
6236
 
6234
6237
 
6235
6238
  const defaultProps = {
6236
- groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("g", null)
6239
+ groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement("g", null)
6237
6240
  };
6238
6241
  const VictoryPortal = initialProps => {
6239
6242
  const props = {
6240
6243
  ...defaultProps,
6241
6244
  ...initialProps
6242
6245
  };
6243
- const id = react__WEBPACK_IMPORTED_MODULE_1___default().useId();
6244
- const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_2__.usePortalContext)();
6246
+ const id = lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default()();
6247
+ const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_3__.usePortalContext)();
6245
6248
  if (!portalContext) {
6246
6249
  const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
6247
- _victory_util_log__WEBPACK_IMPORTED_MODULE_3__.warn(msg);
6250
+ _victory_util_log__WEBPACK_IMPORTED_MODULE_4__.warn(msg);
6248
6251
  }
6249
6252
  const children = Array.isArray(props.children) ? props.children[0] : props.children;
6250
6253
  const {
@@ -6255,15 +6258,15 @@ const VictoryPortal = initialProps => {
6255
6258
  groupComponent,
6256
6259
  standalone: false
6257
6260
  } : {};
6258
- const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.omit(props, ["children", "groupComponent"]), {
6261
+ const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__.omit(props, ["children", "groupComponent"]), {
6259
6262
  key: childProps.key ?? id
6260
6263
  });
6261
- const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(children, newProps);
6262
- react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
6264
+ const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().cloneElement(children, newProps);
6265
+ react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
6263
6266
  portalContext?.addChild(id, child);
6264
6267
  // eslint-disable-next-line react-hooks/exhaustive-deps
6265
6268
  }, [props.children]);
6266
- react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
6269
+ react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
6267
6270
  return () => portalContext?.removeChild(id);
6268
6271
  // eslint-disable-next-line react-hooks/exhaustive-deps
6269
6272
  }, []);
@@ -6497,6 +6500,477 @@ const TSpan = props => {
6497
6500
 
6498
6501
  /***/ }),
6499
6502
 
6503
+ /***/ "../../victory-core/es/victory-theme/clean.js":
6504
+ /*!****************************************************!*\
6505
+ !*** ../../victory-core/es/victory-theme/clean.js ***!
6506
+ \****************************************************/
6507
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6508
+
6509
+ "use strict";
6510
+ __webpack_require__.r(__webpack_exports__);
6511
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6512
+ /* harmony export */ "clean": function() { return /* binding */ clean; }
6513
+ /* harmony export */ });
6514
+ // *
6515
+ // * Colors
6516
+ // *
6517
+
6518
+ const gray = {
6519
+ white: "#FFFFFF",
6520
+ "50": "#FAFAFA",
6521
+ "100": "#F2F2F2",
6522
+ "200": "#E8E8E8",
6523
+ "300": "#E0E0E0",
6524
+ "400": "#D1D1D1",
6525
+ "500": "#757575",
6526
+ "600": "#5C5C5C",
6527
+ "700": "#424242",
6528
+ "800": "#333333",
6529
+ "900": "#292929",
6530
+ black: "#0F0F0F"
6531
+ };
6532
+ const yellow = {
6533
+ "100": "#FFEAB6",
6534
+ "300": "#FFD66E",
6535
+ "500": "#FCB400",
6536
+ "900": "#B87503"
6537
+ };
6538
+ const orange = {
6539
+ "100": "#FEE2D5",
6540
+ "300": "#FFA981",
6541
+ "500": "#FF6F2C",
6542
+ "900": "#D74D26"
6543
+ };
6544
+ const red = {
6545
+ "100": "#FFDCE5",
6546
+ "300": "#FF9EB7",
6547
+ "500": "#F82B60",
6548
+ "900": "#BA1E45"
6549
+ };
6550
+ const pink = {
6551
+ "100": "#FFDAF6",
6552
+ "300": "#F99DE2",
6553
+ "500": "#FF08C2",
6554
+ "900": "#B2158B"
6555
+ };
6556
+ const purple = {
6557
+ "100": "#EDE3FE",
6558
+ "300": "#CDB0FF",
6559
+ "500": "#8B46FF",
6560
+ "900": "#6B1CB0"
6561
+ };
6562
+ const blue = {
6563
+ "100": "#CFDFFF",
6564
+ "300": "#9CC7FF",
6565
+ "500": "#2D7FF9",
6566
+ "900": "#2750AE"
6567
+ };
6568
+ const cyan = {
6569
+ "100": "#D0F0FD",
6570
+ "300": "#77D1F3",
6571
+ "500": "#18BFFF",
6572
+ "900": "#0B76B7"
6573
+ };
6574
+ const teal = {
6575
+ "100": "#C2F5E9",
6576
+ "300": "#72DDC3",
6577
+ "500": "#20D9D2",
6578
+ "900": "#06A09B"
6579
+ };
6580
+ const green = {
6581
+ "100": "#D1F7C4",
6582
+ "300": "#93E088",
6583
+ "500": "#20C933",
6584
+ "900": "#338A17"
6585
+ };
6586
+ const colors = {
6587
+ blue: blue["500"],
6588
+ pink: pink["500"],
6589
+ teal: teal["500"],
6590
+ purple: purple["500"],
6591
+ green: green["500"],
6592
+ orange: orange["500"],
6593
+ cyan: cyan["500"],
6594
+ red: red["500"],
6595
+ yellow: yellow["500"]
6596
+ };
6597
+ const colorScale = Object.values(colors);
6598
+ const grayscale = [gray["200"], gray["400"], gray["600"], gray["900"]];
6599
+ const warm = [yellow["500"], orange["500"], red["500"], pink["500"]];
6600
+ const cool = [cyan["500"], teal["500"], blue["500"], purple["500"]];
6601
+ const heatmap = [green["500"], yellow["500"], red["500"]];
6602
+ const redPalette = [red["500"], red["300"], red["100"]];
6603
+ const greenPalette = [green["500"], green["300"], green["100"]];
6604
+ const bluePalette = [blue["500"], blue["300"], blue["100"]];
6605
+
6606
+ // *
6607
+ // * Typography
6608
+ // *
6609
+ const sansSerif = "'Inter', 'Helvetica Neue', 'Seravek', 'Helvetica', sans-serif";
6610
+ const letterSpacing = "normal";
6611
+ const fontSize = 12;
6612
+ // *
6613
+ // * Layout
6614
+ // *
6615
+ const padding = 8;
6616
+ const baseProps = {
6617
+ width: 450,
6618
+ height: 300,
6619
+ padding: 50,
6620
+ colorScale
6621
+ };
6622
+ // *
6623
+ // * Labels
6624
+ // *
6625
+ const baseLabelStyles = {
6626
+ fontFamily: sansSerif,
6627
+ fontSize,
6628
+ fontWeight: 300,
6629
+ letterSpacing,
6630
+ padding,
6631
+ fill: gray["900"],
6632
+ stroke: "transparent"
6633
+ };
6634
+ const centeredLabelStyles = Object.assign({
6635
+ textAnchor: "middle"
6636
+ }, baseLabelStyles);
6637
+
6638
+ // *
6639
+ // * Strokes
6640
+ // *
6641
+ const strokeDasharray = "10, 5";
6642
+ const strokeLinecap = "round";
6643
+ const strokeLinejoin = "round";
6644
+ const borderRadius = 1;
6645
+ // *
6646
+ // * Theme
6647
+ // *
6648
+ const clean = {
6649
+ palette: {
6650
+ colors,
6651
+ grayscale,
6652
+ qualitative: colorScale,
6653
+ heatmap,
6654
+ warm,
6655
+ cool,
6656
+ red: redPalette,
6657
+ green: greenPalette,
6658
+ blue: bluePalette
6659
+ },
6660
+ area: Object.assign({
6661
+ style: {
6662
+ data: {
6663
+ fill: blue["500"],
6664
+ strokeWidth: 2,
6665
+ fillOpacity: 0.5
6666
+ },
6667
+ labels: baseLabelStyles
6668
+ }
6669
+ }, baseProps),
6670
+ axis: Object.assign({
6671
+ style: {
6672
+ axis: {
6673
+ fill: "transparent",
6674
+ stroke: gray["500"],
6675
+ strokeWidth: 1,
6676
+ strokeLinecap,
6677
+ strokeLinejoin
6678
+ },
6679
+ axisLabel: Object.assign({}, centeredLabelStyles, {
6680
+ padding,
6681
+ stroke: "transparent"
6682
+ }),
6683
+ grid: {
6684
+ fill: "none",
6685
+ stroke: "none",
6686
+ painterEvents: "painted"
6687
+ },
6688
+ ticks: {
6689
+ fill: "transparent",
6690
+ size: 5,
6691
+ stroke: "transparent"
6692
+ },
6693
+ tickLabels: baseLabelStyles
6694
+ }
6695
+ }, baseProps),
6696
+ polarAxis: Object.assign({
6697
+ style: {
6698
+ axis: {
6699
+ stroke: gray["500"]
6700
+ },
6701
+ grid: {
6702
+ stroke: gray["400"],
6703
+ strokeDasharray,
6704
+ strokeLinecap,
6705
+ strokeLinejoin,
6706
+ pointerEvents: "painted"
6707
+ },
6708
+ ticks: {
6709
+ fill: "transparent",
6710
+ size: 5,
6711
+ stroke: gray["400"],
6712
+ strokeWidth: 1,
6713
+ strokeLinecap,
6714
+ strokeLinejoin
6715
+ },
6716
+ tickLabels: baseLabelStyles
6717
+ }
6718
+ }),
6719
+ polarDependentAxis: Object.assign({
6720
+ style: {
6721
+ axis: {
6722
+ stroke: gray["500"]
6723
+ },
6724
+ grid: {
6725
+ stroke: gray["400"],
6726
+ strokeDasharray,
6727
+ strokeLinecap,
6728
+ strokeLinejoin,
6729
+ pointerEvents: "painted"
6730
+ },
6731
+ ticks: {
6732
+ fill: "transparent",
6733
+ size: 5,
6734
+ stroke: gray["300"],
6735
+ strokeWidth: 1,
6736
+ strokeLinecap,
6737
+ strokeLinejoin
6738
+ },
6739
+ tickLabels: baseLabelStyles
6740
+ }
6741
+ }),
6742
+ bar: Object.assign({
6743
+ style: {
6744
+ data: {
6745
+ fill: blue["500"],
6746
+ padding,
6747
+ strokeWidth: 1,
6748
+ fillOpacity: 0.5
6749
+ },
6750
+ labels: baseLabelStyles
6751
+ },
6752
+ cornerRadius: {
6753
+ top: borderRadius
6754
+ }
6755
+ }, baseProps),
6756
+ boxplot: Object.assign({
6757
+ style: {
6758
+ max: {
6759
+ padding,
6760
+ stroke: gray["400"],
6761
+ strokeWidth: 2
6762
+ },
6763
+ maxLabels: Object.assign({}, baseLabelStyles, {
6764
+ padding: 3
6765
+ }),
6766
+ median: {
6767
+ padding,
6768
+ stroke: gray.white,
6769
+ strokeWidth: 2
6770
+ },
6771
+ medianLabels: Object.assign({}, baseLabelStyles, {
6772
+ padding: 3
6773
+ }),
6774
+ min: {
6775
+ padding,
6776
+ stroke: gray["400"],
6777
+ strokeWidth: 2
6778
+ },
6779
+ minLabels: Object.assign({}, baseLabelStyles, {
6780
+ padding: 3
6781
+ }),
6782
+ q1: {
6783
+ padding,
6784
+ fill: teal["500"],
6785
+ rx: borderRadius,
6786
+ strokeWidth: 2
6787
+ },
6788
+ q1Labels: Object.assign({}, baseLabelStyles, {
6789
+ padding: 3
6790
+ }),
6791
+ q3: {
6792
+ padding,
6793
+ fill: cyan["500"],
6794
+ rx: borderRadius
6795
+ },
6796
+ q3Labels: Object.assign({}, baseLabelStyles, {
6797
+ padding: 3
6798
+ })
6799
+ },
6800
+ boxWidth: 20
6801
+ }, baseProps),
6802
+ candlestick: Object.assign({
6803
+ style: {
6804
+ data: {
6805
+ stroke: gray["300"],
6806
+ strokeWidth: 0,
6807
+ rx: borderRadius
6808
+ },
6809
+ labels: Object.assign({}, baseLabelStyles, {
6810
+ padding: 5
6811
+ })
6812
+ },
6813
+ candleColors: {
6814
+ positive: teal["500"],
6815
+ negative: orange["500"]
6816
+ },
6817
+ wickStrokeWidth: 2
6818
+ }, baseProps),
6819
+ chart: baseProps,
6820
+ errorbar: Object.assign({
6821
+ borderWidth: 8,
6822
+ style: {
6823
+ data: {
6824
+ fill: "transparent",
6825
+ opacity: 1,
6826
+ stroke: gray["700"],
6827
+ strokeWidth: 2,
6828
+ strokeLinecap
6829
+ },
6830
+ labels: baseLabelStyles
6831
+ }
6832
+ }, baseProps),
6833
+ group: Object.assign({
6834
+ colorScale
6835
+ }, baseProps),
6836
+ histogram: Object.assign({
6837
+ style: {
6838
+ data: {
6839
+ fill: cyan["500"],
6840
+ fillOpacity: 0.5
6841
+ },
6842
+ labels: baseLabelStyles
6843
+ },
6844
+ binSpacing: 4,
6845
+ cornerRadius: {
6846
+ top: borderRadius
6847
+ }
6848
+ }, baseProps),
6849
+ label: baseLabelStyles,
6850
+ legend: {
6851
+ colorScale,
6852
+ gutter: 24,
6853
+ borderPadding: 10,
6854
+ orientation: "horizontal",
6855
+ titleOrientation: "top",
6856
+ centerTitle: true,
6857
+ style: {
6858
+ data: {
6859
+ type: "circle"
6860
+ },
6861
+ labels: {
6862
+ ...baseLabelStyles,
6863
+ fontSize: 12
6864
+ },
6865
+ title: Object.assign({}, baseLabelStyles, {
6866
+ padding,
6867
+ fontSize: 16
6868
+ }),
6869
+ border: {
6870
+ stroke: gray["200"],
6871
+ strokeWidth: 2,
6872
+ padding: 16
6873
+ }
6874
+ }
6875
+ },
6876
+ line: Object.assign({
6877
+ style: {
6878
+ data: {
6879
+ fill: "transparent",
6880
+ opacity: 1,
6881
+ stroke: blue["500"],
6882
+ strokeWidth: 2,
6883
+ strokeLinecap,
6884
+ strokeLinejoin
6885
+ },
6886
+ labels: baseLabelStyles
6887
+ }
6888
+ }, baseProps),
6889
+ pie: Object.assign({
6890
+ style: {
6891
+ parent: {
6892
+ backgroundColor: gray.white
6893
+ },
6894
+ data: {
6895
+ padding,
6896
+ stroke: gray.white,
6897
+ strokeWidth: 1
6898
+ },
6899
+ labels: {
6900
+ ...baseLabelStyles,
6901
+ padding: 20,
6902
+ fill: gray["600"],
6903
+ fontSize: 10
6904
+ }
6905
+ },
6906
+ colorScale,
6907
+ cornerRadius: borderRadius
6908
+ }, baseProps),
6909
+ scatter: Object.assign({
6910
+ style: {
6911
+ data: {
6912
+ fill: purple["500"],
6913
+ opacity: 1,
6914
+ stroke: "transparent",
6915
+ strokeWidth: 0
6916
+ },
6917
+ labels: {
6918
+ ...baseLabelStyles,
6919
+ padding: 20
6920
+ }
6921
+ }
6922
+ }, baseProps),
6923
+ stack: Object.assign({
6924
+ colorScale
6925
+ }, baseProps),
6926
+ tooltip: {
6927
+ style: Object.assign({}, baseLabelStyles, {
6928
+ padding: 0,
6929
+ pointerEvents: "none"
6930
+ }),
6931
+ flyoutStyle: {
6932
+ stroke: gray["300"],
6933
+ strokeWidth: 2,
6934
+ fill: gray.white,
6935
+ pointerEvents: "none"
6936
+ },
6937
+ flyoutPadding: {
6938
+ top: 8,
6939
+ bottom: 8,
6940
+ left: 16,
6941
+ right: 16
6942
+ },
6943
+ cornerRadius: borderRadius,
6944
+ pointerLength: 4
6945
+ },
6946
+ voronoi: Object.assign({
6947
+ style: {
6948
+ data: {
6949
+ fill: blue["100"],
6950
+ stroke: blue["500"],
6951
+ strokeWidth: 2,
6952
+ opacity: 0.4
6953
+ },
6954
+ labels: Object.assign({}, baseLabelStyles, {
6955
+ padding: 5,
6956
+ pointerEvents: "none"
6957
+ }),
6958
+ flyout: {
6959
+ stroke: gray["900"],
6960
+ strokeWidth: 1,
6961
+ fill: gray["100"],
6962
+ pointerEvents: "none"
6963
+ },
6964
+ padding: {
6965
+ left: 2,
6966
+ bottom: 2
6967
+ }
6968
+ }
6969
+ }, baseProps)
6970
+ };
6971
+
6972
+ /***/ }),
6973
+
6500
6974
  /***/ "../../victory-core/es/victory-theme/grayscale.js":
6501
6975
  /*!********************************************************!*\
6502
6976
  !*** ../../victory-core/es/victory-theme/grayscale.js ***!
@@ -6511,9 +6985,28 @@ __webpack_require__.r(__webpack_exports__);
6511
6985
  // *
6512
6986
  // * Colors
6513
6987
  // *
6514
- const colors = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
6988
+ const colors = {
6989
+ blue: "#4F7DA1",
6990
+ pink: "#E2A37F",
6991
+ teal: "#00796B",
6992
+ purple: "#DF948A",
6993
+ green: "#8BC34A",
6994
+ orange: "#F4511E",
6995
+ cyan: "#006064",
6996
+ red: "#DF5A49",
6997
+ yellow: "#FFF59D"
6998
+ };
6999
+ const colorScale = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
6515
7000
  const charcoal = "#252525";
6516
7001
  const grey = "#969696";
7002
+ const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
7003
+ const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
7004
+ const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
7005
+ const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
7006
+ const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
7007
+ const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
7008
+ const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
7009
+
6517
7010
  // *
6518
7011
  // * Typography
6519
7012
  // *
@@ -6527,7 +7020,7 @@ const baseProps = {
6527
7020
  width: 450,
6528
7021
  height: 300,
6529
7022
  padding: 50,
6530
- colorScale: colors
7023
+ colorScale
6531
7024
  };
6532
7025
  // *
6533
7026
  // * Labels
@@ -6549,6 +7042,17 @@ const centeredLabelStyles = Object.assign({
6549
7042
  const strokeLinecap = "round";
6550
7043
  const strokeLinejoin = "round";
6551
7044
  const grayscale = {
7045
+ palette: {
7046
+ colors,
7047
+ grayscale: colorScale,
7048
+ qualitative,
7049
+ heatmap,
7050
+ warm,
7051
+ cool,
7052
+ red,
7053
+ green,
7054
+ blue
7055
+ },
6552
7056
  area: Object.assign({
6553
7057
  style: {
6554
7058
  data: {
@@ -6663,7 +7167,7 @@ const grayscale = {
6663
7167
  }
6664
7168
  }, baseProps),
6665
7169
  group: Object.assign({
6666
- colorScale: colors
7170
+ colorScale
6667
7171
  }, baseProps),
6668
7172
  histogram: Object.assign({
6669
7173
  style: {
@@ -6676,7 +7180,7 @@ const grayscale = {
6676
7180
  }
6677
7181
  }, baseProps),
6678
7182
  legend: {
6679
- colorScale: colors,
7183
+ colorScale,
6680
7184
  gutter: 10,
6681
7185
  orientation: "vertical",
6682
7186
  titleOrientation: "top",
@@ -6711,7 +7215,7 @@ const grayscale = {
6711
7215
  padding: 20
6712
7216
  })
6713
7217
  },
6714
- colorScale: colors,
7218
+ colorScale,
6715
7219
  width: 400,
6716
7220
  height: 400,
6717
7221
  padding: 50
@@ -6727,7 +7231,7 @@ const grayscale = {
6727
7231
  }
6728
7232
  }, baseProps),
6729
7233
  stack: Object.assign({
6730
- colorScale: colors
7234
+ colorScale
6731
7235
  }, baseProps),
6732
7236
  tooltip: {
6733
7237
  style: Object.assign({}, baseLabelStyles, {
@@ -6787,11 +7291,31 @@ const lime300 = "#DCE775";
6787
7291
  const lightGreen500 = "#8BC34A";
6788
7292
  const teal700 = "#00796B";
6789
7293
  const cyan900 = "#006064";
6790
- const colors = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
7294
+ const colorScale = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
6791
7295
  const blueGrey50 = "#ECEFF1";
6792
7296
  const blueGrey300 = "#90A4AE";
6793
7297
  const blueGrey700 = "#455A64";
6794
7298
  const grey900 = "#212121";
7299
+ const colors = {
7300
+ blue: "#4F7DA1",
7301
+ pink: "#E2A37F",
7302
+ teal: teal700,
7303
+ purple: "#DF948A",
7304
+ green: lightGreen500,
7305
+ orange: deepOrange600,
7306
+ cyan: cyan900,
7307
+ red: "#DF5A49",
7308
+ yellow: yellow200
7309
+ };
7310
+ const grayscale = [blueGrey50, blueGrey300, blueGrey700, grey900];
7311
+ const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
7312
+ const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
7313
+ const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
7314
+ const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
7315
+ const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
7316
+ const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
7317
+ const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
7318
+
6795
7319
  // *
6796
7320
  // * Typography
6797
7321
  // *
@@ -6829,6 +7353,17 @@ const strokeDasharray = "10, 5";
6829
7353
  const strokeLinecap = "round";
6830
7354
  const strokeLinejoin = "round";
6831
7355
  const material = {
7356
+ palette: {
7357
+ colors,
7358
+ grayscale,
7359
+ qualitative,
7360
+ heatmap,
7361
+ warm,
7362
+ cool,
7363
+ red,
7364
+ green,
7365
+ blue
7366
+ },
6832
7367
  area: Object.assign({
6833
7368
  style: {
6834
7369
  data: {
@@ -6961,7 +7496,7 @@ const material = {
6961
7496
  }
6962
7497
  }, baseProps),
6963
7498
  group: Object.assign({
6964
- colorScale: colors
7499
+ colorScale
6965
7500
  }, baseProps),
6966
7501
  histogram: Object.assign({
6967
7502
  style: {
@@ -6974,7 +7509,7 @@ const material = {
6974
7509
  }
6975
7510
  }, baseProps),
6976
7511
  legend: {
6977
- colorScale: colors,
7512
+ colorScale,
6978
7513
  gutter: 10,
6979
7514
  orientation: "vertical",
6980
7515
  titleOrientation: "top",
@@ -7000,7 +7535,7 @@ const material = {
7000
7535
  }
7001
7536
  }, baseProps),
7002
7537
  pie: Object.assign({
7003
- colorScale: colors,
7538
+ colorScale,
7004
7539
  style: {
7005
7540
  data: {
7006
7541
  padding,
@@ -7024,7 +7559,7 @@ const material = {
7024
7559
  }
7025
7560
  }, baseProps),
7026
7561
  stack: Object.assign({
7027
- colorScale: colors
7562
+ colorScale
7028
7563
  }, baseProps),
7029
7564
  tooltip: {
7030
7565
  style: Object.assign({}, baseLabelStyles, {
@@ -7077,12 +7612,15 @@ __webpack_require__.r(__webpack_exports__);
7077
7612
  /* harmony export */ });
7078
7613
  /* harmony import */ var _grayscale__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./grayscale */ "../../victory-core/es/victory-theme/grayscale.js");
7079
7614
  /* harmony import */ var _material__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./material */ "../../victory-core/es/victory-theme/material.js");
7615
+ /* harmony import */ var _clean__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./clean */ "../../victory-core/es/victory-theme/clean.js");
7616
+
7080
7617
 
7081
7618
 
7082
7619
 
7083
7620
  const VictoryTheme = {
7084
7621
  grayscale: _grayscale__WEBPACK_IMPORTED_MODULE_0__.grayscale,
7085
- material: _material__WEBPACK_IMPORTED_MODULE_1__.material
7622
+ material: _material__WEBPACK_IMPORTED_MODULE_1__.material,
7623
+ clean: _clean__WEBPACK_IMPORTED_MODULE_2__.clean
7086
7624
  };
7087
7625
 
7088
7626
  /***/ }),
@@ -10053,6 +10591,9 @@ __webpack_require__.r(__webpack_exports__);
10053
10591
  /* harmony export */ "getColorScale": function() { return /* binding */ getColorScale; },
10054
10592
  /* harmony export */ "toTransformString": function() { return /* binding */ toTransformString; }
10055
10593
  /* harmony export */ });
10594
+ /* 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");
10595
+
10596
+
10056
10597
  /**
10057
10598
  * Given an object with CSS/SVG transform definitions, return the string value
10058
10599
  * for use with the `transform` CSS property or SVG attribute. Note that we
@@ -10089,20 +10630,37 @@ const toTransformString = function (obj) {
10089
10630
  * of 5 hex string values in that color scale. If no 'name' parameter
10090
10631
  * is given, it will return the Victory default grayscale.
10091
10632
  * @param {String} name The name of the color scale to return (optional).
10633
+ * @param {Object} theme The theme object to retrieve the color scale from (optional).
10092
10634
  * @returns {Array} An array of 5 hex string values composing a color scale.
10093
10635
  */
10094
- function getColorScale(name) {
10636
+ function getColorScale(name, theme) {
10637
+ if (theme === void 0) {
10638
+ theme = _victory_theme_victory_theme__WEBPACK_IMPORTED_MODULE_0__.VictoryTheme.material;
10639
+ }
10640
+ const {
10641
+ palette: {
10642
+ grayscale = ["#cccccc", "#969696", "#636363", "#252525"],
10643
+ qualitative = [],
10644
+ heatmap = [],
10645
+ warm = [],
10646
+ cool = [],
10647
+ red = [],
10648
+ blue = [],
10649
+ green = []
10650
+ } = {}
10651
+ } = theme;
10095
10652
  const scales = {
10096
- grayscale: ["#cccccc", "#969696", "#636363", "#252525"],
10097
- qualitative: ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"],
10098
- heatmap: ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"],
10099
- warm: ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"],
10100
- cool: ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"],
10101
- red: ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"],
10102
- blue: ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"],
10103
- green: ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"]
10653
+ grayscale,
10654
+ qualitative,
10655
+ heatmap,
10656
+ warm,
10657
+ cool,
10658
+ red,
10659
+ blue,
10660
+ green
10104
10661
  };
10105
- return name ? scales[name] : scales.grayscale;
10662
+ const selectedScale = name && scales[name]?.length ? scales[name] : scales.grayscale;
10663
+ return selectedScale;
10106
10664
  }
10107
10665
 
10108
10666
  /***/ }),
@@ -10129,6 +10687,7 @@ __webpack_require__.r(__webpack_exports__);
10129
10687
  /* eslint-disable no-magic-numbers */
10130
10688
  // Based on measuring specific character widths
10131
10689
  // as in the following example https://bl.ocks.org/tophtucker/62f93a4658387bb61e4510c37e2e97cf
10690
+ // For new fonts: pull gist, open index.html locally, add font files (if not generic), enter font name in `font-family` input
10132
10691
  // prettier-ignore
10133
10692
  const fonts = {
10134
10693
  "American Typewriter": {
@@ -10187,6 +10746,10 @@ const fonts = {
10187
10746
  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],
10188
10747
  avg: 0.5116447368421051
10189
10748
  },
10749
+ "Inter": {
10750
+ 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],
10751
+ avg: 0.5624362664473683
10752
+ },
10190
10753
  "Montserrat": {
10191
10754
  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],
10192
10755
  avg: 0.571792763157895