@goliapkg/gds 0.9.3 → 0.9.5
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/avatar-By0U5Vts.js +74 -0
- package/dist/avatar-By0U5Vts.js.map +1 -0
- package/dist/badge-DTJq6AXr.js +59 -0
- package/dist/badge-DTJq6AXr.js.map +1 -0
- package/dist/button-avu-rQU4.js +99 -0
- package/dist/button-avu-rQU4.js.map +1 -0
- package/dist/dom-17XgfxMq.js +20 -0
- package/dist/dom-17XgfxMq.js.map +1 -0
- package/dist/gesture-BCGijGek.js +104 -0
- package/dist/gesture-BCGijGek.js.map +1 -0
- package/dist/gesture-system-v-bjvnCe.js +56 -0
- package/dist/gesture-system-v-bjvnCe.js.map +1 -0
- package/dist/glass-CQTlX7IO.js +1702 -0
- package/dist/glass-CQTlX7IO.js.map +1 -0
- package/dist/highlight-BAGZc-4h.js +28 -0
- package/dist/highlight-BAGZc-4h.js.map +1 -0
- package/dist/hooks-BE-_EmDI.js +87 -0
- package/dist/hooks-BE-_EmDI.js.map +1 -0
- package/dist/icon-button-YatlVZnz.js +44 -0
- package/dist/icon-button-YatlVZnz.js.map +1 -0
- package/dist/index.d.ts +8 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +32 -18594
- package/dist/l0-tokens/deps.d.ts +5 -0
- package/dist/l0-tokens/deps.d.ts.map +1 -1
- package/dist/l0-tokens/index.js +4 -0
- package/dist/l0-tokens-DZkyVlac.js +296 -0
- package/dist/l0-tokens-DZkyVlac.js.map +1 -0
- package/dist/l1-systems/index.js +2 -0
- package/dist/l2-primitives/index.js +11 -0
- package/dist/l2-primitives/screen-overlay.d.ts.map +1 -1
- package/dist/l2-primitives/truncate.d.ts +2 -1
- package/dist/l2-primitives/truncate.d.ts.map +1 -1
- package/dist/l2-primitives-CqrezrJ4.js +482 -0
- package/dist/l2-primitives-CqrezrJ4.js.map +1 -0
- package/dist/l3-atoms/index.d.ts +0 -14
- package/dist/l3-atoms/index.d.ts.map +1 -1
- package/dist/l3-atoms/index.js +6 -0
- package/dist/l3-atoms/keyboard-shortcut.d.ts +1 -1
- package/dist/l3-atoms/keyboard-shortcut.d.ts.map +1 -1
- package/dist/l3-atoms/sparkle.d.ts +1 -1
- package/dist/l3-atoms/sparkle.d.ts.map +1 -1
- package/dist/l3-atoms-CsN9IA9J.js +1794 -0
- package/dist/l3-atoms-CsN9IA9J.js.map +1 -0
- package/dist/l4-molecules/dialog.d.ts.map +1 -1
- package/dist/l4-molecules/editable.d.ts.map +1 -0
- package/dist/l4-molecules/index.d.ts +12 -4
- package/dist/l4-molecules/index.d.ts.map +1 -1
- package/dist/l4-molecules/index.js +4 -0
- package/dist/l4-molecules/overflow-menu.d.ts.map +1 -0
- package/dist/l4-molecules/pin-input.d.ts.map +1 -0
- package/dist/l4-molecules/popover.d.ts.map +1 -0
- package/dist/l4-molecules/split-button.d.ts.map +1 -0
- package/dist/l4-molecules/tag-input.d.ts.map +1 -0
- package/dist/l4-molecules-DCc074MJ.js +4048 -0
- package/dist/l4-molecules-DCc074MJ.js.map +1 -0
- package/dist/l5-organisms/command-palette.d.ts.map +1 -1
- package/dist/l5-organisms/confetti.d.ts.map +1 -1
- package/dist/l5-organisms/cookie-banner.d.ts.map +1 -1
- package/dist/l5-organisms/image-preview.d.ts.map +1 -1
- package/dist/l5-organisms/index.d.ts +2 -0
- package/dist/l5-organisms/index.d.ts.map +1 -1
- package/dist/l5-organisms/index.js +2 -0
- package/dist/l5-organisms/notification-toast.d.ts.map +1 -1
- package/dist/{l4-molecules → l5-organisms}/sortable-table.d.ts.map +1 -1
- package/dist/l5-organisms-8KB_8a-H.js +3798 -0
- package/dist/l5-organisms-8KB_8a-H.js.map +1 -0
- package/dist/l6-charts/candlestick-chart.d.ts.map +1 -1
- package/dist/l6-charts/index.js +2 -0
- package/dist/l6-charts-DYnr5B9X.js +1743 -0
- package/dist/l6-charts-DYnr5B9X.js.map +1 -0
- package/dist/l7-patterns/index.js +2 -0
- package/dist/l7-patterns-DZXveS4Y.js +1826 -0
- package/dist/l7-patterns-DZXveS4Y.js.map +1 -0
- package/dist/loading-dots-fB4X_Zh0.js +24 -0
- package/dist/loading-dots-fB4X_Zh0.js.map +1 -0
- package/dist/motion-DUPegem-.js +22 -0
- package/dist/motion-DUPegem-.js.map +1 -0
- package/dist/portal-Bbl6F_Wj.js +9 -0
- package/dist/portal-Bbl6F_Wj.js.map +1 -0
- package/dist/progress-wAKN3Czz.js +44 -0
- package/dist/progress-wAKN3Czz.js.map +1 -0
- package/dist/resize-handle-CktEYqwi.js +77 -0
- package/dist/resize-handle-CktEYqwi.js.map +1 -0
- package/dist/scales-C80FTPsL.js +1299 -0
- package/dist/scales-C80FTPsL.js.map +1 -0
- package/dist/separator-Dqs23A9D.js +65 -0
- package/dist/separator-Dqs23A9D.js.map +1 -0
- package/dist/skeleton-C9FFZSYN.js +43 -0
- package/dist/skeleton-C9FFZSYN.js.map +1 -0
- package/dist/spinner-D8Ti-TFe.js +101 -0
- package/dist/spinner-D8Ti-TFe.js.map +1 -0
- package/dist/stepper-DhpGORX8.js +140 -0
- package/dist/stepper-DhpGORX8.js.map +1 -0
- package/dist/switch-DC85Os9r.js +130 -0
- package/dist/switch-DC85Os9r.js.map +1 -0
- package/dist/textarea-BJCl_aH2.js +40 -0
- package/dist/textarea-BJCl_aH2.js.map +1 -0
- package/dist/toast-DN5xANLM.js +442 -0
- package/dist/toast-DN5xANLM.js.map +1 -0
- package/dist/use-theme-C0aWVw70.js +203 -0
- package/dist/use-theme-C0aWVw70.js.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +7 -0
- package/dist/utils/portal.d.ts +3 -0
- package/dist/utils/portal.d.ts.map +1 -0
- package/package.json +37 -1
- package/dist/index.js.map +0 -1
- package/dist/l3-atoms/editable.d.ts.map +0 -1
- package/dist/l3-atoms/overflow-menu.d.ts.map +0 -1
- package/dist/l3-atoms/pin-input.d.ts.map +0 -1
- package/dist/l3-atoms/popover.d.ts.map +0 -1
- package/dist/l3-atoms/split-button.d.ts.map +0 -1
- package/dist/l3-atoms/tag-input.d.ts.map +0 -1
- package/dist/l3-atoms/time-since.d.ts +0 -9
- package/dist/l3-atoms/time-since.d.ts.map +0 -1
- package/dist/l4-molecules/otp-input.d.ts +0 -11
- package/dist/l4-molecules/otp-input.d.ts.map +0 -1
- /package/dist/{l3-atoms → l4-molecules}/editable.d.ts +0 -0
- /package/dist/{l3-atoms → l4-molecules}/overflow-menu.d.ts +0 -0
- /package/dist/{l3-atoms → l4-molecules}/pin-input.d.ts +0 -0
- /package/dist/{l3-atoms → l4-molecules}/popover.d.ts +0 -0
- /package/dist/{l3-atoms → l4-molecules}/split-button.d.ts +0 -0
- /package/dist/{l3-atoms → l4-molecules}/tag-input.d.ts +0 -0
- /package/dist/{l4-molecules → l5-organisms}/sortable-table.d.ts +0 -0
|
@@ -0,0 +1,1743 @@
|
|
|
1
|
+
import { r as e, t } from "./glass-CQTlX7IO.js";
|
|
2
|
+
import { forwardRef as n, useMemo as r, useState as i } from "react";
|
|
3
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
4
|
+
import { Area as s, AreaChart as c, Bar as l, BarChart as u, CartesianGrid as d, Cell as f, ComposedChart as p, Funnel as m, FunnelChart as h, Legend as g, Line as _, LineChart as v, Pie as y, PieChart as b, PolarAngleAxis as x, PolarGrid as ee, PolarRadiusAxis as te, Radar as ne, RadarChart as S, RadialBar as re, RadialBarChart as ie, ResponsiveContainer as C, Sankey as ae, Scatter as w, ScatterChart as T, Tooltip as E, Treemap as oe, XAxis as D, YAxis as O, ZAxis as se } from "recharts";
|
|
5
|
+
//#region src/l6-charts/area-chart.tsx
|
|
6
|
+
var k = "gds-area-gradient", ce = n(function({ data: t, dataKey: n, xKey: r = "name", className: i, height: l = 300, color: u = "var(--gds-accent)", glass: f, ...p }, m) {
|
|
7
|
+
return /* @__PURE__ */ a("div", {
|
|
8
|
+
className: e("w-full", f && "gds-radius-popover backdrop-blur-md bg-white/5", i),
|
|
9
|
+
"data-component": "area-chart",
|
|
10
|
+
ref: m,
|
|
11
|
+
...p,
|
|
12
|
+
children: /* @__PURE__ */ a(C, {
|
|
13
|
+
height: l,
|
|
14
|
+
width: "100%",
|
|
15
|
+
children: /* @__PURE__ */ o(c, {
|
|
16
|
+
data: t,
|
|
17
|
+
children: [
|
|
18
|
+
/* @__PURE__ */ a("defs", { children: /* @__PURE__ */ o("linearGradient", {
|
|
19
|
+
id: k,
|
|
20
|
+
x1: "0",
|
|
21
|
+
x2: "0",
|
|
22
|
+
y1: "0",
|
|
23
|
+
y2: "1",
|
|
24
|
+
children: [/* @__PURE__ */ a("stop", {
|
|
25
|
+
offset: "5%",
|
|
26
|
+
stopColor: u,
|
|
27
|
+
stopOpacity: .3
|
|
28
|
+
}), /* @__PURE__ */ a("stop", {
|
|
29
|
+
offset: "95%",
|
|
30
|
+
stopColor: u,
|
|
31
|
+
stopOpacity: 0
|
|
32
|
+
})]
|
|
33
|
+
}) }),
|
|
34
|
+
/* @__PURE__ */ a(d, {
|
|
35
|
+
stroke: "var(--gds-border, #e5e7eb)",
|
|
36
|
+
strokeDasharray: "3 3"
|
|
37
|
+
}),
|
|
38
|
+
/* @__PURE__ */ a(D, {
|
|
39
|
+
dataKey: r,
|
|
40
|
+
stroke: "var(--gds-fg-muted, #6b7280)",
|
|
41
|
+
tick: { fontSize: 11 }
|
|
42
|
+
}),
|
|
43
|
+
/* @__PURE__ */ a(O, {
|
|
44
|
+
stroke: "var(--gds-fg-muted, #6b7280)",
|
|
45
|
+
tick: { fontSize: 11 }
|
|
46
|
+
}),
|
|
47
|
+
/* @__PURE__ */ a(E, {}),
|
|
48
|
+
/* @__PURE__ */ a(s, {
|
|
49
|
+
dataKey: n,
|
|
50
|
+
fill: `url(#${k})`,
|
|
51
|
+
fillOpacity: 1,
|
|
52
|
+
stroke: u,
|
|
53
|
+
strokeWidth: 2,
|
|
54
|
+
type: "monotone"
|
|
55
|
+
})
|
|
56
|
+
]
|
|
57
|
+
})
|
|
58
|
+
})
|
|
59
|
+
});
|
|
60
|
+
}), le = n(function({ data: t, dataKey: n, xKey: r = "name", className: i, height: s = 300, color: c = "var(--gds-accent)", glass: f, ...p }, m) {
|
|
61
|
+
return /* @__PURE__ */ a("div", {
|
|
62
|
+
className: e("w-full", f && "gds-radius-popover backdrop-blur-md bg-white/5", i),
|
|
63
|
+
"data-component": "bar-chart",
|
|
64
|
+
ref: m,
|
|
65
|
+
...p,
|
|
66
|
+
children: /* @__PURE__ */ a(C, {
|
|
67
|
+
height: s,
|
|
68
|
+
width: "100%",
|
|
69
|
+
children: /* @__PURE__ */ o(u, {
|
|
70
|
+
data: t,
|
|
71
|
+
children: [
|
|
72
|
+
/* @__PURE__ */ a(d, {
|
|
73
|
+
stroke: "var(--gds-border, #e5e7eb)",
|
|
74
|
+
strokeDasharray: "3 3"
|
|
75
|
+
}),
|
|
76
|
+
/* @__PURE__ */ a(D, {
|
|
77
|
+
dataKey: r,
|
|
78
|
+
stroke: "var(--gds-fg-muted, #6b7280)",
|
|
79
|
+
tick: { fontSize: 11 }
|
|
80
|
+
}),
|
|
81
|
+
/* @__PURE__ */ a(O, {
|
|
82
|
+
stroke: "var(--gds-fg-muted, #6b7280)",
|
|
83
|
+
tick: { fontSize: 11 }
|
|
84
|
+
}),
|
|
85
|
+
/* @__PURE__ */ a(E, {}),
|
|
86
|
+
/* @__PURE__ */ a(l, {
|
|
87
|
+
dataKey: n,
|
|
88
|
+
fill: c,
|
|
89
|
+
radius: [
|
|
90
|
+
4,
|
|
91
|
+
4,
|
|
92
|
+
0,
|
|
93
|
+
0
|
|
94
|
+
]
|
|
95
|
+
})
|
|
96
|
+
]
|
|
97
|
+
})
|
|
98
|
+
})
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region src/l6-charts/box-plot-stats.ts
|
|
103
|
+
function A(e, t) {
|
|
104
|
+
let n = (e.length - 1) * t, r = Math.floor(n), i = Math.ceil(n);
|
|
105
|
+
return r === i ? e[r] : e[r] + (e[i] - e[r]) * (n - r);
|
|
106
|
+
}
|
|
107
|
+
function ue(e) {
|
|
108
|
+
let t = [...e].sort((e, t) => e - t), n = A(t, .25), r = A(t, .5), i = A(t, .75), a = i - n;
|
|
109
|
+
return {
|
|
110
|
+
q1: n,
|
|
111
|
+
median: r,
|
|
112
|
+
q3: i,
|
|
113
|
+
whiskerMin: Math.max(t[0], n - 1.5 * a),
|
|
114
|
+
whiskerMax: Math.min(t[t.length - 1], i + 1.5 * a)
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
//#endregion
|
|
118
|
+
//#region src/l6-charts/box-plot.tsx
|
|
119
|
+
var j = [
|
|
120
|
+
"var(--gds-palette-0, #6366f1)",
|
|
121
|
+
"var(--gds-palette-1, #8b5cf6)",
|
|
122
|
+
"var(--gds-palette-2, #06b6d4)",
|
|
123
|
+
"var(--gds-palette-3, #10b981)",
|
|
124
|
+
"var(--gds-palette-4, #f59e0b)"
|
|
125
|
+
], de = n(function({ data: t, width: n = 400, height: r = 300, glass: i, className: s }, c) {
|
|
126
|
+
let l = {
|
|
127
|
+
top: 20,
|
|
128
|
+
right: 20,
|
|
129
|
+
bottom: 40,
|
|
130
|
+
left: 50
|
|
131
|
+
}, u = n - l.left - l.right, d = r - l.top - l.bottom, f = t.flatMap((e) => e.values), p = f.length > 0 ? Math.min(...f) : 0, m = f.length > 0 ? Math.max(...f) : 1, h = m - p, g = p - h * .1, _ = m + h * .1, v = (e) => l.top + d * (1 - (e - g) / (_ - g)), y = t.length > 0 ? u / t.length : u, b = Math.min(y * .6, 60);
|
|
132
|
+
return /* @__PURE__ */ a("div", {
|
|
133
|
+
ref: c,
|
|
134
|
+
className: e("gds-radius-popover border border-border", i && "backdrop-blur-md bg-white/5", s),
|
|
135
|
+
"data-component": "box-plot",
|
|
136
|
+
children: /* @__PURE__ */ o("svg", {
|
|
137
|
+
width: n,
|
|
138
|
+
height: r,
|
|
139
|
+
viewBox: `0 0 ${n} ${r}`,
|
|
140
|
+
children: [
|
|
141
|
+
/* @__PURE__ */ a("line", {
|
|
142
|
+
x1: l.left,
|
|
143
|
+
y1: l.top,
|
|
144
|
+
x2: l.left,
|
|
145
|
+
y2: l.top + d,
|
|
146
|
+
stroke: "var(--gds-border, #374151)",
|
|
147
|
+
strokeWidth: 1
|
|
148
|
+
}),
|
|
149
|
+
/* @__PURE__ */ a("line", {
|
|
150
|
+
x1: l.left,
|
|
151
|
+
y1: l.top + d,
|
|
152
|
+
x2: l.left + u,
|
|
153
|
+
y2: l.top + d,
|
|
154
|
+
stroke: "var(--gds-border, #374151)",
|
|
155
|
+
strokeWidth: 1
|
|
156
|
+
}),
|
|
157
|
+
t.map((e, t) => {
|
|
158
|
+
if (e.values.length === 0) return null;
|
|
159
|
+
let n = ue(e.values), r = l.left + y * (t + .5), i = j[t % j.length];
|
|
160
|
+
return /* @__PURE__ */ o("g", {
|
|
161
|
+
"data-box": e.label,
|
|
162
|
+
children: [
|
|
163
|
+
/* @__PURE__ */ a("line", {
|
|
164
|
+
x1: r,
|
|
165
|
+
y1: v(n.whiskerMax),
|
|
166
|
+
x2: r,
|
|
167
|
+
y2: v(n.whiskerMin),
|
|
168
|
+
stroke: i,
|
|
169
|
+
strokeWidth: 1.5
|
|
170
|
+
}),
|
|
171
|
+
/* @__PURE__ */ a("line", {
|
|
172
|
+
x1: r - b * .3,
|
|
173
|
+
y1: v(n.whiskerMin),
|
|
174
|
+
x2: r + b * .3,
|
|
175
|
+
y2: v(n.whiskerMin),
|
|
176
|
+
stroke: i,
|
|
177
|
+
strokeWidth: 1.5
|
|
178
|
+
}),
|
|
179
|
+
/* @__PURE__ */ a("line", {
|
|
180
|
+
x1: r - b * .3,
|
|
181
|
+
y1: v(n.whiskerMax),
|
|
182
|
+
x2: r + b * .3,
|
|
183
|
+
y2: v(n.whiskerMax),
|
|
184
|
+
stroke: i,
|
|
185
|
+
strokeWidth: 1.5
|
|
186
|
+
}),
|
|
187
|
+
/* @__PURE__ */ a("rect", {
|
|
188
|
+
x: r - b / 2,
|
|
189
|
+
y: v(n.q3),
|
|
190
|
+
width: b,
|
|
191
|
+
height: v(n.q1) - v(n.q3),
|
|
192
|
+
fill: i,
|
|
193
|
+
fillOpacity: .2,
|
|
194
|
+
stroke: i,
|
|
195
|
+
strokeWidth: 1.5
|
|
196
|
+
}),
|
|
197
|
+
/* @__PURE__ */ a("line", {
|
|
198
|
+
x1: r - b / 2,
|
|
199
|
+
y1: v(n.median),
|
|
200
|
+
x2: r + b / 2,
|
|
201
|
+
y2: v(n.median),
|
|
202
|
+
stroke: i,
|
|
203
|
+
strokeWidth: 2
|
|
204
|
+
}),
|
|
205
|
+
/* @__PURE__ */ a("text", {
|
|
206
|
+
x: r,
|
|
207
|
+
y: l.top + d + 20,
|
|
208
|
+
textAnchor: "middle",
|
|
209
|
+
fill: "var(--gds-fg-muted, #9ca3af)",
|
|
210
|
+
fontSize: 10,
|
|
211
|
+
children: e.label
|
|
212
|
+
})
|
|
213
|
+
]
|
|
214
|
+
}, e.label);
|
|
215
|
+
})
|
|
216
|
+
]
|
|
217
|
+
})
|
|
218
|
+
});
|
|
219
|
+
}), fe = n(function({ data: t, xLabel: n, yLabel: r, height: i = 300, glass: s, className: c, ...l }, u) {
|
|
220
|
+
return /* @__PURE__ */ a("div", {
|
|
221
|
+
className: e("w-full gds-radius-popover border border-[var(--gds-border,#e5e7eb)]", s && "backdrop-blur-md bg-white/5", c),
|
|
222
|
+
"data-component": "bubble-chart",
|
|
223
|
+
ref: u,
|
|
224
|
+
...l,
|
|
225
|
+
children: /* @__PURE__ */ a(C, {
|
|
226
|
+
height: i,
|
|
227
|
+
width: "100%",
|
|
228
|
+
children: /* @__PURE__ */ o(T, { children: [
|
|
229
|
+
/* @__PURE__ */ a(D, {
|
|
230
|
+
dataKey: "x",
|
|
231
|
+
name: n,
|
|
232
|
+
stroke: "var(--gds-fg-muted, #6b7280)",
|
|
233
|
+
tick: { fontSize: 11 },
|
|
234
|
+
type: "number"
|
|
235
|
+
}),
|
|
236
|
+
/* @__PURE__ */ a(O, {
|
|
237
|
+
dataKey: "y",
|
|
238
|
+
name: r,
|
|
239
|
+
stroke: "var(--gds-fg-muted, #6b7280)",
|
|
240
|
+
tick: { fontSize: 11 },
|
|
241
|
+
type: "number"
|
|
242
|
+
}),
|
|
243
|
+
/* @__PURE__ */ a(se, {
|
|
244
|
+
dataKey: "z",
|
|
245
|
+
range: [20, 400],
|
|
246
|
+
type: "number"
|
|
247
|
+
}),
|
|
248
|
+
/* @__PURE__ */ a(E, {}),
|
|
249
|
+
/* @__PURE__ */ a(w, {
|
|
250
|
+
data: t,
|
|
251
|
+
fill: "var(--gds-accent)",
|
|
252
|
+
fillOpacity: .6
|
|
253
|
+
})
|
|
254
|
+
] })
|
|
255
|
+
})
|
|
256
|
+
});
|
|
257
|
+
}), M = [
|
|
258
|
+
"var(--gds-palette-0, #6366f1)",
|
|
259
|
+
"var(--gds-palette-1, #8b5cf6)",
|
|
260
|
+
"var(--gds-palette-2, #06b6d4)",
|
|
261
|
+
"var(--gds-palette-3, #10b981)",
|
|
262
|
+
"var(--gds-palette-4, #f59e0b)",
|
|
263
|
+
"var(--gds-palette-5, #ef4444)",
|
|
264
|
+
"var(--gds-palette-6, #ec4899)",
|
|
265
|
+
"var(--gds-palette-7, #14b8a6)",
|
|
266
|
+
"var(--gds-palette-8, #f97316)",
|
|
267
|
+
"var(--gds-palette-9, #a855f7)"
|
|
268
|
+
], pe = n(function({ data: t, series: n, xKey: r = "name", height: i = 300, glass: s, className: c, ...l }, u) {
|
|
269
|
+
return /* @__PURE__ */ a("div", {
|
|
270
|
+
ref: u,
|
|
271
|
+
className: e("w-full gds-radius-popover border border-border", s && "backdrop-blur-md bg-white/5", c),
|
|
272
|
+
"data-component": "bump-chart",
|
|
273
|
+
...l,
|
|
274
|
+
children: /* @__PURE__ */ a(C, {
|
|
275
|
+
height: i,
|
|
276
|
+
width: "100%",
|
|
277
|
+
children: /* @__PURE__ */ o(v, {
|
|
278
|
+
data: t,
|
|
279
|
+
children: [
|
|
280
|
+
/* @__PURE__ */ a(d, {
|
|
281
|
+
stroke: "var(--gds-border, #e5e7eb)",
|
|
282
|
+
strokeDasharray: "3 3"
|
|
283
|
+
}),
|
|
284
|
+
/* @__PURE__ */ a(D, {
|
|
285
|
+
dataKey: r,
|
|
286
|
+
stroke: "var(--gds-fg-muted, #6b7280)",
|
|
287
|
+
tick: { fontSize: 11 }
|
|
288
|
+
}),
|
|
289
|
+
/* @__PURE__ */ a(O, {
|
|
290
|
+
reversed: !0,
|
|
291
|
+
stroke: "var(--gds-fg-muted, #6b7280)",
|
|
292
|
+
tick: { fontSize: 11 }
|
|
293
|
+
}),
|
|
294
|
+
/* @__PURE__ */ a(E, {}),
|
|
295
|
+
n.map((e, t) => /* @__PURE__ */ a(_, {
|
|
296
|
+
dataKey: e,
|
|
297
|
+
dot: {
|
|
298
|
+
r: 4,
|
|
299
|
+
fill: M[t % M.length]
|
|
300
|
+
},
|
|
301
|
+
stroke: M[t % M.length],
|
|
302
|
+
strokeWidth: 2,
|
|
303
|
+
type: "monotone"
|
|
304
|
+
}, e))
|
|
305
|
+
]
|
|
306
|
+
})
|
|
307
|
+
})
|
|
308
|
+
});
|
|
309
|
+
}), me = [
|
|
310
|
+
"Mon",
|
|
311
|
+
"",
|
|
312
|
+
"Wed",
|
|
313
|
+
"",
|
|
314
|
+
"Fri",
|
|
315
|
+
"",
|
|
316
|
+
""
|
|
317
|
+
], he = [
|
|
318
|
+
"Jan",
|
|
319
|
+
"Feb",
|
|
320
|
+
"Mar",
|
|
321
|
+
"Apr",
|
|
322
|
+
"May",
|
|
323
|
+
"Jun",
|
|
324
|
+
"Jul",
|
|
325
|
+
"Aug",
|
|
326
|
+
"Sep",
|
|
327
|
+
"Oct",
|
|
328
|
+
"Nov",
|
|
329
|
+
"Dec"
|
|
330
|
+
];
|
|
331
|
+
function N(e) {
|
|
332
|
+
return (e.getDay() + 6) % 7;
|
|
333
|
+
}
|
|
334
|
+
function P(e) {
|
|
335
|
+
let t = e.map((e) => e.value).filter((e) => e > 0).sort((e, t) => e - t), n = [];
|
|
336
|
+
if (t.length > 0) for (let e = 1; e <= 4; e++) {
|
|
337
|
+
let r = Math.min(Math.floor(e / 4 * t.length), t.length - 1);
|
|
338
|
+
n.push(t[r]);
|
|
339
|
+
}
|
|
340
|
+
return n;
|
|
341
|
+
}
|
|
342
|
+
function F(e, t) {
|
|
343
|
+
if (e <= 0) return 0;
|
|
344
|
+
for (let n = 0; n < t.length; n++) if (e <= t[n]) return n + 1;
|
|
345
|
+
return 4;
|
|
346
|
+
}
|
|
347
|
+
function I(e, t, n, r) {
|
|
348
|
+
let i = n === void 0 ? /* @__PURE__ */ new Date() : new Date(n), a = t === void 0 ? new Date(i.getFullYear() - 1, i.getMonth(), i.getDate() + 1) : new Date(t), o = /* @__PURE__ */ new Map();
|
|
349
|
+
for (let t of e) o.set(t.date, t.value);
|
|
350
|
+
let s = P(e), c = [], l = [], u = 0, d = -1, f = new Date(a), p = N(f);
|
|
351
|
+
for (p > 0 && f.setDate(f.getDate() - p); f <= i;) {
|
|
352
|
+
let e = N(f), t = f.toISOString().slice(0, 10), n = o.get(t) ?? 0;
|
|
353
|
+
f.getMonth() !== d && e <= 3 && (l.push({
|
|
354
|
+
label: he[f.getMonth()],
|
|
355
|
+
x: u * r
|
|
356
|
+
}), d = f.getMonth()), c.push({
|
|
357
|
+
x: u * r,
|
|
358
|
+
y: e * r,
|
|
359
|
+
date: t,
|
|
360
|
+
value: n,
|
|
361
|
+
level: F(n, s)
|
|
362
|
+
}), e === 6 && u++, f.setDate(f.getDate() + 1);
|
|
363
|
+
}
|
|
364
|
+
return {
|
|
365
|
+
cells: c,
|
|
366
|
+
monthLabels: l,
|
|
367
|
+
weeks: u + 1
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
//#endregion
|
|
371
|
+
//#region src/l6-charts/calendar-heatmap.tsx
|
|
372
|
+
var L = n(function({ data: n, startDate: s, endDate: c, colorScale: l = [
|
|
373
|
+
"var(--gds-bg-tertiary)",
|
|
374
|
+
"var(--gds-accent-dim, rgba(99,179,163,0.3))",
|
|
375
|
+
"var(--gds-accent-muted, rgba(99,179,163,0.55))",
|
|
376
|
+
"var(--gds-accent-soft, rgba(99,179,163,0.75))",
|
|
377
|
+
"var(--gds-accent)"
|
|
378
|
+
], cellSize: u = 12, glass: d, className: f }, p) {
|
|
379
|
+
let [m, h] = i(null), g = u + 2, { cells: _, monthLabels: v, weeks: y } = r(() => I(n, s, c, g), [
|
|
380
|
+
n,
|
|
381
|
+
s,
|
|
382
|
+
c,
|
|
383
|
+
g
|
|
384
|
+
]), b = 28 + y * g, x = 14 + 7 * g;
|
|
385
|
+
return /* @__PURE__ */ o("div", {
|
|
386
|
+
className: e("relative inline-block", d === !0 && e(t(d), "rounded-lg border border-white/10 p-3"), f),
|
|
387
|
+
"data-component": "calendar-heatmap",
|
|
388
|
+
children: [/* @__PURE__ */ o("svg", {
|
|
389
|
+
ref: p,
|
|
390
|
+
height: x,
|
|
391
|
+
width: b,
|
|
392
|
+
children: [
|
|
393
|
+
v.map((e) => /* @__PURE__ */ a("text", {
|
|
394
|
+
fill: "var(--gds-fg-muted, #888)",
|
|
395
|
+
fontSize: 9,
|
|
396
|
+
x: 28 + e.x,
|
|
397
|
+
y: 10,
|
|
398
|
+
children: e.label
|
|
399
|
+
}, `${e.label}-${e.x}`)),
|
|
400
|
+
me.map((e, t) => e === "" ? null : /* @__PURE__ */ a("text", {
|
|
401
|
+
fill: "var(--gds-fg-muted, #888)",
|
|
402
|
+
fontSize: 9,
|
|
403
|
+
textAnchor: "end",
|
|
404
|
+
x: 24,
|
|
405
|
+
y: 14 + t * g + u - 2,
|
|
406
|
+
children: e
|
|
407
|
+
}, e)),
|
|
408
|
+
_.map((e) => /* @__PURE__ */ a("rect", {
|
|
409
|
+
fill: l[e.level] ?? l[l.length - 1],
|
|
410
|
+
height: u,
|
|
411
|
+
rx: 2,
|
|
412
|
+
ry: 2,
|
|
413
|
+
width: u,
|
|
414
|
+
x: 28 + e.x,
|
|
415
|
+
y: 14 + e.y,
|
|
416
|
+
onMouseEnter: (t) => {
|
|
417
|
+
let n = t.target.getBoundingClientRect();
|
|
418
|
+
h({
|
|
419
|
+
x: n.x,
|
|
420
|
+
y: n.y,
|
|
421
|
+
text: `${e.date}: ${e.value}`
|
|
422
|
+
});
|
|
423
|
+
},
|
|
424
|
+
onMouseLeave: () => h(null)
|
|
425
|
+
}, e.date))
|
|
426
|
+
]
|
|
427
|
+
}), m !== null && /* @__PURE__ */ a("div", {
|
|
428
|
+
className: "pointer-events-none fixed z-50 rounded bg-surface px-2 py-1 text-[10px] text-fg shadow-md border border-border",
|
|
429
|
+
style: {
|
|
430
|
+
left: m.x,
|
|
431
|
+
top: m.y - 28
|
|
432
|
+
},
|
|
433
|
+
children: m.text
|
|
434
|
+
})]
|
|
435
|
+
});
|
|
436
|
+
});
|
|
437
|
+
//#endregion
|
|
438
|
+
//#region src/l6-charts/candlestick-chart.tsx
|
|
439
|
+
function R(e) {
|
|
440
|
+
let { x: t = 0, y: n = 0, width: r = 0, height: i = 0, payload: s } = e;
|
|
441
|
+
if (s === void 0 || i === 0 && s.bodyHeight === 0) return null;
|
|
442
|
+
let c = t + r / 2, l = n, u = n + i;
|
|
443
|
+
return /* @__PURE__ */ o("g", { children: [/* @__PURE__ */ a("line", {
|
|
444
|
+
stroke: s.fill,
|
|
445
|
+
strokeWidth: 1,
|
|
446
|
+
x1: c,
|
|
447
|
+
x2: c,
|
|
448
|
+
y1: l - 2,
|
|
449
|
+
y2: u + 2
|
|
450
|
+
}), /* @__PURE__ */ a("rect", {
|
|
451
|
+
fill: s.fill,
|
|
452
|
+
height: Math.max(i, 1),
|
|
453
|
+
rx: 1,
|
|
454
|
+
width: Math.max(r - 2, 2),
|
|
455
|
+
x: t + 1,
|
|
456
|
+
y: n
|
|
457
|
+
})] });
|
|
458
|
+
}
|
|
459
|
+
var ge = n(function({ data: t, height: n = 300, upColor: i = "var(--gds-success, #22c55e)", downColor: s = "var(--gds-danger, #ef4444)", glass: c, className: u, ...f }, m) {
|
|
460
|
+
let h = r(() => t.map((e) => ({
|
|
461
|
+
date: e.date,
|
|
462
|
+
bodyBottom: Math.min(e.open, e.close),
|
|
463
|
+
bodyHeight: Math.abs(e.close - e.open),
|
|
464
|
+
fill: e.close >= e.open ? i : s,
|
|
465
|
+
high: e.high,
|
|
466
|
+
low: e.low
|
|
467
|
+
})), [
|
|
468
|
+
t,
|
|
469
|
+
i,
|
|
470
|
+
s
|
|
471
|
+
]), g = r(() => {
|
|
472
|
+
let e = t.map((e) => e.low), n = t.map((e) => e.high);
|
|
473
|
+
return [Math.min(...e), Math.max(...n)];
|
|
474
|
+
}, [t]);
|
|
475
|
+
return /* @__PURE__ */ a("div", {
|
|
476
|
+
className: e("w-full gds-radius-popover border border-[var(--gds-border,#e5e7eb)]", c && "backdrop-blur-md bg-white/5", u),
|
|
477
|
+
"data-component": "candlestick-chart",
|
|
478
|
+
ref: m,
|
|
479
|
+
...f,
|
|
480
|
+
children: /* @__PURE__ */ a(C, {
|
|
481
|
+
height: n,
|
|
482
|
+
width: "100%",
|
|
483
|
+
children: /* @__PURE__ */ o(p, {
|
|
484
|
+
data: h,
|
|
485
|
+
children: [
|
|
486
|
+
/* @__PURE__ */ a(d, {
|
|
487
|
+
stroke: "var(--gds-border, #e5e7eb)",
|
|
488
|
+
strokeDasharray: "3 3"
|
|
489
|
+
}),
|
|
490
|
+
/* @__PURE__ */ a(D, {
|
|
491
|
+
dataKey: "date",
|
|
492
|
+
stroke: "var(--gds-fg-muted, #6b7280)",
|
|
493
|
+
tick: { fontSize: 11 }
|
|
494
|
+
}),
|
|
495
|
+
/* @__PURE__ */ a(O, {
|
|
496
|
+
domain: g,
|
|
497
|
+
stroke: "var(--gds-fg-muted, #6b7280)",
|
|
498
|
+
tick: { fontSize: 11 }
|
|
499
|
+
}),
|
|
500
|
+
/* @__PURE__ */ a(E, {}),
|
|
501
|
+
/* @__PURE__ */ a(l, {
|
|
502
|
+
dataKey: "bodyHeight",
|
|
503
|
+
shape: /* @__PURE__ */ a(R, {}),
|
|
504
|
+
stackId: "candle"
|
|
505
|
+
})
|
|
506
|
+
]
|
|
507
|
+
})
|
|
508
|
+
})
|
|
509
|
+
});
|
|
510
|
+
}), z = [
|
|
511
|
+
"var(--gds-palette-0, #6366f1)",
|
|
512
|
+
"var(--gds-palette-1, #8b5cf6)",
|
|
513
|
+
"var(--gds-palette-2, #06b6d4)",
|
|
514
|
+
"var(--gds-palette-3, #10b981)",
|
|
515
|
+
"var(--gds-palette-4, #f59e0b)",
|
|
516
|
+
"var(--gds-palette-5, #ef4444)",
|
|
517
|
+
"var(--gds-palette-6, #ec4899)",
|
|
518
|
+
"var(--gds-palette-7, #14b8a6)",
|
|
519
|
+
"var(--gds-palette-8, #f97316)",
|
|
520
|
+
"var(--gds-palette-9, #a855f7)"
|
|
521
|
+
];
|
|
522
|
+
function B(e, t, n, r) {
|
|
523
|
+
return {
|
|
524
|
+
x: e + n * Math.cos(r),
|
|
525
|
+
y: t + n * Math.sin(r)
|
|
526
|
+
};
|
|
527
|
+
}
|
|
528
|
+
function _e(e, t, n, r, i) {
|
|
529
|
+
let a = B(e, t, n, i), o = B(e, t, n, r), s = i - r > Math.PI ? 1 : 0;
|
|
530
|
+
return `M ${a.x} ${a.y} A ${n} ${n} 0 ${s} 0 ${o.x} ${o.y}`;
|
|
531
|
+
}
|
|
532
|
+
function ve(e, t, n, r) {
|
|
533
|
+
let i = 2 * Math.PI - n * r, a = [], o = -Math.PI / 2;
|
|
534
|
+
for (let s = 0; s < n; s++) {
|
|
535
|
+
let n = e[s] / t * i;
|
|
536
|
+
a.push({
|
|
537
|
+
start: o,
|
|
538
|
+
end: o + n
|
|
539
|
+
}), o += n + r;
|
|
540
|
+
}
|
|
541
|
+
return a;
|
|
542
|
+
}
|
|
543
|
+
function ye(e, t, n, r, i) {
|
|
544
|
+
let a = 2 * Math.PI - r * i, o = [], s = t.map((e) => e.start);
|
|
545
|
+
for (let t = 0; t < r; t++) for (let i = t + 1; i < r; i++) {
|
|
546
|
+
if (e[t][i] + e[i][t] <= 0) continue;
|
|
547
|
+
let r = e[t][i] / n * a, c = e[i][t] / n * a;
|
|
548
|
+
o.push({
|
|
549
|
+
source: t,
|
|
550
|
+
target: i,
|
|
551
|
+
sourceStart: s[t],
|
|
552
|
+
sourceEnd: s[t] + r,
|
|
553
|
+
targetStart: s[i],
|
|
554
|
+
targetEnd: s[i] + c
|
|
555
|
+
}), s[t] += r, s[i] += c;
|
|
556
|
+
}
|
|
557
|
+
return o;
|
|
558
|
+
}
|
|
559
|
+
function be(e, t, n, r) {
|
|
560
|
+
let i = B(t, n, r, e.sourceStart), a = B(t, n, r, e.sourceEnd), o = B(t, n, r, e.targetStart), s = B(t, n, r, e.targetEnd);
|
|
561
|
+
return [
|
|
562
|
+
`M ${i.x} ${i.y}`,
|
|
563
|
+
`A ${r} ${r} 0 0 1 ${a.x} ${a.y}`,
|
|
564
|
+
`Q ${t} ${n} ${o.x} ${o.y}`,
|
|
565
|
+
`A ${r} ${r} 0 0 1 ${s.x} ${s.y}`,
|
|
566
|
+
`Q ${t} ${n} ${i.x} ${i.y}`,
|
|
567
|
+
"Z"
|
|
568
|
+
].join(" ");
|
|
569
|
+
}
|
|
570
|
+
//#endregion
|
|
571
|
+
//#region src/l6-charts/chord-diagram.tsx
|
|
572
|
+
var xe = n(function({ matrix: t, labels: n, width: r = 300, height: i = 300, glass: s, className: c }, l) {
|
|
573
|
+
let u = n.length, d = r / 2, f = i / 2, p = Math.min(r, i) / 2 - 30, m = p - 12, h = .04, g = t.map((e) => e.reduce((e, t) => e + t, 0)), _ = g.reduce((e, t) => e + t, 0);
|
|
574
|
+
if (_ === 0 || u === 0) return /* @__PURE__ */ a("div", {
|
|
575
|
+
ref: l,
|
|
576
|
+
className: e("gds-radius-popover border border-border", s && "backdrop-blur-md bg-white/5", c),
|
|
577
|
+
"data-component": "chord-diagram",
|
|
578
|
+
children: /* @__PURE__ */ a("svg", {
|
|
579
|
+
width: r,
|
|
580
|
+
height: i,
|
|
581
|
+
viewBox: `0 0 ${r} ${i}`
|
|
582
|
+
})
|
|
583
|
+
});
|
|
584
|
+
let v = ve(g, _, u, h), y = ye(t, v, _, u, h);
|
|
585
|
+
return /* @__PURE__ */ a("div", {
|
|
586
|
+
ref: l,
|
|
587
|
+
className: e("gds-radius-popover border border-border", s && "backdrop-blur-md bg-white/5", c),
|
|
588
|
+
"data-component": "chord-diagram",
|
|
589
|
+
children: /* @__PURE__ */ o("svg", {
|
|
590
|
+
width: r,
|
|
591
|
+
height: i,
|
|
592
|
+
viewBox: `0 0 ${r} ${i}`,
|
|
593
|
+
children: [
|
|
594
|
+
v.map((e, t) => /* @__PURE__ */ a("path", {
|
|
595
|
+
d: _e(d, f, p, e.start, e.end),
|
|
596
|
+
"data-arc": n[t],
|
|
597
|
+
fill: "none",
|
|
598
|
+
stroke: z[t % z.length],
|
|
599
|
+
strokeWidth: 12,
|
|
600
|
+
strokeLinecap: "round"
|
|
601
|
+
}, `arc-${n[t]}`)),
|
|
602
|
+
y.map((e, t) => /* @__PURE__ */ a("path", {
|
|
603
|
+
d: be(e, d, f, m),
|
|
604
|
+
fill: z[e.source % z.length],
|
|
605
|
+
fillOpacity: .25,
|
|
606
|
+
stroke: z[e.source % z.length],
|
|
607
|
+
strokeOpacity: .4,
|
|
608
|
+
strokeWidth: .5
|
|
609
|
+
}, `chord-${t}`)),
|
|
610
|
+
v.map((e, t) => {
|
|
611
|
+
let r = (e.start + e.end) / 2, i = B(d, f, p + 16, r), o = r > Math.PI / 2 && r < 3 * Math.PI / 2 ? "end" : "start";
|
|
612
|
+
return /* @__PURE__ */ a("text", {
|
|
613
|
+
x: i.x,
|
|
614
|
+
y: i.y,
|
|
615
|
+
textAnchor: o,
|
|
616
|
+
dominantBaseline: "middle",
|
|
617
|
+
fill: "var(--gds-fg-muted, #9ca3af)",
|
|
618
|
+
fontSize: 10,
|
|
619
|
+
children: n[t]
|
|
620
|
+
}, `label-${n[t]}`);
|
|
621
|
+
})
|
|
622
|
+
]
|
|
623
|
+
})
|
|
624
|
+
});
|
|
625
|
+
}), Se = n(function({ data: n, barKey: r, lineKey: i, xKey: s = "name", barColor: c = "var(--gds-accent)", lineColor: u = "var(--gds-success)", height: f = 300, glass: m, className: h, ...v }, y) {
|
|
626
|
+
return /* @__PURE__ */ a("div", {
|
|
627
|
+
className: e("w-full gds-radius-popover border border-white/[0.06]", t(m), h),
|
|
628
|
+
"data-component": "combo-chart",
|
|
629
|
+
ref: y,
|
|
630
|
+
...v,
|
|
631
|
+
children: /* @__PURE__ */ a(C, {
|
|
632
|
+
height: f,
|
|
633
|
+
width: "100%",
|
|
634
|
+
children: /* @__PURE__ */ o(p, {
|
|
635
|
+
data: n,
|
|
636
|
+
children: [
|
|
637
|
+
/* @__PURE__ */ a(d, {
|
|
638
|
+
stroke: "var(--gds-border, #e5e7eb)",
|
|
639
|
+
strokeDasharray: "3 3"
|
|
640
|
+
}),
|
|
641
|
+
/* @__PURE__ */ a(D, {
|
|
642
|
+
dataKey: s,
|
|
643
|
+
stroke: "var(--gds-fg-muted, #6b7280)",
|
|
644
|
+
tick: { fontSize: 11 }
|
|
645
|
+
}),
|
|
646
|
+
/* @__PURE__ */ a(O, {
|
|
647
|
+
stroke: "var(--gds-fg-muted, #6b7280)",
|
|
648
|
+
tick: { fontSize: 11 }
|
|
649
|
+
}),
|
|
650
|
+
/* @__PURE__ */ a(E, {}),
|
|
651
|
+
/* @__PURE__ */ a(g, {}),
|
|
652
|
+
/* @__PURE__ */ a(l, {
|
|
653
|
+
dataKey: r,
|
|
654
|
+
fill: c,
|
|
655
|
+
radius: [
|
|
656
|
+
4,
|
|
657
|
+
4,
|
|
658
|
+
0,
|
|
659
|
+
0
|
|
660
|
+
]
|
|
661
|
+
}),
|
|
662
|
+
/* @__PURE__ */ a(_, {
|
|
663
|
+
dataKey: i,
|
|
664
|
+
dot: !1,
|
|
665
|
+
stroke: u,
|
|
666
|
+
strokeWidth: 2,
|
|
667
|
+
type: "monotone"
|
|
668
|
+
})
|
|
669
|
+
]
|
|
670
|
+
})
|
|
671
|
+
})
|
|
672
|
+
});
|
|
673
|
+
}), Ce = {
|
|
674
|
+
start: "var(--gds-palette-3, #10b981)",
|
|
675
|
+
end: "var(--gds-palette-5, #ef4444)",
|
|
676
|
+
process: "var(--gds-palette-0, #6366f1)",
|
|
677
|
+
decision: "var(--gds-palette-4, #f59e0b)"
|
|
678
|
+
}, V = 100, H = 40;
|
|
679
|
+
function we(e, t, n) {
|
|
680
|
+
let r = Ce[e.type ?? "process"], i = e.type ?? "process";
|
|
681
|
+
if (i === "decision") {
|
|
682
|
+
let i = H * .7;
|
|
683
|
+
return /* @__PURE__ */ o("g", {
|
|
684
|
+
"data-node": e.id,
|
|
685
|
+
children: [/* @__PURE__ */ a("polygon", {
|
|
686
|
+
points: `${t},${n - i} ${t + i},${n} ${t},${n + i} ${t - i},${n}`,
|
|
687
|
+
fill: r,
|
|
688
|
+
fillOpacity: .15,
|
|
689
|
+
stroke: r,
|
|
690
|
+
strokeWidth: 1.5
|
|
691
|
+
}), /* @__PURE__ */ a("text", {
|
|
692
|
+
x: t,
|
|
693
|
+
y: n + 4,
|
|
694
|
+
textAnchor: "middle",
|
|
695
|
+
fill: "var(--gds-fg, #e5e7eb)",
|
|
696
|
+
fontSize: 10,
|
|
697
|
+
children: e.label
|
|
698
|
+
})]
|
|
699
|
+
}, e.id);
|
|
700
|
+
}
|
|
701
|
+
let s = i === "start" || i === "end" ? H / 2 : 4;
|
|
702
|
+
return /* @__PURE__ */ o("g", {
|
|
703
|
+
"data-node": e.id,
|
|
704
|
+
children: [/* @__PURE__ */ a("rect", {
|
|
705
|
+
x: t - V / 2,
|
|
706
|
+
y: n - H / 2,
|
|
707
|
+
width: V,
|
|
708
|
+
height: H,
|
|
709
|
+
rx: s,
|
|
710
|
+
fill: r,
|
|
711
|
+
fillOpacity: .15,
|
|
712
|
+
stroke: r,
|
|
713
|
+
strokeWidth: 1.5
|
|
714
|
+
}), /* @__PURE__ */ a("text", {
|
|
715
|
+
x: t,
|
|
716
|
+
y: n + 4,
|
|
717
|
+
textAnchor: "middle",
|
|
718
|
+
fill: "var(--gds-fg, #e5e7eb)",
|
|
719
|
+
fontSize: 10,
|
|
720
|
+
children: e.label
|
|
721
|
+
})]
|
|
722
|
+
}, e.id);
|
|
723
|
+
}
|
|
724
|
+
var Te = n(function({ nodes: t, edges: n, width: r = 600, height: i = 200, glass: s, className: c }, l) {
|
|
725
|
+
let u = t.length > 1 ? (r - 80) / (t.length - 1) : 0, d = t.length === 1 ? r / 2 : 40, f = i / 2, p = new Map(t.map((e, t) => [e.id, {
|
|
726
|
+
x: d + t * u,
|
|
727
|
+
y: f
|
|
728
|
+
}]));
|
|
729
|
+
return /* @__PURE__ */ a("div", {
|
|
730
|
+
ref: l,
|
|
731
|
+
className: e("gds-radius-popover border border-border", s && "backdrop-blur-md bg-white/5", c),
|
|
732
|
+
"data-component": "flow-chart",
|
|
733
|
+
children: /* @__PURE__ */ o("svg", {
|
|
734
|
+
width: r,
|
|
735
|
+
height: i,
|
|
736
|
+
viewBox: `0 0 ${r} ${i}`,
|
|
737
|
+
children: [
|
|
738
|
+
/* @__PURE__ */ a("defs", { children: /* @__PURE__ */ a("marker", {
|
|
739
|
+
id: "gds-arrow",
|
|
740
|
+
markerWidth: "8",
|
|
741
|
+
markerHeight: "6",
|
|
742
|
+
refX: "8",
|
|
743
|
+
refY: "3",
|
|
744
|
+
orient: "auto",
|
|
745
|
+
children: /* @__PURE__ */ a("path", {
|
|
746
|
+
d: "M0,0 L8,3 L0,6",
|
|
747
|
+
fill: "var(--gds-fg-muted, #6b7280)"
|
|
748
|
+
})
|
|
749
|
+
}) }),
|
|
750
|
+
n.map((e, t) => {
|
|
751
|
+
let n = p.get(e.from), r = p.get(e.to);
|
|
752
|
+
if (n === void 0 || r === void 0) return null;
|
|
753
|
+
let i = n.x + V / 2, s = r.x - V / 2, c = (i + s) / 2, l = (n.y + r.y) / 2;
|
|
754
|
+
return /* @__PURE__ */ o("g", { children: [/* @__PURE__ */ a("line", {
|
|
755
|
+
x1: i,
|
|
756
|
+
y1: n.y,
|
|
757
|
+
x2: s,
|
|
758
|
+
y2: r.y,
|
|
759
|
+
stroke: "var(--gds-fg-muted, #6b7280)",
|
|
760
|
+
strokeWidth: 1.5,
|
|
761
|
+
markerEnd: "url(#gds-arrow)"
|
|
762
|
+
}), e.label !== void 0 && /* @__PURE__ */ a("text", {
|
|
763
|
+
x: c,
|
|
764
|
+
y: l - 8,
|
|
765
|
+
textAnchor: "middle",
|
|
766
|
+
fill: "var(--gds-fg-muted, #9ca3af)",
|
|
767
|
+
fontSize: 9,
|
|
768
|
+
children: e.label
|
|
769
|
+
})] }, t);
|
|
770
|
+
}),
|
|
771
|
+
t.map((e, t) => {
|
|
772
|
+
let n = p.get(e.id);
|
|
773
|
+
return n === void 0 ? null : we(e, n.x, n.y);
|
|
774
|
+
})
|
|
775
|
+
]
|
|
776
|
+
})
|
|
777
|
+
});
|
|
778
|
+
}), Ee = [
|
|
779
|
+
"var(--gds-palette-0, #6366f1)",
|
|
780
|
+
"var(--gds-palette-1, #22d3ee)",
|
|
781
|
+
"var(--gds-palette-2, #f59e0b)",
|
|
782
|
+
"var(--gds-palette-3, #10b981)",
|
|
783
|
+
"var(--gds-palette-4, #ef4444)",
|
|
784
|
+
"var(--gds-palette-5, #8b5cf6)",
|
|
785
|
+
"var(--gds-palette-6, #ec4899)",
|
|
786
|
+
"var(--gds-palette-7, #14b8a6)",
|
|
787
|
+
"var(--gds-palette-8, #f97316)",
|
|
788
|
+
"var(--gds-palette-9, #3b82f6)"
|
|
789
|
+
], De = n(function({ data: t, dataKey: n, className: r, height: i = 300, colors: s = Ee, glass: c, ...l }, u) {
|
|
790
|
+
return /* @__PURE__ */ a("div", {
|
|
791
|
+
className: e("w-full", c && "gds-radius-popover backdrop-blur-md bg-white/5", r),
|
|
792
|
+
"data-component": "funnel-chart",
|
|
793
|
+
ref: u,
|
|
794
|
+
...l,
|
|
795
|
+
children: /* @__PURE__ */ a(C, {
|
|
796
|
+
height: i,
|
|
797
|
+
width: "100%",
|
|
798
|
+
children: /* @__PURE__ */ o(h, { children: [/* @__PURE__ */ a(E, {}), /* @__PURE__ */ a(m, {
|
|
799
|
+
dataKey: n,
|
|
800
|
+
data: t,
|
|
801
|
+
isAnimationActive: !1,
|
|
802
|
+
children: t.map((e, t) => /* @__PURE__ */ a(f, { fill: s[t % s.length] }, t))
|
|
803
|
+
})] })
|
|
804
|
+
})
|
|
805
|
+
});
|
|
806
|
+
}), Oe = n(function({ value: t, max: n = 100, className: r, height: i = 200, color: s = "var(--gds-accent)", trackColor: c = "var(--gds-border, #e5e7eb)", label: l, glass: u, ...d }, p) {
|
|
807
|
+
let m = Math.min(Math.max(t, 0), n), h = n - m, g = [{
|
|
808
|
+
name: "value",
|
|
809
|
+
value: m
|
|
810
|
+
}, {
|
|
811
|
+
name: "remaining",
|
|
812
|
+
value: h
|
|
813
|
+
}];
|
|
814
|
+
return /* @__PURE__ */ o("div", {
|
|
815
|
+
className: e("relative w-full", u && "gds-radius-popover backdrop-blur-md bg-white/5", r),
|
|
816
|
+
"data-component": "gauge",
|
|
817
|
+
ref: p,
|
|
818
|
+
...d,
|
|
819
|
+
children: [/* @__PURE__ */ a(C, {
|
|
820
|
+
height: i,
|
|
821
|
+
width: "100%",
|
|
822
|
+
children: /* @__PURE__ */ a(b, { children: /* @__PURE__ */ o(y, {
|
|
823
|
+
cx: "50%",
|
|
824
|
+
cy: "70%",
|
|
825
|
+
data: g,
|
|
826
|
+
dataKey: "value",
|
|
827
|
+
endAngle: 0,
|
|
828
|
+
innerRadius: "60%",
|
|
829
|
+
outerRadius: "80%",
|
|
830
|
+
startAngle: 180,
|
|
831
|
+
stroke: "none",
|
|
832
|
+
children: [/* @__PURE__ */ a(f, { fill: s }), /* @__PURE__ */ a(f, { fill: c })]
|
|
833
|
+
}) })
|
|
834
|
+
}), /* @__PURE__ */ o("div", {
|
|
835
|
+
className: "absolute inset-0 flex flex-col items-center justify-center",
|
|
836
|
+
style: { top: "20%" },
|
|
837
|
+
children: [/* @__PURE__ */ a("span", {
|
|
838
|
+
className: "text-2xl font-semibold",
|
|
839
|
+
style: { color: s },
|
|
840
|
+
children: m
|
|
841
|
+
}), l !== void 0 && /* @__PURE__ */ a("span", {
|
|
842
|
+
className: "gds-text-body text-[var(--gds-fg-muted,#6b7280)]",
|
|
843
|
+
children: l
|
|
844
|
+
})]
|
|
845
|
+
})]
|
|
846
|
+
});
|
|
847
|
+
});
|
|
848
|
+
//#endregion
|
|
849
|
+
//#region src/l6-charts/heatmap-chart.tsx
|
|
850
|
+
function ke(e, t, n) {
|
|
851
|
+
let r = (e) => {
|
|
852
|
+
let t = e.replace("#", "");
|
|
853
|
+
return [
|
|
854
|
+
parseInt(t.slice(0, 2), 16),
|
|
855
|
+
parseInt(t.slice(2, 4), 16),
|
|
856
|
+
parseInt(t.slice(4, 6), 16)
|
|
857
|
+
];
|
|
858
|
+
}, [i, a, o] = r(e), [s, c, l] = r(t);
|
|
859
|
+
return `rgb(${Math.round(i + (s - i) * n)},${Math.round(a + (c - a) * n)},${Math.round(o + (l - o) * n)})`;
|
|
860
|
+
}
|
|
861
|
+
var Ae = n(function({ data: t, xLabels: n, yLabels: i, colorScale: s = {
|
|
862
|
+
min: "#1e293b",
|
|
863
|
+
max: "#6366f1"
|
|
864
|
+
}, className: c, cellSize: l = 32, glass: u, ...d }, f) {
|
|
865
|
+
let { dataMin: p, dataMax: m } = r(() => {
|
|
866
|
+
let e = t.flat();
|
|
867
|
+
return {
|
|
868
|
+
dataMin: Math.min(...e),
|
|
869
|
+
dataMax: Math.max(...e)
|
|
870
|
+
};
|
|
871
|
+
}, [t]), h = (e) => m === p ? .5 : (e - p) / (m - p);
|
|
872
|
+
return /* @__PURE__ */ a("div", {
|
|
873
|
+
className: e("inline-block", u && "gds-radius-popover backdrop-blur-md bg-white/5", c),
|
|
874
|
+
"data-component": "heatmap-chart",
|
|
875
|
+
ref: f,
|
|
876
|
+
...d,
|
|
877
|
+
children: /* @__PURE__ */ o("div", {
|
|
878
|
+
className: "flex flex-col gap-px",
|
|
879
|
+
children: [n !== void 0 && /* @__PURE__ */ a("div", {
|
|
880
|
+
className: "flex gap-px",
|
|
881
|
+
style: { paddingLeft: i === void 0 ? 0 : l + 4 },
|
|
882
|
+
children: n.map((e) => /* @__PURE__ */ a("div", {
|
|
883
|
+
className: "flex items-center justify-center gds-text-caption text-[var(--gds-fg-muted,#6b7280)]",
|
|
884
|
+
style: {
|
|
885
|
+
width: l,
|
|
886
|
+
height: 16
|
|
887
|
+
},
|
|
888
|
+
children: e
|
|
889
|
+
}, e))
|
|
890
|
+
}), t.map((e, t) => /* @__PURE__ */ o("div", {
|
|
891
|
+
className: "flex items-center gap-px",
|
|
892
|
+
children: [i !== void 0 && i[t] !== void 0 && /* @__PURE__ */ a("div", {
|
|
893
|
+
className: "flex-shrink-0 text-right gds-text-caption text-[var(--gds-fg-muted,#6b7280)] pr-1",
|
|
894
|
+
style: { width: l },
|
|
895
|
+
children: i[t]
|
|
896
|
+
}), e.map((e, t) => /* @__PURE__ */ a("div", {
|
|
897
|
+
className: "rounded-sm",
|
|
898
|
+
style: {
|
|
899
|
+
width: l,
|
|
900
|
+
height: l,
|
|
901
|
+
backgroundColor: ke(s.min, s.max, h(e))
|
|
902
|
+
},
|
|
903
|
+
title: String(e)
|
|
904
|
+
}, t))]
|
|
905
|
+
}, t))]
|
|
906
|
+
})
|
|
907
|
+
});
|
|
908
|
+
});
|
|
909
|
+
//#endregion
|
|
910
|
+
//#region src/l6-charts/histogram.tsx
|
|
911
|
+
function je(e, t) {
|
|
912
|
+
if (e.length === 0) return [];
|
|
913
|
+
let n = Math.min(...e), r = Math.max(...e) - n, i = r === 0 ? 1 : r / t;
|
|
914
|
+
return Array.from({ length: t }, (r, a) => {
|
|
915
|
+
let o = n + a * i, s = o + i, c = e.filter((e) => a === t - 1 ? e >= o && e <= s : e >= o && e < s).length;
|
|
916
|
+
return {
|
|
917
|
+
range: `${o.toFixed(1)}–${s.toFixed(1)}`,
|
|
918
|
+
count: c
|
|
919
|
+
};
|
|
920
|
+
});
|
|
921
|
+
}
|
|
922
|
+
var Me = n(function({ data: t, bins: n = 10, height: r = 300, color: i = "var(--gds-accent)", glass: s, className: c, ...f }, p) {
|
|
923
|
+
let m = je(t, n);
|
|
924
|
+
return /* @__PURE__ */ a("div", {
|
|
925
|
+
className: e("w-full gds-radius-popover border border-border", s && "backdrop-blur-md bg-white/5", c),
|
|
926
|
+
"data-component": "histogram",
|
|
927
|
+
ref: p,
|
|
928
|
+
...f,
|
|
929
|
+
children: /* @__PURE__ */ a(C, {
|
|
930
|
+
height: r,
|
|
931
|
+
width: "100%",
|
|
932
|
+
children: /* @__PURE__ */ o(u, {
|
|
933
|
+
data: m,
|
|
934
|
+
children: [
|
|
935
|
+
/* @__PURE__ */ a(d, {
|
|
936
|
+
stroke: "var(--gds-border, #e5e7eb)",
|
|
937
|
+
strokeDasharray: "3 3"
|
|
938
|
+
}),
|
|
939
|
+
/* @__PURE__ */ a(D, {
|
|
940
|
+
dataKey: "range",
|
|
941
|
+
stroke: "var(--gds-fg-muted, #6b7280)",
|
|
942
|
+
tick: { fontSize: 10 }
|
|
943
|
+
}),
|
|
944
|
+
/* @__PURE__ */ a(O, {
|
|
945
|
+
stroke: "var(--gds-fg-muted, #6b7280)",
|
|
946
|
+
tick: { fontSize: 11 }
|
|
947
|
+
}),
|
|
948
|
+
/* @__PURE__ */ a(E, {}),
|
|
949
|
+
/* @__PURE__ */ a(l, {
|
|
950
|
+
dataKey: "count",
|
|
951
|
+
fill: i,
|
|
952
|
+
radius: [
|
|
953
|
+
4,
|
|
954
|
+
4,
|
|
955
|
+
0,
|
|
956
|
+
0
|
|
957
|
+
]
|
|
958
|
+
})
|
|
959
|
+
]
|
|
960
|
+
})
|
|
961
|
+
})
|
|
962
|
+
});
|
|
963
|
+
}), Ne = n(function({ data: t, dataKey: n, xKey: r = "name", className: i, height: s = 300, color: c = "var(--gds-accent)", glass: l, ...u }, f) {
|
|
964
|
+
return /* @__PURE__ */ a("div", {
|
|
965
|
+
className: e("w-full", l && "gds-radius-popover backdrop-blur-md bg-white/5", i),
|
|
966
|
+
"data-component": "line-chart",
|
|
967
|
+
ref: f,
|
|
968
|
+
...u,
|
|
969
|
+
children: /* @__PURE__ */ a(C, {
|
|
970
|
+
height: s,
|
|
971
|
+
width: "100%",
|
|
972
|
+
children: /* @__PURE__ */ o(v, {
|
|
973
|
+
data: t,
|
|
974
|
+
children: [
|
|
975
|
+
/* @__PURE__ */ a(d, {
|
|
976
|
+
stroke: "var(--gds-border, #e5e7eb)",
|
|
977
|
+
strokeDasharray: "3 3"
|
|
978
|
+
}),
|
|
979
|
+
/* @__PURE__ */ a(D, {
|
|
980
|
+
dataKey: r,
|
|
981
|
+
stroke: "var(--gds-fg-muted, #6b7280)",
|
|
982
|
+
tick: { fontSize: 11 }
|
|
983
|
+
}),
|
|
984
|
+
/* @__PURE__ */ a(O, {
|
|
985
|
+
stroke: "var(--gds-fg-muted, #6b7280)",
|
|
986
|
+
tick: { fontSize: 11 }
|
|
987
|
+
}),
|
|
988
|
+
/* @__PURE__ */ a(E, {}),
|
|
989
|
+
/* @__PURE__ */ a(_, {
|
|
990
|
+
dataKey: n,
|
|
991
|
+
dot: !1,
|
|
992
|
+
stroke: c,
|
|
993
|
+
strokeWidth: 2,
|
|
994
|
+
type: "monotone"
|
|
995
|
+
})
|
|
996
|
+
]
|
|
997
|
+
})
|
|
998
|
+
})
|
|
999
|
+
});
|
|
1000
|
+
}), U = [
|
|
1001
|
+
"var(--gds-palette-0, #6366f1)",
|
|
1002
|
+
"var(--gds-palette-1, #8b5cf6)",
|
|
1003
|
+
"var(--gds-palette-2, #06b6d4)",
|
|
1004
|
+
"var(--gds-palette-3, #10b981)",
|
|
1005
|
+
"var(--gds-palette-4, #f59e0b)",
|
|
1006
|
+
"var(--gds-palette-5, #ef4444)",
|
|
1007
|
+
"var(--gds-palette-6, #ec4899)",
|
|
1008
|
+
"var(--gds-palette-7, #14b8a6)",
|
|
1009
|
+
"var(--gds-palette-8, #f97316)",
|
|
1010
|
+
"var(--gds-palette-9, #84cc16)"
|
|
1011
|
+
];
|
|
1012
|
+
function Pe(e, t, n, r) {
|
|
1013
|
+
return Array.from({ length: e }, (i, a) => {
|
|
1014
|
+
let o = 2 * Math.PI * a / e - Math.PI / 2;
|
|
1015
|
+
return {
|
|
1016
|
+
x: t + r * Math.cos(o),
|
|
1017
|
+
y: n + r * Math.sin(o)
|
|
1018
|
+
};
|
|
1019
|
+
});
|
|
1020
|
+
}
|
|
1021
|
+
var Fe = n(function({ nodes: t, edges: n, width: r = 400, height: i = 300, glass: s, className: c }, l) {
|
|
1022
|
+
let u = r / 2, d = i / 2, f = Math.min(u, d) * .65, p = Pe(t.length, u, d, f), m = new Map(t.map((e, t) => [e.id, t])), h = Math.max(8, Math.min(16, 120 / Math.max(t.length, 1)));
|
|
1023
|
+
return /* @__PURE__ */ a("div", {
|
|
1024
|
+
ref: l,
|
|
1025
|
+
className: e("gds-radius-popover border border-border", s && "backdrop-blur-md bg-white/5", c),
|
|
1026
|
+
"data-component": "network-graph",
|
|
1027
|
+
children: /* @__PURE__ */ o("svg", {
|
|
1028
|
+
width: r,
|
|
1029
|
+
height: i,
|
|
1030
|
+
viewBox: `0 0 ${r} ${i}`,
|
|
1031
|
+
children: [n.map((e, t) => {
|
|
1032
|
+
let n = m.get(e.source), r = m.get(e.target);
|
|
1033
|
+
if (n === void 0 || r === void 0) return null;
|
|
1034
|
+
let i = p[n], o = p[r];
|
|
1035
|
+
return /* @__PURE__ */ a("line", {
|
|
1036
|
+
x1: i.x,
|
|
1037
|
+
y1: i.y,
|
|
1038
|
+
x2: o.x,
|
|
1039
|
+
y2: o.y,
|
|
1040
|
+
stroke: "var(--gds-border, #374151)",
|
|
1041
|
+
strokeWidth: 1.5,
|
|
1042
|
+
strokeOpacity: .5
|
|
1043
|
+
}, t);
|
|
1044
|
+
}), t.map((e, t) => {
|
|
1045
|
+
let n = p[t], r = U[(e.group ?? t) % U.length];
|
|
1046
|
+
return /* @__PURE__ */ o("g", { children: [/* @__PURE__ */ a("circle", {
|
|
1047
|
+
cx: n.x,
|
|
1048
|
+
cy: n.y,
|
|
1049
|
+
r: h,
|
|
1050
|
+
fill: r,
|
|
1051
|
+
fillOpacity: .8
|
|
1052
|
+
}), /* @__PURE__ */ a("text", {
|
|
1053
|
+
x: n.x,
|
|
1054
|
+
y: n.y + h + 14,
|
|
1055
|
+
textAnchor: "middle",
|
|
1056
|
+
fill: "var(--gds-fg-muted, #9ca3af)",
|
|
1057
|
+
fontSize: 10,
|
|
1058
|
+
children: e.label
|
|
1059
|
+
})] }, e.id);
|
|
1060
|
+
})]
|
|
1061
|
+
})
|
|
1062
|
+
});
|
|
1063
|
+
}), Ie = n(function({ bids: t, asks: n, height: i = 300, bidColor: l = "var(--gds-success, #22c55e)", askColor: u = "var(--gds-danger, #ef4444)", glass: f, className: p, ...m }, h) {
|
|
1064
|
+
let g = r(() => {
|
|
1065
|
+
let e = t.map((e) => ({
|
|
1066
|
+
price: e.price,
|
|
1067
|
+
bidDepth: e.depth,
|
|
1068
|
+
askDepth: void 0
|
|
1069
|
+
})), r = n.map((e) => ({
|
|
1070
|
+
price: e.price,
|
|
1071
|
+
bidDepth: void 0,
|
|
1072
|
+
askDepth: e.depth
|
|
1073
|
+
}));
|
|
1074
|
+
return [...e, ...r].sort((e, t) => e.price - t.price);
|
|
1075
|
+
}, [t, n]);
|
|
1076
|
+
return /* @__PURE__ */ a("div", {
|
|
1077
|
+
ref: h,
|
|
1078
|
+
className: e("w-full gds-radius-popover border border-border", f && "backdrop-blur-md bg-white/5", p),
|
|
1079
|
+
"data-component": "order-book-chart",
|
|
1080
|
+
...m,
|
|
1081
|
+
children: /* @__PURE__ */ a(C, {
|
|
1082
|
+
height: i,
|
|
1083
|
+
width: "100%",
|
|
1084
|
+
children: /* @__PURE__ */ o(c, {
|
|
1085
|
+
data: g,
|
|
1086
|
+
children: [
|
|
1087
|
+
/* @__PURE__ */ a(d, {
|
|
1088
|
+
stroke: "var(--gds-border, #e5e7eb)",
|
|
1089
|
+
strokeDasharray: "3 3"
|
|
1090
|
+
}),
|
|
1091
|
+
/* @__PURE__ */ a(D, {
|
|
1092
|
+
dataKey: "price",
|
|
1093
|
+
stroke: "var(--gds-fg-muted, #6b7280)",
|
|
1094
|
+
tick: { fontSize: 11 },
|
|
1095
|
+
type: "number",
|
|
1096
|
+
domain: ["dataMin", "dataMax"]
|
|
1097
|
+
}),
|
|
1098
|
+
/* @__PURE__ */ a(O, {
|
|
1099
|
+
stroke: "var(--gds-fg-muted, #6b7280)",
|
|
1100
|
+
tick: { fontSize: 11 }
|
|
1101
|
+
}),
|
|
1102
|
+
/* @__PURE__ */ a(E, {}),
|
|
1103
|
+
/* @__PURE__ */ a(s, {
|
|
1104
|
+
dataKey: "bidDepth",
|
|
1105
|
+
fill: l,
|
|
1106
|
+
fillOpacity: .3,
|
|
1107
|
+
stroke: l,
|
|
1108
|
+
strokeWidth: 2,
|
|
1109
|
+
type: "stepAfter",
|
|
1110
|
+
connectNulls: !1
|
|
1111
|
+
}),
|
|
1112
|
+
/* @__PURE__ */ a(s, {
|
|
1113
|
+
dataKey: "askDepth",
|
|
1114
|
+
fill: u,
|
|
1115
|
+
fillOpacity: .3,
|
|
1116
|
+
stroke: u,
|
|
1117
|
+
strokeWidth: 2,
|
|
1118
|
+
type: "stepBefore",
|
|
1119
|
+
connectNulls: !1
|
|
1120
|
+
})
|
|
1121
|
+
]
|
|
1122
|
+
})
|
|
1123
|
+
})
|
|
1124
|
+
});
|
|
1125
|
+
}), Le = [
|
|
1126
|
+
"var(--gds-palette-0, #6366f1)",
|
|
1127
|
+
"var(--gds-palette-1, #22d3ee)",
|
|
1128
|
+
"var(--gds-palette-2, #f59e0b)",
|
|
1129
|
+
"var(--gds-palette-3, #10b981)",
|
|
1130
|
+
"var(--gds-palette-4, #ef4444)",
|
|
1131
|
+
"var(--gds-palette-5, #8b5cf6)",
|
|
1132
|
+
"var(--gds-palette-6, #ec4899)",
|
|
1133
|
+
"var(--gds-palette-7, #14b8a6)",
|
|
1134
|
+
"var(--gds-palette-8, #f97316)",
|
|
1135
|
+
"var(--gds-palette-9, #3b82f6)"
|
|
1136
|
+
], Re = n(function({ data: t, dataKey: n, nameKey: r = "name", className: i, height: s = 300, colors: c = Le, innerRadius: l = 0, glass: u, ...d }, p) {
|
|
1137
|
+
return /* @__PURE__ */ a("div", {
|
|
1138
|
+
className: e("w-full", u && "gds-radius-popover backdrop-blur-md bg-white/5", i),
|
|
1139
|
+
"data-component": "pie-chart",
|
|
1140
|
+
ref: p,
|
|
1141
|
+
...d,
|
|
1142
|
+
children: /* @__PURE__ */ a(C, {
|
|
1143
|
+
height: s,
|
|
1144
|
+
width: "100%",
|
|
1145
|
+
children: /* @__PURE__ */ o(b, { children: [/* @__PURE__ */ a(E, {}), /* @__PURE__ */ a(y, {
|
|
1146
|
+
cx: "50%",
|
|
1147
|
+
cy: "50%",
|
|
1148
|
+
data: t,
|
|
1149
|
+
dataKey: n,
|
|
1150
|
+
innerRadius: l,
|
|
1151
|
+
nameKey: r,
|
|
1152
|
+
children: t.map((e, t) => /* @__PURE__ */ a(f, { fill: c[t % c.length] }, t))
|
|
1153
|
+
})] })
|
|
1154
|
+
})
|
|
1155
|
+
});
|
|
1156
|
+
}), ze = n(function({ data: t, dataKey: n, angleKey: r = "name", className: i, height: s = 300, color: c = "var(--gds-accent)", glass: l, ...u }, d) {
|
|
1157
|
+
return /* @__PURE__ */ a("div", {
|
|
1158
|
+
className: e("w-full", l && "gds-radius-popover backdrop-blur-md bg-white/5", i),
|
|
1159
|
+
"data-component": "radar-chart",
|
|
1160
|
+
ref: d,
|
|
1161
|
+
...u,
|
|
1162
|
+
children: /* @__PURE__ */ a(C, {
|
|
1163
|
+
height: s,
|
|
1164
|
+
width: "100%",
|
|
1165
|
+
children: /* @__PURE__ */ o(S, {
|
|
1166
|
+
cx: "50%",
|
|
1167
|
+
cy: "50%",
|
|
1168
|
+
data: t,
|
|
1169
|
+
outerRadius: "80%",
|
|
1170
|
+
children: [
|
|
1171
|
+
/* @__PURE__ */ a(ee, { stroke: "var(--gds-border, #e5e7eb)" }),
|
|
1172
|
+
/* @__PURE__ */ a(x, {
|
|
1173
|
+
dataKey: r,
|
|
1174
|
+
stroke: "var(--gds-fg-muted, #6b7280)",
|
|
1175
|
+
tick: { fontSize: 11 }
|
|
1176
|
+
}),
|
|
1177
|
+
/* @__PURE__ */ a(te, {
|
|
1178
|
+
stroke: "var(--gds-fg-muted, #6b7280)",
|
|
1179
|
+
tick: { fontSize: 10 }
|
|
1180
|
+
}),
|
|
1181
|
+
/* @__PURE__ */ a(E, {}),
|
|
1182
|
+
/* @__PURE__ */ a(ne, {
|
|
1183
|
+
dataKey: n,
|
|
1184
|
+
fill: c,
|
|
1185
|
+
fillOpacity: .3,
|
|
1186
|
+
stroke: c,
|
|
1187
|
+
strokeWidth: 2
|
|
1188
|
+
})
|
|
1189
|
+
]
|
|
1190
|
+
})
|
|
1191
|
+
})
|
|
1192
|
+
});
|
|
1193
|
+
}), W = [
|
|
1194
|
+
"var(--gds-palette-0, #6366f1)",
|
|
1195
|
+
"var(--gds-palette-1, #22d3ee)",
|
|
1196
|
+
"var(--gds-palette-2, #f59e0b)",
|
|
1197
|
+
"var(--gds-palette-3, #10b981)",
|
|
1198
|
+
"var(--gds-palette-4, #ef4444)",
|
|
1199
|
+
"var(--gds-palette-5, #8b5cf6)",
|
|
1200
|
+
"var(--gds-palette-6, #ec4899)",
|
|
1201
|
+
"var(--gds-palette-7, #14b8a6)",
|
|
1202
|
+
"var(--gds-palette-8, #f97316)",
|
|
1203
|
+
"var(--gds-palette-9, #3b82f6)"
|
|
1204
|
+
], Be = n(function({ data: n, height: r = 300, innerRadius: i = "20%", glass: s, className: c, ...l }, u) {
|
|
1205
|
+
let d = n.map((e, t) => ({
|
|
1206
|
+
...e,
|
|
1207
|
+
fill: e.fill ?? W[t % W.length]
|
|
1208
|
+
}));
|
|
1209
|
+
return /* @__PURE__ */ a("div", {
|
|
1210
|
+
className: e("w-full gds-radius-popover border border-white/[0.06]", t(s), c),
|
|
1211
|
+
"data-component": "radial-bar-chart",
|
|
1212
|
+
ref: u,
|
|
1213
|
+
...l,
|
|
1214
|
+
children: /* @__PURE__ */ a(C, {
|
|
1215
|
+
height: r,
|
|
1216
|
+
width: "100%",
|
|
1217
|
+
children: /* @__PURE__ */ o(ie, {
|
|
1218
|
+
cx: "50%",
|
|
1219
|
+
cy: "50%",
|
|
1220
|
+
data: d,
|
|
1221
|
+
innerRadius: i,
|
|
1222
|
+
outerRadius: "90%",
|
|
1223
|
+
children: [
|
|
1224
|
+
/* @__PURE__ */ a(re, {
|
|
1225
|
+
dataKey: "value",
|
|
1226
|
+
background: { fill: "rgba(255,255,255,0.05)" }
|
|
1227
|
+
}),
|
|
1228
|
+
/* @__PURE__ */ a(E, {}),
|
|
1229
|
+
/* @__PURE__ */ a(g, { iconSize: 8 })
|
|
1230
|
+
]
|
|
1231
|
+
})
|
|
1232
|
+
})
|
|
1233
|
+
});
|
|
1234
|
+
}), Ve = n(function({ nodes: t, links: n, className: r, height: i = 300, nodePadding: o = 50, nodeWidth: s = 10, glass: c, ...l }, u) {
|
|
1235
|
+
let d = {
|
|
1236
|
+
nodes: t,
|
|
1237
|
+
links: n
|
|
1238
|
+
};
|
|
1239
|
+
return /* @__PURE__ */ a("div", {
|
|
1240
|
+
className: e("w-full", c && "gds-radius-popover backdrop-blur-md bg-white/5", r),
|
|
1241
|
+
"data-component": "sankey-chart",
|
|
1242
|
+
ref: u,
|
|
1243
|
+
...l,
|
|
1244
|
+
children: /* @__PURE__ */ a(C, {
|
|
1245
|
+
height: i,
|
|
1246
|
+
width: "100%",
|
|
1247
|
+
children: /* @__PURE__ */ a(ae, {
|
|
1248
|
+
data: d,
|
|
1249
|
+
nodePadding: o,
|
|
1250
|
+
nodeWidth: s,
|
|
1251
|
+
children: /* @__PURE__ */ a(E, {})
|
|
1252
|
+
})
|
|
1253
|
+
})
|
|
1254
|
+
});
|
|
1255
|
+
}), He = n(function({ data: t, xKey: n, yKey: r, className: i, height: s = 300, color: c = "var(--gds-accent)", glass: l, ...u }, f) {
|
|
1256
|
+
return /* @__PURE__ */ a("div", {
|
|
1257
|
+
className: e("w-full", l && "gds-radius-popover backdrop-blur-md bg-white/5", i),
|
|
1258
|
+
"data-component": "scatter-chart",
|
|
1259
|
+
ref: f,
|
|
1260
|
+
...u,
|
|
1261
|
+
children: /* @__PURE__ */ a(C, {
|
|
1262
|
+
height: s,
|
|
1263
|
+
width: "100%",
|
|
1264
|
+
children: /* @__PURE__ */ o(T, { children: [
|
|
1265
|
+
/* @__PURE__ */ a(d, {
|
|
1266
|
+
stroke: "var(--gds-border, #e5e7eb)",
|
|
1267
|
+
strokeDasharray: "3 3"
|
|
1268
|
+
}),
|
|
1269
|
+
/* @__PURE__ */ a(D, {
|
|
1270
|
+
dataKey: n,
|
|
1271
|
+
stroke: "var(--gds-fg-muted, #6b7280)",
|
|
1272
|
+
tick: { fontSize: 11 },
|
|
1273
|
+
type: "number"
|
|
1274
|
+
}),
|
|
1275
|
+
/* @__PURE__ */ a(O, {
|
|
1276
|
+
dataKey: r,
|
|
1277
|
+
stroke: "var(--gds-fg-muted, #6b7280)",
|
|
1278
|
+
tick: { fontSize: 11 },
|
|
1279
|
+
type: "number"
|
|
1280
|
+
}),
|
|
1281
|
+
/* @__PURE__ */ a(E, {}),
|
|
1282
|
+
/* @__PURE__ */ a(w, {
|
|
1283
|
+
data: t,
|
|
1284
|
+
fill: c
|
|
1285
|
+
})
|
|
1286
|
+
] })
|
|
1287
|
+
})
|
|
1288
|
+
});
|
|
1289
|
+
}), Ue = n(function({ data: t, dataKey: n, className: r, height: i = 32, width: o = 120, color: s = "var(--gds-accent)", glass: c, ...l }, u) {
|
|
1290
|
+
return /* @__PURE__ */ a("div", {
|
|
1291
|
+
className: e("inline-block", c && "rounded backdrop-blur-md bg-white/5", r),
|
|
1292
|
+
"data-component": "sparkline",
|
|
1293
|
+
ref: u,
|
|
1294
|
+
...l,
|
|
1295
|
+
children: /* @__PURE__ */ a(C, {
|
|
1296
|
+
height: i,
|
|
1297
|
+
width: o,
|
|
1298
|
+
children: /* @__PURE__ */ a(v, {
|
|
1299
|
+
data: t,
|
|
1300
|
+
children: /* @__PURE__ */ a(_, {
|
|
1301
|
+
dataKey: n,
|
|
1302
|
+
dot: !1,
|
|
1303
|
+
stroke: s,
|
|
1304
|
+
strokeWidth: 1.5,
|
|
1305
|
+
type: "monotone"
|
|
1306
|
+
})
|
|
1307
|
+
})
|
|
1308
|
+
})
|
|
1309
|
+
});
|
|
1310
|
+
}), G = [
|
|
1311
|
+
"var(--gds-palette-0, #6366f1)",
|
|
1312
|
+
"var(--gds-palette-1, #8b5cf6)",
|
|
1313
|
+
"var(--gds-palette-2, #06b6d4)",
|
|
1314
|
+
"var(--gds-palette-3, #10b981)",
|
|
1315
|
+
"var(--gds-palette-4, #f59e0b)",
|
|
1316
|
+
"var(--gds-palette-5, #ef4444)",
|
|
1317
|
+
"var(--gds-palette-6, #ec4899)",
|
|
1318
|
+
"var(--gds-palette-7, #14b8a6)",
|
|
1319
|
+
"var(--gds-palette-8, #f97316)",
|
|
1320
|
+
"var(--gds-palette-9, #a855f7)"
|
|
1321
|
+
], We = n(function({ data: t, keys: n, xKey: r = "name", height: i = 300, glass: l, className: u, ...d }, f) {
|
|
1322
|
+
return /* @__PURE__ */ a("div", {
|
|
1323
|
+
ref: f,
|
|
1324
|
+
className: e("w-full gds-radius-popover border border-border", l && "backdrop-blur-md bg-white/5", u),
|
|
1325
|
+
"data-component": "stream-chart",
|
|
1326
|
+
...d,
|
|
1327
|
+
children: /* @__PURE__ */ a(C, {
|
|
1328
|
+
height: i,
|
|
1329
|
+
width: "100%",
|
|
1330
|
+
children: /* @__PURE__ */ o(c, {
|
|
1331
|
+
data: t,
|
|
1332
|
+
children: [
|
|
1333
|
+
/* @__PURE__ */ a(D, {
|
|
1334
|
+
dataKey: r,
|
|
1335
|
+
stroke: "var(--gds-fg-muted, #6b7280)",
|
|
1336
|
+
tick: { fontSize: 11 }
|
|
1337
|
+
}),
|
|
1338
|
+
/* @__PURE__ */ a(E, {}),
|
|
1339
|
+
n.map((e, t) => /* @__PURE__ */ a(s, {
|
|
1340
|
+
dataKey: e,
|
|
1341
|
+
fill: G[t % G.length],
|
|
1342
|
+
fillOpacity: .6,
|
|
1343
|
+
stackId: "1",
|
|
1344
|
+
stroke: G[t % G.length],
|
|
1345
|
+
strokeWidth: 1.5,
|
|
1346
|
+
type: "monotone"
|
|
1347
|
+
}, e))
|
|
1348
|
+
]
|
|
1349
|
+
})
|
|
1350
|
+
})
|
|
1351
|
+
});
|
|
1352
|
+
});
|
|
1353
|
+
//#endregion
|
|
1354
|
+
//#region src/l6-charts/sunburst-math.ts
|
|
1355
|
+
function K(e) {
|
|
1356
|
+
return e.children !== void 0 && e.children.length > 0 ? e.children.reduce((e, t) => e + K(t), 0) : e.value ?? 0;
|
|
1357
|
+
}
|
|
1358
|
+
function Ge(e, t, n, r, i, a) {
|
|
1359
|
+
let o = Math.min(a - i, 2 * Math.PI - .001), s = o > Math.PI ? 1 : 0, c = e + r * Math.cos(i), l = t + r * Math.sin(i), u = e + r * Math.cos(i + o), d = t + r * Math.sin(i + o), f = e + n * Math.cos(i + o), p = t + n * Math.sin(i + o), m = e + n * Math.cos(i), h = t + n * Math.sin(i);
|
|
1360
|
+
return [
|
|
1361
|
+
`M ${c} ${l}`,
|
|
1362
|
+
`A ${r} ${r} 0 ${s} 1 ${u} ${d}`,
|
|
1363
|
+
`L ${f} ${p}`,
|
|
1364
|
+
`A ${n} ${n} 0 ${s} 0 ${m} ${h}`,
|
|
1365
|
+
"Z"
|
|
1366
|
+
].join(" ");
|
|
1367
|
+
}
|
|
1368
|
+
function q(e, t, n, r, i) {
|
|
1369
|
+
if (e.children === void 0 || e.children.length === 0) return [];
|
|
1370
|
+
let a = [], o = K(e);
|
|
1371
|
+
if (o === 0) return [];
|
|
1372
|
+
let s = n;
|
|
1373
|
+
for (let c = 0; c < e.children.length; c++) {
|
|
1374
|
+
let l = e.children[c], u = K(l) / o * (r - n), d = s + u;
|
|
1375
|
+
a.push({
|
|
1376
|
+
depth: t,
|
|
1377
|
+
index: i * 10 + c,
|
|
1378
|
+
startAngle: s,
|
|
1379
|
+
endAngle: d
|
|
1380
|
+
}), a.push(...q(l, t + 1, s, d, i * 10 + c)), s = d;
|
|
1381
|
+
}
|
|
1382
|
+
return a;
|
|
1383
|
+
}
|
|
1384
|
+
//#endregion
|
|
1385
|
+
//#region src/l6-charts/sunburst-chart.tsx
|
|
1386
|
+
var J = [
|
|
1387
|
+
"var(--gds-palette-0, #6366f1)",
|
|
1388
|
+
"var(--gds-palette-1, #22d3ee)",
|
|
1389
|
+
"var(--gds-palette-2, #f59e0b)",
|
|
1390
|
+
"var(--gds-palette-3, #10b981)",
|
|
1391
|
+
"var(--gds-palette-4, #ef4444)",
|
|
1392
|
+
"var(--gds-palette-5, #8b5cf6)",
|
|
1393
|
+
"var(--gds-palette-6, #ec4899)",
|
|
1394
|
+
"var(--gds-palette-7, #14b8a6)",
|
|
1395
|
+
"var(--gds-palette-8, #f97316)",
|
|
1396
|
+
"var(--gds-palette-9, #3b82f6)"
|
|
1397
|
+
], Ke = n(function({ data: n, width: r = 300, height: i = 300, glass: s, className: c, ...l }, u) {
|
|
1398
|
+
let d = r / 2, f = i / 2, p = Math.min(d, f) - 10, m = q(n, 0, -Math.PI / 2, 1.5 * Math.PI, 0), h = m.reduce((e, t) => Math.max(e, t.depth), 0), g = p * .25, _ = (p - g) / (h + 1);
|
|
1399
|
+
return /* @__PURE__ */ a("div", {
|
|
1400
|
+
className: e("inline-flex gds-radius-popover border border-white/[0.06]", t(s), c),
|
|
1401
|
+
"data-component": "sunburst-chart",
|
|
1402
|
+
ref: u,
|
|
1403
|
+
...l,
|
|
1404
|
+
children: /* @__PURE__ */ o("svg", {
|
|
1405
|
+
height: i,
|
|
1406
|
+
width: r,
|
|
1407
|
+
viewBox: `0 0 ${r} ${i}`,
|
|
1408
|
+
children: [m.map((e, t) => {
|
|
1409
|
+
let n = g + e.depth * _, r = n + _ - 1, i = J[(e.index + e.depth) % J.length];
|
|
1410
|
+
return /* @__PURE__ */ a("path", {
|
|
1411
|
+
d: Ge(d, f, n, r, e.startAngle, e.endAngle),
|
|
1412
|
+
fill: i,
|
|
1413
|
+
opacity: 1 - e.depth * .15,
|
|
1414
|
+
stroke: "var(--gds-bg, #000)",
|
|
1415
|
+
strokeWidth: 1,
|
|
1416
|
+
"data-arc": !0
|
|
1417
|
+
}, t);
|
|
1418
|
+
}), /* @__PURE__ */ a("text", {
|
|
1419
|
+
x: d,
|
|
1420
|
+
y: f,
|
|
1421
|
+
textAnchor: "middle",
|
|
1422
|
+
dominantBaseline: "central",
|
|
1423
|
+
fill: "var(--gds-fg, #fff)",
|
|
1424
|
+
fontSize: 12,
|
|
1425
|
+
fontWeight: 600,
|
|
1426
|
+
"data-center-label": !0,
|
|
1427
|
+
children: n.name
|
|
1428
|
+
})]
|
|
1429
|
+
})
|
|
1430
|
+
});
|
|
1431
|
+
}), Y = [
|
|
1432
|
+
"var(--gds-palette-0, #6366f1)",
|
|
1433
|
+
"var(--gds-palette-1, #22d3ee)",
|
|
1434
|
+
"var(--gds-palette-2, #f59e0b)",
|
|
1435
|
+
"var(--gds-palette-3, #10b981)",
|
|
1436
|
+
"var(--gds-palette-4, #ef4444)",
|
|
1437
|
+
"var(--gds-palette-5, #8b5cf6)"
|
|
1438
|
+
], qe = n(function({ events: n, width: r = 600, height: i = 120, glass: s, className: c, ...l }, u) {
|
|
1439
|
+
if (n.length === 0) return /* @__PURE__ */ a("div", {
|
|
1440
|
+
className: e("inline-flex gds-radius-popover border border-white/[0.06]", t(s), c),
|
|
1441
|
+
"data-component": "timeline-chart",
|
|
1442
|
+
ref: u,
|
|
1443
|
+
...l,
|
|
1444
|
+
children: /* @__PURE__ */ a("svg", {
|
|
1445
|
+
height: i,
|
|
1446
|
+
width: r
|
|
1447
|
+
})
|
|
1448
|
+
});
|
|
1449
|
+
let d = i / 2, f = n.map((e) => new Date(e.date).getTime()), p = Math.min(...f), m = Math.max(...f) - p;
|
|
1450
|
+
function h(e) {
|
|
1451
|
+
return m === 0 ? r / 2 : 40 + (e - p) / m * (r - 80);
|
|
1452
|
+
}
|
|
1453
|
+
return /* @__PURE__ */ a("div", {
|
|
1454
|
+
className: e("inline-flex gds-radius-popover border border-white/[0.06]", t(s), c),
|
|
1455
|
+
"data-component": "timeline-chart",
|
|
1456
|
+
ref: u,
|
|
1457
|
+
...l,
|
|
1458
|
+
children: /* @__PURE__ */ o("svg", {
|
|
1459
|
+
height: i,
|
|
1460
|
+
width: r,
|
|
1461
|
+
viewBox: `0 0 ${r} ${i}`,
|
|
1462
|
+
children: [/* @__PURE__ */ a("line", {
|
|
1463
|
+
x1: 40,
|
|
1464
|
+
y1: d,
|
|
1465
|
+
x2: r - 40,
|
|
1466
|
+
y2: d,
|
|
1467
|
+
stroke: "var(--gds-border, #e5e7eb)",
|
|
1468
|
+
strokeWidth: 2
|
|
1469
|
+
}), n.map((e, t) => {
|
|
1470
|
+
let n = f[t], r = h(n), i = t % 2 == 0, s = i ? d - 24 : d + 32, c = e.color ?? Y[t % Y.length], l = new Date(e.date).toLocaleDateString();
|
|
1471
|
+
return /* @__PURE__ */ o("g", {
|
|
1472
|
+
"data-event": !0,
|
|
1473
|
+
children: [
|
|
1474
|
+
/* @__PURE__ */ a("circle", {
|
|
1475
|
+
cx: r,
|
|
1476
|
+
cy: d,
|
|
1477
|
+
r: 5,
|
|
1478
|
+
fill: c
|
|
1479
|
+
}),
|
|
1480
|
+
/* @__PURE__ */ a("line", {
|
|
1481
|
+
x1: r,
|
|
1482
|
+
y1: d + (i ? -6 : 6),
|
|
1483
|
+
x2: r,
|
|
1484
|
+
y2: s + (i ? 10 : -10),
|
|
1485
|
+
stroke: "var(--gds-border, #e5e7eb)",
|
|
1486
|
+
strokeWidth: 1
|
|
1487
|
+
}),
|
|
1488
|
+
/* @__PURE__ */ a("text", {
|
|
1489
|
+
x: r,
|
|
1490
|
+
y: s,
|
|
1491
|
+
textAnchor: "middle",
|
|
1492
|
+
fill: "var(--gds-fg, #fff)",
|
|
1493
|
+
fontSize: 10,
|
|
1494
|
+
fontWeight: 500,
|
|
1495
|
+
"data-label": i ? "above" : "below",
|
|
1496
|
+
children: e.label
|
|
1497
|
+
}),
|
|
1498
|
+
/* @__PURE__ */ a("text", {
|
|
1499
|
+
x: r,
|
|
1500
|
+
y: s + (i ? -10 : 12),
|
|
1501
|
+
textAnchor: "middle",
|
|
1502
|
+
fill: "var(--gds-fg-muted, #6b7280)",
|
|
1503
|
+
fontSize: 8,
|
|
1504
|
+
children: l
|
|
1505
|
+
})
|
|
1506
|
+
]
|
|
1507
|
+
}, t);
|
|
1508
|
+
})]
|
|
1509
|
+
})
|
|
1510
|
+
});
|
|
1511
|
+
}), X = n(function({ data: t, dataKey: n = "value", className: r, height: i = 300, color: o = "var(--gds-accent)", glass: s, ...c }, l) {
|
|
1512
|
+
return /* @__PURE__ */ a("div", {
|
|
1513
|
+
className: e("w-full", s && "gds-radius-popover backdrop-blur-md bg-white/5", r),
|
|
1514
|
+
"data-component": "treemap-chart",
|
|
1515
|
+
ref: l,
|
|
1516
|
+
...c,
|
|
1517
|
+
children: /* @__PURE__ */ a(C, {
|
|
1518
|
+
height: i,
|
|
1519
|
+
width: "100%",
|
|
1520
|
+
children: /* @__PURE__ */ a(oe, {
|
|
1521
|
+
data: t,
|
|
1522
|
+
dataKey: n,
|
|
1523
|
+
fill: o,
|
|
1524
|
+
stroke: "var(--gds-bg, #fff)"
|
|
1525
|
+
})
|
|
1526
|
+
})
|
|
1527
|
+
});
|
|
1528
|
+
}), Z = [
|
|
1529
|
+
"var(--gds-palette-0, #6366f1)",
|
|
1530
|
+
"var(--gds-palette-1, #8b5cf6)",
|
|
1531
|
+
"var(--gds-palette-2, #06b6d4)",
|
|
1532
|
+
"var(--gds-palette-3, #10b981)",
|
|
1533
|
+
"var(--gds-palette-4, #f59e0b)"
|
|
1534
|
+
];
|
|
1535
|
+
function Je(e, t, n, r) {
|
|
1536
|
+
let i = r - n;
|
|
1537
|
+
if (i === 0) return Array(t).fill(1 / t);
|
|
1538
|
+
let a = Array(t).fill(0), o = i / t;
|
|
1539
|
+
for (let r of e) {
|
|
1540
|
+
let e = Math.min(Math.floor((r - n) / o), t - 1);
|
|
1541
|
+
a[e]++;
|
|
1542
|
+
}
|
|
1543
|
+
let s = Math.max(...a);
|
|
1544
|
+
return s === 0 ? a : a.map((e) => e / s);
|
|
1545
|
+
}
|
|
1546
|
+
function Ye(e) {
|
|
1547
|
+
let t = [...e].sort((e, t) => e - t), n = Math.floor(t.length / 2);
|
|
1548
|
+
return t.length % 2 == 0 ? (t[n - 1] + t[n]) / 2 : t[n];
|
|
1549
|
+
}
|
|
1550
|
+
var Xe = n(function({ data: t, width: n = 400, height: r = 300, glass: i, className: s }, c) {
|
|
1551
|
+
let l = {
|
|
1552
|
+
top: 20,
|
|
1553
|
+
right: 20,
|
|
1554
|
+
bottom: 40,
|
|
1555
|
+
left: 50
|
|
1556
|
+
}, u = n - l.left - l.right, d = r - l.top - l.bottom, f = t.flatMap((e) => e.values), p = f.length > 0 ? Math.min(...f) : 0, m = f.length > 0 ? Math.max(...f) : 1, h = m - p, g = p - h * .1, _ = m + h * .1, v = (e) => l.top + d * (1 - (e - g) / (_ - g)), y = t.length > 0 ? u / t.length : u, b = Math.min(y * .7, 80) / 2;
|
|
1557
|
+
return /* @__PURE__ */ a("div", {
|
|
1558
|
+
ref: c,
|
|
1559
|
+
className: e("gds-radius-popover border border-border", i && "backdrop-blur-md bg-white/5", s),
|
|
1560
|
+
"data-component": "violin-plot",
|
|
1561
|
+
children: /* @__PURE__ */ o("svg", {
|
|
1562
|
+
width: n,
|
|
1563
|
+
height: r,
|
|
1564
|
+
viewBox: `0 0 ${n} ${r}`,
|
|
1565
|
+
children: [
|
|
1566
|
+
/* @__PURE__ */ a("line", {
|
|
1567
|
+
x1: l.left,
|
|
1568
|
+
y1: l.top,
|
|
1569
|
+
x2: l.left,
|
|
1570
|
+
y2: l.top + d,
|
|
1571
|
+
stroke: "var(--gds-border, #374151)",
|
|
1572
|
+
strokeWidth: 1
|
|
1573
|
+
}),
|
|
1574
|
+
/* @__PURE__ */ a("line", {
|
|
1575
|
+
x1: l.left,
|
|
1576
|
+
y1: l.top + d,
|
|
1577
|
+
x2: l.left + u,
|
|
1578
|
+
y2: l.top + d,
|
|
1579
|
+
stroke: "var(--gds-border, #374151)",
|
|
1580
|
+
strokeWidth: 1
|
|
1581
|
+
}),
|
|
1582
|
+
t.map((e, t) => {
|
|
1583
|
+
if (e.values.length === 0) return null;
|
|
1584
|
+
let n = l.left + y * (t + .5), r = Z[t % Z.length], i = Je(e.values, 20, p, m), s = (_ - g) / 20, c = Ye(e.values), u = i.map((e, t) => {
|
|
1585
|
+
let r = v(g + s * (t + .5));
|
|
1586
|
+
return `${n + e * b},${r}`;
|
|
1587
|
+
}), f = [...i].reverse().map((e, t) => {
|
|
1588
|
+
let r = v(g + s * (19 - t + .5));
|
|
1589
|
+
return `${n - e * b},${r}`;
|
|
1590
|
+
}), h = `M ${u[0]} ${u.map((e) => `L ${e}`).join(" ")} ${f.map((e) => `L ${e}`).join(" ")} Z`;
|
|
1591
|
+
return /* @__PURE__ */ o("g", {
|
|
1592
|
+
"data-violin": e.label,
|
|
1593
|
+
children: [
|
|
1594
|
+
/* @__PURE__ */ a("path", {
|
|
1595
|
+
d: h,
|
|
1596
|
+
fill: r,
|
|
1597
|
+
fillOpacity: .25,
|
|
1598
|
+
stroke: r,
|
|
1599
|
+
strokeWidth: 1.5
|
|
1600
|
+
}),
|
|
1601
|
+
/* @__PURE__ */ a("circle", {
|
|
1602
|
+
cx: n,
|
|
1603
|
+
cy: v(c),
|
|
1604
|
+
r: 3,
|
|
1605
|
+
fill: r
|
|
1606
|
+
}),
|
|
1607
|
+
/* @__PURE__ */ a("text", {
|
|
1608
|
+
x: n,
|
|
1609
|
+
y: l.top + d + 20,
|
|
1610
|
+
textAnchor: "middle",
|
|
1611
|
+
fill: "var(--gds-fg-muted, #9ca3af)",
|
|
1612
|
+
fontSize: 10,
|
|
1613
|
+
children: e.label
|
|
1614
|
+
})
|
|
1615
|
+
]
|
|
1616
|
+
}, e.label);
|
|
1617
|
+
})
|
|
1618
|
+
]
|
|
1619
|
+
})
|
|
1620
|
+
});
|
|
1621
|
+
}), Q = [
|
|
1622
|
+
"var(--gds-palette-0, #6366f1)",
|
|
1623
|
+
"var(--gds-palette-1, #22d3ee)",
|
|
1624
|
+
"var(--gds-palette-2, #f59e0b)",
|
|
1625
|
+
"var(--gds-palette-3, #10b981)",
|
|
1626
|
+
"var(--gds-palette-4, #ef4444)",
|
|
1627
|
+
"var(--gds-palette-5, #8b5cf6)",
|
|
1628
|
+
"var(--gds-palette-6, #ec4899)",
|
|
1629
|
+
"var(--gds-palette-7, #14b8a6)",
|
|
1630
|
+
"var(--gds-palette-8, #f97316)",
|
|
1631
|
+
"var(--gds-palette-9, #3b82f6)"
|
|
1632
|
+
], Ze = n(function({ data: n, size: r = 200, glass: i, className: s, ...c }, l) {
|
|
1633
|
+
let u = [], d = 0;
|
|
1634
|
+
for (let e = 0; e < n.length; e++) {
|
|
1635
|
+
let t = n[e], r = Math.round(t.value), i = t.color ?? Q[e % Q.length];
|
|
1636
|
+
for (let e = 0; e < r && d < 100; e++) u[d] = i, d++;
|
|
1637
|
+
}
|
|
1638
|
+
for (; d < 100;) u[d] = "transparent", d++;
|
|
1639
|
+
let f = r / 10, p = Math.max(1, f * .1);
|
|
1640
|
+
return /* @__PURE__ */ o("div", {
|
|
1641
|
+
className: e("inline-flex flex-col gds-radius-popover border border-white/[0.06]", t(i), s),
|
|
1642
|
+
"data-component": "waffle-chart",
|
|
1643
|
+
ref: l,
|
|
1644
|
+
...c,
|
|
1645
|
+
children: [/* @__PURE__ */ a("svg", {
|
|
1646
|
+
height: r,
|
|
1647
|
+
width: r,
|
|
1648
|
+
viewBox: `0 0 ${r} ${r}`,
|
|
1649
|
+
children: u.map((e, t) => {
|
|
1650
|
+
let n = Math.floor(t / 10);
|
|
1651
|
+
return /* @__PURE__ */ a("rect", {
|
|
1652
|
+
x: t % 10 * f + p,
|
|
1653
|
+
y: n * f + p,
|
|
1654
|
+
width: f - p * 2,
|
|
1655
|
+
height: f - p * 2,
|
|
1656
|
+
rx: 2,
|
|
1657
|
+
fill: e,
|
|
1658
|
+
"data-cell": t
|
|
1659
|
+
}, t);
|
|
1660
|
+
})
|
|
1661
|
+
}), /* @__PURE__ */ a("div", {
|
|
1662
|
+
className: "flex flex-wrap gap-3 px-2 pb-2 pt-1",
|
|
1663
|
+
children: n.map((e, t) => /* @__PURE__ */ o("div", {
|
|
1664
|
+
className: "flex items-center gap-1.5 text-[10px] text-fg-muted",
|
|
1665
|
+
children: [
|
|
1666
|
+
/* @__PURE__ */ a("span", {
|
|
1667
|
+
className: "inline-block h-2 w-2 rounded-full",
|
|
1668
|
+
style: { backgroundColor: e.color ?? Q[t % Q.length] }
|
|
1669
|
+
}),
|
|
1670
|
+
/* @__PURE__ */ a("span", { children: e.label }),
|
|
1671
|
+
/* @__PURE__ */ o("span", {
|
|
1672
|
+
className: "text-fg-muted/50",
|
|
1673
|
+
children: [e.value, "%"]
|
|
1674
|
+
})
|
|
1675
|
+
]
|
|
1676
|
+
}, e.label))
|
|
1677
|
+
})]
|
|
1678
|
+
});
|
|
1679
|
+
}), Qe = n(function({ data: t, width: n = 400, height: i = 100, progress: o = 0, color: s = "var(--gds-accent, #6366f1)", playedColor: c, glass: l, className: u, ...d }, f) {
|
|
1680
|
+
let p = c ?? s, m = Math.floor(o * t.length), h = i / 2, g = r(() => {
|
|
1681
|
+
if (t.length === 0) return [];
|
|
1682
|
+
let e = n / t.length;
|
|
1683
|
+
return t.map((t, n) => {
|
|
1684
|
+
let r = Math.max(t * h, 1);
|
|
1685
|
+
return {
|
|
1686
|
+
x: n * e,
|
|
1687
|
+
y: h - r,
|
|
1688
|
+
w: Math.max(e - 1, 1),
|
|
1689
|
+
h: r * 2,
|
|
1690
|
+
played: n < m
|
|
1691
|
+
};
|
|
1692
|
+
});
|
|
1693
|
+
}, [
|
|
1694
|
+
t,
|
|
1695
|
+
n,
|
|
1696
|
+
h,
|
|
1697
|
+
m
|
|
1698
|
+
]);
|
|
1699
|
+
return /* @__PURE__ */ a("div", {
|
|
1700
|
+
ref: f,
|
|
1701
|
+
className: e("inline-block gds-radius-popover border border-border", l && "backdrop-blur-md bg-white/5", u),
|
|
1702
|
+
"data-component": "waveform-display",
|
|
1703
|
+
...d,
|
|
1704
|
+
children: /* @__PURE__ */ a("svg", {
|
|
1705
|
+
height: i,
|
|
1706
|
+
width: n,
|
|
1707
|
+
viewBox: `0 0 ${n} ${i}`,
|
|
1708
|
+
children: g.map((e, t) => /* @__PURE__ */ a("rect", {
|
|
1709
|
+
x: e.x,
|
|
1710
|
+
y: e.y,
|
|
1711
|
+
width: e.w,
|
|
1712
|
+
height: e.h,
|
|
1713
|
+
fill: e.played ? p : s,
|
|
1714
|
+
opacity: e.played ? 1 : .3,
|
|
1715
|
+
rx: 1
|
|
1716
|
+
}, t))
|
|
1717
|
+
})
|
|
1718
|
+
});
|
|
1719
|
+
}), $ = Array.from({ length: 10 }, (e, t) => `var(--gds-palette-${t})`), $e = n(function({ words: t, maxFontSize: n = 48, minFontSize: r = 12, glass: i, height: o = 300, className: s, ...c }, l) {
|
|
1720
|
+
let u = t.map((e) => e.weight), d = Math.min(...u), f = Math.max(...u) - d;
|
|
1721
|
+
return /* @__PURE__ */ a("div", {
|
|
1722
|
+
className: e("flex flex-wrap items-center justify-center gap-2 overflow-hidden gds-radius-popover border border-[var(--gds-border,#e5e7eb)]", i && "backdrop-blur-md bg-white/5", s),
|
|
1723
|
+
"data-component": "word-cloud",
|
|
1724
|
+
ref: l,
|
|
1725
|
+
style: { height: o },
|
|
1726
|
+
...c,
|
|
1727
|
+
children: t.map((e, t) => {
|
|
1728
|
+
let i = f === 0 ? .5 : (e.weight - d) / f;
|
|
1729
|
+
return /* @__PURE__ */ a("span", {
|
|
1730
|
+
className: "inline-block select-none px-1",
|
|
1731
|
+
style: {
|
|
1732
|
+
fontSize: Math.round(r + i * (n - r)),
|
|
1733
|
+
color: $[t % $.length]
|
|
1734
|
+
},
|
|
1735
|
+
children: e.text
|
|
1736
|
+
}, `${e.text}-${t}`);
|
|
1737
|
+
})
|
|
1738
|
+
});
|
|
1739
|
+
});
|
|
1740
|
+
//#endregion
|
|
1741
|
+
export { le as A, Se as C, pe as D, L as E, fe as O, Te as S, ge as T, Ne as _, X as a, Oe as b, We as c, Ve as d, Be as f, Fe as g, Ie as h, Xe as i, ce as j, de as k, Ue as l, Re as m, Qe as n, qe as o, ze as p, Ze as r, Ke as s, $e as t, He as u, Me as v, xe as w, De as x, Ae as y };
|
|
1742
|
+
|
|
1743
|
+
//# sourceMappingURL=l6-charts-DYnr5B9X.js.map
|