victory-chart 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.
@@ -7116,31 +7116,34 @@ __webpack_require__.r(__webpack_exports__);
7116
7116
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7117
7117
  /* harmony export */ "VictoryPortal": function() { return /* binding */ VictoryPortal; }
7118
7118
  /* harmony export */ });
7119
- /* 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");
7120
- /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
7121
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
7122
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
7123
- /* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
7124
- /* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
7125
- /* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
7119
+ /* 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");
7120
+ /* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0__);
7121
+ /* 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");
7122
+ /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
7123
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
7124
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
7125
+ /* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
7126
+ /* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
7127
+ /* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
7128
+
7126
7129
 
7127
7130
 
7128
7131
 
7129
7132
 
7130
7133
 
7131
7134
  const defaultProps = {
7132
- groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("g", null)
7135
+ groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement("g", null)
7133
7136
  };
7134
7137
  const VictoryPortal = initialProps => {
7135
7138
  const props = {
7136
7139
  ...defaultProps,
7137
7140
  ...initialProps
7138
7141
  };
7139
- const id = react__WEBPACK_IMPORTED_MODULE_1___default().useId();
7140
- const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_2__.usePortalContext)();
7142
+ const id = lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default()();
7143
+ const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_3__.usePortalContext)();
7141
7144
  if (!portalContext) {
7142
7145
  const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
7143
- _victory_util_log__WEBPACK_IMPORTED_MODULE_3__.warn(msg);
7146
+ _victory_util_log__WEBPACK_IMPORTED_MODULE_4__.warn(msg);
7144
7147
  }
7145
7148
  const children = Array.isArray(props.children) ? props.children[0] : props.children;
7146
7149
  const {
@@ -7151,15 +7154,15 @@ const VictoryPortal = initialProps => {
7151
7154
  groupComponent,
7152
7155
  standalone: false
7153
7156
  } : {};
7154
- const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.omit(props, ["children", "groupComponent"]), {
7157
+ const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__.omit(props, ["children", "groupComponent"]), {
7155
7158
  key: childProps.key ?? id
7156
7159
  });
7157
- const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(children, newProps);
7158
- react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
7160
+ const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().cloneElement(children, newProps);
7161
+ react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
7159
7162
  portalContext?.addChild(id, child);
7160
7163
  // eslint-disable-next-line react-hooks/exhaustive-deps
7161
7164
  }, [props.children]);
7162
- react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
7165
+ react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
7163
7166
  return () => portalContext?.removeChild(id);
7164
7167
  // eslint-disable-next-line react-hooks/exhaustive-deps
7165
7168
  }, []);
@@ -7651,6 +7654,477 @@ const TSpan = props => {
7651
7654
 
7652
7655
  /***/ }),
7653
7656
 
