victory-create-container 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.
@@ -8177,31 +8177,34 @@ __webpack_require__.r(__webpack_exports__);
8177
8177
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8178
8178
  /* harmony export */ "VictoryPortal": function() { return /* binding */ VictoryPortal; }
8179
8179
  /* harmony export */ });
8180
- /* 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");
8181
- /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
8182
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
8183
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
8184
- /* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
8185
- /* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
8186
- /* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
8180
+ /* 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");
8181
+ /* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0__);
8182
+ /* 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");
8183
+ /* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
8184
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
8185
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
8186
+ /* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
8187
+ /* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
8188
+ /* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
8189
+
8187
8190
 
8188
8191
 
8189
8192
 
8190
8193
 
8191
8194
 
8192
8195
  const defaultProps = {
8193
- groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("g", null)
8196
+ groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement("g", null)
8194
8197
  };
8195
8198
  const VictoryPortal = initialProps => {
8196
8199
  const props = {
8197
8200
  ...defaultProps,
8198
8201
  ...initialProps
8199
8202
  };
8200
- const id = react__WEBPACK_IMPORTED_MODULE_1___default().useId();
8201
- const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_2__.usePortalContext)();
8203
+ const id = lodash_uniqueId__WEBPACK_IMPORTED_MODULE_0___default()();
8204
+ const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_3__.usePortalContext)();
8202
8205
  if (!portalContext) {
8203
8206
  const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
8204
- _victory_util_log__WEBPACK_IMPORTED_MODULE_3__.warn(msg);
8207
+ _victory_util_log__WEBPACK_IMPORTED_MODULE_4__.warn(msg);
8205
8208
  }
8206
8209
  const children = Array.isArray(props.children) ? props.children[0] : props.children;
8207
8210
  const {
@@ -8212,15 +8215,15 @@ const VictoryPortal = initialProps => {
8212
8215
  groupComponent,
8213
8216
  standalone: false
8214
8217
  } : {};
8215
- const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.omit(props, ["children", "groupComponent"]), {
8218
+ const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__.omit(props, ["children", "groupComponent"]), {
8216
8219
  key: childProps.key ?? id
8217
8220
  });
8218
- const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(children, newProps);
8219
- react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
8221
+ const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().cloneElement(children, newProps);
8222
+ react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
8220
8223
  portalContext?.addChild(id, child);
8221
8224
  // eslint-disable-next-line react-hooks/exhaustive-deps
8222
8225
  }, [props.children]);
8223
- react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(() => {
8226
+ react__WEBPACK_IMPORTED_MODULE_2___default().useEffect(() => {
8224
8227
  return () => portalContext?.removeChild(id);
8225
8228
  // eslint-disable-next-line react-hooks/exhaustive-deps
8226
8229
  }, []);
@@ -8569,6 +8572,477 @@ const TSpan = props => {
8569
8572
 
8570
8573
  /***/ }),
8571
8574
 
