victory-errorbar 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.
@@ -6292,31 +6292,34 @@ __webpack_require__.r(__webpack_exports__);
6292
6292
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6293
6293
  /* harmony export */ "VictoryPortal": function() { return /* binding */ VictoryPortal; }
6294
6294
  /* harmony export */ });
6295
- /* 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");
6296
- /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
6297
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
6298
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
6299
- /* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
6300
- /* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
6301
- /* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
6295
+ /* 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");
6296
+ /* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0__);
6297
+ /* 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");
6298
+ /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
6299
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
6300
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
6301
+ /* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
6302
+ /* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
6303
+ /* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
6304
+
6302
6305
 
6303
6306
 
6304
6307
 
6305
6308
 
6306
6309
 
6307
6310
  const defaultProps = {
6308
- groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("g", null)
6311
+ groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement("g", null)
6309
6312
  };
6310
6313
  const VictoryPortal = initialProps => {
6311
6314
  const props = {
6312
6315
  ...defaultProps,
6313
6316
  ...initialProps
6314
6317
  };
6315
- const id = react__WEBPACK_IMPORTED_MODULE_1___default().useId();
6316
- const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_2__.usePortalContext)();
6318
+ const id = lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default()();
6319
+ const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_3__.usePortalContext)();
6317
6320
  if (!portalContext) {
6318
6321
  const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
6319
- _victory_util_log__WEBPACK_IMPORTED_MODULE_3__.warn(msg);
6322
+ _victory_util_log__WEBPACK_IMPORTED_MODULE_4__.warn(msg);
6320
6323
  }
6321
6324
  const children = Array.isArray(props.children) ? props.children[0] : props.children;
6322
6325
  const {
@@ -6327,15 +6330,15 @@ const VictoryPortal = initialProps => {
6327
6330
  groupComponent,
6328
6331
  standalone: false
6329
6332
  } : {};
6330
- const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.omit(props, ["children", "groupComponent"]), {
6333
+ const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__.omit(props, ["children", "groupComponent"]), {
6331
6334
  key: childProps.key ?? id
6332
6335
  });
6333
- const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(children, newProps);
6334
- react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
6336
+ const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().cloneElement(children, newProps);
6337
+ react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
6335
6338
  portalContext?.addChild(id, child);
6336
6339
  // eslint-disable-next-line react-hooks/exhaustive-deps
6337
6340
  }, [props.children]);
6338
- react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
6341
+ react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
6339
6342
  return () => portalContext?.removeChild(id);
6340
6343
  // eslint-disable-next-line react-hooks/exhaustive-deps
6341
6344
  }, []);
@@ -6507,6 +6510,477 @@ const TSpan = props => {
6507
6510
 
6508
6511
  /***/ }),
6509
6512
 
