victory-chart 37.1.2 → 37.3.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.
- package/CHANGELOG.md +4 -0
- package/dist/victory-chart.js +293 -168
- package/dist/victory-chart.min.js +1 -1
- package/package.json +5 -5
package/dist/victory-chart.js
CHANGED
|
@@ -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
|
|
7120
|
-
/* harmony import */ var
|
|
7121
|
-
/* harmony import */ var
|
|
7122
|
-
/* harmony import */ var
|
|
7123
|
-
/* harmony import */ var
|
|
7124
|
-
/* harmony import */ var
|
|
7125
|
-
/* harmony import */ var
|
|
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__*/
|
|
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 =
|
|
7140
|
-
const portalContext = (0,
|
|
7142
|
+
const [id] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(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
|
-
|
|
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 =
|
|
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__*/
|
|
7158
|
-
|
|
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
|
-
|
|
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
|
}, []);
|
|
@@ -7690,20 +7693,16 @@ const orange = {
|
|
|
7690
7693
|
"100": "#FEE2D5",
|
|
7691
7694
|
"300": "#FFA981",
|
|
7692
7695
|
"500": "#FF6F2C",
|
|
7696
|
+
"700": "#FF4E1B",
|
|
7693
7697
|
"900": "#D74D26"
|
|
7694
7698
|
};
|
|
7695
7699
|
const red = {
|
|
7696
7700
|
"100": "#FFDCE5",
|
|
7697
7701
|
"300": "#FF9EB7",
|
|
7698
7702
|
"500": "#F82B60",
|
|
7703
|
+
"700": "#D31A3D",
|
|
7699
7704
|
"900": "#BA1E45"
|
|
7700
7705
|
};
|
|
7701
|
-
const pink = {
|
|
7702
|
-
"100": "#FFDAF6",
|
|
7703
|
-
"300": "#F99DE2",
|
|
7704
|
-
"500": "#FF08C2",
|
|
7705
|
-
"900": "#B2158B"
|
|
7706
|
-
};
|
|
7707
7706
|
const purple = {
|
|
7708
7707
|
"100": "#EDE3FE",
|
|
7709
7708
|
"300": "#CDB0FF",
|
|
@@ -7714,6 +7713,7 @@ const blue = {
|
|
|
7714
7713
|
"100": "#CFDFFF",
|
|
7715
7714
|
"300": "#9CC7FF",
|
|
7716
7715
|
"500": "#2D7FF9",
|
|
7716
|
+
"700": "#0056B3",
|
|
7717
7717
|
"900": "#2750AE"
|
|
7718
7718
|
};
|
|
7719
7719
|
const cyan = {
|
|
@@ -7732,9 +7732,29 @@ const green = {
|
|
|
7732
7732
|
"100": "#D1F7C4",
|
|
7733
7733
|
"300": "#93E088",
|
|
7734
7734
|
"500": "#20C933",
|
|
7735
|
+
"700": "#1B9B2A",
|
|
7735
7736
|
"900": "#338A17"
|
|
7736
7737
|
};
|
|
7737
|
-
const colors =
|
|
7738
|
+
const colors = {
|
|
7739
|
+
blue: blue["500"],
|
|
7740
|
+
cyan: cyan["500"],
|
|
7741
|
+
green: green["500"],
|
|
7742
|
+
yellow: yellow["500"],
|
|
7743
|
+
orange: orange["500"],
|
|
7744
|
+
red: red["500"],
|
|
7745
|
+
purple: purple["500"],
|
|
7746
|
+
teal: teal["500"]
|
|
7747
|
+
};
|
|
7748
|
+
const colorScale = Object.values(colors);
|
|
7749
|
+
const grayscale = [gray["100"], gray["300"], gray["500"], gray["700"], gray["900"]];
|
|
7750
|
+
const warm = [yellow["300"], yellow["500"], orange["500"], orange["900"], red["500"]];
|
|
7751
|
+
const cool = [purple["500"], blue["500"], cyan["500"], teal["500"], green["500"]];
|
|
7752
|
+
const heatmap = [green["900"], green["500"], yellow["500"], orange["500"], red["500"]];
|
|
7753
|
+
const redPalette = Object.values(red);
|
|
7754
|
+
const greenPalette = Object.values(green);
|
|
7755
|
+
const bluePalette = Object.values(blue);
|
|
7756
|
+
const defaultColor = blue["500"];
|
|
7757
|
+
|
|
7738
7758
|
// *
|
|
7739
7759
|
// * Typography
|
|
7740
7760
|
// *
|
|
@@ -7748,8 +7768,8 @@ const padding = 8;
|
|
|
7748
7768
|
const baseProps = {
|
|
7749
7769
|
width: 450,
|
|
7750
7770
|
height: 300,
|
|
7751
|
-
padding:
|
|
7752
|
-
colorScale
|
|
7771
|
+
padding: 60,
|
|
7772
|
+
colorScale
|
|
7753
7773
|
};
|
|
7754
7774
|
// *
|
|
7755
7775
|
// * Labels
|
|
@@ -7778,10 +7798,23 @@ const borderRadius = 1;
|
|
|
7778
7798
|
// * Theme
|
|
7779
7799
|
// *
|
|
7780
7800
|
const clean = {
|
|
7801
|
+
palette: {
|
|
7802
|
+
colors,
|
|
7803
|
+
grayscale,
|
|
7804
|
+
qualitative: colorScale,
|
|
7805
|
+
heatmap,
|
|
7806
|
+
warm,
|
|
7807
|
+
cool,
|
|
7808
|
+
red: redPalette,
|
|
7809
|
+
green: greenPalette,
|
|
7810
|
+
blue: bluePalette
|
|
7811
|
+
},
|
|
7781
7812
|
area: Object.assign({
|
|
7782
7813
|
style: {
|
|
7783
7814
|
data: {
|
|
7784
|
-
fill:
|
|
7815
|
+
fill: defaultColor,
|
|
7816
|
+
strokeWidth: 2,
|
|
7817
|
+
fillOpacity: 0.5
|
|
7785
7818
|
},
|
|
7786
7819
|
labels: baseLabelStyles
|
|
7787
7820
|
}
|
|
@@ -7790,13 +7823,13 @@ const clean = {
|
|
|
7790
7823
|
style: {
|
|
7791
7824
|
axis: {
|
|
7792
7825
|
fill: "transparent",
|
|
7793
|
-
stroke: gray["
|
|
7826
|
+
stroke: gray["500"],
|
|
7794
7827
|
strokeWidth: 1,
|
|
7795
7828
|
strokeLinecap,
|
|
7796
7829
|
strokeLinejoin
|
|
7797
7830
|
},
|
|
7798
7831
|
axisLabel: Object.assign({}, centeredLabelStyles, {
|
|
7799
|
-
padding,
|
|
7832
|
+
padding: 35,
|
|
7800
7833
|
stroke: "transparent"
|
|
7801
7834
|
}),
|
|
7802
7835
|
grid: {
|
|
@@ -7815,10 +7848,10 @@ const clean = {
|
|
|
7815
7848
|
polarAxis: Object.assign({
|
|
7816
7849
|
style: {
|
|
7817
7850
|
axis: {
|
|
7818
|
-
stroke: gray["
|
|
7851
|
+
stroke: gray["500"]
|
|
7819
7852
|
},
|
|
7820
7853
|
grid: {
|
|
7821
|
-
stroke: gray["
|
|
7854
|
+
stroke: gray["400"],
|
|
7822
7855
|
strokeDasharray,
|
|
7823
7856
|
strokeLinecap,
|
|
7824
7857
|
strokeLinejoin,
|
|
@@ -7827,7 +7860,7 @@ const clean = {
|
|
|
7827
7860
|
ticks: {
|
|
7828
7861
|
fill: "transparent",
|
|
7829
7862
|
size: 5,
|
|
7830
|
-
stroke: gray["
|
|
7863
|
+
stroke: gray["400"],
|
|
7831
7864
|
strokeWidth: 1,
|
|
7832
7865
|
strokeLinecap,
|
|
7833
7866
|
strokeLinejoin
|
|
@@ -7838,10 +7871,10 @@ const clean = {
|
|
|
7838
7871
|
polarDependentAxis: Object.assign({
|
|
7839
7872
|
style: {
|
|
7840
7873
|
axis: {
|
|
7841
|
-
stroke: gray["
|
|
7874
|
+
stroke: gray["500"]
|
|
7842
7875
|
},
|
|
7843
7876
|
grid: {
|
|
7844
|
-
stroke: gray["
|
|
7877
|
+
stroke: gray["400"],
|
|
7845
7878
|
strokeDasharray,
|
|
7846
7879
|
strokeLinecap,
|
|
7847
7880
|
strokeLinejoin,
|
|
@@ -7850,7 +7883,7 @@ const clean = {
|
|
|
7850
7883
|
ticks: {
|
|
7851
7884
|
fill: "transparent",
|
|
7852
7885
|
size: 5,
|
|
7853
|
-
stroke: gray["
|
|
7886
|
+
stroke: gray["300"],
|
|
7854
7887
|
strokeWidth: 1,
|
|
7855
7888
|
strokeLinecap,
|
|
7856
7889
|
strokeLinejoin
|
|
@@ -7861,9 +7894,10 @@ const clean = {
|
|
|
7861
7894
|
bar: Object.assign({
|
|
7862
7895
|
style: {
|
|
7863
7896
|
data: {
|
|
7864
|
-
fill:
|
|
7897
|
+
fill: defaultColor,
|
|
7865
7898
|
padding,
|
|
7866
|
-
strokeWidth:
|
|
7899
|
+
strokeWidth: 1,
|
|
7900
|
+
fillOpacity: 0.5
|
|
7867
7901
|
},
|
|
7868
7902
|
labels: baseLabelStyles
|
|
7869
7903
|
},
|
|
@@ -7899,15 +7933,16 @@ const clean = {
|
|
|
7899
7933
|
}),
|
|
7900
7934
|
q1: {
|
|
7901
7935
|
padding,
|
|
7902
|
-
fill:
|
|
7903
|
-
rx: borderRadius
|
|
7936
|
+
fill: colorScale[0],
|
|
7937
|
+
rx: borderRadius,
|
|
7938
|
+
strokeWidth: 2
|
|
7904
7939
|
},
|
|
7905
7940
|
q1Labels: Object.assign({}, baseLabelStyles, {
|
|
7906
7941
|
padding: 3
|
|
7907
7942
|
}),
|
|
7908
7943
|
q3: {
|
|
7909
7944
|
padding,
|
|
7910
|
-
fill:
|
|
7945
|
+
fill: colorScale[1],
|
|
7911
7946
|
rx: borderRadius
|
|
7912
7947
|
},
|
|
7913
7948
|
q3Labels: Object.assign({}, baseLabelStyles, {
|
|
@@ -7928,8 +7963,8 @@ const clean = {
|
|
|
7928
7963
|
})
|
|
7929
7964
|
},
|
|
7930
7965
|
candleColors: {
|
|
7931
|
-
positive:
|
|
7932
|
-
negative:
|
|
7966
|
+
positive: green["500"],
|
|
7967
|
+
negative: red["500"]
|
|
7933
7968
|
},
|
|
7934
7969
|
wickStrokeWidth: 2
|
|
7935
7970
|
}, baseProps),
|
|
@@ -7948,14 +7983,13 @@ const clean = {
|
|
|
7948
7983
|
}
|
|
7949
7984
|
}, baseProps),
|
|
7950
7985
|
group: Object.assign({
|
|
7951
|
-
colorScale
|
|
7986
|
+
colorScale
|
|
7952
7987
|
}, baseProps),
|
|
7953
7988
|
histogram: Object.assign({
|
|
7954
7989
|
style: {
|
|
7955
7990
|
data: {
|
|
7956
7991
|
fill: cyan["500"],
|
|
7957
|
-
|
|
7958
|
-
strokeWidth: 0
|
|
7992
|
+
fillOpacity: 0.5
|
|
7959
7993
|
},
|
|
7960
7994
|
labels: baseLabelStyles
|
|
7961
7995
|
},
|
|
@@ -7966,21 +8000,23 @@ const clean = {
|
|
|
7966
8000
|
}, baseProps),
|
|
7967
8001
|
label: baseLabelStyles,
|
|
7968
8002
|
legend: {
|
|
7969
|
-
colorScale
|
|
7970
|
-
gutter:
|
|
7971
|
-
|
|
8003
|
+
colorScale,
|
|
8004
|
+
gutter: 24,
|
|
8005
|
+
borderPadding: 10,
|
|
8006
|
+
orientation: "horizontal",
|
|
7972
8007
|
titleOrientation: "top",
|
|
8008
|
+
centerTitle: true,
|
|
7973
8009
|
style: {
|
|
7974
8010
|
data: {
|
|
7975
8011
|
type: "circle"
|
|
7976
8012
|
},
|
|
7977
8013
|
labels: {
|
|
7978
8014
|
...baseLabelStyles,
|
|
7979
|
-
fontSize:
|
|
8015
|
+
fontSize: 12
|
|
7980
8016
|
},
|
|
7981
8017
|
title: Object.assign({}, baseLabelStyles, {
|
|
7982
8018
|
padding,
|
|
7983
|
-
fontSize:
|
|
8019
|
+
fontSize: 16
|
|
7984
8020
|
}),
|
|
7985
8021
|
border: {
|
|
7986
8022
|
stroke: gray["200"],
|
|
@@ -7994,7 +8030,7 @@ const clean = {
|
|
|
7994
8030
|
data: {
|
|
7995
8031
|
fill: "transparent",
|
|
7996
8032
|
opacity: 1,
|
|
7997
|
-
stroke:
|
|
8033
|
+
stroke: defaultColor,
|
|
7998
8034
|
strokeWidth: 2,
|
|
7999
8035
|
strokeLinecap,
|
|
8000
8036
|
strokeLinejoin
|
|
@@ -8004,31 +8040,40 @@ const clean = {
|
|
|
8004
8040
|
}, baseProps),
|
|
8005
8041
|
pie: Object.assign({
|
|
8006
8042
|
style: {
|
|
8043
|
+
parent: {
|
|
8044
|
+
backgroundColor: gray.white
|
|
8045
|
+
},
|
|
8007
8046
|
data: {
|
|
8008
8047
|
padding,
|
|
8009
8048
|
stroke: gray.white,
|
|
8010
8049
|
strokeWidth: 1
|
|
8011
8050
|
},
|
|
8012
|
-
labels:
|
|
8013
|
-
|
|
8014
|
-
|
|
8051
|
+
labels: {
|
|
8052
|
+
...baseLabelStyles,
|
|
8053
|
+
padding: 20,
|
|
8054
|
+
fill: gray["600"],
|
|
8055
|
+
fontSize: 10
|
|
8056
|
+
}
|
|
8015
8057
|
},
|
|
8016
|
-
colorScale
|
|
8058
|
+
colorScale,
|
|
8017
8059
|
cornerRadius: borderRadius
|
|
8018
8060
|
}, baseProps),
|
|
8019
8061
|
scatter: Object.assign({
|
|
8020
8062
|
style: {
|
|
8021
8063
|
data: {
|
|
8022
|
-
fill:
|
|
8064
|
+
fill: defaultColor,
|
|
8023
8065
|
opacity: 1,
|
|
8024
8066
|
stroke: "transparent",
|
|
8025
8067
|
strokeWidth: 0
|
|
8026
8068
|
},
|
|
8027
|
-
labels:
|
|
8069
|
+
labels: {
|
|
8070
|
+
...baseLabelStyles,
|
|
8071
|
+
padding: 20
|
|
8072
|
+
}
|
|
8028
8073
|
}
|
|
8029
8074
|
}, baseProps),
|
|
8030
8075
|
stack: Object.assign({
|
|
8031
|
-
colorScale
|
|
8076
|
+
colorScale
|
|
8032
8077
|
}, baseProps),
|
|
8033
8078
|
tooltip: {
|
|
8034
8079
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -8036,7 +8081,7 @@ const clean = {
|
|
|
8036
8081
|
pointerEvents: "none"
|
|
8037
8082
|
}),
|
|
8038
8083
|
flyoutStyle: {
|
|
8039
|
-
stroke: gray["
|
|
8084
|
+
stroke: gray["300"],
|
|
8040
8085
|
strokeWidth: 2,
|
|
8041
8086
|
fill: gray.white,
|
|
8042
8087
|
pointerEvents: "none"
|
|
@@ -8053,8 +8098,8 @@ const clean = {
|
|
|
8053
8098
|
voronoi: Object.assign({
|
|
8054
8099
|
style: {
|
|
8055
8100
|
data: {
|
|
8056
|
-
fill:
|
|
8057
|
-
stroke:
|
|
8101
|
+
fill: blue["100"],
|
|
8102
|
+
stroke: defaultColor,
|
|
8058
8103
|
strokeWidth: 2
|
|
8059
8104
|
},
|
|
8060
8105
|
labels: Object.assign({}, baseLabelStyles, {
|
|
@@ -8091,9 +8136,28 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8091
8136
|
// *
|
|
8092
8137
|
// * Colors
|
|
8093
8138
|
// *
|
|
8094
|
-
const colors =
|
|
8139
|
+
const colors = {
|
|
8140
|
+
blue: "#4F7DA1",
|
|
8141
|
+
pink: "#E2A37F",
|
|
8142
|
+
teal: "#00796B",
|
|
8143
|
+
purple: "#DF948A",
|
|
8144
|
+
green: "#8BC34A",
|
|
8145
|
+
orange: "#F4511E",
|
|
8146
|
+
cyan: "#006064",
|
|
8147
|
+
red: "#DF5A49",
|
|
8148
|
+
yellow: "#FFF59D"
|
|
8149
|
+
};
|
|
8150
|
+
const colorScale = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
|
|
8095
8151
|
const charcoal = "#252525";
|
|
8096
8152
|
const grey = "#969696";
|
|
8153
|
+
const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
|
|
8154
|
+
const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
|
|
8155
|
+
const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
|
|
8156
|
+
const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
|
|
8157
|
+
const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
|
|
8158
|
+
const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
|
|
8159
|
+
const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
|
|
8160
|
+
|
|
8097
8161
|
// *
|
|
8098
8162
|
// * Typography
|
|
8099
8163
|
// *
|
|
@@ -8107,7 +8171,7 @@ const baseProps = {
|
|
|
8107
8171
|
width: 450,
|
|
8108
8172
|
height: 300,
|
|
8109
8173
|
padding: 50,
|
|
8110
|
-
colorScale
|
|
8174
|
+
colorScale
|
|
8111
8175
|
};
|
|
8112
8176
|
// *
|
|
8113
8177
|
// * Labels
|
|
@@ -8129,6 +8193,17 @@ const centeredLabelStyles = Object.assign({
|
|
|
8129
8193
|
const strokeLinecap = "round";
|
|
8130
8194
|
const strokeLinejoin = "round";
|
|
8131
8195
|
const grayscale = {
|
|
8196
|
+
palette: {
|
|
8197
|
+
colors,
|
|
8198
|
+
grayscale: colorScale,
|
|
8199
|
+
qualitative,
|
|
8200
|
+
heatmap,
|
|
8201
|
+
warm,
|
|
8202
|
+
cool,
|
|
8203
|
+
red,
|
|
8204
|
+
green,
|
|
8205
|
+
blue
|
|
8206
|
+
},
|
|
8132
8207
|
area: Object.assign({
|
|
8133
8208
|
style: {
|
|
8134
8209
|
data: {
|
|
@@ -8243,7 +8318,7 @@ const grayscale = {
|
|
|
8243
8318
|
}
|
|
8244
8319
|
}, baseProps),
|
|
8245
8320
|
group: Object.assign({
|
|
8246
|
-
colorScale
|
|
8321
|
+
colorScale
|
|
8247
8322
|
}, baseProps),
|
|
8248
8323
|
histogram: Object.assign({
|
|
8249
8324
|
style: {
|
|
@@ -8256,7 +8331,7 @@ const grayscale = {
|
|
|
8256
8331
|
}
|
|
8257
8332
|
}, baseProps),
|
|
8258
8333
|
legend: {
|
|
8259
|
-
colorScale
|
|
8334
|
+
colorScale,
|
|
8260
8335
|
gutter: 10,
|
|
8261
8336
|
orientation: "vertical",
|
|
8262
8337
|
titleOrientation: "top",
|
|
@@ -8291,7 +8366,7 @@ const grayscale = {
|
|
|
8291
8366
|
padding: 20
|
|
8292
8367
|
})
|
|
8293
8368
|
},
|
|
8294
|
-
colorScale
|
|
8369
|
+
colorScale,
|
|
8295
8370
|
width: 400,
|
|
8296
8371
|
height: 400,
|
|
8297
8372
|
padding: 50
|
|
@@ -8307,7 +8382,7 @@ const grayscale = {
|
|
|
8307
8382
|
}
|
|
8308
8383
|
}, baseProps),
|
|
8309
8384
|
stack: Object.assign({
|
|
8310
|
-
colorScale
|
|
8385
|
+
colorScale
|
|
8311
8386
|
}, baseProps),
|
|
8312
8387
|
tooltip: {
|
|
8313
8388
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -8367,11 +8442,31 @@ const lime300 = "#DCE775";
|
|
|
8367
8442
|
const lightGreen500 = "#8BC34A";
|
|
8368
8443
|
const teal700 = "#00796B";
|
|
8369
8444
|
const cyan900 = "#006064";
|
|
8370
|
-
const
|
|
8445
|
+
const colorScale = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
|
|
8371
8446
|
const blueGrey50 = "#ECEFF1";
|
|
8372
8447
|
const blueGrey300 = "#90A4AE";
|
|
8373
8448
|
const blueGrey700 = "#455A64";
|
|
8374
8449
|
const grey900 = "#212121";
|
|
8450
|
+
const colors = {
|
|
8451
|
+
blue: "#4F7DA1",
|
|
8452
|
+
pink: "#E2A37F",
|
|
8453
|
+
teal: teal700,
|
|
8454
|
+
purple: "#DF948A",
|
|
8455
|
+
green: lightGreen500,
|
|
8456
|
+
orange: deepOrange600,
|
|
8457
|
+
cyan: cyan900,
|
|
8458
|
+
red: "#DF5A49",
|
|
8459
|
+
yellow: yellow200
|
|
8460
|
+
};
|
|
8461
|
+
const grayscale = [blueGrey50, blueGrey300, blueGrey700, grey900];
|
|
8462
|
+
const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
|
|
8463
|
+
const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
|
|
8464
|
+
const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
|
|
8465
|
+
const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
|
|
8466
|
+
const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
|
|
8467
|
+
const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
|
|
8468
|
+
const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
|
|
8469
|
+
|
|
8375
8470
|
// *
|
|
8376
8471
|
// * Typography
|
|
8377
8472
|
// *
|
|
@@ -8409,6 +8504,17 @@ const strokeDasharray = "10, 5";
|
|
|
8409
8504
|
const strokeLinecap = "round";
|
|
8410
8505
|
const strokeLinejoin = "round";
|
|
8411
8506
|
const material = {
|
|
8507
|
+
palette: {
|
|
8508
|
+
colors,
|
|
8509
|
+
grayscale,
|
|
8510
|
+
qualitative,
|
|
8511
|
+
heatmap,
|
|
8512
|
+
warm,
|
|
8513
|
+
cool,
|
|
8514
|
+
red,
|
|
8515
|
+
green,
|
|
8516
|
+
blue
|
|
8517
|
+
},
|
|
8412
8518
|
area: Object.assign({
|
|
8413
8519
|
style: {
|
|
8414
8520
|
data: {
|
|
@@ -8541,7 +8647,7 @@ const material = {
|
|
|
8541
8647
|
}
|
|
8542
8648
|
}, baseProps),
|
|
8543
8649
|
group: Object.assign({
|
|
8544
|
-
colorScale
|
|
8650
|
+
colorScale
|
|
8545
8651
|
}, baseProps),
|
|
8546
8652
|
histogram: Object.assign({
|
|
8547
8653
|
style: {
|
|
@@ -8554,7 +8660,7 @@ const material = {
|
|
|
8554
8660
|
}
|
|
8555
8661
|
}, baseProps),
|
|
8556
8662
|
legend: {
|
|
8557
|
-
colorScale
|
|
8663
|
+
colorScale,
|
|
8558
8664
|
gutter: 10,
|
|
8559
8665
|
orientation: "vertical",
|
|
8560
8666
|
titleOrientation: "top",
|
|
@@ -8580,7 +8686,7 @@ const material = {
|
|
|
8580
8686
|
}
|
|
8581
8687
|
}, baseProps),
|
|
8582
8688
|
pie: Object.assign({
|
|
8583
|
-
colorScale
|
|
8689
|
+
colorScale,
|
|
8584
8690
|
style: {
|
|
8585
8691
|
data: {
|
|
8586
8692
|
padding,
|
|
@@ -8604,7 +8710,7 @@ const material = {
|
|
|
8604
8710
|
}
|
|
8605
8711
|
}, baseProps),
|
|
8606
8712
|
stack: Object.assign({
|
|
8607
|
-
colorScale
|
|
8713
|
+
colorScale
|
|
8608
8714
|
}, baseProps),
|
|
8609
8715
|
tooltip: {
|
|
8610
8716
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -11992,6 +12098,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11992
12098
|
/* harmony export */ "getColorScale": function() { return /* binding */ getColorScale; },
|
|
11993
12099
|
/* harmony export */ "toTransformString": function() { return /* binding */ toTransformString; }
|
|
11994
12100
|
/* harmony export */ });
|
|
12101
|
+
/* 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");
|
|
12102
|
+
|
|
12103
|
+
|
|
11995
12104
|
/**
|
|
11996
12105
|
* Given an object with CSS/SVG transform definitions, return the string value
|
|
11997
12106
|
* for use with the `transform` CSS property or SVG attribute. Note that we
|
|
@@ -12028,20 +12137,37 @@ const toTransformString = function (obj) {
|
|
|
12028
12137
|
* of 5 hex string values in that color scale. If no 'name' parameter
|
|
12029
12138
|
* is given, it will return the Victory default grayscale.
|
|
12030
12139
|
* @param {String} name The name of the color scale to return (optional).
|
|
12140
|
+
* @param {Object} theme The theme object to retrieve the color scale from (optional).
|
|
12031
12141
|
* @returns {Array} An array of 5 hex string values composing a color scale.
|
|
12032
12142
|
*/
|
|
12033
|
-
function getColorScale(name) {
|
|
12143
|
+
function getColorScale(name, theme) {
|
|
12144
|
+
if (theme === void 0) {
|
|
12145
|
+
theme = _victory_theme_victory_theme__WEBPACK_IMPORTED_MODULE_0__.VictoryTheme.material;
|
|
12146
|
+
}
|
|
12147
|
+
const {
|
|
12148
|
+
palette: {
|
|
12149
|
+
grayscale = ["#cccccc", "#969696", "#636363", "#252525"],
|
|
12150
|
+
qualitative = [],
|
|
12151
|
+
heatmap = [],
|
|
12152
|
+
warm = [],
|
|
12153
|
+
cool = [],
|
|
12154
|
+
red = [],
|
|
12155
|
+
blue = [],
|
|
12156
|
+
green = []
|
|
12157
|
+
} = {}
|
|
12158
|
+
} = theme;
|
|
12034
12159
|
const scales = {
|
|
12035
|
-
grayscale
|
|
12036
|
-
qualitative
|
|
12037
|
-
heatmap
|
|
12038
|
-
warm
|
|
12039
|
-
cool
|
|
12040
|
-
red
|
|
12041
|
-
blue
|
|
12042
|
-
green
|
|
12160
|
+
grayscale,
|
|
12161
|
+
qualitative,
|
|
12162
|
+
heatmap,
|
|
12163
|
+
warm,
|
|
12164
|
+
cool,
|
|
12165
|
+
red,
|
|
12166
|
+
blue,
|
|
12167
|
+
green
|
|
12043
12168
|
};
|
|
12044
|
-
|
|
12169
|
+
const selectedScale = name && scales[name]?.length ? scales[name] : scales.grayscale;
|
|
12170
|
+
return selectedScale;
|
|
12045
12171
|
}
|
|
12046
12172
|
|
|
12047
12173
|
/***/ }),
|
|
@@ -13000,34 +13126,31 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
13000
13126
|
/* harmony export */ "getDomain": function() { return /* binding */ getDomain; },
|
|
13001
13127
|
/* harmony export */ "getDomainFromChildren": function() { return /* binding */ getDomainFromChildren; },
|
|
13002
13128
|
/* harmony export */ "getScale": function() { return /* binding */ getScale; },
|
|
13003
|
-
/* harmony export */ "getStringsFromCategories": function() { return /* binding */ getStringsFromCategories; },
|
|
13004
13129
|
/* harmony export */ "getStringsFromChildren": function() { return /* binding */ getStringsFromChildren; },
|
|
13130
|
+
/* harmony export */ "getStringsFromChildrenCategories": function() { return /* binding */ getStringsFromChildrenCategories; },
|
|
13005
13131
|
/* harmony export */ "getStringsFromData": function() { return /* binding */ getStringsFromData; },
|
|
13006
13132
|
/* harmony export */ "getStyle": function() { return /* binding */ getStyle; },
|
|
13007
13133
|
/* harmony export */ "getWidth": function() { return /* binding */ getWidth; }
|
|
13008
13134
|
/* harmony export */ });
|
|
13009
|
-
/* harmony import */ var
|
|
13010
|
-
/* harmony import */ var
|
|
13011
|
-
/* harmony import */ var
|
|
13012
|
-
/* harmony import */ var
|
|
13013
|
-
/* harmony import */ var
|
|
13014
|
-
/* harmony import */ var
|
|
13015
|
-
/* harmony import */ var
|
|
13016
|
-
/* harmony import */ var
|
|
13017
|
-
/* harmony import */ var
|
|
13018
|
-
/* harmony import */ var
|
|
13019
|
-
/* harmony import */ var
|
|
13020
|
-
/* harmony import */ var
|
|
13021
|
-
/* harmony import */ var
|
|
13022
|
-
/* harmony import */ var
|
|
13023
|
-
/* harmony import */ var
|
|
13024
|
-
/* harmony import */ var
|
|
13025
|
-
/* harmony import */ var
|
|
13026
|
-
/* harmony import */ var
|
|
13027
|
-
/* harmony import */ var
|
|
13028
|
-
/* harmony import */ var _scale__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./scale */ "../../victory-core/es/victory-util/scale.js");
|
|
13029
|
-
/* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./log */ "../../victory-core/es/victory-util/log.js");
|
|
13030
|
-
|
|
13135
|
+
/* harmony import */ var lodash_uniqBy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/uniqBy */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/uniqBy.js");
|
|
13136
|
+
/* harmony import */ var lodash_uniqBy__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqBy__WEBPACK_IMPORTED_MODULE_0__);
|
|
13137
|
+
/* harmony import */ var lodash_groupBy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/groupBy */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/groupBy.js");
|
|
13138
|
+
/* harmony import */ var lodash_groupBy__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_groupBy__WEBPACK_IMPORTED_MODULE_1__);
|
|
13139
|
+
/* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash/uniq */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/uniq.js");
|
|
13140
|
+
/* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_uniq__WEBPACK_IMPORTED_MODULE_2__);
|
|
13141
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaults.js");
|
|
13142
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_3__);
|
|
13143
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "react");
|
|
13144
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
|
|
13145
|
+
/* harmony import */ var _axis__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./axis */ "../../victory-core/es/victory-util/axis.js");
|
|
13146
|
+
/* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./style */ "../../victory-core/es/victory-util/style.js");
|
|
13147
|
+
/* harmony import */ var _data__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./data */ "../../victory-core/es/victory-util/data.js");
|
|
13148
|
+
/* harmony import */ var _domain__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./domain */ "../../victory-core/es/victory-util/domain.js");
|
|
13149
|
+
/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./events */ "../../victory-core/es/victory-util/events.js");
|
|
13150
|
+
/* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./collection */ "../../victory-core/es/victory-util/collection.js");
|
|
13151
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
13152
|
+
/* harmony import */ var _scale__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./scale */ "../../victory-core/es/victory-util/scale.js");
|
|
13153
|
+
/* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./log */ "../../victory-core/es/victory-util/log.js");
|
|
13031
13154
|
|
|
13032
13155
|
|
|
13033
13156
|
|
|
@@ -13056,7 +13179,7 @@ function addBinsToParentPropsIfHistogram(_ref) {
|
|
|
13056
13179
|
return child.type && child.type.role === "histogram";
|
|
13057
13180
|
});
|
|
13058
13181
|
if (someChildrenAreHistograms && !allChildrenAreHistograms) {
|
|
13059
|
-
|
|
13182
|
+
_log__WEBPACK_IMPORTED_MODULE_5__.warn("VictoryHistogram only supports being stacked with other VictoryHistogram components. Check to make sure that you are only passing VictoryHistogram components to VictoryStack");
|
|
13060
13183
|
}
|
|
13061
13184
|
|
|
13062
13185
|
// if we are stacking histograms, we need to generate explicit bins
|
|
@@ -13069,7 +13192,7 @@ function addBinsToParentPropsIfHistogram(_ref) {
|
|
|
13069
13192
|
// if we have explicit bins then we don't need to calculate them
|
|
13070
13193
|
if (!Array.isArray(childBins)) {
|
|
13071
13194
|
const combinedData = children.reduce((memo, child) => {
|
|
13072
|
-
const xAccessor =
|
|
13195
|
+
const xAccessor = _helpers__WEBPACK_IMPORTED_MODULE_6__.createAccessor(child.props.x || "x");
|
|
13073
13196
|
return memo.concat(child.props.data.map(datum => ({
|
|
13074
13197
|
x: xAccessor(datum)
|
|
13075
13198
|
})));
|
|
@@ -13112,7 +13235,7 @@ function getDataFromChildren(props, childComponents) {
|
|
|
13112
13235
|
maxDomain
|
|
13113
13236
|
};
|
|
13114
13237
|
let stack = 0;
|
|
13115
|
-
const children = childComponents ? childComponents.slice(0) :
|
|
13238
|
+
const children = childComponents ? childComponents.slice(0) : react__WEBPACK_IMPORTED_MODULE_4___default().Children.toArray(props.children);
|
|
13116
13239
|
parentProps = addBinsToParentPropsIfHistogram({
|
|
13117
13240
|
children,
|
|
13118
13241
|
props,
|
|
@@ -13123,13 +13246,13 @@ function getDataFromChildren(props, childComponents) {
|
|
|
13123
13246
|
const childProps = Object.assign({}, child.props, parentProps);
|
|
13124
13247
|
let childData;
|
|
13125
13248
|
let childElement = child;
|
|
13126
|
-
if (!
|
|
13249
|
+
if (!_data__WEBPACK_IMPORTED_MODULE_7__.isDataComponent(child)) {
|
|
13127
13250
|
return null;
|
|
13128
|
-
} else if (child.type &&
|
|
13129
|
-
childElement = parent ? /*#__PURE__*/
|
|
13251
|
+
} else if (child.type && _helpers__WEBPACK_IMPORTED_MODULE_6__.isFunction(child.type.getData)) {
|
|
13252
|
+
childElement = parent ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().cloneElement(child, parent.props) : child;
|
|
13130
13253
|
childData = childElement.type.getData(childProps);
|
|
13131
13254
|
} else {
|
|
13132
|
-
childData =
|
|
13255
|
+
childData = _data__WEBPACK_IMPORTED_MODULE_7__.getData(childProps);
|
|
13133
13256
|
}
|
|
13134
13257
|
stack += 1;
|
|
13135
13258
|
return childData.map((datum, index) => Object.assign({
|
|
@@ -13138,23 +13261,23 @@ function getDataFromChildren(props, childComponents) {
|
|
|
13138
13261
|
}, datum));
|
|
13139
13262
|
};
|
|
13140
13263
|
const stacked = children.filter(c => c.type && c.type.role === "stack").length;
|
|
13141
|
-
const combine = (memo, val) => memo.concat(
|
|
13142
|
-
const datasets =
|
|
13264
|
+
const combine = (memo, val) => memo.concat(lodash_uniqBy__WEBPACK_IMPORTED_MODULE_0___default()(val, "_group"));
|
|
13265
|
+
const datasets = _helpers__WEBPACK_IMPORTED_MODULE_6__.reduceChildren(children, iteratee, props, [], combine);
|
|
13143
13266
|
const group = stacked ? "_group" : "_stack";
|
|
13144
|
-
return Object.values(
|
|
13267
|
+
return Object.values(lodash_groupBy__WEBPACK_IMPORTED_MODULE_1___default()(datasets, group));
|
|
13145
13268
|
}
|
|
13146
13269
|
function getData(props, childComponents) {
|
|
13147
13270
|
if (props.data) {
|
|
13148
|
-
return
|
|
13271
|
+
return _data__WEBPACK_IMPORTED_MODULE_7__.getData(props);
|
|
13149
13272
|
}
|
|
13150
|
-
return getDataFromChildren(props, childComponents ||
|
|
13273
|
+
return getDataFromChildren(props, childComponents || react__WEBPACK_IMPORTED_MODULE_4___default().Children.toArray(props.children));
|
|
13151
13274
|
}
|
|
13152
13275
|
function getWidth(props, groupLength, seriesLength) {
|
|
13153
13276
|
const {
|
|
13154
13277
|
datasets,
|
|
13155
13278
|
horizontal
|
|
13156
13279
|
} = props;
|
|
13157
|
-
const range = horizontal ?
|
|
13280
|
+
const range = horizontal ? _helpers__WEBPACK_IMPORTED_MODULE_6__.getRange(props, "y") : _helpers__WEBPACK_IMPORTED_MODULE_6__.getRange(props, "x");
|
|
13158
13281
|
const extent = Math.abs(range[1] - range[0]);
|
|
13159
13282
|
const seriesLengthValue = seriesLength !== undefined ? seriesLength : Array.isArray(datasets[0]) && datasets[0].length || 1;
|
|
13160
13283
|
const groupLengthValue = groupLength || datasets.length;
|
|
@@ -13200,8 +13323,8 @@ function getDefaultDomainPadding(props, axis, childComponents) {
|
|
|
13200
13323
|
}
|
|
13201
13324
|
function getDomainFromChildren(props, axis, childComponents) {
|
|
13202
13325
|
// eslint-disable-line max-statements, complexity, max-len
|
|
13203
|
-
const children = childComponents ? childComponents.slice(0) :
|
|
13204
|
-
const parentData = props.data ?
|
|
13326
|
+
const children = childComponents ? childComponents.slice(0) : react__WEBPACK_IMPORTED_MODULE_4___default().Children.toArray(props.children);
|
|
13327
|
+
const parentData = props.data ? _data__WEBPACK_IMPORTED_MODULE_7__.getData(props) : undefined;
|
|
13205
13328
|
const {
|
|
13206
13329
|
polar,
|
|
13207
13330
|
startAngle,
|
|
@@ -13225,65 +13348,67 @@ function getDomainFromChildren(props, axis, childComponents) {
|
|
|
13225
13348
|
}) : baseParentProps;
|
|
13226
13349
|
const iteratee = child => {
|
|
13227
13350
|
const sharedProps = Object.assign({}, child.props, parentProps);
|
|
13228
|
-
if (!
|
|
13351
|
+
if (!_domain__WEBPACK_IMPORTED_MODULE_8__.isDomainComponent(child)) {
|
|
13229
13352
|
return null;
|
|
13230
|
-
} else if (child.type &&
|
|
13353
|
+
} else if (child.type && _helpers__WEBPACK_IMPORTED_MODULE_6__.isFunction(child.type.getDomain)) {
|
|
13231
13354
|
return child.props && child.type.getDomain(sharedProps, axis);
|
|
13232
13355
|
}
|
|
13233
|
-
return
|
|
13356
|
+
return _domain__WEBPACK_IMPORTED_MODULE_8__.getDomain(sharedProps, axis);
|
|
13234
13357
|
};
|
|
13235
|
-
const childDomains =
|
|
13236
|
-
const min = childDomains.length === 0 ? 0 :
|
|
13237
|
-
const max = childDomains.length === 0 ? 1 :
|
|
13358
|
+
const childDomains = _helpers__WEBPACK_IMPORTED_MODULE_6__.reduceChildren(children, iteratee, props);
|
|
13359
|
+
const min = childDomains.length === 0 ? 0 : _collection__WEBPACK_IMPORTED_MODULE_9__.getMinValue(childDomains);
|
|
13360
|
+
const max = childDomains.length === 0 ? 1 : _collection__WEBPACK_IMPORTED_MODULE_9__.getMaxValue(childDomains);
|
|
13238
13361
|
return [min, max];
|
|
13239
13362
|
}
|
|
13240
13363
|
function getDomain(props, axis, childComponents) {
|
|
13241
|
-
const children = childComponents ||
|
|
13242
|
-
const propsDomain =
|
|
13364
|
+
const children = childComponents || react__WEBPACK_IMPORTED_MODULE_4___default().Children.toArray(props.children);
|
|
13365
|
+
const propsDomain = _domain__WEBPACK_IMPORTED_MODULE_8__.getDomainFromProps(props, axis);
|
|
13243
13366
|
const domainPadding = getDefaultDomainPadding(props, axis, children);
|
|
13244
13367
|
let domain;
|
|
13245
13368
|
if (propsDomain) {
|
|
13246
13369
|
domain = propsDomain;
|
|
13247
13370
|
} else {
|
|
13248
|
-
const minDomain =
|
|
13249
|
-
const maxDomain =
|
|
13250
|
-
const dataset = (props.data || props.y) &&
|
|
13251
|
-
const dataDomain = dataset ?
|
|
13371
|
+
const minDomain = _domain__WEBPACK_IMPORTED_MODULE_8__.getMinFromProps(props, axis);
|
|
13372
|
+
const maxDomain = _domain__WEBPACK_IMPORTED_MODULE_8__.getMaxFromProps(props, axis);
|
|
13373
|
+
const dataset = (props.data || props.y) && _data__WEBPACK_IMPORTED_MODULE_7__.getData(props);
|
|
13374
|
+
const dataDomain = dataset ? _domain__WEBPACK_IMPORTED_MODULE_8__.getDomainFromData(props, axis, dataset) : [];
|
|
13252
13375
|
const childDomain = getDomainFromChildren(props, axis, children);
|
|
13253
|
-
const min = minDomain ||
|
|
13254
|
-
const max = maxDomain ||
|
|
13255
|
-
domain =
|
|
13376
|
+
const min = minDomain || _collection__WEBPACK_IMPORTED_MODULE_9__.getMinValue([...dataDomain, ...childDomain]);
|
|
13377
|
+
const max = maxDomain || _collection__WEBPACK_IMPORTED_MODULE_9__.getMaxValue([...dataDomain, ...childDomain]);
|
|
13378
|
+
domain = _domain__WEBPACK_IMPORTED_MODULE_8__.getDomainFromMinMax(min, max);
|
|
13256
13379
|
}
|
|
13257
|
-
return
|
|
13380
|
+
return _domain__WEBPACK_IMPORTED_MODULE_8__.formatDomain(domain, Object.assign({
|
|
13258
13381
|
domainPadding
|
|
13259
13382
|
}, props), axis);
|
|
13260
13383
|
}
|
|
13261
13384
|
function getScale(props, axis, childComponents) {
|
|
13262
13385
|
if (props.data) {
|
|
13263
|
-
return
|
|
13386
|
+
return _scale__WEBPACK_IMPORTED_MODULE_10__.getBaseScale(props, axis);
|
|
13264
13387
|
}
|
|
13265
|
-
const children = childComponents ? childComponents.slice(0) :
|
|
13388
|
+
const children = childComponents ? childComponents.slice(0) : react__WEBPACK_IMPORTED_MODULE_4___default().Children.toArray(props.children);
|
|
13266
13389
|
const iteratee = child => {
|
|
13267
13390
|
const sharedProps = Object.assign({}, child.props, {
|
|
13268
13391
|
horizontal: props.horizontal
|
|
13269
13392
|
});
|
|
13270
|
-
return
|
|
13393
|
+
return _scale__WEBPACK_IMPORTED_MODULE_10__.getScaleType(sharedProps, axis);
|
|
13271
13394
|
};
|
|
13272
|
-
const childScale =
|
|
13395
|
+
const childScale = lodash_uniq__WEBPACK_IMPORTED_MODULE_2___default()(_helpers__WEBPACK_IMPORTED_MODULE_6__.reduceChildren(children, iteratee, props));
|
|
13273
13396
|
|
|
13274
13397
|
// default to linear scale if more than one uniq scale type is given by children
|
|
13275
|
-
return childScale.length > 1 ?
|
|
13398
|
+
return childScale.length > 1 ? _scale__WEBPACK_IMPORTED_MODULE_10__.getScaleFromName("linear") : _scale__WEBPACK_IMPORTED_MODULE_10__.getScaleFromName(childScale[0]);
|
|
13276
13399
|
}
|
|
13277
13400
|
function getAllEvents(props) {
|
|
13278
13401
|
const components = ["groupComponent", "containerComponent", "labelComponent"];
|
|
13279
|
-
const componentEvents =
|
|
13402
|
+
const componentEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getComponentEvents(props, components);
|
|
13280
13403
|
let events = props.events;
|
|
13281
13404
|
if (Array.isArray(componentEvents)) {
|
|
13282
13405
|
events = Array.isArray(props.events) ? componentEvents.concat(...props.events) : componentEvents;
|
|
13283
13406
|
}
|
|
13284
13407
|
return events || [];
|
|
13285
13408
|
}
|
|
13286
|
-
|
|
13409
|
+
|
|
13410
|
+
// eslint-disable-next-line max-params
|
|
13411
|
+
function getColor(calculatedProps, child, index, theme) {
|
|
13287
13412
|
// check for styles first
|
|
13288
13413
|
const {
|
|
13289
13414
|
style
|
|
@@ -13300,14 +13425,16 @@ function getColor(calculatedProps, child, index) {
|
|
|
13300
13425
|
if (!colorScale && !color) {
|
|
13301
13426
|
return undefined;
|
|
13302
13427
|
}
|
|
13303
|
-
const colors = Array.isArray(colorScale) ? colorScale :
|
|
13428
|
+
const colors = Array.isArray(colorScale) ? colorScale : _style__WEBPACK_IMPORTED_MODULE_12__.getColorScale(colorScale, theme);
|
|
13304
13429
|
return color || colors[index % colors.length];
|
|
13305
13430
|
}
|
|
13306
13431
|
function getStyle(theme, style, role) {
|
|
13307
13432
|
const defaultStyle = theme && theme[role] && theme[role].style ? theme[role].style : {};
|
|
13308
|
-
return
|
|
13433
|
+
return _helpers__WEBPACK_IMPORTED_MODULE_6__.getStyles(style, defaultStyle);
|
|
13309
13434
|
}
|
|
13310
|
-
|
|
13435
|
+
|
|
13436
|
+
// eslint-disable-next-line max-params
|
|
13437
|
+
function getChildStyle(child, index, calculatedProps, theme) {
|
|
13311
13438
|
const {
|
|
13312
13439
|
style,
|
|
13313
13440
|
role
|
|
@@ -13317,7 +13444,7 @@ function getChildStyle(child, index, calculatedProps) {
|
|
|
13317
13444
|
return childStyle;
|
|
13318
13445
|
}
|
|
13319
13446
|
const childRole = child.type && child.type.role;
|
|
13320
|
-
const defaultFill = childRole === "stack" ? undefined : getColor(calculatedProps, child, index);
|
|
13447
|
+
const defaultFill = childRole === "stack" ? undefined : getColor(calculatedProps, child, index, theme);
|
|
13321
13448
|
const defaultColor = childRole === "line" ? {
|
|
13322
13449
|
fill: "none",
|
|
13323
13450
|
stroke: defaultFill
|
|
@@ -13327,8 +13454,8 @@ function getChildStyle(child, index, calculatedProps) {
|
|
|
13327
13454
|
const dataWidth = role === "stack" ? {} : {
|
|
13328
13455
|
width: getWidth(calculatedProps)
|
|
13329
13456
|
};
|
|
13330
|
-
const dataStyle =
|
|
13331
|
-
const labelsStyle =
|
|
13457
|
+
const dataStyle = lodash_defaults__WEBPACK_IMPORTED_MODULE_3___default()({}, childStyle.data, Object.assign({}, dataWidth, style.data, defaultColor));
|
|
13458
|
+
const labelsStyle = lodash_defaults__WEBPACK_IMPORTED_MODULE_3___default()({}, childStyle.labels, style.labels);
|
|
13332
13459
|
return {
|
|
13333
13460
|
...childStyle,
|
|
13334
13461
|
parent: style.parent,
|
|
@@ -13336,28 +13463,26 @@ function getChildStyle(child, index, calculatedProps) {
|
|
|
13336
13463
|
labels: labelsStyle
|
|
13337
13464
|
};
|
|
13338
13465
|
}
|
|
13339
|
-
function
|
|
13466
|
+
function getStringsFromChildrenCategories(childComponents, axis) {
|
|
13340
13467
|
const iteratee = child => {
|
|
13341
|
-
|
|
13342
|
-
if (!_domain__WEBPACK_IMPORTED_MODULE_9__.isDomainComponent(child) || !childProps.categories) {
|
|
13468
|
+
if (!_domain__WEBPACK_IMPORTED_MODULE_8__.isDomainComponent(child)) {
|
|
13343
13469
|
return null;
|
|
13344
13470
|
}
|
|
13345
|
-
const
|
|
13346
|
-
|
|
13347
|
-
return categoryStrings ? _collection__WEBPACK_IMPORTED_MODULE_10__.removeUndefined(categoryStrings) : [];
|
|
13471
|
+
const childProps = child.props || {};
|
|
13472
|
+
return _data__WEBPACK_IMPORTED_MODULE_7__.getStringsFromCategories(childProps, axis);
|
|
13348
13473
|
};
|
|
13349
|
-
return
|
|
13474
|
+
return _helpers__WEBPACK_IMPORTED_MODULE_6__.reduceChildren(childComponents.slice(0), iteratee);
|
|
13350
13475
|
}
|
|
13351
13476
|
function getStringsFromData(childComponents) {
|
|
13352
13477
|
const iteratee = child => {
|
|
13353
13478
|
const childProps = child.props || {};
|
|
13354
13479
|
let data;
|
|
13355
|
-
if (!
|
|
13480
|
+
if (!_data__WEBPACK_IMPORTED_MODULE_7__.isDataComponent(child)) {
|
|
13356
13481
|
return null;
|
|
13357
|
-
} else if (child.type &&
|
|
13482
|
+
} else if (child.type && _helpers__WEBPACK_IMPORTED_MODULE_6__.isFunction(child.type.getData)) {
|
|
13358
13483
|
data = child.type.getData(childProps);
|
|
13359
13484
|
} else {
|
|
13360
|
-
data =
|
|
13485
|
+
data = _data__WEBPACK_IMPORTED_MODULE_7__.getData(childProps);
|
|
13361
13486
|
}
|
|
13362
13487
|
return data.map(d => ({
|
|
13363
13488
|
x: d.xName,
|
|
@@ -13376,28 +13501,28 @@ function getStringsFromData(childComponents) {
|
|
|
13376
13501
|
y: y !== undefined ? memo.y.concat(y) : memo.y
|
|
13377
13502
|
};
|
|
13378
13503
|
};
|
|
13379
|
-
return
|
|
13504
|
+
return _helpers__WEBPACK_IMPORTED_MODULE_6__.reduceChildren(childComponents.slice(0), iteratee, {}, initialMemo, combine);
|
|
13380
13505
|
}
|
|
13381
13506
|
function getCategoryAndAxisStringsFromChildren(props, axis, childComponents) {
|
|
13382
|
-
const categories =
|
|
13383
|
-
const axisComponent =
|
|
13384
|
-
const axisStrings = axisComponent ?
|
|
13385
|
-
const categoryStrings = categories
|
|
13386
|
-
return
|
|
13507
|
+
const categories = _data__WEBPACK_IMPORTED_MODULE_7__.getStringsFromCategories(props, axis);
|
|
13508
|
+
const axisComponent = _axis__WEBPACK_IMPORTED_MODULE_13__.getAxisComponent(childComponents, axis);
|
|
13509
|
+
const axisStrings = axisComponent ? _data__WEBPACK_IMPORTED_MODULE_7__.getStringsFromAxes(axisComponent.props, axis) : [];
|
|
13510
|
+
const categoryStrings = categories.length ? categories : getStringsFromChildrenCategories(childComponents, axis);
|
|
13511
|
+
return lodash_uniq__WEBPACK_IMPORTED_MODULE_2___default()([...categoryStrings, ...axisStrings].flat());
|
|
13387
13512
|
}
|
|
13388
13513
|
function getStringsFromChildren(props, childComponents) {
|
|
13389
|
-
const children = childComponents ||
|
|
13514
|
+
const children = childComponents || react__WEBPACK_IMPORTED_MODULE_4___default().Children.toArray(props.children);
|
|
13390
13515
|
const xStrings = getCategoryAndAxisStringsFromChildren(props, "x", children);
|
|
13391
13516
|
const yStrings = getCategoryAndAxisStringsFromChildren(props, "y", children);
|
|
13392
13517
|
const dataStrings = getStringsFromData(children);
|
|
13393
13518
|
return {
|
|
13394
|
-
x:
|
|
13395
|
-
y:
|
|
13519
|
+
x: lodash_uniq__WEBPACK_IMPORTED_MODULE_2___default()([...xStrings, ...dataStrings.x].flat()),
|
|
13520
|
+
y: lodash_uniq__WEBPACK_IMPORTED_MODULE_2___default()([...yStrings, ...dataStrings.y].flat())
|
|
13396
13521
|
};
|
|
13397
13522
|
}
|
|
13398
13523
|
function getCategories(props, childComponents, allStrings) {
|
|
13399
|
-
const xPropCategories = props.categories &&
|
|
13400
|
-
const yPropCategories = props.categories &&
|
|
13524
|
+
const xPropCategories = props.categories && _data__WEBPACK_IMPORTED_MODULE_7__.getStringsFromCategories(props, "x");
|
|
13525
|
+
const yPropCategories = props.categories && _data__WEBPACK_IMPORTED_MODULE_7__.getStringsFromCategories(props, "y");
|
|
13401
13526
|
const fallbackRequired = !xPropCategories || !yPropCategories;
|
|
13402
13527
|
const fallbackProps = fallbackRequired ? allStrings || getStringsFromChildren(props, childComponents) : {};
|
|
13403
13528
|
const xCategories = xPropCategories || fallbackProps.x;
|