8575
+ /***/ "../../victory-core/es/victory-theme/clean.js":
8576
+ /*!****************************************************!*\
8577
+ !*** ../../victory-core/es/victory-theme/clean.js ***!
8578
+ \****************************************************/
8579
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
8580
+
8581
+ "use strict";
8582
+ __webpack_require__.r(__webpack_exports__);
8583
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8584
+ /* harmony export */ "clean": function() { return /* binding */ clean; }
8585
+ /* harmony export */ });
8586
+ // *
8587
+ // * Colors
8588
+ // *
8589
+
8590
+ const gray = {
8591
+ white: "#FFFFFF",
8592
+ "50": "#FAFAFA",
8593
+ "100": "#F2F2F2",
8594
+ "200": "#E8E8E8",
8595
+ "300": "#E0E0E0",
8596
+ "400": "#D1D1D1",
8597
+ "500": "#757575",
8598
+ "600": "#5C5C5C",
8599
+ "700": "#424242",
8600
+ "800": "#333333",
8601
+ "900": "#292929",
8602
+ black: "#0F0F0F"
8603
+ };
8604
+ const yellow = {
8605
+ "100": "#FFEAB6",
8606
+ "300": "#FFD66E",
8607
+ "500": "#FCB400",
8608
+ "900": "#B87503"
8609
+ };
8610
+ const orange = {
8611
+ "100": "#FEE2D5",
8612
+ "300": "#FFA981",
8613
+ "500": "#FF6F2C",
8614
+ "900": "#D74D26"
8615
+ };
8616
+ const red = {
8617
+ "100": "#FFDCE5",
8618
+ "300": "#FF9EB7",
8619
+ "500": "#F82B60",
8620
+ "900": "#BA1E45"
8621
+ };
8622
+ const pink = {
8623
+ "100": "#FFDAF6",
8624
+ "300": "#F99DE2",
8625
+ "500": "#FF08C2",
8626
+ "900": "#B2158B"
8627
+ };
8628
+ const purple = {
8629
+ "100": "#EDE3FE",
8630
+ "300": "#CDB0FF",
8631
+ "500": "#8B46FF",
8632
+ "900": "#6B1CB0"
8633
+ };
8634
+ const blue = {
8635
+ "100": "#CFDFFF",
8636
+ "300": "#9CC7FF",
8637
+ "500": "#2D7FF9",
8638
+ "900": "#2750AE"
8639
+ };
8640
+ const cyan = {
8641
+ "100": "#D0F0FD",
8642
+ "300": "#77D1F3",
8643
+ "500": "#18BFFF",
8644
+ "900": "#0B76B7"
8645
+ };
8646
+ const teal = {
8647
+ "100": "#C2F5E9",
8648
+ "300": "#72DDC3",
8649
+ "500": "#20D9D2",
8650
+ "900": "#06A09B"
8651
+ };
8652
+ const green = {
8653
+ "100": "#D1F7C4",
8654
+ "300": "#93E088",
8655
+ "500": "#20C933",
8656
+ "900": "#338A17"
8657
+ };
8658
+ const colors = {
8659
+ blue: blue["500"],
8660
+ pink: pink["500"],
8661
+ teal: teal["500"],
8662
+ purple: purple["500"],
8663
+ green: green["500"],
8664
+ orange: orange["500"],
8665
+ cyan: cyan["500"],
8666
+ red: red["500"],
8667
+ yellow: yellow["500"]
8668
+ };
8669
+ const colorScale = Object.values(colors);
8670
+ const grayscale = [gray["200"], gray["400"], gray["600"], gray["900"]];
8671
+ const warm = [yellow["500"], orange["500"], red["500"], pink["500"]];
8672
+ const cool = [cyan["500"], teal["500"], blue["500"], purple["500"]];
8673
+ const heatmap = [green["500"], yellow["500"], red["500"]];
8674
+ const redPalette = [red["500"], red["300"], red["100"]];
8675
+ const greenPalette = [green["500"], green["300"], green["100"]];
8676
+ const bluePalette = [blue["500"], blue["300"], blue["100"]];
8677
+
8678
+ // *
8679
+ // * Typography
8680
+ // *
8681
+ const sansSerif = "'Inter', 'Helvetica Neue', 'Seravek', 'Helvetica', sans-serif";
8682
+ const letterSpacing = "normal";
8683
+ const fontSize = 12;
8684
+ // *
8685
+ // * Layout
8686
+ // *
8687
+ const padding = 8;
8688
+ const baseProps = {
8689
+ width: 450,
8690
+ height: 300,
8691
+ padding: 50,
8692
+ colorScale
8693
+ };
8694
+ // *
8695
+ // * Labels
8696
+ // *
8697
+ const baseLabelStyles = {
8698
+ fontFamily: sansSerif,
8699
+ fontSize,
8700
+ fontWeight: 300,
8701
+ letterSpacing,
8702
+ padding,
8703
+ fill: gray["900"],
8704
+ stroke: "transparent"
8705
+ };
8706
+ const centeredLabelStyles = Object.assign({
8707
+ textAnchor: "middle"
8708
+ }, baseLabelStyles);
8709
+
8710
+ // *
8711
+ // * Strokes
8712
+ // *
8713
+ const strokeDasharray = "10, 5";
8714
+ const strokeLinecap = "round";
8715
+ const strokeLinejoin = "round";
8716
+ const borderRadius = 1;
8717
+ // *
8718
+ // * Theme
8719
+ // *
8720
+ const clean = {
8721
+ palette: {
8722
+ colors,
8723
+ grayscale,
8724
+ qualitative: colorScale,
8725
+ heatmap,
8726
+ warm,
8727
+ cool,
8728
+ red: redPalette,
8729
+ green: greenPalette,
8730
+ blue: bluePalette
8731
+ },
8732
+ area: Object.assign({
8733
+ style: {
8734
+ data: {
8735
+ fill: blue["500"],
8736
+ strokeWidth: 2,
8737
+ fillOpacity: 0.5
8738
+ },
8739
+ labels: baseLabelStyles
8740
+ }
8741
+ }, baseProps),
8742
+ axis: Object.assign({
8743
+ style: {
8744
+ axis: {
8745
+ fill: "transparent",
8746
+ stroke: gray["500"],
8747
+ strokeWidth: 1,
8748
+ strokeLinecap,
8749
+ strokeLinejoin
8750
+ },
8751
+ axisLabel: Object.assign({}, centeredLabelStyles, {
8752
+ padding,
8753
+ stroke: "transparent"
8754
+ }),
8755
+ grid: {
8756
+ fill: "none",
8757
+ stroke: "none",
8758
+ painterEvents: "painted"
8759
+ },
8760
+ ticks: {
8761
+ fill: "transparent",
8762
+ size: 5,
8763
+ stroke: "transparent"
8764
+ },
8765
+ tickLabels: baseLabelStyles
8766
+ }
8767
+ }, baseProps),
8768
+ polarAxis: Object.assign({
8769
+ style: {
8770
+ axis: {
8771
+ stroke: gray["500"]
8772
+ },
8773
+ grid: {
8774
+ stroke: gray["400"],
8775
+ strokeDasharray,
8776
+ strokeLinecap,
8777
+ strokeLinejoin,
8778
+ pointerEvents: "painted"
8779
+ },
8780
+ ticks: {
8781
+ fill: "transparent",
8782
+ size: 5,
8783
+ stroke: gray["400"],
8784
+ strokeWidth: 1,
8785
+ strokeLinecap,
8786
+ strokeLinejoin
8787
+ },
8788
+ tickLabels: baseLabelStyles
8789
+ }
8790
+ }),
8791
+ polarDependentAxis: Object.assign({
8792
+ style: {
8793
+ axis: {
8794
+ stroke: gray["500"]
8795
+ },
8796
+ grid: {
8797
+ stroke: gray["400"],
8798
+ strokeDasharray,
8799
+ strokeLinecap,
8800
+ strokeLinejoin,
8801
+ pointerEvents: "painted"
8802
+ },
8803
+ ticks: {
8804
+ fill: "transparent",
8805
+ size: 5,
8806
+ stroke: gray["300"],
8807
+ strokeWidth: 1,
8808
+ strokeLinecap,
8809
+ strokeLinejoin
8810
+ },
8811
+ tickLabels: baseLabelStyles
8812
+ }
8813
+ }),
8814
+ bar: Object.assign({
8815
+ style: {
8816
+ data: {
8817
+ fill: blue["500"],
8818
+ padding,
8819
+ strokeWidth: 1,
8820
+ fillOpacity: 0.5
8821
+ },
8822
+ labels: baseLabelStyles
8823
+ },
8824
+ cornerRadius: {
8825
+ top: borderRadius
8826
+ }
8827
+ }, baseProps),
8828
+ boxplot: Object.assign({
8829
+ style: {
8830
+ max: {
8831
+ padding,
8832
+ stroke: gray["400"],
8833
+ strokeWidth: 2
8834
+ },
8835
+ maxLabels: Object.assign({}, baseLabelStyles, {
8836
+ padding: 3
8837
+ }),
8838
+ median: {
8839
+ padding,
8840
+ stroke: gray.white,
8841
+ strokeWidth: 2
8842
+ },
8843
+ medianLabels: Object.assign({}, baseLabelStyles, {
8844
+ padding: 3
8845
+ }),
8846
+ min: {
8847
+ padding,
8848
+ stroke: gray["400"],
8849
+ strokeWidth: 2
8850
+ },
8851
+ minLabels: Object.assign({}, baseLabelStyles, {
8852
+ padding: 3
8853
+ }),
8854
+ q1: {
8855
+ padding,
8856
+ fill: teal["500"],
8857
+ rx: borderRadius,
8858
+ strokeWidth: 2
8859
+ },
8860
+ q1Labels: Object.assign({}, baseLabelStyles, {
8861
+ padding: 3
8862
+ }),
8863
+ q3: {
8864
+ padding,
8865
+ fill: cyan["500"],
8866
+ rx: borderRadius
8867
+ },
8868
+ q3Labels: Object.assign({}, baseLabelStyles, {
8869
+ padding: 3
8870
+ })
8871
+ },
8872
+ boxWidth: 20
8873
+ }, baseProps),
8874
+ candlestick: Object.assign({
8875
+ style: {
8876
+ data: {
8877
+ stroke: gray["300"],
8878
+ strokeWidth: 0,
8879
+ rx: borderRadius
8880
+ },
8881
+ labels: Object.assign({}, baseLabelStyles, {
8882
+ padding: 5
8883
+ })
8884
+ },
8885
+ candleColors: {
8886
+ positive: teal["500"],
8887
+ negative: orange["500"]
8888
+ },
8889
+ wickStrokeWidth: 2
8890
+ }, baseProps),
8891
+ chart: baseProps,
8892
+ errorbar: Object.assign({
8893
+ borderWidth: 8,
8894
+ style: {
8895
+ data: {
8896
+ fill: "transparent",
8897
+ opacity: 1,
8898
+ stroke: gray["700"],
8899
+ strokeWidth: 2,
8900
+ strokeLinecap
8901
+ },
8902
+ labels: baseLabelStyles
8903
+ }
8904
+ }, baseProps),
8905
+ group: Object.assign({
8906
+ colorScale
8907
+ }, baseProps),
8908
+ histogram: Object.assign({
8909
+ style: {
8910
+ data: {
8911
+ fill: cyan["500"],
8912
+ fillOpacity: 0.5
8913
+ },
8914
+ labels: baseLabelStyles
8915
+ },
8916
+ binSpacing: 4,
8917
+ cornerRadius: {
8918
+ top: borderRadius
8919
+ }
8920
+ }, baseProps),
8921
+ label: baseLabelStyles,
8922
+ legend: {
8923
+ colorScale,
8924
+ gutter: 24,
8925
+ borderPadding: 10,
8926
+ orientation: "horizontal",
8927
+ titleOrientation: "top",
8928
+ centerTitle: true,
8929
+ style: {
8930
+ data: {
8931
+ type: "circle"
8932
+ },
8933
+ labels: {
8934
+ ...baseLabelStyles,
8935
+ fontSize: 12
8936
+ },
8937
+ title: Object.assign({}, baseLabelStyles, {
8938
+ padding,
8939
+ fontSize: 16
8940
+ }),
8941
+ border: {
8942
+ stroke: gray["200"],
8943
+ strokeWidth: 2,
8944
+ padding: 16
8945
+ }
8946
+ }
8947
+ },
8948
+ line: Object.assign({
8949
+ style: {
8950
+ data: {
8951
+ fill: "transparent",
8952
+ opacity: 1,
8953
+ stroke: blue["500"],
8954
+ strokeWidth: 2,
8955
+ strokeLinecap,
8956
+ strokeLinejoin
8957
+ },
8958
+ labels: baseLabelStyles
8959
+ }
8960
+ }, baseProps),
8961
+ pie: Object.assign({
8962
+ style: {
8963
+ parent: {
8964
+ backgroundColor: gray.white
8965
+ },
8966
+ data: {
8967
+ padding,
8968
+ stroke: gray.white,
8969
+ strokeWidth: 1
8970
+ },
8971
+ labels: {
8972
+ ...baseLabelStyles,
8973
+ padding: 20,
8974
+ fill: gray["600"],
8975
+ fontSize: 10
8976
+ }
8977
+ },
8978
+ colorScale,
8979
+ cornerRadius: borderRadius
8980
+ }, baseProps),
8981
+ scatter: Object.assign({
8982
+ style: {
8983
+ data: {
8984
+ fill: purple["500"],
8985
+ opacity: 1,
8986
+ stroke: "transparent",
8987
+ strokeWidth: 0
8988
+ },
8989
+ labels: {
8990
+ ...baseLabelStyles,
8991
+ padding: 20
8992
+ }
8993
+ }
8994
+ }, baseProps),
8995
+ stack: Object.assign({
8996
+ colorScale
8997
+ }, baseProps),
8998
+ tooltip: {
8999
+ style: Object.assign({}, baseLabelStyles, {
9000
+ padding: 0,
9001
+ pointerEvents: "none"
9002
+ }),
9003
+ flyoutStyle: {
9004
+ stroke: gray["300"],
9005
+ strokeWidth: 2,
9006
+ fill: gray.white,
9007
+ pointerEvents: "none"
9008
+ },
9009
+ flyoutPadding: {
9010
+ top: 8,
9011
+ bottom: 8,
9012
+ left: 16,
9013
+ right: 16
9014
+ },
9015
+ cornerRadius: borderRadius,
9016
+ pointerLength: 4
9017
+ },
9018
+ voronoi: Object.assign({
9019
+ style: {
9020
+ data: {
9021
+ fill: blue["100"],
9022
+ stroke: blue["500"],
9023
+ strokeWidth: 2,
9024
+ opacity: 0.4
9025
+ },
9026
+ labels: Object.assign({}, baseLabelStyles, {
9027
+ padding: 5,
9028
+ pointerEvents: "none"
9029
+ }),
9030
+ flyout: {
9031
+ stroke: gray["900"],
9032
+ strokeWidth: 1,
9033
+ fill: gray["100"],
9034
+ pointerEvents: "none"
9035
+ },
9036
+ padding: {
9037
+ left: 2,
9038
+ bottom: 2
9039
+ }
9040
+ }
9041
+ }, baseProps)
9042
+ };
9043
+
9044
+ /***/ }),
9045
+
8572
9046
  /***/ "../../victory-core/es/victory-theme/grayscale.js":