6513
+ /***/ "../../victory-core/es/victory-theme/clean.js":
6514
+ /*!****************************************************!*\
6515
+ !*** ../../victory-core/es/victory-theme/clean.js ***!
6516
+ \****************************************************/
6517
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6518
+
6519
+ "use strict";
6520
+ __webpack_require__.r(__webpack_exports__);
6521
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6522
+ /* harmony export */ "clean": function() { return /* binding */ clean; }
6523
+ /* harmony export */ });
6524
+ // *
6525
+ // * Colors
6526
+ // *
6527
+
6528
+ const gray = {
6529
+ white: "#FFFFFF",
6530
+ "50": "#FAFAFA",
6531
+ "100": "#F2F2F2",
6532
+ "200": "#E8E8E8",
6533
+ "300": "#E0E0E0",
6534
+ "400": "#D1D1D1",
6535
+ "500": "#757575",
6536
+ "600": "#5C5C5C",
6537
+ "700": "#424242",
6538
+ "800": "#333333",
6539
+ "900": "#292929",
6540
+ black: "#0F0F0F"
6541
+ };
6542
+ const yellow = {
6543
+ "100": "#FFEAB6",
6544
+ "300": "#FFD66E",
6545
+ "500": "#FCB400",
6546
+ "900": "#B87503"
6547
+ };
6548
+ const orange = {
6549
+ "100": "#FEE2D5",
6550
+ "300": "#FFA981",
6551
+ "500": "#FF6F2C",
6552
+ "900": "#D74D26"
6553
+ };
6554
+ const red = {
6555
+ "100": "#FFDCE5",
6556
+ "300": "#FF9EB7",
6557
+ "500": "#F82B60",
6558
+ "900": "#BA1E45"
6559
+ };
6560
+ const pink = {
6561
+ "100": "#FFDAF6",
6562
+ "300": "#F99DE2",
6563
+ "500": "#FF08C2",
6564
+ "900": "#B2158B"
6565
+ };
6566
+ const purple = {
6567
+ "100": "#EDE3FE",
6568
+ "300": "#CDB0FF",
6569
+ "500": "#8B46FF",
6570
+ "900": "#6B1CB0"
6571
+ };
6572
+ const blue = {
6573
+ "100": "#CFDFFF",
6574
+ "300": "#9CC7FF",
6575
+ "500": "#2D7FF9",
6576
+ "900": "#2750AE"
6577
+ };
6578
+ const cyan = {
6579
+ "100": "#D0F0FD",
6580
+ "300": "#77D1F3",
6581
+ "500": "#18BFFF",
6582
+ "900": "#0B76B7"
6583
+ };
6584
+ const teal = {
6585
+ "100": "#C2F5E9",
6586
+ "300": "#72DDC3",
6587
+ "500": "#20D9D2",
6588
+ "900": "#06A09B"
6589
+ };
6590
+ const green = {
6591
+ "100": "#D1F7C4",
6592
+ "300": "#93E088",
6593
+ "500": "#20C933",
6594
+ "900": "#338A17"
6595
+ };
6596
+ const colors = {
6597
+ blue: blue["500"],
6598
+ pink: pink["500"],
6599
+ teal: teal["500"],
6600
+ purple: purple["500"],
6601
+ green: green["500"],
6602
+ orange: orange["500"],
6603
+ cyan: cyan["500"],
6604
+ red: red["500"],
6605
+ yellow: yellow["500"]
6606
+ };
6607
+ const colorScale = Object.values(colors);
6608
+ const grayscale = [gray["200"], gray["400"], gray["600"], gray["900"]];
6609
+ const warm = [yellow["500"], orange["500"], red["500"], pink["500"]];
6610
+ const cool = [cyan["500"], teal["500"], blue["500"], purple["500"]];
6611
+ const heatmap = [green["500"], yellow["500"], red["500"]];
6612
+ const redPalette = [red["500"], red["300"], red["100"]];
6613
+ const greenPalette = [green["500"], green["300"], green["100"]];
6614
+ const bluePalette = [blue["500"], blue["300"], blue["100"]];
6615
+
6616
+ // *
6617
+ // * Typography
6618
+ // *
6619
+ const sansSerif = "'Inter', 'Helvetica Neue', 'Seravek', 'Helvetica', sans-serif";
6620
+ const letterSpacing = "normal";
6621
+ const fontSize = 12;
6622
+ // *
6623
+ // * Layout
6624
+ // *
6625
+ const padding = 8;
6626
+ const baseProps = {
6627
+ width: 450,
6628
+ height: 300,
6629
+ padding: 50,
6630
+ colorScale
6631
+ };
6632
+ // *
6633
+ // * Labels
6634
+ // *
6635
+ const baseLabelStyles = {
6636
+ fontFamily: sansSerif,
6637
+ fontSize,
6638
+ fontWeight: 300,
6639
+ letterSpacing,
6640
+ padding,
6641
+ fill: gray["900"],
6642
+ stroke: "transparent"
6643
+ };
6644
+ const centeredLabelStyles = Object.assign({
6645
+ textAnchor: "middle"
6646
+ }, baseLabelStyles);
6647
+
6648
+ // *
6649
+ // * Strokes
6650
+ // *
6651
+ const strokeDasharray = "10, 5";
6652
+ const strokeLinecap = "round";
6653
+ const strokeLinejoin = "round";
6654
+ const borderRadius = 1;
6655
+ // *
6656
+ // * Theme
6657
+ // *
6658
+ const clean = {
6659
+ palette: {
6660
+ colors,
6661
+ grayscale,
6662
+ qualitative: colorScale,
6663
+ heatmap,
6664
+ warm,
6665
+ cool,
6666
+ red: redPalette,
6667
+ green: greenPalette,
6668
+ blue: bluePalette
6669
+ },
6670
+ area: Object.assign({
6671
+ style: {
6672
+ data: {
6673
+ fill: blue["500"],
6674
+ strokeWidth: 2,
6675
+ fillOpacity: 0.5
6676
+ },
6677
+ labels: baseLabelStyles
6678
+ }
6679
+ }, baseProps),
6680
+ axis: Object.assign({
6681
+ style: {
6682
+ axis: {
6683
+ fill: "transparent",
6684
+ stroke: gray["500"],
6685
+ strokeWidth: 1,
6686
+ strokeLinecap,
6687
+ strokeLinejoin
6688
+ },
6689
+ axisLabel: Object.assign({}, centeredLabelStyles, {
6690
+ padding,
6691
+ stroke: "transparent"
6692
+ }),
6693
+ grid: {
6694
+ fill: "none",
6695
+ stroke: "none",
6696
+ painterEvents: "painted"
6697
+ },
6698
+ ticks: {
6699
+ fill: "transparent",
6700
+ size: 5,
6701
+ stroke: "transparent"
6702
+ },
6703
+ tickLabels: baseLabelStyles
6704
+ }
6705
+ }, baseProps),
6706
+ polarAxis: Object.assign({
6707
+ style: {
6708
+ axis: {
6709
+ stroke: gray["500"]
6710
+ },
6711
+ grid: {
6712
+ stroke: gray["400"],
6713
+ strokeDasharray,
6714
+ strokeLinecap,
6715
+ strokeLinejoin,
6716
+ pointerEvents: "painted"
6717
+ },
6718
+ ticks: {
6719
+ fill: "transparent",
6720
+ size: 5,
6721
+ stroke: gray["400"],
6722
+ strokeWidth: 1,
6723
+ strokeLinecap,
6724
+ strokeLinejoin
6725
+ },
6726
+ tickLabels: baseLabelStyles
6727
+ }
6728
+ }),
6729
+ polarDependentAxis: Object.assign({
6730
+ style: {
6731
+ axis: {
6732
+ stroke: gray["500"]
6733
+ },
6734
+ grid: {
6735
+ stroke: gray["400"],
6736
+ strokeDasharray,
6737
+ strokeLinecap,
6738
+ strokeLinejoin,
6739
+ pointerEvents: "painted"
6740
+ },
6741
+ ticks: {
6742
+ fill: "transparent",
6743
+ size: 5,
6744
+ stroke: gray["300"],
6745
+ strokeWidth: 1,
6746
+ strokeLinecap,
6747
+ strokeLinejoin
6748
+ },
6749
+ tickLabels: baseLabelStyles
6750
+ }
6751
+ }),
6752
+ bar: Object.assign({
6753
+ style: {
6754
+ data: {
6755
+ fill: blue["500"],
6756
+ padding,
6757
+ strokeWidth: 1,
6758
+ fillOpacity: 0.5
6759
+ },
6760
+ labels: baseLabelStyles
6761
+ },
6762
+ cornerRadius: {
6763
+ top: borderRadius
6764
+ }
6765
+ }, baseProps),
6766
+ boxplot: Object.assign({
6767
+ style: {
6768
+ max: {
6769
+ padding,
6770
+ stroke: gray["400"],
6771
+ strokeWidth: 2
6772
+ },
6773
+ maxLabels: Object.assign({}, baseLabelStyles, {
6774
+ padding: 3
6775
+ }),
6776
+ median: {
6777
+ padding,
6778
+ stroke: gray.white,
6779
+ strokeWidth: 2
6780
+ },
6781
+ medianLabels: Object.assign({}, baseLabelStyles, {
6782
+ padding: 3
6783
+ }),
6784
+ min: {
6785
+ padding,
6786
+ stroke: gray["400"],
6787
+ strokeWidth: 2
6788
+ },
6789
+ minLabels: Object.assign({}, baseLabelStyles, {
6790
+ padding: 3
6791
+ }),
6792
+ q1: {
6793
+ padding,
6794
+ fill: teal["500"],
6795
+ rx: borderRadius,
6796
+ strokeWidth: 2
6797
+ },
6798
+ q1Labels: Object.assign({}, baseLabelStyles, {
6799
+ padding: 3
6800
+ }),
6801
+ q3: {
6802
+ padding,
6803
+ fill: cyan["500"],
6804
+ rx: borderRadius
6805
+ },
6806
+ q3Labels: Object.assign({}, baseLabelStyles, {
6807
+ padding: 3
6808
+ })
6809
+ },
6810
+ boxWidth: 20
6811
+ }, baseProps),
6812
+ candlestick: Object.assign({
6813
+ style: {
6814
+ data: {
6815
+ stroke: gray["300"],
6816
+ strokeWidth: 0,
6817
+ rx: borderRadius
6818
+ },
6819
+ labels: Object.assign({}, baseLabelStyles, {
6820
+ padding: 5
6821
+ })
6822
+ },
6823
+ candleColors: {
6824
+ positive: teal["500"],
6825
+ negative: orange["500"]
6826
+ },
6827
+ wickStrokeWidth: 2
6828
+ }, baseProps),
6829
+ chart: baseProps,
6830
+ errorbar: Object.assign({
6831
+ borderWidth: 8,
6832
+ style: {
6833
+ data: {
6834
+ fill: "transparent",
6835
+ opacity: 1,
6836
+ stroke: gray["700"],
6837
+ strokeWidth: 2,
6838
+ strokeLinecap
6839
+ },
6840
+ labels: baseLabelStyles
6841
+ }
6842
+ }, baseProps),
6843
+ group: Object.assign({
6844
+ colorScale
6845
+ }, baseProps),
6846
+ histogram: Object.assign({
6847
+ style: {
6848
+ data: {
6849
+ fill: cyan["500"],
6850
+ fillOpacity: 0.5
6851
+ },
6852
+ labels: baseLabelStyles
6853
+ },
6854
+ binSpacing: 4,
6855
+ cornerRadius: {
6856
+ top: borderRadius
6857
+ }
6858
+ }, baseProps),
6859
+ label: baseLabelStyles,
6860
+ legend: {
6861
+ colorScale,
6862
+ gutter: 24,
6863
+ borderPadding: 10,
6864
+ orientation: "horizontal",
6865
+ titleOrientation: "top",
6866
+ centerTitle: true,
6867
+ style: {
6868
+ data: {
6869
+ type: "circle"
6870
+ },
6871
+ labels: {
6872
+ ...baseLabelStyles,
6873
+ fontSize: 12
6874
+ },
6875
+ title: Object.assign({}, baseLabelStyles, {
6876
+ padding,
6877
+ fontSize: 16
6878
+ }),
6879
+ border: {
6880
+ stroke: gray["200"],
6881
+ strokeWidth: 2,
6882
+ padding: 16
6883
+ }
6884
+ }
6885
+ },
6886
+ line: Object.assign({
6887
+ style: {
6888
+ data: {
6889
+ fill: "transparent",
6890
+ opacity: 1,
6891
+ stroke: blue["500"],
6892
+ strokeWidth: 2,
6893
+ strokeLinecap,
6894
+ strokeLinejoin
6895
+ },
6896
+ labels: baseLabelStyles
6897
+ }
6898
+ }, baseProps),
6899
+ pie: Object.assign({
6900
+ style: {
6901
+ parent: {
6902
+ backgroundColor: gray.white
6903
+ },
6904
+ data: {
6905
+ padding,
6906
+ stroke: gray.white,
6907
+ strokeWidth: 1
6908
+ },
6909
+ labels: {
6910
+ ...baseLabelStyles,
6911
+ padding: 20,
6912
+ fill: gray["600"],
6913
+ fontSize: 10
6914
+ }
6915
+ },
6916
+ colorScale,
6917
+ cornerRadius: borderRadius
6918
+ }, baseProps),
6919
+ scatter: Object.assign({
6920
+ style: {
6921
+ data: {
6922
+ fill: purple["500"],
6923
+ opacity: 1,
6924
+ stroke: "transparent",
6925
+ strokeWidth: 0
6926
+ },
6927
+ labels: {
6928
+ ...baseLabelStyles,
6929
+ padding: 20
6930
+ }
6931
+ }
6932
+ }, baseProps),
6933
+ stack: Object.assign({
6934
+ colorScale
6935
+ }, baseProps),
6936
+ tooltip: {
6937
+ style: Object.assign({}, baseLabelStyles, {
6938
+ padding: 0,
6939
+ pointerEvents: "none"
6940
+ }),
6941
+ flyoutStyle: {
6942
+ stroke: gray["300"],
6943
+ strokeWidth: 2,
6944
+ fill: gray.white,
6945
+ pointerEvents: "none"
6946
+ },
6947
+ flyoutPadding: {
6948
+ top: 8,
6949
+ bottom: 8,
6950
+ left: 16,
6951
+ right: 16
6952
+ },
6953
+ cornerRadius: borderRadius,
6954
+ pointerLength: 4
6955
+ },
6956
+ voronoi: Object.assign({
6957
+ style: {
6958
+ data: {
6959
+ fill: blue["100"],
6960
+ stroke: blue["500"],
6961
+ strokeWidth: 2,
6962
+ opacity: 0.4
6963
+ },
6964
+ labels: Object.assign({}, baseLabelStyles, {
6965
+ padding: 5,
6966
+ pointerEvents: "none"
6967
+ }),
6968
+ flyout: {
6969
+ stroke: gray["900"],
6970
+ strokeWidth: 1,
6971
+ fill: gray["100"],
6972
+ pointerEvents: "none"
6973
+ },
6974
+ padding: {
6975
+ left: 2,
6976
+ bottom: 2
6977
+ }
6978
+ }
6979
+ }, baseProps)
6980
+ };
6981
+
6982
+ /***/ }),
6983
+
6510
6984
  /***/ "../../victory-core/es/victory-theme/grayscale.js":