7657
+ /***/ "../../victory-core/es/victory-theme/clean.js":
7658
+ /*!****************************************************!*\
7659
+ !*** ../../victory-core/es/victory-theme/clean.js ***!
7660
+ \****************************************************/
7661
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
7662
+
7663
+ "use strict";
7664
+ __webpack_require__.r(__webpack_exports__);
7665
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7666
+ /* harmony export */ "clean": function() { return /* binding */ clean; }
7667
+ /* harmony export */ });
7668
+ // *
7669
+ // * Colors
7670
+ // *
7671
+
7672
+ const gray = {
7673
+ white: "#FFFFFF",
7674
+ "50": "#FAFAFA",
7675
+ "100": "#F2F2F2",
7676
+ "200": "#E8E8E8",
7677
+ "300": "#E0E0E0",
7678
+ "400": "#D1D1D1",
7679
+ "500": "#757575",
7680
+ "600": "#5C5C5C",
7681
+ "700": "#424242",
7682
+ "800": "#333333",
7683
+ "900": "#292929",
7684
+ black: "#0F0F0F"
7685
+ };
7686
+ const yellow = {
7687
+ "100": "#FFEAB6",
7688
+ "300": "#FFD66E",
7689
+ "500": "#FCB400",
7690
+ "900": "#B87503"
7691
+ };
7692
+ const orange = {
7693
+ "100": "#FEE2D5",
7694
+ "300": "#FFA981",
7695
+ "500": "#FF6F2C",
7696
+ "900": "#D74D26"
7697
+ };
7698
+ const red = {
7699
+ "100": "#FFDCE5",
7700
+ "300": "#FF9EB7",
7701
+ "500": "#F82B60",
7702
+ "900": "#BA1E45"
7703
+ };
7704
+ const pink = {
7705
+ "100": "#FFDAF6",
7706
+ "300": "#F99DE2",
7707
+ "500": "#FF08C2",
7708
+ "900": "#B2158B"
7709
+ };
7710
+ const purple = {
7711
+ "100": "#EDE3FE",
7712
+ "300": "#CDB0FF",
7713
+ "500": "#8B46FF",
7714
+ "900": "#6B1CB0"
7715
+ };
7716
+ const blue = {
7717
+ "100": "#CFDFFF",
7718
+ "300": "#9CC7FF",
7719
+ "500": "#2D7FF9",
7720
+ "900": "#2750AE"
7721
+ };
7722
+ const cyan = {
7723
+ "100": "#D0F0FD",
7724
+ "300": "#77D1F3",
7725
+ "500": "#18BFFF",
7726
+ "900": "#0B76B7"
7727
+ };
7728
+ const teal = {
7729
+ "100": "#C2F5E9",
7730
+ "300": "#72DDC3",
7731
+ "500": "#20D9D2",
7732
+ "900": "#06A09B"
7733
+ };
7734
+ const green = {
7735
+ "100": "#D1F7C4",
7736
+ "300": "#93E088",
7737
+ "500": "#20C933",
7738
+ "900": "#338A17"
7739
+ };
7740
+ const colors = {
7741
+ blue: blue["500"],
7742
+ pink: pink["500"],
7743
+ teal: teal["500"],
7744
+ purple: purple["500"],
7745
+ green: green["500"],
7746
+ orange: orange["500"],
7747
+ cyan: cyan["500"],
7748
+ red: red["500"],
7749
+ yellow: yellow["500"]
7750
+ };
7751
+ const colorScale = Object.values(colors);
7752
+ const grayscale = [gray["200"], gray["400"], gray["600"], gray["900"]];
7753
+ const warm = [yellow["500"], orange["500"], red["500"], pink["500"]];
7754
+ const cool = [cyan["500"], teal["500"], blue["500"], purple["500"]];
7755
+ const heatmap = [green["500"], yellow["500"], red["500"]];
7756
+ const redPalette = [red["500"], red["300"], red["100"]];
7757
+ const greenPalette = [green["500"], green["300"], green["100"]];
7758
+ const bluePalette = [blue["500"], blue["300"], blue["100"]];
7759
+
7760
+ // *
7761
+ // * Typography
7762
+ // *
7763
+ const sansSerif = "'Inter', 'Helvetica Neue', 'Seravek', 'Helvetica', sans-serif";
7764
+ const letterSpacing = "normal";
7765
+ const fontSize = 12;
7766
+ // *
7767
+ // * Layout
7768
+ // *
7769
+ const padding = 8;
7770
+ const baseProps = {
7771
+ width: 450,
7772
+ height: 300,
7773
+ padding: 50,
7774
+ colorScale
7775
+ };
7776
+ // *
7777
+ // * Labels
7778
+ // *
7779
+ const baseLabelStyles = {
7780
+ fontFamily: sansSerif,
7781
+ fontSize,
7782
+ fontWeight: 300,
7783
+ letterSpacing,
7784
+ padding,
7785
+ fill: gray["900"],
7786
+ stroke: "transparent"
7787
+ };
7788
+ const centeredLabelStyles = Object.assign({
7789
+ textAnchor: "middle"
7790
+ }, baseLabelStyles);
7791
+
7792
+ // *
7793
+ // * Strokes
7794
+ // *
7795
+ const strokeDasharray = "10, 5";
7796
+ const strokeLinecap = "round";
7797
+ const strokeLinejoin = "round";
7798
+ const borderRadius = 1;
7799
+ // *
7800
+ // * Theme
7801
+ // *
7802
+ const clean = {
7803
+ palette: {
7804
+ colors,
7805
+ grayscale,
7806
+ qualitative: colorScale,
7807
+ heatmap,
7808
+ warm,
7809
+ cool,
7810
+ red: redPalette,
7811
+ green: greenPalette,
7812
+ blue: bluePalette
7813
+ },
7814
+ area: Object.assign({
7815
+ style: {
7816
+ data: {
7817
+ fill: blue["500"],
7818
+ strokeWidth: 2,
7819
+ fillOpacity: 0.5
7820
+ },
7821
+ labels: baseLabelStyles
7822
+ }
7823
+ }, baseProps),
7824
+ axis: Object.assign({
7825
+ style: {
7826
+ axis: {
7827
+ fill: "transparent",
7828
+ stroke: gray["500"],
7829
+ strokeWidth: 1,
7830
+ strokeLinecap,
7831
+ strokeLinejoin
7832
+ },
7833
+ axisLabel: Object.assign({}, centeredLabelStyles, {
7834
+ padding,
7835
+ stroke: "transparent"
7836
+ }),
7837
+ grid: {
7838
+ fill: "none",
7839
+ stroke: "none",
7840
+ painterEvents: "painted"
7841
+ },
7842
+ ticks: {
7843
+ fill: "transparent",
7844
+ size: 5,
7845
+ stroke: "transparent"
7846
+ },
7847
+ tickLabels: baseLabelStyles
7848
+ }
7849
+ }, baseProps),
7850
+ polarAxis: Object.assign({
7851
+ style: {
7852
+ axis: {
7853
+ stroke: gray["500"]
7854
+ },
7855
+ grid: {
7856
+ stroke: gray["400"],
7857
+ strokeDasharray,
7858
+ strokeLinecap,
7859
+ strokeLinejoin,
7860
+ pointerEvents: "painted"
7861
+ },
7862
+ ticks: {
7863
+ fill: "transparent",
7864
+ size: 5,
7865
+ stroke: gray["400"],
7866
+ strokeWidth: 1,
7867
+ strokeLinecap,
7868
+ strokeLinejoin
7869
+ },
7870
+ tickLabels: baseLabelStyles
7871
+ }
7872
+ }),
7873
+ polarDependentAxis: Object.assign({
7874
+ style: {
7875
+ axis: {
7876
+ stroke: gray["500"]
7877
+ },
7878
+ grid: {
7879
+ stroke: gray["400"],
7880
+ strokeDasharray,
7881
+ strokeLinecap,
7882
+ strokeLinejoin,
7883
+ pointerEvents: "painted"
7884
+ },
7885
+ ticks: {
7886
+ fill: "transparent",
7887
+ size: 5,
7888
+ stroke: gray["300"],
7889
+ strokeWidth: 1,
7890
+ strokeLinecap,
7891
+ strokeLinejoin
7892
+ },
7893
+ tickLabels: baseLabelStyles
7894
+ }
7895
+ }),
7896
+ bar: Object.assign({
7897
+ style: {
7898
+ data: {
7899
+ fill: blue["500"],
7900
+ padding,
7901
+ strokeWidth: 1,
7902
+ fillOpacity: 0.5
7903
+ },
7904
+ labels: baseLabelStyles
7905
+ },
7906
+ cornerRadius: {
7907
+ top: borderRadius
7908
+ }
7909
+ }, baseProps),
7910
+ boxplot: Object.assign({
7911
+ style: {
7912
+ max: {
7913
+ padding,
7914
+ stroke: gray["400"],
7915
+ strokeWidth: 2
7916
+ },
7917
+ maxLabels: Object.assign({}, baseLabelStyles, {
7918
+ padding: 3
7919
+ }),
7920
+ median: {
7921
+ padding,
7922
+ stroke: gray.white,
7923
+ strokeWidth: 2
7924
+ },
7925
+ medianLabels: Object.assign({}, baseLabelStyles, {
7926
+ padding: 3
7927
+ }),
7928
+ min: {
7929
+ padding,
7930
+ stroke: gray["400"],
7931
+ strokeWidth: 2
7932
+ },
7933
+ minLabels: Object.assign({}, baseLabelStyles, {
7934
+ padding: 3
7935
+ }),
7936
+ q1: {
7937
+ padding,
7938
+ fill: teal["500"],
7939
+ rx: borderRadius,
7940
+ strokeWidth: 2
7941
+ },
7942
+ q1Labels: Object.assign({}, baseLabelStyles, {
7943
+ padding: 3
7944
+ }),
7945
+ q3: {
7946
+ padding,
7947
+ fill: cyan["500"],
7948
+ rx: borderRadius
7949
+ },
7950
+ q3Labels: Object.assign({}, baseLabelStyles, {
7951
+ padding: 3
7952
+ })
7953
+ },
7954
+ boxWidth: 20
7955
+ }, baseProps),
7956
+ candlestick: Object.assign({
7957
+ style: {
7958
+ data: {
7959
+ stroke: gray["300"],
7960
+ strokeWidth: 0,
7961
+ rx: borderRadius
7962
+ },
7963
+ labels: Object.assign({}, baseLabelStyles, {
7964
+ padding: 5
7965
+ })
7966
+ },
7967
+ candleColors: {
7968
+ positive: teal["500"],
7969
+ negative: orange["500"]
7970
+ },
7971
+ wickStrokeWidth: 2
7972
+ }, baseProps),
7973
+ chart: baseProps,
7974
+ errorbar: Object.assign({
7975
+ borderWidth: 8,
7976
+ style: {
7977
+ data: {
7978
+ fill: "transparent",
7979
+ opacity: 1,
7980
+ stroke: gray["700"],
7981
+ strokeWidth: 2,
7982
+ strokeLinecap
7983
+ },
7984
+ labels: baseLabelStyles
7985
+ }
7986
+ }, baseProps),
7987
+ group: Object.assign({
7988
+ colorScale
7989
+ }, baseProps),
7990
+ histogram: Object.assign({
7991
+ style: {
7992
+ data: {
7993
+ fill: cyan["500"],
7994
+ fillOpacity: 0.5
7995
+ },
7996
+ labels: baseLabelStyles
7997
+ },
7998
+ binSpacing: 4,
7999
+ cornerRadius: {
8000
+ top: borderRadius
8001
+ }
8002
+ }, baseProps),
8003
+ label: baseLabelStyles,
8004
+ legend: {
8005
+ colorScale,
8006
+ gutter: 24,
8007
+ borderPadding: 10,
8008
+ orientation: "horizontal",
8009
+ titleOrientation: "top",
8010
+ centerTitle: true,
8011
+ style: {
8012
+ data: {
8013
+ type: "circle"
8014
+ },
8015
+ labels: {
8016
+ ...baseLabelStyles,
8017
+ fontSize: 12
8018
+ },
8019
+ title: Object.assign({}, baseLabelStyles, {
8020
+ padding,
8021
+ fontSize: 16
8022
+ }),
8023
+ border: {
8024
+ stroke: gray["200"],
8025
+ strokeWidth: 2,
8026
+ padding: 16
8027
+ }
8028
+ }
8029
+ },
8030
+ line: Object.assign({
8031
+ style: {
8032
+ data: {
8033
+ fill: "transparent",
8034
+ opacity: 1,
8035
+ stroke: blue["500"],
8036
+ strokeWidth: 2,
8037
+ strokeLinecap,
8038
+ strokeLinejoin
8039
+ },
8040
+ labels: baseLabelStyles
8041
+ }
8042
+ }, baseProps),
8043
+ pie: Object.assign({
8044
+ style: {
8045
+ parent: {
8046
+ backgroundColor: gray.white
8047
+ },
8048
+ data: {
8049
+ padding,
8050
+ stroke: gray.white,
8051
+ strokeWidth: 1
8052
+ },
8053
+ labels: {
8054
+ ...baseLabelStyles,
8055
+ padding: 20,
8056
+ fill: gray["600"],
8057
+ fontSize: 10
8058
+ }
8059
+ },
8060
+ colorScale,
8061
+ cornerRadius: borderRadius
8062
+ }, baseProps),
8063
+ scatter: Object.assign({
8064
+ style: {
8065
+ data: {
8066
+ fill: purple["500"],
8067
+ opacity: 1,
8068
+ stroke: "transparent",
8069
+ strokeWidth: 0
8070
+ },
8071
+ labels: {
8072
+ ...baseLabelStyles,
8073
+ padding: 20
8074
+ }
8075
+ }
8076
+ }, baseProps),
8077
+ stack: Object.assign({
8078
+ colorScale
8079
+ }, baseProps),
8080
+ tooltip: {
8081
+ style: Object.assign({}, baseLabelStyles, {
8082
+ padding: 0,
8083
+ pointerEvents: "none"
8084
+ }),
8085
+ flyoutStyle: {
8086
+ stroke: gray["300"],
8087
+ strokeWidth: 2,
8088
+ fill: gray.white,
8089
+ pointerEvents: "none"
8090
+ },
8091
+ flyoutPadding: {
8092
+ top: 8,
8093
+ bottom: 8,
8094
+ left: 16,
8095
+ right: 16
8096
+ },
8097
+ cornerRadius: borderRadius,
8098
+ pointerLength: 4
8099
+ },
8100
+ voronoi: Object.assign({
8101
+ style: {
8102
+ data: {
8103
+ fill: blue["100"],
8104
+ stroke: blue["500"],
8105
+ strokeWidth: 2,
8106
+ opacity: 0.4
8107
+ },
8108
+ labels: Object.assign({}, baseLabelStyles, {
8109
+ padding: 5,
8110
+ pointerEvents: "none"
8111
+ }),
8112
+ flyout: {
8113
+ stroke: gray["900"],
8114
+ strokeWidth: 1,
8115
+ fill: gray["100"],
8116
+ pointerEvents: "none"
8117
+ },
8118
+ padding: {
8119
+ left: 2,
8120
+ bottom: 2
8121
+ }
8122
+ }
8123
+ }, baseProps)
8124
+ };
8125
+
8126
+ /***/ }),
8127
+
7654
8128
  /***/ "../../victory-core/es/victory-theme/grayscale.js":