8573
9047
  /*!********************************************************!*\
8574
9048
  !*** ../../victory-core/es/victory-theme/grayscale.js ***!
@@ -8583,9 +9057,28 @@ __webpack_require__.r(__webpack_exports__);
8583
9057
  // *
8584
9058
  // * Colors
8585
9059
  // *
8586
- const colors = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
9060
+ const colors = {
9061
+ blue: "#4F7DA1",
9062
+ pink: "#E2A37F",
9063
+ teal: "#00796B",
9064
+ purple: "#DF948A",
9065
+ green: "#8BC34A",
9066
+ orange: "#F4511E",
9067
+ cyan: "#006064",
9068
+ red: "#DF5A49",
9069
+ yellow: "#FFF59D"
9070
+ };
9071
+ const colorScale = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
8587
9072
  const charcoal = "#252525";
8588
9073
  const grey = "#969696";
9074
+ const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
9075
+ const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
9076
+ const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
9077
+ const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
9078
+ const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
9079
+ const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
9080
+ const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
9081
+
8589
9082
  // *
8590
9083
  // * Typography
8591
9084
  // *
@@ -8599,7 +9092,7 @@ const baseProps = {
8599
9092
  width: 450,
8600
9093
  height: 300,
8601
9094
  padding: 50,
8602
- colorScale: colors
9095
+ colorScale
8603
9096
  };
8604
9097
  // *
8605
9098
  // * Labels
@@ -8621,6 +9114,17 @@ const centeredLabelStyles = Object.assign({
8621
9114
  const strokeLinecap = "round";
8622
9115
  const strokeLinejoin = "round";
8623
9116
  const grayscale = {
9117
+ palette: {
9118
+ colors,
9119
+ grayscale: colorScale,
9120
+ qualitative,
9121
+ heatmap,
9122
+ warm,
9123
+ cool,
9124
+ red,
9125
+ green,
9126
+ blue
9127
+ },
8624
9128
  area: Object.assign({
8625
9129
  style: {
8626
9130
  data: {
@@ -8735,7 +9239,7 @@ const grayscale = {
8735
9239
  }
8736
9240
  }, baseProps),
8737
9241
  group: Object.assign({
8738
- colorScale: colors
9242
+ colorScale
8739
9243
  }, baseProps),
8740
9244
  histogram: Object.assign({
8741
9245
  style: {
@@ -8748,7 +9252,7 @@ const grayscale = {
8748
9252
  }
8749
9253
  }, baseProps),
8750
9254
  legend: {
8751
- colorScale: colors,
9255
+ colorScale,
8752
9256
  gutter: 10,
8753
9257
  orientation: "vertical",
8754
9258
  titleOrientation: "top",
@@ -8783,7 +9287,7 @@ const grayscale = {
8783
9287
  padding: 20
8784
9288
  })
8785
9289
  },
8786
- colorScale: colors,
9290
+ colorScale,
8787
9291
  width: 400,
8788
9292
  height: 400,
8789
9293
  padding: 50
@@ -8799,7 +9303,7 @@ const grayscale = {
8799
9303
  }
8800
9304
  }, baseProps),
8801
9305
  stack: Object.assign({
8802
- colorScale: colors
9306
+ colorScale
8803
9307
  }, baseProps),
8804
9308
  tooltip: {
8805
9309
  style: Object.assign({}, baseLabelStyles, {
@@ -8859,11 +9363,31 @@ const lime300 = "#DCE775";
8859
9363
  const lightGreen500 = "#8BC34A";
8860
9364
  const teal700 = "#00796B";
8861
9365
  const cyan900 = "#006064";
8862
- const colors = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
9366
+ const colorScale = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
8863
9367
  const blueGrey50 = "#ECEFF1";
8864
9368
  const blueGrey300 = "#90A4AE";
8865
9369
  const blueGrey700 = "#455A64";
8866
9370
  const grey900 = "#212121";
9371
+ const colors = {
9372
+ blue: "#4F7DA1",
9373
+ pink: "#E2A37F",
9374
+ teal: teal700,
9375
+ purple: "#DF948A",
9376
+ green: lightGreen500,
9377
+ orange: deepOrange600,
9378
+ cyan: cyan900,
9379
+ red: "#DF5A49",
9380
+ yellow: yellow200
9381
+ };
9382
+ const grayscale = [blueGrey50, blueGrey300, blueGrey700, grey900];
9383
+ const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
9384
+ const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
9385
+ const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
9386
+ const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
9387
+ const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
9388
+ const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
9389
+ const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
9390
+
8867
9391
  // *
8868
9392
  // * Typography
8869
9393
  // *
@@ -8901,6 +9425,17 @@ const strokeDasharray = "10, 5";
8901
9425
  const strokeLinecap = "round";
8902
9426
  const strokeLinejoin = "round";
8903
9427
  const material = {
9428
+ palette: {
9429
+ colors,
9430
+ grayscale,
9431
+ qualitative,
9432
+ heatmap,
9433
+ warm,
9434
+ cool,
9435
+ red,
9436
+ green,
9437
+ blue
9438
+ },
8904
9439
  area: Object.assign({
8905
9440
  style: {
8906
9441
  data: {
@@ -9033,7 +9568,7 @@ const material = {
9033
9568
  }
9034
9569
  }, baseProps),
9035
9570
  group: Object.assign({
9036
- colorScale: colors
9571
+ colorScale
9037
9572
  }, baseProps),
9038
9573
  histogram: Object.assign({
9039
9574
  style: {
@@ -9046,7 +9581,7 @@ const material = {
9046
9581
  }
9047
9582
  }, baseProps),
9048
9583
  legend: {
9049
- colorScale: colors,
9584
+ colorScale,
9050
9585
  gutter: 10,
9051
9586
  orientation: "vertical",
9052
9587
  titleOrientation: "top",
@@ -9072,7 +9607,7 @@ const material = {
9072
9607
  }
9073
9608
  }, baseProps),
9074
9609
  pie: Object.assign({
9075
- colorScale: colors,
9610
+ colorScale,
9076
9611
  style: {
9077
9612
  data: {
9078
9613
  padding,
@@ -9096,7 +9631,7 @@ const material = {
9096
9631
  }
9097
9632
  }, baseProps),
9098
9633
  stack: Object.assign({
9099
- colorScale: colors
9634
+ colorScale
9100
9635
  }, baseProps),
9101
9636
  tooltip: {
9102
9637
  style: Object.assign({}, baseLabelStyles, {
@@ -9149,12 +9684,15 @@ __webpack_require__.r(__webpack_exports__);
9149
9684
  /* harmony export */ });