6511
6985
  /*!********************************************************!*\
6512
6986
  !*** ../../victory-core/es/victory-theme/grayscale.js ***!
@@ -6521,9 +6995,28 @@ __webpack_require__.r(__webpack_exports__);
6521
6995
  // *
6522
6996
  // * Colors
6523
6997
  // *
6524
- const colors = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
6998
+ const colors = {
6999
+ blue: "#4F7DA1",
7000
+ pink: "#E2A37F",
7001
+ teal: "#00796B",
7002
+ purple: "#DF948A",
7003
+ green: "#8BC34A",
7004
+ orange: "#F4511E",
7005
+ cyan: "#006064",
7006
+ red: "#DF5A49",
7007
+ yellow: "#FFF59D"
7008
+ };
7009
+ const colorScale = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
6525
7010
  const charcoal = "#252525";
6526
7011
  const grey = "#969696";
7012
+ const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
7013
+ const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
7014
+ const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
7015
+ const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
7016
+ const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
7017
+ const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
7018
+ const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
7019
+
6527
7020
  // *
6528
7021
  // * Typography
6529
7022
  // *
@@ -6537,7 +7030,7 @@ const baseProps = {
6537
7030
  width: 450,
6538
7031
  height: 300,
6539
7032
  padding: 50,
6540
- colorScale: colors
7033
+ colorScale
6541
7034
  };
6542
7035
  // *
6543
7036
  // * Labels
@@ -6559,6 +7052,17 @@ const centeredLabelStyles = Object.assign({
6559
7052
  const strokeLinecap = "round";
6560
7053
  const strokeLinejoin = "round";
6561
7054
  const grayscale = {
7055
+ palette: {
7056
+ colors,
7057
+ grayscale: colorScale,
7058
+ qualitative,
7059
+ heatmap,
7060
+ warm,
7061
+ cool,
7062
+ red,
7063
+ green,
7064
+ blue
7065
+ },
6562
7066
  area: Object.assign({
6563
7067
  style: {
6564
7068
  data: {
@@ -6673,7 +7177,7 @@ const grayscale = {
6673
7177
  }
6674
7178
  }, baseProps),
6675
7179
  group: Object.assign({
6676
- colorScale: colors
7180
+ colorScale
6677
7181
  }, baseProps),
6678
7182
  histogram: Object.assign({
6679
7183
  style: {
@@ -6686,7 +7190,7 @@ const grayscale = {
6686
7190
  }
6687
7191
  }, baseProps),
6688
7192
  legend: {
6689
- colorScale: colors,
7193
+ colorScale,
6690
7194
  gutter: 10,
6691
7195
  orientation: "vertical",
6692
7196
  titleOrientation: "top",
@@ -6721,7 +7225,7 @@ const grayscale = {
6721
7225
  padding: 20
6722
7226
  })
6723
7227
  },
6724
- colorScale: colors,
7228
+ colorScale,
6725
7229
  width: 400,
6726
7230
  height: 400,
6727
7231
  padding: 50
@@ -6737,7 +7241,7 @@ const grayscale = {
6737
7241
  }
6738
7242
  }, baseProps),
6739
7243
  stack: Object.assign({
6740
- colorScale: colors
7244
+ colorScale
6741
7245
  }, baseProps),
6742
7246
  tooltip: {
6743
7247
  style: Object.assign({}, baseLabelStyles, {
@@ -6797,11 +7301,31 @@ const lime300 = "#DCE775";
6797
7301
  const lightGreen500 = "#8BC34A";
6798
7302
  const teal700 = "#00796B";
6799
7303
  const cyan900 = "#006064";
6800
- const colors = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
7304
+ const colorScale = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
6801
7305
  const blueGrey50 = "#ECEFF1";
6802
7306
  const blueGrey300 = "#90A4AE";
6803
7307
  const blueGrey700 = "#455A64";
6804
7308
  const grey900 = "#212121";
7309
+ const colors = {
7310
+ blue: "#4F7DA1",
7311
+ pink: "#E2A37F",
7312
+ teal: teal700,
7313
+ purple: "#DF948A",
7314
+ green: lightGreen500,
7315
+ orange: deepOrange600,
7316
+ cyan: cyan900,
7317
+ red: "#DF5A49",
7318
+ yellow: yellow200
7319
+ };
7320
+ const grayscale = [blueGrey50, blueGrey300, blueGrey700, grey900];
7321
+ const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
7322
+ const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
7323
+ const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
7324
+ const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
7325
+ const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
7326
+ const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
7327
+ const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
7328
+
6805
7329
  // *
6806
7330
  // * Typography
6807
7331
  // *
@@ -6839,6 +7363,17 @@ const strokeDasharray = "10, 5";
6839
7363
  const strokeLinecap = "round";
6840
7364
  const strokeLinejoin = "round";
6841
7365
  const material = {
7366
+ palette: {
7367
+ colors,
7368
+ grayscale,
7369
+ qualitative,
7370
+ heatmap,
7371
+ warm,
7372
+ cool,
7373
+ red,
7374
+ green,
7375
+ blue
7376
+ },
6842
7377
  area: Object.assign({
6843
7378
  style: {
6844
7379
  data: {
@@ -6971,7 +7506,7 @@ const material = {
6971
7506
  }
6972
7507
  }, baseProps),
6973
7508
  group: Object.assign({
6974
- colorScale: colors
7509
+ colorScale
6975
7510
  }, baseProps),
6976
7511
  histogram: Object.assign({
6977
7512
  style: {
@@ -6984,7 +7519,7 @@ const material = {
6984
7519
  }
6985
7520
  }, baseProps),
6986
7521
  legend: {
6987
- colorScale: colors,
7522
+ colorScale,
6988
7523
  gutter: 10,
6989
7524
  orientation: "vertical",
6990
7525
  titleOrientation: "top",
@@ -7010,7 +7545,7 @@ const material = {
7010
7545
  }
7011
7546
  }, baseProps),
7012
7547
  pie: Object.assign({
7013
- colorScale: colors,
7548
+ colorScale,
7014
7549
  style: {
7015
7550
  data: {
7016
7551
  padding,
@@ -7034,7 +7569,7 @@ const material = {
7034
7569
  }
7035
7570
  }, baseProps),
7036
7571
  stack: Object.assign({
7037
- colorScale: colors
7572
+ colorScale
7038
7573
  }, baseProps),
7039
7574
  tooltip: {
7040
7575
  style: Object.assign({}, baseLabelStyles, {
@@ -7087,12 +7622,15 @@ __webpack_require__.r(__webpack_exports__);
7087
7622
  /* harmony export */ });
