waffle-board 0.2.2 → 0.2.4
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/README.md +53 -6
- package/dist-lib/{AreaChart-BybfMJe7.js → AreaChart-FcTyoMIU.js} +92 -89
- package/dist-lib/BarChart-B_gQGncr.js +383 -0
- package/dist-lib/{BubbleChart-4mszGuHa.js → BubbleChart-ChjG24ep.js} +3 -3
- package/dist-lib/CandlestickChart-CNPWAUc7.js +201 -0
- package/dist-lib/{ChordChart-C1--yz3H.js → ChordChart-Mqk6fqnw.js} +2 -2
- package/dist-lib/{CompositeChart-CC9WaSX2.js → CompositeChart-D8ZYLRaj.js} +4 -4
- package/dist-lib/D3ShapeFactories-BW5r_o96.js +259 -0
- package/dist-lib/{Grid-DoKyoesQ.js → Grid-CFUvuF-c.js} +2 -2
- package/dist-lib/{GridColumns-Bmuw2WtH.js → GridColumns-B3meoJgP.js} +4 -4
- package/dist-lib/{GridRows-DGQ9ou3n.js → GridRows-7-3enkd1.js} +5 -4
- package/dist-lib/{HeatmapChart-BA7C9aDH.js → HeatmapChart-DZpssQYc.js} +1 -1
- package/dist-lib/LineChart-TlaDdO56.js +257 -0
- package/dist-lib/PieChart-o5Bf7WW3.js +321 -0
- package/dist-lib/{RadarChart-Qb_0U-rp.js → RadarChart-CmGksAYH.js} +1 -1
- package/dist-lib/{SankeyChart-DzvTwdbQ.js → SankeyChart-ZThr5BbW.js} +1 -1
- package/dist-lib/{ScatterChart-texqcqO7.js → ScatterChart-0sGTmbit.js} +3 -3
- package/dist-lib/{band-Q-NQixeu.js → band-DbiWCPe-.js} +6 -6
- package/dist-lib/{linear-BMy3dF_L.js → linear-BdXdqDf3.js} +42 -42
- package/dist-lib/{monotone-DpfKcgi8.js → monotone-ClLgsXsq.js} +1 -1
- package/dist-lib/{ordinal-CB3mLwcq.js → ordinal-C_i-AnC9.js} +2 -2
- package/dist-lib/{ordinal-CEApqus_.js → ordinal-DZ5TFA9v.js} +1 -1
- package/dist-lib/{scaleOperator-BDwBQdxT.js → scaleOperator-Dwi9_Jub.js} +21 -21
- package/dist-lib/stackOffset-BVFXLVew.js +143 -0
- package/dist-lib/{time-BkG4aUoI.js → time-CYw7WqrE.js} +2 -2
- package/dist-lib/waffle-board.css +1 -1
- package/dist-lib/waffle-board.es.js +675 -577
- package/dist-lib/waffle-board.umd.js +4 -4
- package/package.json +4 -4
- package/dist-lib/BarChart-BBQ6DRng.js +0 -147
- package/dist-lib/D3ShapeFactories-D3zwXaLE.js +0 -395
- package/dist-lib/LineChart-DhhhQVLj.js +0 -313
- package/dist-lib/PieChart-dluYJoK7.js +0 -319
package/README.md
CHANGED
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
A **JSON schema-based dashboard renderer** for React. Build complex, draggable grid layouts simply by defining a JSON configuration.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/waffle-board)
|
|
6
|
-
[](https://
|
|
6
|
+
[](https://surprisewaffles-io.github.io/waffle-board/)
|
|
7
7
|
|
|
8
|
-

|
|
9
9
|
|
|
10
10
|
## Features
|
|
11
11
|
|
|
12
12
|
- **JSON-Driven**: Define your entire dashboard layout and widget configuration in a simple JSON object.
|
|
13
13
|
- **Drag & Drop**: Built-in support for resizing and rearranging widgets (powered by `react-grid-layout`).
|
|
14
14
|
- **Theme System**: 4 distinct themes (Ocean, Forest, Sunset, Default) with dark mode support.
|
|
15
|
-
- **Waffle Charts Integration**: Showcases the full power of the [Waffle Charts](https://github.com/
|
|
15
|
+
- **Waffle Charts Integration**: Showcases the full power of the [Waffle Charts](https://github.com/surprisewaffles-io/waffle-charts) library.
|
|
16
16
|
- **Modern UI**: Clean aesthetics using Tailwind CSS and Lucide icons.
|
|
17
17
|
|
|
18
18
|
## Tech Stack
|
|
@@ -20,7 +20,7 @@ A **JSON schema-based dashboard renderer** for React. Build complex, draggable g
|
|
|
20
20
|
- **Framework**: [React](https://react.dev/) + [Vite](https://vitejs.dev/)
|
|
21
21
|
- **Language**: TypeScript
|
|
22
22
|
- **Styling**: Tailwind CSS
|
|
23
|
-
- **Charts**: [Waffle Charts](https://github.com/
|
|
23
|
+
- **Charts**: [Waffle Charts](https://github.com/surprisewaffles-io/waffle-charts) (Visx-based)
|
|
24
24
|
- **Grid**: `react-grid-layout`
|
|
25
25
|
|
|
26
26
|
## Installation (As a Library)
|
|
@@ -35,7 +35,8 @@ npm install waffle-board
|
|
|
35
35
|
|
|
36
36
|
```tsx
|
|
37
37
|
import { Dashboard } from 'waffle-board';
|
|
38
|
-
import { BarChart
|
|
38
|
+
import { BarChart } from '@waffle-charts/components/waffle/BarChart';
|
|
39
|
+
import { LineChart } from '@waffle-charts/components/waffle/LineChart'; // Your chart components
|
|
39
40
|
import 'waffle-board/dist-lib/style.css'; // Import styles
|
|
40
41
|
|
|
41
42
|
const registry = {
|
|
@@ -54,7 +55,44 @@ function MyDashboard() {
|
|
|
54
55
|
}
|
|
55
56
|
```
|
|
56
57
|
|
|
57
|
-
|
|
58
|
+
> **Note**: The Vite config in this repo defines an alias `@waffle-charts` that points to the local source of the `waffle-charts` library. This lets you import chart components directly from their file paths.
|
|
59
|
+
|
|
60
|
+
### Supported Charts
|
|
61
|
+
Directly import these components from `@waffle-charts/components/waffle/`:
|
|
62
|
+
|
|
63
|
+
- `BarChart` - Supports stacked and grouped variants
|
|
64
|
+
- `LineChart` - Supports multi-series and legends
|
|
65
|
+
- `AreaChart`
|
|
66
|
+
- `PieChart`
|
|
67
|
+
- `CandlestickChart` - Financial OHLC data
|
|
68
|
+
- `ScatterChart`
|
|
69
|
+
- `RadarChart`
|
|
70
|
+
- `HeatmapChart`
|
|
71
|
+
- `TreemapChart`
|
|
72
|
+
- `SankeyChart`
|
|
73
|
+
- `ChordChart`
|
|
74
|
+
|
|
75
|
+
### Registry Explanation
|
|
76
|
+
The `registry` object maps the string `type` found in your JSON configuration (e.g., `"type": "my-bar-chart"`) to the actual React component. This allows the JSON schema to remain serializable and agnostic of implementation details.
|
|
77
|
+
|
|
78
|
+
### Data Integration (Dynamic Loading)
|
|
79
|
+
Widgets can fetch their own data by defining a `dataSource` in the JSON config. You provide the `fetcher` implementation.
|
|
80
|
+
|
|
81
|
+
```tsx
|
|
82
|
+
<Dashboard
|
|
83
|
+
// ...
|
|
84
|
+
fetcher={async (dataSource) => {
|
|
85
|
+
// Implement your data fetching logic here
|
|
86
|
+
if (dataSource.type === 'api') {
|
|
87
|
+
const response = await fetch(dataSource.endpoint);
|
|
88
|
+
return response.json();
|
|
89
|
+
}
|
|
90
|
+
return null;
|
|
91
|
+
}}
|
|
92
|
+
/>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Running the Project
|
|
58
96
|
|
|
59
97
|
### Demo App
|
|
60
98
|
To run the included demo application:
|
|
@@ -78,6 +116,15 @@ Themes are defined in `src/index.css` using CSS variables. To add a new theme:
|
|
|
78
116
|
2. Define the color palette (background, foreground, primary, etc.).
|
|
79
117
|
3. Add the theme to the `themes` array in `src/App.tsx`.
|
|
80
118
|
|
|
119
|
+
## Troubleshooting
|
|
120
|
+
|
|
121
|
+
- **Module not found**: Verify the `@waffle-charts` alias exists in `vite.config.ts`.
|
|
122
|
+
- **TypeScript errors**: Run `npm run build:lib` to generate the compiled type definitions.
|
|
123
|
+
|
|
124
|
+
## Contributing
|
|
125
|
+
|
|
126
|
+
See [CONTRIBUTING.md](https://github.com/surprisewaffles-io/waffle-board/blob/main/CONTRIBUTING.md) for guidelines.
|
|
127
|
+
|
|
81
128
|
## License
|
|
82
129
|
|
|
83
130
|
MIT
|
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
import { j as o, c as C } from "./utils-B4eT4KZs.js";
|
|
2
|
-
import N, { useMemo as
|
|
3
|
-
import { G, c as W, P as
|
|
4
|
-
import { c as
|
|
5
|
-
import { c as
|
|
6
|
-
import { u as
|
|
7
|
-
import { G as
|
|
8
|
-
import { G as
|
|
9
|
-
import {
|
|
10
|
-
import { l as
|
|
11
|
-
var
|
|
12
|
-
function
|
|
13
|
-
return
|
|
2
|
+
import N, { useMemo as G } from "react";
|
|
3
|
+
import { G as R, c as W, P as Q } from "./ParentSize-DgScxYmK.js";
|
|
4
|
+
import { c as U } from "./time-CYw7WqrE.js";
|
|
5
|
+
import { c as V, b as Z } from "./linear-BdXdqDf3.js";
|
|
6
|
+
import { u as _, a as tt, d as et } from "./useTooltipInPortal-DOXS3zAG.js";
|
|
7
|
+
import { G as at, A as rt, a as ot } from "./GridRows-7-3enkd1.js";
|
|
8
|
+
import { G as nt } from "./GridColumns-B3meoJgP.js";
|
|
9
|
+
import { s as st, b as lt } from "./D3ShapeFactories-BW5r_o96.js";
|
|
10
|
+
import { l as it } from "./localPoint-BIHUncaY.js";
|
|
11
|
+
var ct = ["className", "top", "left", "keys", "data", "curve", "defined", "x", "x0", "x1", "y0", "y1", "value", "order", "offset", "color", "children"];
|
|
12
|
+
function I() {
|
|
13
|
+
return I = Object.assign ? Object.assign.bind() : function(t) {
|
|
14
14
|
for (var r = 1; r < arguments.length; r++) {
|
|
15
15
|
var a = arguments[r];
|
|
16
16
|
for (var n in a)
|
|
17
17
|
Object.prototype.hasOwnProperty.call(a, n) && (t[n] = a[n]);
|
|
18
18
|
}
|
|
19
19
|
return t;
|
|
20
|
-
},
|
|
20
|
+
}, I.apply(this, arguments);
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function dt(t, r) {
|
|
23
23
|
if (t == null) return {};
|
|
24
24
|
var a = {}, n = Object.keys(t), s, l;
|
|
25
25
|
for (l = 0; l < n.length; l++)
|
|
26
26
|
s = n[l], !(r.indexOf(s) >= 0) && (a[s] = t[s]);
|
|
27
27
|
return a;
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
var r = t.className, a = t.top, n = t.left, s = t.keys, l = t.data, S = t.curve, O = t.defined, P = t.x, b = t.x0, k = t.x1, T = t.y0, A = t.y1, M = t.value, w = t.order, c = t.offset, u = t.color, p = t.children, i =
|
|
29
|
+
function ut(t) {
|
|
30
|
+
var r = t.className, a = t.top, n = t.left, s = t.keys, l = t.data, S = t.curve, O = t.defined, P = t.x, b = t.x0, k = t.x1, T = t.y0, A = t.y1, M = t.value, w = t.order, c = t.offset, u = t.color, p = t.children, i = dt(t, ct), y = st({
|
|
31
31
|
keys: s,
|
|
32
32
|
value: M,
|
|
33
33
|
order: w,
|
|
34
34
|
offset: c
|
|
35
|
-
}), j =
|
|
35
|
+
}), j = lt({
|
|
36
36
|
x: P,
|
|
37
37
|
x0: b,
|
|
38
38
|
x1: k,
|
|
@@ -40,35 +40,35 @@ function dt(t) {
|
|
|
40
40
|
y1: A,
|
|
41
41
|
curve: S,
|
|
42
42
|
defined: O
|
|
43
|
-
}), x =
|
|
43
|
+
}), x = y(l);
|
|
44
44
|
return p ? /* @__PURE__ */ N.createElement(N.Fragment, null, p({
|
|
45
45
|
stacks: x,
|
|
46
46
|
path: j,
|
|
47
|
-
stack:
|
|
48
|
-
})) : /* @__PURE__ */ N.createElement(
|
|
47
|
+
stack: y
|
|
48
|
+
})) : /* @__PURE__ */ N.createElement(R, {
|
|
49
49
|
top: a,
|
|
50
50
|
left: n
|
|
51
|
-
}, x.map(function(d,
|
|
52
|
-
return /* @__PURE__ */ N.createElement("path",
|
|
51
|
+
}, x.map(function(d, m) {
|
|
52
|
+
return /* @__PURE__ */ N.createElement("path", I({
|
|
53
53
|
className: W("visx-stack", r),
|
|
54
|
-
key: "stack-" +
|
|
54
|
+
key: "stack-" + m + "-" + (d.key || ""),
|
|
55
55
|
d: j(d) || "",
|
|
56
|
-
fill: u?.(d.key,
|
|
56
|
+
fill: u?.(d.key, m)
|
|
57
57
|
}, i));
|
|
58
58
|
}));
|
|
59
59
|
}
|
|
60
|
-
var
|
|
61
|
-
function
|
|
62
|
-
return
|
|
60
|
+
var pt = ["className", "top", "left", "keys", "data", "curve", "defined", "x", "x0", "x1", "y0", "y1", "value", "order", "offset", "color", "children"];
|
|
61
|
+
function z() {
|
|
62
|
+
return z = Object.assign ? Object.assign.bind() : function(t) {
|
|
63
63
|
for (var r = 1; r < arguments.length; r++) {
|
|
64
64
|
var a = arguments[r];
|
|
65
65
|
for (var n in a)
|
|
66
66
|
Object.prototype.hasOwnProperty.call(a, n) && (t[n] = a[n]);
|
|
67
67
|
}
|
|
68
68
|
return t;
|
|
69
|
-
},
|
|
69
|
+
}, z.apply(this, arguments);
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function mt(t, r) {
|
|
72
72
|
if (t == null) return {};
|
|
73
73
|
var a = {}, n = Object.keys(t), s, l;
|
|
74
74
|
for (l = 0; l < n.length; l++)
|
|
@@ -76,8 +76,8 @@ function pt(t, r) {
|
|
|
76
76
|
return a;
|
|
77
77
|
}
|
|
78
78
|
function xt(t) {
|
|
79
|
-
var r = t.className, a = t.top, n = t.left, s = t.keys, l = t.data, S = t.curve, O = t.defined, P = t.x, b = t.x0, k = t.x1, T = t.y0, A = t.y1, M = t.value, w = t.order, c = t.offset, u = t.color, p = t.children, i =
|
|
80
|
-
return /* @__PURE__ */ N.createElement(
|
|
79
|
+
var r = t.className, a = t.top, n = t.left, s = t.keys, l = t.data, S = t.curve, O = t.defined, P = t.x, b = t.x0, k = t.x1, T = t.y0, A = t.y1, M = t.value, w = t.order, c = t.offset, u = t.color, p = t.children, i = mt(t, pt);
|
|
80
|
+
return /* @__PURE__ */ N.createElement(ut, z({
|
|
81
81
|
className: r,
|
|
82
82
|
top: a,
|
|
83
83
|
left: n,
|
|
@@ -94,19 +94,19 @@ function xt(t) {
|
|
|
94
94
|
order: w,
|
|
95
95
|
offset: c,
|
|
96
96
|
color: u
|
|
97
|
-
}, i), p || function(
|
|
98
|
-
var j =
|
|
99
|
-
return j.map(function(d,
|
|
100
|
-
return /* @__PURE__ */ N.createElement("path",
|
|
97
|
+
}, i), p || function(y) {
|
|
98
|
+
var j = y.stacks, x = y.path;
|
|
99
|
+
return j.map(function(d, m) {
|
|
100
|
+
return /* @__PURE__ */ N.createElement("path", z({
|
|
101
101
|
className: W("visx-area-stack", r),
|
|
102
|
-
key: "area-stack-" +
|
|
102
|
+
key: "area-stack-" + m + "-" + (d.key || ""),
|
|
103
103
|
d: x(d) || "",
|
|
104
|
-
fill: u?.(d.key,
|
|
104
|
+
fill: u?.(d.key, m)
|
|
105
105
|
}, i));
|
|
106
106
|
});
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
|
-
function
|
|
109
|
+
function ft({
|
|
110
110
|
data: t,
|
|
111
111
|
width: r,
|
|
112
112
|
height: a,
|
|
@@ -125,53 +125,56 @@ function mt({
|
|
|
125
125
|
const c = { ...{ top: 40, right: 30, bottom: 50, left: 50 }, ...M }, u = r - c.left - c.right, p = a - c.top - c.bottom;
|
|
126
126
|
if (!Array.isArray(t))
|
|
127
127
|
return console.warn("AreaChart: data prop is not an array", t), null;
|
|
128
|
-
const i = (e) => new Date(e[n]),
|
|
129
|
-
|
|
128
|
+
const i = (e) => new Date(e[n]), y = (e) => e[0], j = (e) => e[1], x = G(() => t.filter((e) => {
|
|
129
|
+
const f = i(e);
|
|
130
|
+
return f instanceof Date && !isNaN(f.getTime());
|
|
131
|
+
}), [t, i]), d = G(
|
|
132
|
+
() => U({
|
|
130
133
|
range: [0, u],
|
|
131
|
-
domain: [
|
|
134
|
+
domain: [
|
|
135
|
+
Math.min(...x.map((e) => i(e).getTime())) || 0,
|
|
136
|
+
Math.max(...x.map((e) => i(e).getTime())) || 0
|
|
137
|
+
]
|
|
132
138
|
}),
|
|
133
|
-
[u,
|
|
134
|
-
),
|
|
135
|
-
() =>
|
|
139
|
+
[u, x, n]
|
|
140
|
+
), m = G(
|
|
141
|
+
() => V({
|
|
136
142
|
range: [p, 0],
|
|
137
143
|
round: !0,
|
|
138
|
-
|
|
139
|
-
// For accurate stacking, we should ideally calculate the max stack value.
|
|
140
|
-
// For this demo, let's just make sure we cover the data range generously.
|
|
141
|
-
domain: [0, Math.max(...t.map((e) => s.reduce((y, m) => y + Number(e[m]), 0))) * 1.1],
|
|
144
|
+
domain: [0, Math.max(...x.map((e) => s.reduce((f, h) => f + (Number(e[h]) || 0), 0))) * 1.1 || 100],
|
|
142
145
|
nice: !0
|
|
143
146
|
}),
|
|
144
|
-
[p,
|
|
147
|
+
[p, x, s]
|
|
145
148
|
), {
|
|
146
|
-
tooltipOpen:
|
|
147
|
-
tooltipLeft:
|
|
148
|
-
tooltipTop:
|
|
149
|
+
tooltipOpen: H,
|
|
150
|
+
tooltipLeft: Y,
|
|
151
|
+
tooltipTop: B,
|
|
149
152
|
tooltipData: E,
|
|
150
|
-
hideTooltip:
|
|
151
|
-
showTooltip:
|
|
152
|
-
} =
|
|
153
|
+
hideTooltip: F,
|
|
154
|
+
showTooltip: K
|
|
155
|
+
} = _(), { containerRef: X, TooltipInPortal: q } = tt({
|
|
153
156
|
scroll: !0
|
|
154
|
-
}),
|
|
155
|
-
const { x:
|
|
156
|
-
let
|
|
157
|
-
|
|
158
|
-
tooltipData:
|
|
159
|
-
tooltipLeft:
|
|
160
|
-
tooltipTop:
|
|
157
|
+
}), J = Z((e) => i(e)).left, $ = (e) => {
|
|
158
|
+
const { x: f } = it(e) || { x: 0 }, h = d.invert(f - c.left), L = J(t, h, 1), g = t[L - 1], v = t[L];
|
|
159
|
+
let D = g;
|
|
160
|
+
v && i(v) && (D = h.valueOf() - i(g).valueOf() > i(v).valueOf() - h.valueOf() ? v : g), D && K({
|
|
161
|
+
tooltipData: D,
|
|
162
|
+
tooltipLeft: d(i(D)) + c.left,
|
|
163
|
+
tooltipTop: m(0) + c.top
|
|
161
164
|
// Snap to bottom or follow mouse
|
|
162
165
|
});
|
|
163
166
|
};
|
|
164
167
|
return r < 10 || a < 100 ? null : /* @__PURE__ */ o.jsxs("div", { className: C("relative", S), children: [
|
|
165
|
-
/* @__PURE__ */ o.jsx("svg", { ref:
|
|
166
|
-
(b || k) && /* @__PURE__ */ o.jsxs(
|
|
167
|
-
b && /* @__PURE__ */ o.jsx(
|
|
168
|
-
k && /* @__PURE__ */ o.jsx(
|
|
168
|
+
/* @__PURE__ */ o.jsx("svg", { ref: X, width: r, height: a, className: "overflow-visible", children: /* @__PURE__ */ o.jsxs(R, { left: c.left, top: c.top, children: [
|
|
169
|
+
(b || k) && /* @__PURE__ */ o.jsxs(R, { children: [
|
|
170
|
+
b && /* @__PURE__ */ o.jsx(at, { scale: m, width: u, height: p, strokeDasharray: "3,3", stroke: "hsl(var(--border, 214.3 31.8% 91.4%))" }),
|
|
171
|
+
k && /* @__PURE__ */ o.jsx(nt, { scale: d, width: u, height: p, strokeDasharray: "3,3", stroke: "hsl(var(--border, 214.3 31.8% 91.4%))" })
|
|
169
172
|
] }),
|
|
170
173
|
O && /* @__PURE__ */ o.jsx(
|
|
171
|
-
|
|
174
|
+
rt,
|
|
172
175
|
{
|
|
173
176
|
top: p,
|
|
174
|
-
scale:
|
|
177
|
+
scale: d,
|
|
175
178
|
stroke: "hsl(var(--border, 214.3 31.8% 91.4%))",
|
|
176
179
|
tickStroke: "hsl(var(--border, 214.3 31.8% 91.4%))",
|
|
177
180
|
label: T,
|
|
@@ -190,9 +193,9 @@ function mt({
|
|
|
190
193
|
}
|
|
191
194
|
),
|
|
192
195
|
P && /* @__PURE__ */ o.jsx(
|
|
193
|
-
|
|
196
|
+
ot,
|
|
194
197
|
{
|
|
195
|
-
scale:
|
|
198
|
+
scale: m,
|
|
196
199
|
stroke: "transparent",
|
|
197
200
|
tickStroke: "hsl(var(--border))",
|
|
198
201
|
label: A,
|
|
@@ -216,20 +219,20 @@ function mt({
|
|
|
216
219
|
{
|
|
217
220
|
data: t,
|
|
218
221
|
keys: s,
|
|
219
|
-
x: (e) =>
|
|
220
|
-
y0: (e) =>
|
|
221
|
-
y1: (e) =>
|
|
222
|
-
children: ({ stacks: e, path:
|
|
223
|
-
const g = l[L % l.length],
|
|
222
|
+
x: (e) => d(i(e.data)) ?? 0,
|
|
223
|
+
y0: (e) => m(y(e)) ?? 0,
|
|
224
|
+
y1: (e) => m(j(e)) ?? 0,
|
|
225
|
+
children: ({ stacks: e, path: f }) => e.map((h, L) => {
|
|
226
|
+
const g = l[L % l.length], v = g.startsWith("#");
|
|
224
227
|
return /* @__PURE__ */ o.jsx(
|
|
225
228
|
"path",
|
|
226
229
|
{
|
|
227
|
-
d:
|
|
230
|
+
d: f(h) || "",
|
|
228
231
|
stroke: "transparent",
|
|
229
|
-
fill:
|
|
230
|
-
className: C("opacity-80 hover:opacity-100 transition-opacity", !
|
|
232
|
+
fill: v ? g : void 0,
|
|
233
|
+
className: C("opacity-80 hover:opacity-100 transition-opacity", !v && "fill-current", !v && g)
|
|
231
234
|
},
|
|
232
|
-
`stack-${
|
|
235
|
+
`stack-${h.key}`
|
|
233
236
|
);
|
|
234
237
|
})
|
|
235
238
|
}
|
|
@@ -245,20 +248,20 @@ function mt({
|
|
|
245
248
|
onTouchStart: $,
|
|
246
249
|
onTouchMove: $,
|
|
247
250
|
onMouseMove: $,
|
|
248
|
-
onMouseLeave: () =>
|
|
251
|
+
onMouseLeave: () => F()
|
|
249
252
|
}
|
|
250
253
|
)
|
|
251
254
|
] }) }),
|
|
252
|
-
|
|
253
|
-
|
|
255
|
+
H && E && /* @__PURE__ */ o.jsx(
|
|
256
|
+
q,
|
|
254
257
|
{
|
|
255
|
-
top:
|
|
256
|
-
left:
|
|
257
|
-
style: { ...
|
|
258
|
+
top: B,
|
|
259
|
+
left: Y,
|
|
260
|
+
style: { ...et, padding: 0, borderRadius: 0, boxShadow: "none", background: "transparent", zIndex: 50 },
|
|
258
261
|
children: /* @__PURE__ */ o.jsxs("div", { className: "rounded-md border bg-white dark:bg-slate-900 px-3 py-1.5 text-sm text-slate-900 dark:text-slate-100 shadow-lg", children: [
|
|
259
262
|
/* @__PURE__ */ o.jsx("p", { className: "font-semibold text-xs text-muted-foreground mb-1", children: i(E).toLocaleDateString() }),
|
|
260
|
-
s.map((e,
|
|
261
|
-
/* @__PURE__ */ o.jsx("div", { className: C("w-2 h-2 rounded-full bg-current", l[
|
|
263
|
+
s.map((e, f) => /* @__PURE__ */ o.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
264
|
+
/* @__PURE__ */ o.jsx("div", { className: C("w-2 h-2 rounded-full bg-current", l[f % l.length]) }),
|
|
262
265
|
/* @__PURE__ */ o.jsxs("span", { className: "text-xs capitalize", children: [
|
|
263
266
|
e,
|
|
264
267
|
":"
|
|
@@ -270,7 +273,7 @@ function mt({
|
|
|
270
273
|
)
|
|
271
274
|
] });
|
|
272
275
|
}
|
|
273
|
-
const
|
|
276
|
+
const Pt = (t) => /* @__PURE__ */ o.jsx("div", { style: { width: "100%", height: "100%", minHeight: 100 }, children: /* @__PURE__ */ o.jsx(Q, { children: ({ width: r, height: a }) => /* @__PURE__ */ o.jsx(ft, { ...t, width: r, height: a }) }) });
|
|
274
277
|
export {
|
|
275
|
-
|
|
278
|
+
Pt as AreaChart
|
|
276
279
|
};
|