7655
8129
  /*!********************************************************!*\
7656
8130
  !*** ../../victory-core/es/victory-theme/grayscale.js ***!
@@ -7665,9 +8139,28 @@ __webpack_require__.r(__webpack_exports__);
7665
8139
  // *
7666
8140
  // * Colors
7667
8141
  // *
7668
- const colors = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
8142
+ const colors = {
8143
+ blue: "#4F7DA1",
8144
+ pink: "#E2A37F",
8145
+ teal: "#00796B",
8146
+ purple: "#DF948A",
8147
+ green: "#8BC34A",
8148
+ orange: "#F4511E",
8149
+ cyan: "#006064",
8150
+ red: "#DF5A49",
8151
+ yellow: "#FFF59D"
8152
+ };
8153
+ const colorScale = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
7669
8154
  const charcoal = "#252525";
7670
8155
  const grey = "#969696";
8156
+ const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
8157
+ const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
8158
+ const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
8159
+ const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
8160
+ const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
8161
+ const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
8162
+ const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
8163
+
7671
8164
  // *
7672
8165
  // * Typography
7673
8166
  // *
@@ -7681,7 +8174,7 @@ const baseProps = {
7681
8174
  width: 450,
7682
8175
  height: 300,
7683
8176
  padding: 50,
7684
- colorScale: colors
8177
+ colorScale
7685
8178
  };
7686
8179
  // *
7687
8180
  // * Labels
@@ -7703,6 +8196,17 @@ const centeredLabelStyles = Object.assign({
7703
8196
  const strokeLinecap = "round";
7704
8197
  const strokeLinejoin = "round";
7705
8198
  const grayscale = {
8199
+ palette: {
8200
+ colors,
8201
+ grayscale: colorScale,
8202
+ qualitative,
8203
+ heatmap,
8204
+ warm,
8205
+ cool,
8206
+ red,
8207
+ green,
8208
+ blue
8209
+ },
7706
8210
  area: Object.assign({
7707
8211
  style: {
7708
8212
  data: {
@@ -7817,7 +8321,7 @@ const grayscale = {
7817
8321
  }
7818
8322
  }, baseProps),
7819
8323
  group: Object.assign({
7820
- colorScale: colors
8324
+ colorScale
7821
8325
  }, baseProps),
7822
8326
  histogram: Object.assign({
7823
8327
  style: {
@@ -7830,7 +8334,7 @@ const grayscale = {
7830
8334
  }
7831
8335
  }, baseProps),
7832
8336
  legend: {
7833
- colorScale: colors,
8337
+ colorScale,
7834
8338
  gutter: 10,
7835
8339
  orientation: "vertical",
7836
8340
  titleOrientation: "top",
@@ -7865,7 +8369,7 @@ const grayscale = {
7865
8369
  padding: 20
7866
8370
  })
7867
8371
  },
7868
- colorScale: colors,
8372
+ colorScale,
7869
8373
  width: 400,
7870
8374
  height: 400,
7871
8375
  padding: 50
@@ -7881,7 +8385,7 @@ const grayscale = {
7881
8385
  }
7882
8386
  }, baseProps),
7883
8387
  stack: Object.assign({
7884
- colorScale: colors
8388
+ colorScale
7885
8389
  }, baseProps),
7886
8390
  tooltip: {
7887
8391
  style: Object.assign({}, baseLabelStyles, {
@@ -7941,11 +8445,31 @@ const lime300 = "#DCE775";
7941
8445
  const lightGreen500 = "#8BC34A";
7942
8446
  const teal700 = "#00796B";
7943
8447
  const cyan900 = "#006064";
7944
- const colors = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
8448
+ const colorScale = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
7945
8449
  const blueGrey50 = "#ECEFF1";
7946
8450
  const blueGrey300 = "#90A4AE";
7947
8451
  const blueGrey700 = "#455A64";
7948
8452
  const grey900 = "#212121";
8453
+ const colors = {
8454
+ blue: "#4F7DA1",
8455
+ pink: "#E2A37F",
8456
+ teal: teal700,
8457
+ purple: "#DF948A",
8458
+ green: lightGreen500,
8459
+ orange: deepOrange600,
8460
+ cyan: cyan900,
8461
+ red: "#DF5A49",
8462
+ yellow: yellow200
8463
+ };
8464
+ const grayscale = [blueGrey50, blueGrey300, blueGrey700, grey900];
8465
+ const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
8466
+ const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
8467
+ const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
8468
+ const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
8469
+ const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
8470
+ const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
8471
+ const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
8472
+
7949
8473
  // *
7950
8474
  // * Typography
7951
8475
  // *
@@ -7983,6 +8507,17 @@ const strokeDasharray = "10, 5";
7983
8507
  const strokeLinecap = "round";
7984
8508
  const strokeLinejoin = "round";
7985
8509
  const material = {
8510
+ palette: {
8511
+ colors,
8512
+ grayscale,
8513
+ qualitative,
8514
+ heatmap,
8515
+ warm,
8516
+ cool,
8517
+ red,
8518
+ green,
8519
+ blue
8520
+ },
7986
8521
  area: Object.assign({
7987
8522
  style: {
7988
8523
  data: {
@@ -8115,7 +8650,7 @@ const material = {
8115
8650
  }
8116
8651
  }, baseProps),
8117
8652
  group: Object.assign({
8118
- colorScale: colors
8653
+ colorScale
8119
8654
  }, baseProps),
8120
8655
  histogram: Object.assign({
8121
8656
  style: {
@@ -8128,7 +8663,7 @@ const material = {
8128
8663
  }
8129
8664
  }, baseProps),
8130
8665
  legend: {
8131
- colorScale: colors,
8666
+ colorScale,
8132
8667
  gutter: 10,
8133
8668
  orientation: "vertical",
8134
8669
  titleOrientation: "top",
@@ -8154,7 +8689,7 @@ const material = {
8154
8689
  }
8155
8690
  }, baseProps),
8156
8691
  pie: Object.assign({
8157
- colorScale: colors,
8692
+ colorScale,
8158
8693
  style: {
8159
8694
  data: {
8160
8695
  padding,
@@ -8178,7 +8713,7 @@ const material = {
8178
8713
  }
8179
8714
  }, baseProps),
8180
8715
  stack: Object.assign({
8181
- colorScale: colors
8716
+ colorScale
8182
8717
  }, baseProps),
8183
8718
  tooltip: {
8184
8719
  style: Object.assign({}, baseLabelStyles, {
@@ -8231,12 +8766,15 @@ __webpack_require__.r(__webpack_exports__);
8231
8766
  /* harmony export */ });
