@aivenio/aquarium 1.41.0 → 1.43.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/dist/_variables.scss +1 -1
- package/dist/charts.cjs +176 -18
- package/dist/charts.mjs +174 -18
- package/dist/src/charts/AreaChart/AreaChart.d.ts +12 -0
- package/dist/src/charts/AreaChart/AreaChart.js +46 -0
- package/dist/src/charts/BarChart/BarChart.d.ts +2 -0
- package/dist/src/charts/BarChart/BarChart.js +6 -1
- package/dist/src/charts/LineChart/LineChart.d.ts +12 -0
- package/dist/src/charts/LineChart/LineChart.js +39 -0
- package/dist/src/charts/Reference/Reference.d.ts +10 -0
- package/dist/src/charts/Reference/Reference.js +9 -0
- package/dist/src/charts/Tooltip/Tooltip.d.ts +6 -3
- package/dist/src/charts/Tooltip/Tooltip.js +19 -7
- package/dist/src/charts/index.d.ts +3 -0
- package/dist/src/charts/index.js +4 -1
- package/dist/src/charts/lib/utils.d.ts +1 -1
- package/dist/src/charts/lib/utils.js +3 -2
- package/dist/src/molecules/Alert/Alert.js +14 -9
- package/dist/src/molecules/Box/Box.d.ts +6 -6
- package/dist/src/molecules/Popover/PopoverOverlay.d.ts +1 -1
- package/dist/styles.css +47 -14
- package/dist/system.cjs +26 -15
- package/dist/system.mjs +35 -24
- package/dist/tsconfig.module.tsbuildinfo +1 -1
- package/dist/types/tailwindGenerated.d.ts +1 -1
- package/package.json +2 -2
package/dist/_variables.scss
CHANGED
package/dist/charts.cjs
CHANGED
@@ -55,10 +55,15 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
55
55
|
// src/charts/index.ts
|
56
56
|
var charts_exports = {};
|
57
57
|
__export(charts_exports, {
|
58
|
+
Area: () => Area,
|
59
|
+
AreaChart: () => AreaChart,
|
58
60
|
Axis: () => Axis,
|
59
61
|
Bar: () => Bar,
|
60
62
|
BarChart: () => BarChart,
|
61
63
|
CartesianGrid: () => CartesianGrid,
|
64
|
+
Line: () => Line,
|
65
|
+
LineChart: () => LineChart,
|
66
|
+
Reference: () => Reference,
|
62
67
|
ResponsiveContainer: () => ResponsiveContainer,
|
63
68
|
Tooltip: () => Tooltip,
|
64
69
|
getDisplayName: () => getDisplayName,
|
@@ -136,6 +141,10 @@ __export(charts_exports, {
|
|
136
141
|
});
|
137
142
|
module.exports = __toCommonJS(charts_exports);
|
138
143
|
|
144
|
+
// src/charts/AreaChart/AreaChart.tsx
|
145
|
+
var import_react4 = __toESM(require("react"));
|
146
|
+
var import_recharts4 = require("recharts");
|
147
|
+
|
139
148
|
// src/charts/Axis/Axis.tsx
|
140
149
|
var import_react = __toESM(require("react"));
|
141
150
|
var import_recharts = require("recharts");
|
@@ -1970,10 +1979,11 @@ var getDisplayName = (Comp) => {
|
|
1970
1979
|
};
|
1971
1980
|
var isDateArray = (arr) => arr.every(import_isDate.default);
|
1972
1981
|
var getXAxisTicks = ({ dataKey, ticks: ticks2 }, chartProps) => {
|
1982
|
+
var _a;
|
1973
1983
|
if (!ticks2 || (0, import_isArray.default)(ticks2)) {
|
1974
1984
|
return ticks2 != null ? ticks2 : void 0;
|
1975
1985
|
}
|
1976
|
-
const xValues = chartProps.data.map(
|
1986
|
+
const xValues = ((_a = chartProps.data) != null ? _a : []).map(
|
1977
1987
|
(datum) => typeof dataKey === "function" ? dataKey(datum) : dataKey ? datum[dataKey] : void 0
|
1978
1988
|
);
|
1979
1989
|
if (!isDateArray(xValues)) {
|
@@ -2024,10 +2034,6 @@ var Axis = {
|
|
2024
2034
|
YAxis
|
2025
2035
|
};
|
2026
2036
|
|
2027
|
-
// src/charts/BarChart/BarChart.tsx
|
2028
|
-
var import_react4 = __toESM(require("react"));
|
2029
|
-
var import_recharts4 = require("recharts");
|
2030
|
-
|
2031
2037
|
// src/charts/Container/Container.tsx
|
2032
2038
|
var import_react2 = __toESM(require("react"));
|
2033
2039
|
var import_recharts2 = require("recharts");
|
@@ -2048,7 +2054,7 @@ var CartesianGrid = Object.assign(
|
|
2048
2054
|
import_recharts3.CartesianGrid
|
2049
2055
|
);
|
2050
2056
|
|
2051
|
-
// src/charts/
|
2057
|
+
// src/charts/AreaChart/AreaChart.tsx
|
2052
2058
|
var renderChildren = (props) => {
|
2053
2059
|
return import_react4.default.Children.map(props.children, (child) => {
|
2054
2060
|
switch (getDisplayName(child.type)) {
|
@@ -2067,13 +2073,12 @@ var renderChildren = (props) => {
|
|
2067
2073
|
}
|
2068
2074
|
});
|
2069
2075
|
};
|
2070
|
-
var
|
2076
|
+
var AreaChart = (props) => {
|
2071
2077
|
const { data } = props;
|
2072
|
-
return /* @__PURE__ */ import_react4.default.createElement(ResponsiveContainer, null, /* @__PURE__ */ import_react4.default.createElement(import_recharts4.
|
2078
|
+
return /* @__PURE__ */ import_react4.default.createElement(ResponsiveContainer, null, /* @__PURE__ */ import_react4.default.createElement(import_recharts4.AreaChart, {
|
2073
2079
|
width: 500,
|
2074
2080
|
height: 500,
|
2075
2081
|
data,
|
2076
|
-
barCategoryGap: "5%",
|
2077
2082
|
style: { stroke: "#fff", strokeWidth: 1 },
|
2078
2083
|
margin: {
|
2079
2084
|
top: 20,
|
@@ -2083,26 +2088,179 @@ var BarChart = (props) => {
|
|
2083
2088
|
}
|
2084
2089
|
}, /* @__PURE__ */ import_react4.default.createElement(CartesianGrid, null), renderChildren(props)));
|
2085
2090
|
};
|
2086
|
-
var
|
2087
|
-
|
2088
|
-
|
2089
|
-
|
2091
|
+
var Area = Object.assign(
|
2092
|
+
(props) => {
|
2093
|
+
var _a;
|
2094
|
+
return /* @__PURE__ */ import_react4.default.createElement(import_recharts4.Area, __spreadProps(__spreadValues({
|
2095
|
+
type: "monotone",
|
2096
|
+
strokeWidth: 2,
|
2097
|
+
dot: false
|
2098
|
+
}, props), {
|
2099
|
+
fill: (_a = props.fill) != null ? _a : props.stroke,
|
2100
|
+
fillOpacity: 0.1,
|
2101
|
+
isAnimationActive: false
|
2102
|
+
}));
|
2103
|
+
},
|
2104
|
+
import_recharts4.Area
|
2105
|
+
);
|
2106
|
+
Area.defaultProps = Object.assign(import_recharts4.Area.defaultProps, {
|
2107
|
+
fillOpacity: 0.1,
|
2108
|
+
fill: void 0
|
2109
|
+
});
|
2110
|
+
AreaChart.Area = Area;
|
2111
|
+
|
2112
|
+
// src/charts/BarChart/BarChart.tsx
|
2113
|
+
var import_react5 = __toESM(require("react"));
|
2114
|
+
var import_recharts6 = require("recharts");
|
2090
2115
|
|
2091
2116
|
// src/charts/Tooltip/Tooltip.tsx
|
2092
2117
|
var import_recharts5 = require("recharts");
|
2093
|
-
var
|
2094
|
-
|
2118
|
+
var contentStyle = {
|
2119
|
+
boxShadow: "var(--aquarium-box-shadow-8dp)",
|
2120
|
+
background: "#fff"
|
2121
|
+
};
|
2122
|
+
var itemStyle = {
|
2123
|
+
display: "flex",
|
2124
|
+
paddingTop: "2px",
|
2125
|
+
paddingBottom: "2px"
|
2126
|
+
};
|
2127
|
+
var Tooltip = Object.assign(import_recharts5.Tooltip, {
|
2128
|
+
DefaultContent: import_recharts5.DefaultTooltipContent
|
2129
|
+
});
|
2130
|
+
Tooltip.defaultProps = Object.assign({}, import_recharts5.Tooltip.defaultProps, {
|
2131
|
+
separator: "",
|
2095
2132
|
isAnimationActive: false,
|
2096
|
-
contentStyle
|
2097
|
-
itemStyle
|
2098
|
-
cursor:
|
2133
|
+
contentStyle,
|
2134
|
+
itemStyle,
|
2135
|
+
cursor: { stroke: "var(--aquarium-colors-grey-70)", strokeDasharray: "5" }
|
2099
2136
|
});
|
2137
|
+
|
2138
|
+
// src/charts/BarChart/BarChart.tsx
|
2139
|
+
var renderChildren2 = (props) => {
|
2140
|
+
return import_react5.default.Children.map(props.children, (child) => {
|
2141
|
+
switch (getDisplayName(child.type)) {
|
2142
|
+
case Axis.XAxis.displayName: {
|
2143
|
+
return renderXAxis(child, props);
|
2144
|
+
}
|
2145
|
+
case Axis.XAxis.Time.displayName: {
|
2146
|
+
return renderXTimeAxis(child, props);
|
2147
|
+
}
|
2148
|
+
case Axis.YAxis.displayName: {
|
2149
|
+
return renderYAxis(child, props);
|
2150
|
+
}
|
2151
|
+
case Tooltip.displayName: {
|
2152
|
+
return /* @__PURE__ */ import_react5.default.createElement(Tooltip, __spreadProps(__spreadValues({}, child.props), {
|
2153
|
+
cursor: false
|
2154
|
+
}));
|
2155
|
+
}
|
2156
|
+
default: {
|
2157
|
+
return child;
|
2158
|
+
}
|
2159
|
+
}
|
2160
|
+
});
|
2161
|
+
};
|
2162
|
+
var BarChart = (props) => {
|
2163
|
+
const { data } = props;
|
2164
|
+
return /* @__PURE__ */ import_react5.default.createElement(ResponsiveContainer, null, /* @__PURE__ */ import_react5.default.createElement(import_recharts6.BarChart, {
|
2165
|
+
width: 500,
|
2166
|
+
height: 500,
|
2167
|
+
data,
|
2168
|
+
barCategoryGap: "5%",
|
2169
|
+
style: { stroke: "#fff", strokeWidth: 1 },
|
2170
|
+
margin: {
|
2171
|
+
top: 20,
|
2172
|
+
right: 30,
|
2173
|
+
left: 20,
|
2174
|
+
bottom: 5
|
2175
|
+
}
|
2176
|
+
}, /* @__PURE__ */ import_react5.default.createElement(CartesianGrid, null), renderChildren2(props)));
|
2177
|
+
};
|
2178
|
+
var Bar = Object.assign((props) => /* @__PURE__ */ import_react5.default.createElement(import_recharts6.Bar, __spreadProps(__spreadValues({}, props), {
|
2179
|
+
isAnimationActive: false
|
2180
|
+
})), import_recharts6.Bar);
|
2181
|
+
BarChart.Bar = Bar;
|
2182
|
+
BarChart.Tooltip = Tooltip;
|
2183
|
+
|
2184
|
+
// src/charts/LineChart/LineChart.tsx
|
2185
|
+
var import_react6 = __toESM(require("react"));
|
2186
|
+
var import_recharts7 = require("recharts");
|
2187
|
+
var renderChildren3 = (props) => {
|
2188
|
+
return import_react6.default.Children.map(props.children, (child) => {
|
2189
|
+
switch (getDisplayName(child.type)) {
|
2190
|
+
case Axis.XAxis.displayName: {
|
2191
|
+
return renderXAxis(child, props);
|
2192
|
+
}
|
2193
|
+
case Axis.XAxis.Time.displayName: {
|
2194
|
+
return renderXTimeAxis(child, props);
|
2195
|
+
}
|
2196
|
+
case Axis.YAxis.displayName: {
|
2197
|
+
return renderYAxis(child, props);
|
2198
|
+
}
|
2199
|
+
default: {
|
2200
|
+
return child;
|
2201
|
+
}
|
2202
|
+
}
|
2203
|
+
});
|
2204
|
+
};
|
2205
|
+
var LineChart = (props) => {
|
2206
|
+
const { data } = props;
|
2207
|
+
return /* @__PURE__ */ import_react6.default.createElement(ResponsiveContainer, null, /* @__PURE__ */ import_react6.default.createElement(import_recharts7.LineChart, {
|
2208
|
+
width: 500,
|
2209
|
+
height: 500,
|
2210
|
+
data,
|
2211
|
+
style: { stroke: "#fff", strokeWidth: 1 },
|
2212
|
+
margin: {
|
2213
|
+
top: 20,
|
2214
|
+
right: 30,
|
2215
|
+
left: 20,
|
2216
|
+
bottom: 5
|
2217
|
+
}
|
2218
|
+
}, /* @__PURE__ */ import_react6.default.createElement(CartesianGrid, null), renderChildren3(props)));
|
2219
|
+
};
|
2220
|
+
var Line = Object.assign(
|
2221
|
+
(props) => /* @__PURE__ */ import_react6.default.createElement(import_recharts7.Line, __spreadProps(__spreadValues({
|
2222
|
+
type: "monotone"
|
2223
|
+
}, props), {
|
2224
|
+
strokeWidth: 2,
|
2225
|
+
isAnimationActive: false,
|
2226
|
+
dot: false
|
2227
|
+
})),
|
2228
|
+
import_recharts7.Line
|
2229
|
+
);
|
2230
|
+
LineChart.Line = Line;
|
2231
|
+
|
2232
|
+
// src/charts/Reference/Reference.tsx
|
2233
|
+
var import_react7 = __toESM(require("react"));
|
2234
|
+
var import_recharts8 = require("recharts");
|
2235
|
+
var ReferenceLine = Object.assign(
|
2236
|
+
(props) => /* @__PURE__ */ import_react7.default.createElement(import_recharts8.ReferenceLine, __spreadProps(__spreadValues({}, props), {
|
2237
|
+
strokeDasharray: "9 3",
|
2238
|
+
strokeWidth: 2
|
2239
|
+
})),
|
2240
|
+
import_recharts8.ReferenceLine
|
2241
|
+
);
|
2242
|
+
var ReferenceArea = Object.assign(
|
2243
|
+
(props) => /* @__PURE__ */ import_react7.default.createElement(import_recharts8.ReferenceArea, __spreadProps(__spreadValues({}, props), {
|
2244
|
+
strokeWidth: 0,
|
2245
|
+
fillOpacity: 0.1
|
2246
|
+
})),
|
2247
|
+
import_recharts8.ReferenceLine
|
2248
|
+
);
|
2249
|
+
var Reference = {
|
2250
|
+
Line: ReferenceLine,
|
2251
|
+
Area: ReferenceArea
|
2252
|
+
};
|
2100
2253
|
// Annotate the CommonJS export names for ESM import in node:
|
2101
2254
|
0 && (module.exports = {
|
2255
|
+
Area,
|
2256
|
+
AreaChart,
|
2102
2257
|
Axis,
|
2103
2258
|
Bar,
|
2104
2259
|
BarChart,
|
2105
2260
|
CartesianGrid,
|
2261
|
+
Line,
|
2262
|
+
LineChart,
|
2263
|
+
Reference,
|
2106
2264
|
ResponsiveContainer,
|
2107
2265
|
Tooltip,
|
2108
2266
|
getDisplayName,
|
package/dist/charts.mjs
CHANGED
@@ -30,6 +30,10 @@ var __objRest = (source, exclude) => {
|
|
30
30
|
return target;
|
31
31
|
};
|
32
32
|
|
33
|
+
// src/charts/AreaChart/AreaChart.tsx
|
34
|
+
import React4 from "react";
|
35
|
+
import { Area as _Area, AreaChart as _AreaChart } from "recharts";
|
36
|
+
|
33
37
|
// src/charts/Axis/Axis.tsx
|
34
38
|
import React from "react";
|
35
39
|
import { XAxis as _XAxis, YAxis as _YAxis } from "recharts";
|
@@ -1864,10 +1868,11 @@ var getDisplayName = (Comp) => {
|
|
1864
1868
|
};
|
1865
1869
|
var isDateArray = (arr) => arr.every(isDate);
|
1866
1870
|
var getXAxisTicks = ({ dataKey, ticks: ticks2 }, chartProps) => {
|
1871
|
+
var _a;
|
1867
1872
|
if (!ticks2 || isArray(ticks2)) {
|
1868
1873
|
return ticks2 != null ? ticks2 : void 0;
|
1869
1874
|
}
|
1870
|
-
const xValues = chartProps.data.map(
|
1875
|
+
const xValues = ((_a = chartProps.data) != null ? _a : []).map(
|
1871
1876
|
(datum) => typeof dataKey === "function" ? dataKey(datum) : dataKey ? datum[dataKey] : void 0
|
1872
1877
|
);
|
1873
1878
|
if (!isDateArray(xValues)) {
|
@@ -1918,10 +1923,6 @@ var Axis = {
|
|
1918
1923
|
YAxis
|
1919
1924
|
};
|
1920
1925
|
|
1921
|
-
// src/charts/BarChart/BarChart.tsx
|
1922
|
-
import React4 from "react";
|
1923
|
-
import { Bar as _Bar, BarChart as _BarChart } from "recharts";
|
1924
|
-
|
1925
1926
|
// src/charts/Container/Container.tsx
|
1926
1927
|
import React2 from "react";
|
1927
1928
|
import { ResponsiveContainer as _ResponsiveContainer } from "recharts";
|
@@ -1942,7 +1943,7 @@ var CartesianGrid = Object.assign(
|
|
1942
1943
|
_CartesianGrid
|
1943
1944
|
);
|
1944
1945
|
|
1945
|
-
// src/charts/
|
1946
|
+
// src/charts/AreaChart/AreaChart.tsx
|
1946
1947
|
var renderChildren = (props) => {
|
1947
1948
|
return React4.Children.map(props.children, (child) => {
|
1948
1949
|
switch (getDisplayName(child.type)) {
|
@@ -1961,9 +1962,95 @@ var renderChildren = (props) => {
|
|
1961
1962
|
}
|
1962
1963
|
});
|
1963
1964
|
};
|
1965
|
+
var AreaChart = (props) => {
|
1966
|
+
const { data } = props;
|
1967
|
+
return /* @__PURE__ */ React4.createElement(ResponsiveContainer, null, /* @__PURE__ */ React4.createElement(_AreaChart, {
|
1968
|
+
width: 500,
|
1969
|
+
height: 500,
|
1970
|
+
data,
|
1971
|
+
style: { stroke: "#fff", strokeWidth: 1 },
|
1972
|
+
margin: {
|
1973
|
+
top: 20,
|
1974
|
+
right: 30,
|
1975
|
+
left: 20,
|
1976
|
+
bottom: 5
|
1977
|
+
}
|
1978
|
+
}, /* @__PURE__ */ React4.createElement(CartesianGrid, null), renderChildren(props)));
|
1979
|
+
};
|
1980
|
+
var Area = Object.assign(
|
1981
|
+
(props) => {
|
1982
|
+
var _a;
|
1983
|
+
return /* @__PURE__ */ React4.createElement(_Area, __spreadProps(__spreadValues({
|
1984
|
+
type: "monotone",
|
1985
|
+
strokeWidth: 2,
|
1986
|
+
dot: false
|
1987
|
+
}, props), {
|
1988
|
+
fill: (_a = props.fill) != null ? _a : props.stroke,
|
1989
|
+
fillOpacity: 0.1,
|
1990
|
+
isAnimationActive: false
|
1991
|
+
}));
|
1992
|
+
},
|
1993
|
+
_Area
|
1994
|
+
);
|
1995
|
+
Area.defaultProps = Object.assign(_Area.defaultProps, {
|
1996
|
+
fillOpacity: 0.1,
|
1997
|
+
fill: void 0
|
1998
|
+
});
|
1999
|
+
AreaChart.Area = Area;
|
2000
|
+
|
2001
|
+
// src/charts/BarChart/BarChart.tsx
|
2002
|
+
import React5 from "react";
|
2003
|
+
import { Bar as _Bar, BarChart as _BarChart } from "recharts";
|
2004
|
+
|
2005
|
+
// src/charts/Tooltip/Tooltip.tsx
|
2006
|
+
import { DefaultTooltipContent, Tooltip as _Tooltip } from "recharts";
|
2007
|
+
var contentStyle = {
|
2008
|
+
boxShadow: "var(--aquarium-box-shadow-8dp)",
|
2009
|
+
background: "#fff"
|
2010
|
+
};
|
2011
|
+
var itemStyle = {
|
2012
|
+
display: "flex",
|
2013
|
+
paddingTop: "2px",
|
2014
|
+
paddingBottom: "2px"
|
2015
|
+
};
|
2016
|
+
var Tooltip = Object.assign(_Tooltip, {
|
2017
|
+
DefaultContent: DefaultTooltipContent
|
2018
|
+
});
|
2019
|
+
Tooltip.defaultProps = Object.assign({}, _Tooltip.defaultProps, {
|
2020
|
+
separator: "",
|
2021
|
+
isAnimationActive: false,
|
2022
|
+
contentStyle,
|
2023
|
+
itemStyle,
|
2024
|
+
cursor: { stroke: "var(--aquarium-colors-grey-70)", strokeDasharray: "5" }
|
2025
|
+
});
|
2026
|
+
|
2027
|
+
// src/charts/BarChart/BarChart.tsx
|
2028
|
+
var renderChildren2 = (props) => {
|
2029
|
+
return React5.Children.map(props.children, (child) => {
|
2030
|
+
switch (getDisplayName(child.type)) {
|
2031
|
+
case Axis.XAxis.displayName: {
|
2032
|
+
return renderXAxis(child, props);
|
2033
|
+
}
|
2034
|
+
case Axis.XAxis.Time.displayName: {
|
2035
|
+
return renderXTimeAxis(child, props);
|
2036
|
+
}
|
2037
|
+
case Axis.YAxis.displayName: {
|
2038
|
+
return renderYAxis(child, props);
|
2039
|
+
}
|
2040
|
+
case Tooltip.displayName: {
|
2041
|
+
return /* @__PURE__ */ React5.createElement(Tooltip, __spreadProps(__spreadValues({}, child.props), {
|
2042
|
+
cursor: false
|
2043
|
+
}));
|
2044
|
+
}
|
2045
|
+
default: {
|
2046
|
+
return child;
|
2047
|
+
}
|
2048
|
+
}
|
2049
|
+
});
|
2050
|
+
};
|
1964
2051
|
var BarChart = (props) => {
|
1965
2052
|
const { data } = props;
|
1966
|
-
return /* @__PURE__ */
|
2053
|
+
return /* @__PURE__ */ React5.createElement(ResponsiveContainer, null, /* @__PURE__ */ React5.createElement(_BarChart, {
|
1967
2054
|
width: 500,
|
1968
2055
|
height: 500,
|
1969
2056
|
data,
|
@@ -1975,27 +2062,96 @@ var BarChart = (props) => {
|
|
1975
2062
|
left: 20,
|
1976
2063
|
bottom: 5
|
1977
2064
|
}
|
1978
|
-
}, /* @__PURE__ */
|
2065
|
+
}, /* @__PURE__ */ React5.createElement(CartesianGrid, null), renderChildren2(props)));
|
1979
2066
|
};
|
1980
|
-
var Bar = Object.assign((props) => /* @__PURE__ */
|
2067
|
+
var Bar = Object.assign((props) => /* @__PURE__ */ React5.createElement(_Bar, __spreadProps(__spreadValues({}, props), {
|
1981
2068
|
isAnimationActive: false
|
1982
2069
|
})), _Bar);
|
1983
2070
|
BarChart.Bar = Bar;
|
2071
|
+
BarChart.Tooltip = Tooltip;
|
1984
2072
|
|
1985
|
-
// src/charts/
|
1986
|
-
import
|
1987
|
-
|
1988
|
-
|
1989
|
-
|
1990
|
-
|
1991
|
-
|
1992
|
-
|
1993
|
-
}
|
2073
|
+
// src/charts/LineChart/LineChart.tsx
|
2074
|
+
import React6 from "react";
|
2075
|
+
import { Line as _Line, LineChart as _LineChart } from "recharts";
|
2076
|
+
var renderChildren3 = (props) => {
|
2077
|
+
return React6.Children.map(props.children, (child) => {
|
2078
|
+
switch (getDisplayName(child.type)) {
|
2079
|
+
case Axis.XAxis.displayName: {
|
2080
|
+
return renderXAxis(child, props);
|
2081
|
+
}
|
2082
|
+
case Axis.XAxis.Time.displayName: {
|
2083
|
+
return renderXTimeAxis(child, props);
|
2084
|
+
}
|
2085
|
+
case Axis.YAxis.displayName: {
|
2086
|
+
return renderYAxis(child, props);
|
2087
|
+
}
|
2088
|
+
default: {
|
2089
|
+
return child;
|
2090
|
+
}
|
2091
|
+
}
|
2092
|
+
});
|
2093
|
+
};
|
2094
|
+
var LineChart = (props) => {
|
2095
|
+
const { data } = props;
|
2096
|
+
return /* @__PURE__ */ React6.createElement(ResponsiveContainer, null, /* @__PURE__ */ React6.createElement(_LineChart, {
|
2097
|
+
width: 500,
|
2098
|
+
height: 500,
|
2099
|
+
data,
|
2100
|
+
style: { stroke: "#fff", strokeWidth: 1 },
|
2101
|
+
margin: {
|
2102
|
+
top: 20,
|
2103
|
+
right: 30,
|
2104
|
+
left: 20,
|
2105
|
+
bottom: 5
|
2106
|
+
}
|
2107
|
+
}, /* @__PURE__ */ React6.createElement(CartesianGrid, null), renderChildren3(props)));
|
2108
|
+
};
|
2109
|
+
var Line = Object.assign(
|
2110
|
+
(props) => /* @__PURE__ */ React6.createElement(_Line, __spreadProps(__spreadValues({
|
2111
|
+
type: "monotone"
|
2112
|
+
}, props), {
|
2113
|
+
strokeWidth: 2,
|
2114
|
+
isAnimationActive: false,
|
2115
|
+
dot: false
|
2116
|
+
})),
|
2117
|
+
_Line
|
2118
|
+
);
|
2119
|
+
LineChart.Line = Line;
|
2120
|
+
|
2121
|
+
// src/charts/Reference/Reference.tsx
|
2122
|
+
import React7 from "react";
|
2123
|
+
import {
|
2124
|
+
ReferenceArea as _ReferenceArea,
|
2125
|
+
ReferenceLine as _ReferenceLine
|
2126
|
+
} from "recharts";
|
2127
|
+
var ReferenceLine = Object.assign(
|
2128
|
+
(props) => /* @__PURE__ */ React7.createElement(_ReferenceLine, __spreadProps(__spreadValues({}, props), {
|
2129
|
+
strokeDasharray: "9 3",
|
2130
|
+
strokeWidth: 2
|
2131
|
+
})),
|
2132
|
+
_ReferenceLine
|
2133
|
+
);
|
2134
|
+
var ReferenceArea = Object.assign(
|
2135
|
+
(props) => /* @__PURE__ */ React7.createElement(_ReferenceArea, __spreadProps(__spreadValues({}, props), {
|
2136
|
+
strokeWidth: 0,
|
2137
|
+
fillOpacity: 0.1
|
2138
|
+
})),
|
2139
|
+
_ReferenceLine
|
2140
|
+
);
|
2141
|
+
var Reference = {
|
2142
|
+
Line: ReferenceLine,
|
2143
|
+
Area: ReferenceArea
|
2144
|
+
};
|
1994
2145
|
export {
|
2146
|
+
Area,
|
2147
|
+
AreaChart,
|
1995
2148
|
Axis,
|
1996
2149
|
Bar,
|
1997
2150
|
BarChart,
|
1998
2151
|
CartesianGrid,
|
2152
|
+
Line,
|
2153
|
+
LineChart,
|
2154
|
+
Reference,
|
1999
2155
|
ResponsiveContainer,
|
2000
2156
|
Tooltip,
|
2001
2157
|
getDisplayName,
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Area as _Area, AreaChart as _AreaChart, type AreaProps } from 'recharts';
|
3
|
+
import { type ChartProps } from '../../../src/charts/lib/utils';
|
4
|
+
declare type ComposedAreaChart = {
|
5
|
+
Area: typeof Area;
|
6
|
+
};
|
7
|
+
declare type AreaChartProps = ChartProps & React.ComponentProps<typeof _AreaChart> & {
|
8
|
+
children: React.ReactElement | React.ReactElement[];
|
9
|
+
};
|
10
|
+
export declare const AreaChart: ComposedAreaChart & React.FC<AreaChartProps>;
|
11
|
+
export declare const Area: ((props: Omit<AreaProps, 'ref'>) => React.JSX.Element) & typeof _Area;
|
12
|
+
export {};
|
@@ -0,0 +1,46 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Area as _Area, AreaChart as _AreaChart } from 'recharts';
|
3
|
+
import { Axis, renderXAxis, renderXTimeAxis, renderYAxis } from '../../../src/charts/Axis/Axis';
|
4
|
+
import { ResponsiveContainer } from '../../../src/charts/Container/Container';
|
5
|
+
import { CartesianGrid } from '../../../src/charts/Grid/Grid';
|
6
|
+
import { getDisplayName } from '../../../src/charts/lib/utils';
|
7
|
+
const renderChildren = (props) => {
|
8
|
+
return React.Children.map(props.children, (child) => {
|
9
|
+
switch (getDisplayName(child.type)) {
|
10
|
+
case Axis.XAxis.displayName: {
|
11
|
+
return renderXAxis(child, props);
|
12
|
+
}
|
13
|
+
case Axis.XAxis.Time.displayName: {
|
14
|
+
return renderXTimeAxis(child, props);
|
15
|
+
}
|
16
|
+
case Axis.YAxis.displayName: {
|
17
|
+
return renderYAxis(child, props);
|
18
|
+
}
|
19
|
+
default: {
|
20
|
+
return child;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
});
|
24
|
+
};
|
25
|
+
export const AreaChart = (props) => {
|
26
|
+
const { data } = props;
|
27
|
+
return (React.createElement(ResponsiveContainer, null,
|
28
|
+
React.createElement(_AreaChart, { width: 500, height: 500, data: data, style: { stroke: '#fff', strokeWidth: 1 }, margin: {
|
29
|
+
top: 20,
|
30
|
+
right: 30,
|
31
|
+
left: 20,
|
32
|
+
bottom: 5,
|
33
|
+
} },
|
34
|
+
React.createElement(CartesianGrid, null),
|
35
|
+
renderChildren(props))));
|
36
|
+
};
|
37
|
+
export const Area = Object.assign((props) => {
|
38
|
+
var _a;
|
39
|
+
return (React.createElement(_Area, Object.assign({ type: "monotone", strokeWidth: 2, dot: false }, props, { fill: (_a = props.fill) !== null && _a !== void 0 ? _a : props.stroke, fillOpacity: 0.1, isAnimationActive: false })));
|
40
|
+
}, _Area);
|
41
|
+
Area.defaultProps = Object.assign(_Area.defaultProps, {
|
42
|
+
fillOpacity: 0.1,
|
43
|
+
fill: undefined,
|
44
|
+
});
|
45
|
+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Q2pDLG9CQUFDLEtBQUssa0JBQ0osSUFBSSxFQUFDLFVBQVUsRUFDZixXQUFXLEVBQUUsQ0FBQyxFQUNkLEdBQUcsRUFBRSxLQUFLLElBQ04sS0FBSyxJQUNULElBQUksRUFBRSxNQUFBLEtBQUssQ0FBQyxJQUFJLG1DQUFJLEtBQUssQ0FBQyxNQUFNLEVBQ2hDLFdBQVcsRUFBRSxHQUFHLEVBQ2hCLGlCQUFpQixFQUFFLEtBQUssSUFDeEIsQ0FDSCxDQUFBO0NBQUEsRUFDRCxLQUFLLENBQ04sQ0FBQztBQUVGLElBQUksQ0FBQyxZQUFZLEdBQUcsTUFBTSxDQUFDLE1BQU0sQ0FBQyxLQUFLLENBQUMsWUFBWSxFQUFFO0lBQ3BELFdBQVcsRUFBRSxHQUFHO0lBQ2hCLElBQUksRUFBRSxTQUFTO0NBQ2hCLENBQUMsQ0FBQztBQUVILFNBQVMsQ0FBQyxJQUFJLEdBQUcsSUFBSSxDQUFDIn0=
|
@@ -1,8 +1,10 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { Bar as _Bar, BarChart as _BarChart, type BarProps } from 'recharts';
|
3
3
|
import { type ChartProps } from '../../../src/charts/lib/utils';
|
4
|
+
import { Tooltip } from '../../../src/charts/Tooltip/Tooltip';
|
4
5
|
declare type ComposedBarChart = {
|
5
6
|
Bar: typeof Bar;
|
7
|
+
Tooltip: typeof Tooltip;
|
6
8
|
};
|
7
9
|
declare type BarChartProps = ChartProps & React.ComponentProps<typeof _BarChart> & {
|
8
10
|
children: React.ReactElement | React.ReactElement[];
|
@@ -4,6 +4,7 @@ import { Axis, renderXAxis, renderXTimeAxis, renderYAxis } from '../../../src/ch
|
|
4
4
|
import { ResponsiveContainer } from '../../../src/charts/Container/Container';
|
5
5
|
import { CartesianGrid } from '../../../src/charts/Grid/Grid';
|
6
6
|
import { getDisplayName } from '../../../src/charts/lib/utils';
|
7
|
+
import { Tooltip } from '../../../src/charts/Tooltip/Tooltip';
|
7
8
|
const renderChildren = (props) => {
|
8
9
|
return React.Children.map(props.children, (child) => {
|
9
10
|
switch (getDisplayName(child.type)) {
|
@@ -16,6 +17,9 @@ const renderChildren = (props) => {
|
|
16
17
|
case Axis.YAxis.displayName: {
|
17
18
|
return renderYAxis(child, props);
|
18
19
|
}
|
20
|
+
case Tooltip.displayName: {
|
21
|
+
return React.createElement(Tooltip, Object.assign({}, child.props, { cursor: false }));
|
22
|
+
}
|
19
23
|
default: {
|
20
24
|
return child;
|
21
25
|
}
|
@@ -36,4 +40,5 @@ export const BarChart = (props) => {
|
|
36
40
|
};
|
37
41
|
export const Bar = Object.assign((props) => React.createElement(_Bar, Object.assign({}, props, { isAnimationActive: false })), _Bar);
|
38
42
|
BarChart.Bar = Bar;
|
39
|
-
|
43
|
+
BarChart.Tooltip = Tooltip;
|
44
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQmFyQ2hhcnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvY2hhcnRzL0JhckNoYXJ0L0JhckNoYXJ0LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssTUFBTSxPQUFPLENBQUM7QUFDMUIsT0FBTyxFQUFFLEdBQUcsSUFBSSxJQUFJLEVBQUUsUUFBUSxJQUFJLFNBQVMsRUFBaUIsTUFBTSxVQUFVLENBQUM7QUFFN0UsT0FBTyxFQUFFLElBQUksRUFBRSxXQUFXLEVBQUUsZUFBZSxFQUFFLFdBQVcsRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBQ3ZGLE9BQU8sRUFBRSxtQkFBbUIsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBQ3JFLE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUNyRCxPQUFPLEVBQW1CLGNBQWMsRUFBRSxNQUFNLHNCQUFzQixDQ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NUUsTUFBTSxFQUFFLElBQUksRUFBRSxHQUFHLEtBQUssQ0FBQztJQUN2QixPQUFPLENBQ0wsb0JBQUMsbUJBQW1CO1FBQ2xCLG9CQUFDLFNBQVMsSUFDUixLQUFLLEVBQUUsR0FBRyxFQUNWLE1BQU0sRUFBRSxHQUFHLEVBQ1gsSUFBSSxFQUFFLElBQUksRUFDVixjQUFjLEVBQUMsSUFBSSxFQUNuQixLQUFLLEVBQUUsRUFBRSxNQUFNLEVBQUUsTUFBTSxFQUFFLFdBQVcsRUFBRSxDQUFDLEVBQUUsRUFDekMsTUFBTSxFQUFFO2dCQUNOLEdBQUcsRUFBRSxFQUFFO2dCQUNQLEtBQUssRUFBRSxFQUFFO2dCQUNULElBQUksRUFBRSxFQUFFO2dCQUNSLE1BQU0sRUFBRSxDQUFDO2FBQ1Y7WUFFRCxvQkFBQyxhQUFhLE9BQUc7WUFDaEIsY0FBYyxDQUFDLEtBQUssQ0FBQyxDQUNaLENBQ1EsQ0FDdkIsQ0FBQztBQUNKLENBQUMsQ0FBQztBQUVGLE1BQU0sQ0FBQyxNQUFNLEdBQUcsR0FBRyxNQUFNLENBQUMsTUFBTSxDQUFDLENBQUMsS0FBNEIsRUFBRSxFQUFFLENBQUMsb0JBQUMsSUFBSSxvQkFBSyxLQUFLLElBQUUsaUJBQWlCLEVBQUUsS0FBSyxJQUFJLEVBQUUsSUFBSSxDQUFDLENBQUM7QUFDeEgsUUFBUSxDQUFDLEdBQUcsR0FBRyxHQUFHLENBQUM7QUFDbkIsUUFBUSxDQUFDLE9BQU8sR0FBRyxPQUFPLENBQUMifQ==
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Line as _Line, LineChart as _LineChart, type LineProps } from 'recharts';
|
3
|
+
import { type ChartProps } from '../../../src/charts/lib/utils';
|
4
|
+
declare type ComposedLineChart = {
|
5
|
+
Line: typeof Line;
|
6
|
+
};
|
7
|
+
declare type LineChartProps = ChartProps & React.ComponentProps<typeof _LineChart> & {
|
8
|
+
children: React.ReactElement | React.ReactElement[];
|
9
|
+
};
|
10
|
+
export declare const LineChart: ComposedLineChart & React.FC<LineChartProps>;
|
11
|
+
export declare const Line: ((props: Omit<LineProps, 'ref'>) => React.JSX.Element) & typeof _Line;
|
12
|
+
export {};
|