9150
9685
  /* harmony import */ var _grayscale__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./grayscale */ "../../victory-core/es/victory-theme/grayscale.js");
9151
9686
  /* harmony import */ var _material__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./material */ "../../victory-core/es/victory-theme/material.js");
9687
+ /* harmony import */ var _clean__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./clean */ "../../victory-core/es/victory-theme/clean.js");
9688
+
9152
9689
 
9153
9690
 
9154
9691
 
9155
9692
  const VictoryTheme = {
9156
9693
  grayscale: _grayscale__WEBPACK_IMPORTED_MODULE_0__.grayscale,
9157
- material: _material__WEBPACK_IMPORTED_MODULE_1__.material
9694
+ material: _material__WEBPACK_IMPORTED_MODULE_1__.material,
9695
+ clean: _clean__WEBPACK_IMPORTED_MODULE_2__.clean
9158
9696
  };
9159
9697
 
9160
9698
  /***/ }),
@@ -11958,6 +12496,9 @@ __webpack_require__.r(__webpack_exports__);
11958
12496
  /* harmony export */ "getColorScale": function() { return /* binding */ getColorScale; },
11959
12497
  /* harmony export */ "toTransformString": function() { return /* binding */ toTransformString; }
11960
12498
  /* harmony export */ });
12499
+ /* 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");
12500
+
12501
+
11961
12502
  /**
11962
12503
  * Given an object with CSS/SVG transform definitions, return the string value
11963
12504
  * for use with the `transform` CSS property or SVG attribute. Note that we
@@ -11994,20 +12535,37 @@ const toTransformString = function (obj) {
11994
12535
  * of 5 hex string values in that color scale. If no 'name' parameter
11995
12536
  * is given, it will return the Victory default grayscale.
11996
12537
  * @param {String} name The name of the color scale to return (optional).
12538
+ * @param {Object} theme The theme object to retrieve the color scale from (optional).
11997
12539
  * @returns {Array} An array of 5 hex string values composing a color scale.
11998
12540
  */