8232
8767
  /* harmony import */ var _grayscale__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./grayscale */ "../../victory-core/es/victory-theme/grayscale.js");
8233
8768
  /* harmony import */ var _material__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./material */ "../../victory-core/es/victory-theme/material.js");
8769
+ /* harmony import */ var _clean__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./clean */ "../../victory-core/es/victory-theme/clean.js");
8770
+
8234
8771
 
8235
8772
 
8236
8773
 
8237
8774
  const VictoryTheme = {
8238
8775
  grayscale: _grayscale__WEBPACK_IMPORTED_MODULE_0__.grayscale,
8239
- material: _material__WEBPACK_IMPORTED_MODULE_1__.material
8776
+ material: _material__WEBPACK_IMPORTED_MODULE_1__.material,
8777
+ clean: _clean__WEBPACK_IMPORTED_MODULE_2__.clean
8240
8778
  };
8241
8779
 
8242
8780
  /***/ }),
@@ -11563,6 +12101,9 @@ __webpack_require__.r(__webpack_exports__);
11563
12101
  /* harmony export */ "getColorScale": function() { return /* binding */ getColorScale; },
11564
12102
  /* harmony export */ "toTransformString": function() { return /* binding */ toTransformString; }
11565
12103
  /* harmony export */ });
12104
+ /* 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");
12105
+
12106
+
11566
12107
  /**
11567
12108
  * Given an object with CSS/SVG transform definitions, return the string value
11568
12109
  * for use with the `transform` CSS property or SVG attribute. Note that we
@@ -11599,20 +12140,37 @@ const toTransformString = function (obj) {
11599
12140
  * of 5 hex string values in that color scale. If no 'name' parameter
11600
12141
  * is given, it will return the Victory default grayscale.
11601
12142
  * @param {String} name The name of the color scale to return (optional).
12143
+ * @param {Object} theme The theme object to retrieve the color scale from (optional).
11602
12144
  * @returns {Array} An array of 5 hex string values composing a color scale.
11603
12145
  */