7088
7623
  /* harmony import */ var _grayscale__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./grayscale */ "../../victory-core/es/victory-theme/grayscale.js");
7089
7624
  /* harmony import */ var _material__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./material */ "../../victory-core/es/victory-theme/material.js");
7625
+ /* harmony import */ var _clean__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./clean */ "../../victory-core/es/victory-theme/clean.js");
7626
+
7090
7627
 
7091
7628
 
7092
7629
 
7093
7630
  const VictoryTheme = {
7094
7631
  grayscale: _grayscale__WEBPACK_IMPORTED_MODULE_0__.grayscale,
7095
- material: _material__WEBPACK_IMPORTED_MODULE_1__.material
7632
+ material: _material__WEBPACK_IMPORTED_MODULE_1__.material,
7633
+ clean: _clean__WEBPACK_IMPORTED_MODULE_2__.clean
7096
7634
  };
7097
7635
 
7098
7636
  /***/ }),
@@ -9997,6 +10535,9 @@ __webpack_require__.r(__webpack_exports__);
9997
10535
  /* harmony export */ "getColorScale": function() { return /* binding */ getColorScale; },
9998
10536
  /* harmony export */ "toTransformString": function() { return /* binding */ toTransformString; }
9999
10537
  /* harmony export */ });
10538
+ /* 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");
10539
+
10540
+
10000
10541
  /**
10001
10542
  * Given an object with CSS/SVG transform definitions, return the string value
10002
10543
  * for use with the `transform` CSS property or SVG attribute. Note that we
@@ -10033,20 +10574,37 @@ const toTransformString = function (obj) {
10033
10574
  * of 5 hex string values in that color scale. If no 'name' parameter
10034
10575
  * is given, it will return the Victory default grayscale.
10035
10576
  * @param {String} name The name of the color scale to return (optional).
10577
+ * @param {Object} theme The theme object to retrieve the color scale from (optional).
10036
10578
  * @returns {Array} An array of 5 hex string values composing a color scale.
10037
10579
  */