11999
- function getColorScale(name) {
12541
+ function getColorScale(name, theme) {
12542
+ if (theme === void 0) {
12543
+ theme = _victory_theme_victory_theme__WEBPACK_IMPORTED_MODULE_0__.VictoryTheme.material;
12544
+ }
12545
+ const {
12546
+ palette: {
12547
+ grayscale = ["#cccccc", "#969696", "#636363", "#252525"],
12548
+ qualitative = [],
12549
+ heatmap = [],
12550
+ warm = [],
12551
+ cool = [],
12552
+ red = [],
12553
+ blue = [],
12554
+ green = []
12555
+ } = {}
12556
+ } = theme;
12000
12557
  const scales = {
12001
- grayscale: ["#cccccc", "#969696", "#636363", "#252525"],
12002
- qualitative: ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"],
12003
- heatmap: ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"],
12004
- warm: ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"],
12005
- cool: ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"],
12006
- red: ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"],
12007
- blue: ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"],
12008
- green: ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"]
12558
+ grayscale,
12559
+ qualitative,
12560
+ heatmap,
12561
+ warm,
12562
+ cool,
12563
+ red,
12564
+ blue,
12565
+ green
12009
12566
  };
12010
- return name ? scales[name] : scales.grayscale;
12567
+ const selectedScale = name && scales[name]?.length ? scales[name] : scales.grayscale;
12568
+ return selectedScale;
12011
12569
  }
12012
12570
 
12013
12571
  /***/ }),