11604
- function getColorScale(name) {
12146
+ function getColorScale(name, theme) {
12147
+ if (theme === void 0) {
12148
+ theme = _victory_theme_victory_theme__WEBPACK_IMPORTED_MODULE_0__.VictoryTheme.material;
12149
+ }
12150
+ const {
12151
+ palette: {
12152
+ grayscale = ["#cccccc", "#969696", "#636363", "#252525"],
12153
+ qualitative = [],
12154
+ heatmap = [],
12155
+ warm = [],
12156
+ cool = [],
12157
+ red = [],
12158
+ blue = [],
12159
+ green = []
12160
+ } = {}
12161
+ } = theme;
11605
12162
  const scales = {
11606
- grayscale: ["#cccccc", "#969696", "#636363", "#252525"],
11607
- qualitative: ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"],
11608
- heatmap: ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"],
11609
- warm: ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"],
11610
- cool: ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"],
11611
- red: ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"],
11612
- blue: ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"],
11613
- green: ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"]
12163
+ grayscale,
12164
+ qualitative,
12165
+ heatmap,
12166
+ warm,
12167
+ cool,
12168
+ red,
12169
+ blue,
12170
+ green
11614
12171
  };
11615
- return name ? scales[name] : scales.grayscale;
12172
+ const selectedScale = name && scales[name]?.length ? scales[name] : scales.grayscale;
12173
+ return selectedScale;
11616
12174
  }
11617
12175
 
11618
12176
  /***/ }),