10038
- function getColorScale(name) {
10580
+ function getColorScale(name, theme) {
10581
+ if (theme === void 0) {
10582
+ theme = _victory_theme_victory_theme__WEBPACK_IMPORTED_MODULE_0__.VictoryTheme.material;
10583
+ }
10584
+ const {
10585
+ palette: {
10586
+ grayscale = ["#cccccc", "#969696", "#636363", "#252525"],
10587
+ qualitative = [],
10588
+ heatmap = [],
10589
+ warm = [],
10590
+ cool = [],
10591
+ red = [],
10592
+ blue = [],
10593
+ green = []
10594
+ } = {}
10595
+ } = theme;
10039
10596
  const scales = {
10040
- grayscale: ["#cccccc", "#969696", "#636363", "#252525"],
10041
- qualitative: ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"],
10042
- heatmap: ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"],
10043
- warm: ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"],
10044
- cool: ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"],
10045
- red: ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"],
10046
- blue: ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"],
10047
- green: ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"]
10597
+ grayscale,
10598
+ qualitative,
10599
+ heatmap,
10600
+ warm,
10601
+ cool,
10602
+ red,
10603
+ blue,
10604
+ green
10048
10605
  };
10049
- return name ? scales[name] : scales.grayscale;
10606
+ const selectedScale = name && scales[name]?.length ? scales[name] : scales.grayscale;
10607
+ return selectedScale;
10050
10608
  }
10051
10609
 
10052
10610
  /***/ }),
@@ -10073,6 +10631,7 @@ __webpack_require__.r(__webpack_exports__);
10073
10631
  /* eslint-disable no-magic-numbers */
10074
10632
  // Based on measuring specific character widths
10075
10633
  // as in the following example https://bl.ocks.org/tophtucker/62f93a4658387bb61e4510c37e2e97cf
10634
+ // For new fonts: pull gist, open index.html locally, add font files (if not generic), enter font name in `font-family` input
10076
10635
  // prettier-ignore
10077
10636
  const fonts = {
10078
10637
  "American Typewriter": {
@@ -10131,6 +10690,10 @@ const fonts = {
10131
10690
  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],
10132
10691
  avg: 0.5116447368421051
10133
10692
  },
10693
+ "Inter": {
10694
+ 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],
10695
+ avg: 0.5624362664473683
10696
+ },
10134
10697
  "Montserrat": {
10135
10698
  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],
10136
10699
  avg: 0.571792763157895