@@ -12034,6 +12592,7 @@ __webpack_require__.r(__webpack_exports__);
12034
12592
  /* eslint-disable no-magic-numbers */
12035
12593
  // Based on measuring specific character widths
12036
12594
  // as in the following example https://bl.ocks.org/tophtucker/62f93a4658387bb61e4510c37e2e97cf
12595
+ // For new fonts: pull gist, open index.html locally, add font files (if not generic), enter font name in `font-family` input
12037
12596
  // prettier-ignore
12038
12597
  const fonts = {
12039
12598
  "American Typewriter": {
@@ -12092,6 +12651,10 @@ const fonts = {
12092
12651
  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],
12093
12652
  avg: 0.5116447368421051
12094
12653
  },
12654
+ "Inter": {
12655
+ 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],
12656
+ avg: 0.5624362664473683
12657
+ },
12095
12658
  "Montserrat": {
12096
12659
  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],
12097
12660
  avg: 0.571792763157895
@@ -12760,7 +13323,9 @@ function getAllEvents(props) {
12760
13323
  }
12761
13324
  return events || [];
12762
13325
  }
12763
- function getColor(calculatedProps, child, index) {
13326
+
13327
+ // eslint-disable-next-line max-params
13328
+ function getColor(calculatedProps, child, index, theme) {
12764
13329
  // check for styles first
12765
13330
  const {
12766
13331
  style
@@ -12777,14 +13342,16 @@ function getColor(calculatedProps, child, index) {
12777
13342
  if (!colorScale && !color) {
12778
13343
  return undefined;
12779
13344
  }
12780
- const colors = Array.isArray(colorScale) ? colorScale : _style__WEBPACK_IMPORTED_MODULE_13__.getColorScale(colorScale);
13345
+ const colors = Array.isArray(colorScale) ? colorScale : _style__WEBPACK_IMPORTED_MODULE_13__.getColorScale(colorScale, theme);
12781
13346
  return color || colors[index % colors.length];
12782
13347
  }
12783
13348
  function getStyle(theme, style, role) {
12784
13349
  const defaultStyle = theme && theme[role] && theme[role].style ? theme[role].style : {};
12785
13350
  return _helpers__WEBPACK_IMPORTED_MODULE_7__.getStyles(style, defaultStyle);
12786
13351
  }
12787
- function getChildStyle(child, index, calculatedProps) {
13352
+
13353
+ // eslint-disable-next-line max-params
13354
+ function getChildStyle(child, index, calculatedProps, theme) {
12788
13355
  const {
12789
13356
  style,
12790
13357
  role
@@ -12794,7 +13361,7 @@ function getChildStyle(child, index, calculatedProps) {
12794
13361
  return childStyle;
12795
13362
  }
12796
13363
  const childRole = child.type && child.type.role;
12797
- const defaultFill = childRole === "stack" ? undefined : getColor(calculatedProps, child, index);
13364
+ const defaultFill = childRole === "stack" ? undefined : getColor(calculatedProps, child, index, theme);
12798
13365
  const defaultColor = childRole === "line" ? {
12799
13366
  fill: "none",
12800
13367
  stroke: defaultFill
@@ -14738,6 +15305,7 @@ class VoronoiHelpersClass {
14738
15305
  }
14739
15306
  }
14740
15307
  onMouseLeave = (evt, targetProps) => {
15308
+ this.onMouseMove.cancel();
14741
15309
  const activePoints = targetProps.activePoints || [];
14742
15310
  this.onDeactivated(targetProps, activePoints);
14743
15311
  const inactiveMutations = activePoints.length ? activePoints.map(point => this.getInactiveMutations(targetProps, point)) : [];