@@ -11639,6 +12197,7 @@ __webpack_require__.r(__webpack_exports__);
11639
12197
  /* eslint-disable no-magic-numbers */
11640
12198
  // Based on measuring specific character widths
11641
12199
  // as in the following example https://bl.ocks.org/tophtucker/62f93a4658387bb61e4510c37e2e97cf
12200
+ // For new fonts: pull gist, open index.html locally, add font files (if not generic), enter font name in `font-family` input
11642
12201
  // prettier-ignore
11643
12202
  const fonts = {
11644
12203
  "American Typewriter": {
@@ -11697,6 +12256,10 @@ const fonts = {
11697
12256
  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],
11698
12257
  avg: 0.5116447368421051
11699
12258
  },
12259
+ "Inter": {
12260
+ 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],
12261
+ avg: 0.5624362664473683
12262
+ },
11700
12263
  "Montserrat": {
11701
12264
  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],
11702
12265
  avg: 0.571792763157895
@@ -12849,7 +13412,9 @@ function getAllEvents(props) {
12849
13412
  }
12850
13413
  return events || [];
12851
13414
  }
12852
- function getColor(calculatedProps, child, index) {
13415
+
13416
+ // eslint-disable-next-line max-params
13417
+ function getColor(calculatedProps, child, index, theme) {
12853
13418
  // check for styles first
12854
13419
  const {
12855
13420
  style
@@ -12866,14 +13431,16 @@ function getColor(calculatedProps, child, index) {
12866
13431
  if (!colorScale && !color) {
12867
13432
  return undefined;
12868
13433
  }
12869
- const colors = Array.isArray(colorScale) ? colorScale : _style__WEBPACK_IMPORTED_MODULE_13__.getColorScale(colorScale);
13434
+ const colors = Array.isArray(colorScale) ? colorScale : _style__WEBPACK_IMPORTED_MODULE_13__.getColorScale(colorScale, theme);
12870
13435
  return color || colors[index % colors.length];
12871
13436
  }
12872
13437
  function getStyle(theme, style, role) {
12873
13438
  const defaultStyle = theme && theme[role] && theme[role].style ? theme[role].style : {};
12874
13439
  return _helpers__WEBPACK_IMPORTED_MODULE_7__.getStyles(style, defaultStyle);
12875
13440
  }
12876
- function getChildStyle(child, index, calculatedProps) {
13441
+
13442
+ // eslint-disable-next-line max-params
13443
+ function getChildStyle(child, index, calculatedProps, theme) {
12877
13444
  const {
12878
13445
  style,
12879
13446
  role
@@ -12883,7 +13450,7 @@ function getChildStyle(child, index, calculatedProps) {
12883
13450
  return childStyle;
12884
13451
  }
12885
13452
  const childRole = child.type && child.type.role;
12886
- const defaultFill = childRole === "stack" ? undefined : getColor(calculatedProps, child, index);
13453
+ const defaultFill = childRole === "stack" ? undefined : getColor(calculatedProps, child, index, theme);
12887
13454
  const defaultColor = childRole === "line" ? {
12888
13455
  fill: "none",
12889
13456
  stroke: defaultFill