@sckyzo/cosmos-charts 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/LICENSE +21 -0
- package/README.md +38 -0
- package/dist/index.cjs +484 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +143 -0
- package/dist/index.d.ts +143 -0
- package/dist/index.js +463 -0
- package/dist/index.js.map +1 -0
- package/package.json +70 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,463 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
import 'apexcharts/line';
|
|
3
|
+
import ReactApexChart from 'react-apexcharts/core';
|
|
4
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
|
+
import 'apexcharts/features/annotations';
|
|
6
|
+
import 'apexcharts/radialBar';
|
|
7
|
+
import 'apexcharts/donut';
|
|
8
|
+
import 'apexcharts/features/legend';
|
|
9
|
+
import 'apexcharts/treemap';
|
|
10
|
+
import 'apexcharts/bar';
|
|
11
|
+
|
|
12
|
+
var COSMOS_BRAND = "#465fff";
|
|
13
|
+
var COSMOS_PALETTE = ["#465fff", "#10b981", "#f59e0b", "#ef4444", "#8b5cf6"];
|
|
14
|
+
var detectDark = () => {
|
|
15
|
+
if (typeof document === "undefined") return false;
|
|
16
|
+
return document.documentElement.classList.contains("dark");
|
|
17
|
+
};
|
|
18
|
+
var useDarkMode = () => {
|
|
19
|
+
const [dark, setDark] = useState(detectDark);
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (typeof document === "undefined") return;
|
|
22
|
+
const observer = new MutationObserver(() => setDark(detectDark()));
|
|
23
|
+
observer.observe(document.documentElement, {
|
|
24
|
+
attributes: true,
|
|
25
|
+
attributeFilter: ["class"]
|
|
26
|
+
});
|
|
27
|
+
return () => observer.disconnect();
|
|
28
|
+
}, []);
|
|
29
|
+
return dark;
|
|
30
|
+
};
|
|
31
|
+
var useChartTheme = () => {
|
|
32
|
+
const dark = useDarkMode();
|
|
33
|
+
const grid = {
|
|
34
|
+
borderColor: dark ? "#1f2937" : "#e5e7eb",
|
|
35
|
+
strokeDashArray: 4
|
|
36
|
+
};
|
|
37
|
+
const axisLabels = {
|
|
38
|
+
style: {
|
|
39
|
+
colors: dark ? "#9ca3af" : "#6b7280",
|
|
40
|
+
fontSize: "11px",
|
|
41
|
+
fontFamily: "inherit"
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
return { dark, grid, axisLabels, brand: COSMOS_BRAND, palette: COSMOS_PALETTE };
|
|
45
|
+
};
|
|
46
|
+
var LineAreaChart = ({
|
|
47
|
+
series,
|
|
48
|
+
categories,
|
|
49
|
+
height = 280,
|
|
50
|
+
width = "100%"
|
|
51
|
+
}) => {
|
|
52
|
+
const { grid, axisLabels, palette } = useChartTheme();
|
|
53
|
+
const options = {
|
|
54
|
+
chart: {
|
|
55
|
+
type: "area",
|
|
56
|
+
toolbar: { show: false },
|
|
57
|
+
zoom: { enabled: false },
|
|
58
|
+
fontFamily: "inherit"
|
|
59
|
+
},
|
|
60
|
+
colors: palette,
|
|
61
|
+
dataLabels: { enabled: false },
|
|
62
|
+
stroke: { curve: "smooth", width: 2 },
|
|
63
|
+
fill: { type: "gradient", gradient: { opacityFrom: 0.45, opacityTo: 0.05 } },
|
|
64
|
+
grid,
|
|
65
|
+
xaxis: {
|
|
66
|
+
categories,
|
|
67
|
+
labels: axisLabels,
|
|
68
|
+
axisBorder: { show: false },
|
|
69
|
+
axisTicks: { show: false }
|
|
70
|
+
},
|
|
71
|
+
yaxis: { labels: axisLabels },
|
|
72
|
+
legend: { show: false },
|
|
73
|
+
tooltip: { theme: "dark" }
|
|
74
|
+
};
|
|
75
|
+
return /* @__PURE__ */ jsx(ReactApexChart, { type: "area", options, series, height, width });
|
|
76
|
+
};
|
|
77
|
+
var defaultGenerator = /* @__PURE__ */ (() => {
|
|
78
|
+
let last = 50;
|
|
79
|
+
return () => {
|
|
80
|
+
last += (Math.random() - 0.5) * 8;
|
|
81
|
+
last = Math.max(20, Math.min(95, last));
|
|
82
|
+
return Math.round(last);
|
|
83
|
+
};
|
|
84
|
+
})();
|
|
85
|
+
var RealtimeChart = ({
|
|
86
|
+
generator = defaultGenerator,
|
|
87
|
+
intervalMs = 2e3,
|
|
88
|
+
windowSize = 30,
|
|
89
|
+
warnThreshold = 70,
|
|
90
|
+
critThreshold = 85,
|
|
91
|
+
height = 240,
|
|
92
|
+
width = "100%"
|
|
93
|
+
}) => {
|
|
94
|
+
const { grid, axisLabels, brand } = useChartTheme();
|
|
95
|
+
const [series, setSeries] = useState(() => Array.from({ length: windowSize }, () => generator()));
|
|
96
|
+
useEffect(() => {
|
|
97
|
+
const id = setInterval(() => {
|
|
98
|
+
setSeries((current) => [...current.slice(1), generator()]);
|
|
99
|
+
}, intervalMs);
|
|
100
|
+
return () => clearInterval(id);
|
|
101
|
+
}, [generator, intervalMs]);
|
|
102
|
+
const options = {
|
|
103
|
+
chart: {
|
|
104
|
+
type: "line",
|
|
105
|
+
animations: { enabled: true, dynamicAnimation: { enabled: true, speed: 800 } },
|
|
106
|
+
toolbar: { show: false },
|
|
107
|
+
zoom: { enabled: false },
|
|
108
|
+
fontFamily: "inherit"
|
|
109
|
+
},
|
|
110
|
+
colors: [brand],
|
|
111
|
+
stroke: { curve: "smooth", width: 2 },
|
|
112
|
+
dataLabels: { enabled: false },
|
|
113
|
+
grid,
|
|
114
|
+
xaxis: {
|
|
115
|
+
type: "numeric",
|
|
116
|
+
labels: { show: false },
|
|
117
|
+
axisBorder: { show: false },
|
|
118
|
+
axisTicks: { show: false }
|
|
119
|
+
},
|
|
120
|
+
yaxis: { min: 0, max: 100, labels: axisLabels },
|
|
121
|
+
annotations: {
|
|
122
|
+
yaxis: [
|
|
123
|
+
{
|
|
124
|
+
y: warnThreshold,
|
|
125
|
+
borderColor: "#f59e0b",
|
|
126
|
+
label: { text: "WARN", style: { color: "#fff", background: "#f59e0b" } }
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
y: critThreshold,
|
|
130
|
+
borderColor: "#ef4444",
|
|
131
|
+
label: { text: "CRIT", style: { color: "#fff", background: "#ef4444" } }
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
},
|
|
135
|
+
tooltip: { theme: "dark" }
|
|
136
|
+
};
|
|
137
|
+
return /* @__PURE__ */ jsx(
|
|
138
|
+
ReactApexChart,
|
|
139
|
+
{
|
|
140
|
+
type: "line",
|
|
141
|
+
options,
|
|
142
|
+
series: [{ name: "value", data: series }],
|
|
143
|
+
height,
|
|
144
|
+
width
|
|
145
|
+
}
|
|
146
|
+
);
|
|
147
|
+
};
|
|
148
|
+
var RadialBarChart = ({
|
|
149
|
+
series,
|
|
150
|
+
labels,
|
|
151
|
+
height = 320,
|
|
152
|
+
width = "100%"
|
|
153
|
+
}) => {
|
|
154
|
+
const { palette } = useChartTheme();
|
|
155
|
+
const options = {
|
|
156
|
+
chart: { type: "radialBar", fontFamily: "inherit" },
|
|
157
|
+
colors: palette,
|
|
158
|
+
labels,
|
|
159
|
+
plotOptions: {
|
|
160
|
+
radialBar: {
|
|
161
|
+
track: { background: "rgba(150,150,150,0.15)" },
|
|
162
|
+
dataLabels: {
|
|
163
|
+
name: { fontSize: "12px" },
|
|
164
|
+
value: { fontSize: "14px", formatter: (v) => `${v}%` },
|
|
165
|
+
total: {
|
|
166
|
+
show: true,
|
|
167
|
+
label: "Avg",
|
|
168
|
+
formatter: () => `${Math.round(series.reduce((a, b) => a + b, 0) / series.length)}%`
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
return /* @__PURE__ */ jsx(
|
|
175
|
+
ReactApexChart,
|
|
176
|
+
{
|
|
177
|
+
type: "radialBar",
|
|
178
|
+
options,
|
|
179
|
+
series,
|
|
180
|
+
height,
|
|
181
|
+
width
|
|
182
|
+
}
|
|
183
|
+
);
|
|
184
|
+
};
|
|
185
|
+
var GradientRadial = ({
|
|
186
|
+
value,
|
|
187
|
+
label = "Score",
|
|
188
|
+
height = 280,
|
|
189
|
+
width = "100%"
|
|
190
|
+
}) => {
|
|
191
|
+
const { brand } = useChartTheme();
|
|
192
|
+
const options = {
|
|
193
|
+
chart: { type: "radialBar", fontFamily: "inherit" },
|
|
194
|
+
colors: [brand],
|
|
195
|
+
fill: {
|
|
196
|
+
type: "gradient",
|
|
197
|
+
gradient: {
|
|
198
|
+
shade: "dark",
|
|
199
|
+
type: "horizontal",
|
|
200
|
+
shadeIntensity: 0.5,
|
|
201
|
+
gradientToColors: ["#10b981"],
|
|
202
|
+
inverseColors: false,
|
|
203
|
+
opacityFrom: 1,
|
|
204
|
+
opacityTo: 1,
|
|
205
|
+
stops: [0, 100]
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
plotOptions: {
|
|
209
|
+
radialBar: {
|
|
210
|
+
hollow: { size: "70%" },
|
|
211
|
+
dataLabels: {
|
|
212
|
+
name: { fontSize: "12px", offsetY: -10 },
|
|
213
|
+
value: { fontSize: "32px", fontWeight: 700, formatter: (v) => `${v}%` }
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
labels: [label]
|
|
218
|
+
};
|
|
219
|
+
return /* @__PURE__ */ jsx(
|
|
220
|
+
ReactApexChart,
|
|
221
|
+
{
|
|
222
|
+
type: "radialBar",
|
|
223
|
+
options,
|
|
224
|
+
series: [value],
|
|
225
|
+
height,
|
|
226
|
+
width
|
|
227
|
+
}
|
|
228
|
+
);
|
|
229
|
+
};
|
|
230
|
+
var SemiCircleGauge = ({
|
|
231
|
+
value,
|
|
232
|
+
label = "",
|
|
233
|
+
color,
|
|
234
|
+
height = 200,
|
|
235
|
+
width = "100%"
|
|
236
|
+
}) => {
|
|
237
|
+
const { brand } = useChartTheme();
|
|
238
|
+
const options = {
|
|
239
|
+
chart: { type: "radialBar", fontFamily: "inherit", sparkline: { enabled: true } },
|
|
240
|
+
colors: [color ?? brand],
|
|
241
|
+
plotOptions: {
|
|
242
|
+
radialBar: {
|
|
243
|
+
startAngle: -90,
|
|
244
|
+
endAngle: 90,
|
|
245
|
+
track: { background: "rgba(150,150,150,0.15)", strokeWidth: "100%" },
|
|
246
|
+
dataLabels: {
|
|
247
|
+
name: { offsetY: -10, fontSize: "12px" },
|
|
248
|
+
value: { offsetY: -45, fontSize: "24px", fontWeight: 700, formatter: (v) => `${v}%` }
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
labels: [label]
|
|
253
|
+
};
|
|
254
|
+
return /* @__PURE__ */ jsx(
|
|
255
|
+
ReactApexChart,
|
|
256
|
+
{
|
|
257
|
+
type: "radialBar",
|
|
258
|
+
options,
|
|
259
|
+
series: [value],
|
|
260
|
+
height,
|
|
261
|
+
width
|
|
262
|
+
}
|
|
263
|
+
);
|
|
264
|
+
};
|
|
265
|
+
var StrokedGauge = ({
|
|
266
|
+
value,
|
|
267
|
+
label = "",
|
|
268
|
+
height = 280,
|
|
269
|
+
width = "100%"
|
|
270
|
+
}) => {
|
|
271
|
+
const { brand } = useChartTheme();
|
|
272
|
+
const options = {
|
|
273
|
+
chart: { type: "radialBar", fontFamily: "inherit" },
|
|
274
|
+
colors: [brand],
|
|
275
|
+
stroke: { lineCap: "round", dashArray: 4 },
|
|
276
|
+
plotOptions: {
|
|
277
|
+
radialBar: {
|
|
278
|
+
hollow: { size: "70%" },
|
|
279
|
+
track: { background: "rgba(150,150,150,0.15)", strokeWidth: "100%" },
|
|
280
|
+
dataLabels: {
|
|
281
|
+
name: { fontSize: "12px", offsetY: -10 },
|
|
282
|
+
value: { fontSize: "32px", fontWeight: 700, formatter: (v) => `${v}%` }
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
labels: [label]
|
|
287
|
+
};
|
|
288
|
+
return /* @__PURE__ */ jsx(
|
|
289
|
+
ReactApexChart,
|
|
290
|
+
{
|
|
291
|
+
type: "radialBar",
|
|
292
|
+
options,
|
|
293
|
+
series: [value],
|
|
294
|
+
height,
|
|
295
|
+
width
|
|
296
|
+
}
|
|
297
|
+
);
|
|
298
|
+
};
|
|
299
|
+
var DonutChart = ({
|
|
300
|
+
series,
|
|
301
|
+
labels,
|
|
302
|
+
rightLegend = false,
|
|
303
|
+
height = 280,
|
|
304
|
+
width = "100%"
|
|
305
|
+
}) => {
|
|
306
|
+
const { palette } = useChartTheme();
|
|
307
|
+
const options = {
|
|
308
|
+
chart: { type: "donut", fontFamily: "inherit" },
|
|
309
|
+
colors: palette,
|
|
310
|
+
labels,
|
|
311
|
+
legend: { position: rightLegend ? "right" : "bottom" },
|
|
312
|
+
dataLabels: { enabled: false },
|
|
313
|
+
plotOptions: {
|
|
314
|
+
pie: {
|
|
315
|
+
donut: { size: "68%", labels: { show: true, total: { show: true, label: "Total" } } }
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
return /* @__PURE__ */ jsx(ReactApexChart, { type: "donut", options, series, height, width });
|
|
320
|
+
};
|
|
321
|
+
var DonutRightLegend = (props) => /* @__PURE__ */ jsx(DonutChart, { ...props, rightLegend: true });
|
|
322
|
+
var Sparkline = ({
|
|
323
|
+
data,
|
|
324
|
+
color,
|
|
325
|
+
variant = "area",
|
|
326
|
+
height = 60,
|
|
327
|
+
width = "100%"
|
|
328
|
+
}) => {
|
|
329
|
+
const { brand } = useChartTheme();
|
|
330
|
+
const options = {
|
|
331
|
+
chart: { sparkline: { enabled: true }, fontFamily: "inherit", type: variant },
|
|
332
|
+
colors: [color ?? brand],
|
|
333
|
+
stroke: { curve: "smooth", width: 2 },
|
|
334
|
+
fill: variant === "area" ? { type: "gradient", gradient: { opacityFrom: 0.45, opacityTo: 0.05 } } : void 0,
|
|
335
|
+
tooltip: { fixed: { enabled: false }, x: { show: false }, marker: { show: false } }
|
|
336
|
+
};
|
|
337
|
+
return /* @__PURE__ */ jsx(
|
|
338
|
+
ReactApexChart,
|
|
339
|
+
{
|
|
340
|
+
type: variant,
|
|
341
|
+
options,
|
|
342
|
+
series: [{ name: "value", data }],
|
|
343
|
+
height,
|
|
344
|
+
width
|
|
345
|
+
}
|
|
346
|
+
);
|
|
347
|
+
};
|
|
348
|
+
var SparklineGroup = ({
|
|
349
|
+
items,
|
|
350
|
+
className
|
|
351
|
+
}) => /* @__PURE__ */ jsx(
|
|
352
|
+
"div",
|
|
353
|
+
{
|
|
354
|
+
className,
|
|
355
|
+
style: {
|
|
356
|
+
display: "grid",
|
|
357
|
+
gap: "1rem",
|
|
358
|
+
gridTemplateColumns: "repeat(auto-fit, minmax(180px, 1fr))"
|
|
359
|
+
},
|
|
360
|
+
children: items.map((it) => /* @__PURE__ */ jsxs(
|
|
361
|
+
"div",
|
|
362
|
+
{
|
|
363
|
+
className: "rounded-2xl border border-gray-200 bg-white p-4 dark:border-gray-800 dark:bg-gray-900",
|
|
364
|
+
children: [
|
|
365
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs font-medium tracking-wider text-gray-500 uppercase dark:text-gray-400", children: it.label }),
|
|
366
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 text-2xl font-bold text-gray-900 dark:text-white", children: it.value }),
|
|
367
|
+
/* @__PURE__ */ jsx(Sparkline, { data: it.data, color: it.color, height: 50 })
|
|
368
|
+
]
|
|
369
|
+
},
|
|
370
|
+
it.label
|
|
371
|
+
))
|
|
372
|
+
}
|
|
373
|
+
);
|
|
374
|
+
var TreemapChart = ({ series, height = 320, width = "100%" }) => {
|
|
375
|
+
const { palette } = useChartTheme();
|
|
376
|
+
const options = {
|
|
377
|
+
chart: { type: "treemap", fontFamily: "inherit", toolbar: { show: false } },
|
|
378
|
+
colors: palette,
|
|
379
|
+
legend: { show: false },
|
|
380
|
+
dataLabels: { enabled: true, style: { fontSize: "12px" } },
|
|
381
|
+
plotOptions: { treemap: { distributed: true, enableShades: false } }
|
|
382
|
+
};
|
|
383
|
+
return /* @__PURE__ */ jsx(
|
|
384
|
+
ReactApexChart,
|
|
385
|
+
{
|
|
386
|
+
type: "treemap",
|
|
387
|
+
options,
|
|
388
|
+
series,
|
|
389
|
+
height,
|
|
390
|
+
width
|
|
391
|
+
}
|
|
392
|
+
);
|
|
393
|
+
};
|
|
394
|
+
var BarChart = ({
|
|
395
|
+
series,
|
|
396
|
+
categories,
|
|
397
|
+
orientation = "vertical",
|
|
398
|
+
stacked = false,
|
|
399
|
+
colors,
|
|
400
|
+
formatValue,
|
|
401
|
+
showLegend,
|
|
402
|
+
borderRadius = 4,
|
|
403
|
+
height = 320,
|
|
404
|
+
width = "100%"
|
|
405
|
+
}) => {
|
|
406
|
+
const { grid, axisLabels, palette } = useChartTheme();
|
|
407
|
+
const horizontal = orientation === "horizontal";
|
|
408
|
+
const legendVisible = showLegend ?? series.length > 1;
|
|
409
|
+
const valueFormatter = formatValue ?? ((v) => String(v));
|
|
410
|
+
const options = {
|
|
411
|
+
chart: {
|
|
412
|
+
type: "bar",
|
|
413
|
+
toolbar: { show: false },
|
|
414
|
+
zoom: { enabled: false },
|
|
415
|
+
stacked,
|
|
416
|
+
fontFamily: "inherit"
|
|
417
|
+
},
|
|
418
|
+
colors: colors ?? palette,
|
|
419
|
+
dataLabels: { enabled: false },
|
|
420
|
+
plotOptions: {
|
|
421
|
+
bar: {
|
|
422
|
+
horizontal,
|
|
423
|
+
borderRadius,
|
|
424
|
+
borderRadiusApplication: "end",
|
|
425
|
+
columnWidth: "55%"
|
|
426
|
+
}
|
|
427
|
+
},
|
|
428
|
+
grid,
|
|
429
|
+
xaxis: {
|
|
430
|
+
categories,
|
|
431
|
+
labels: {
|
|
432
|
+
...axisLabels,
|
|
433
|
+
formatter: horizontal ? (val) => valueFormatter(Number(val)) : void 0
|
|
434
|
+
},
|
|
435
|
+
axisBorder: { show: false },
|
|
436
|
+
axisTicks: { show: false }
|
|
437
|
+
},
|
|
438
|
+
yaxis: {
|
|
439
|
+
labels: {
|
|
440
|
+
...axisLabels,
|
|
441
|
+
formatter: horizontal ? void 0 : (val) => valueFormatter(Number(val))
|
|
442
|
+
}
|
|
443
|
+
},
|
|
444
|
+
legend: {
|
|
445
|
+
show: legendVisible,
|
|
446
|
+
position: "top",
|
|
447
|
+
horizontalAlign: "right",
|
|
448
|
+
labels: { colors: axisLabels.style.colors },
|
|
449
|
+
markers: { size: 5 }
|
|
450
|
+
},
|
|
451
|
+
tooltip: {
|
|
452
|
+
theme: "dark",
|
|
453
|
+
y: { formatter: (v) => valueFormatter(Number(v)) }
|
|
454
|
+
},
|
|
455
|
+
fill: { opacity: 1 },
|
|
456
|
+
stroke: { show: false }
|
|
457
|
+
};
|
|
458
|
+
return /* @__PURE__ */ jsx(ReactApexChart, { type: "bar", options, series, height, width });
|
|
459
|
+
};
|
|
460
|
+
|
|
461
|
+
export { BarChart, COSMOS_BRAND, COSMOS_PALETTE, DonutChart, DonutRightLegend, GradientRadial, LineAreaChart, RadialBarChart, RealtimeChart, SemiCircleGauge, Sparkline, SparklineGroup, StrokedGauge, TreemapChart, useChartTheme, useDarkMode };
|
|
462
|
+
//# sourceMappingURL=index.js.map
|
|
463
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/theme.ts","../src/LineAreaChart.tsx","../src/RealtimeChart.tsx","../src/RadialBarChart.tsx","../src/GradientRadial.tsx","../src/SemiCircleGauge.tsx","../src/StrokedGauge.tsx","../src/DonutChart.tsx","../src/Sparkline.tsx","../src/TreemapChart.tsx","../src/BarChart.tsx"],"names":["useState","useEffect","jsx","ReactApexChart"],"mappings":";;;;;;;;;;;AAGO,IAAM,YAAA,GAAe;AACrB,IAAM,iBAAiB,CAAC,SAAA,EAAW,SAAA,EAAW,SAAA,EAAW,WAAW,SAAS;AAEpF,IAAM,aAAa,MAAe;AAChC,EAAA,IAAI,OAAO,QAAA,KAAa,WAAA,EAAa,OAAO,KAAA;AAC5C,EAAA,OAAO,QAAA,CAAS,eAAA,CAAgB,SAAA,CAAU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AAiB,OAAA;AAAA,MACjB,MAAA,EAAQ,EAAE,MAAA,EAAQ,UAAA,CAAW,MAAM,MAAA,EAAO;AAAA,MAC1C,OAAA,EAAS,EAAE,IAAA,EAAM,CAAA;AAAE,KACrB;AAAA,IACA,OAAA,EAAS;AAAA,MACP,KAAA,EAAO,MAAA;AAAA,MACP,CAAA,EAAG,EAAE,SAAA,EAAW,CAAC,MAAM,cAAA,CAAe,MAAA,CAAO,CAAC,CAAC,CAAA;AAAE,KACnD;AAAA,IACA,IAAA,EAAM,EAAE,OAAA,EAAS,CAAA,EAAE;AAAA,IACnB,MAAA,EAAQ,EAAE,IAAA,EAAM,KAAA;AAAM,GACxB;AAEA,EAAA,uBACED,IAACC,cAAAA,EAAA,EAAe,MAAK,KAAA,EAAM,OAAA,EAAkB,MAAA,EAAgB,MAAA,EAAgB,KAAA,EAAc,CAAA;AAE/F","file":"index.js","sourcesContent":["import type { ApexOptions } from 'apexcharts';\nimport { useEffect, useState } from 'react';\n\nexport const COSMOS_BRAND = '#465fff';\nexport const COSMOS_PALETTE = ['#465fff', '#10b981', '#f59e0b', '#ef4444', '#8b5cf6'];\n\nconst detectDark = (): boolean => {\n if (typeof document === 'undefined') return false;\n return document.documentElement.classList.contains('dark');\n};\n\n/**\n * Subscribes to dark-mode toggles on `<html>` (the Cosmos convention).\n * Returns the current `isDark` value.\n */\nexport const useDarkMode = (): boolean => {\n const [dark, setDark] = useState(detectDark);\n\n useEffect(() => {\n if (typeof document === 'undefined') return;\n const observer = new MutationObserver(() => setDark(detectDark()));\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['class'],\n });\n return () => observer.disconnect();\n }, []);\n\n return dark;\n};\n\n/**\n * Returns ApexCharts grid + axis options matching the Cosmos design tokens\n * for the current color scheme.\n */\nexport const useChartTheme = () => {\n const dark = useDarkMode();\n const grid: ApexOptions['grid'] = {\n borderColor: dark ? '#1f2937' : '#e5e7eb',\n strokeDashArray: 4,\n };\n const axisLabels = {\n style: {\n colors: dark ? '#9ca3af' : '#6b7280',\n fontSize: '11px',\n fontFamily: 'inherit',\n },\n };\n return { dark, grid, axisLabels, brand: COSMOS_BRAND, palette: COSMOS_PALETTE };\n};\n","import type { ApexOptions } from 'apexcharts';\nimport 'apexcharts/line';\nimport ReactApexChart from 'react-apexcharts/core';\nimport { useChartTheme } from './theme';\nimport type { ChartSize } from './types';\n\nexport type LineAreaChartProps = ChartSize & {\n series: { name: string; data: number[] }[];\n categories: (string | number)[];\n};\n\nexport const LineAreaChart = ({\n series,\n categories,\n height = 280,\n width = '100%',\n}: LineAreaChartProps) => {\n const { grid, axisLabels, palette } = useChartTheme();\n const options: ApexOptions = {\n chart: {\n type: 'area',\n toolbar: { show: false },\n zoom: { enabled: false },\n fontFamily: 'inherit',\n },\n colors: palette,\n dataLabels: { enabled: false },\n stroke: { curve: 'smooth', width: 2 },\n fill: { type: 'gradient', gradient: { opacityFrom: 0.45, opacityTo: 0.05 } },\n grid,\n xaxis: {\n categories,\n labels: axisLabels,\n axisBorder: { show: false },\n axisTicks: { show: false },\n },\n yaxis: { labels: axisLabels },\n legend: { show: false },\n tooltip: { theme: 'dark' },\n };\n return (\n <ReactApexChart type=\"area\" options={options} series={series} height={height} width={width} />\n );\n};\n","import { useEffect, useState } from 'react';\nimport type { ApexOptions } from 'apexcharts';\nimport 'apexcharts/line';\nimport 'apexcharts/features/annotations';\nimport ReactApexChart from 'react-apexcharts/core';\nimport { useChartTheme } from './theme';\nimport type { ChartSize } from './types';\n\nexport type RealtimeChartProps = ChartSize & {\n /** Sample generator — defaults to a noisy walk between 30 and 80. */\n generator?: () => number;\n /** Interval in ms — defaults to 2000. */\n intervalMs?: number;\n windowSize?: number;\n warnThreshold?: number;\n critThreshold?: number;\n};\n\nconst defaultGenerator = (() => {\n let last = 50;\n return () => {\n last += (Math.random() - 0.5) * 8;\n last = Math.max(20, Math.min(95, last));\n return Math.round(last);\n };\n})();\n\nexport const RealtimeChart = ({\n generator = defaultGenerator,\n intervalMs = 2000,\n windowSize = 30,\n warnThreshold = 70,\n critThreshold = 85,\n height = 240,\n width = '100%',\n}: RealtimeChartProps) => {\n const { grid, axisLabels, brand } = useChartTheme();\n const [series, setSeries] = useState(() => Array.from({ length: windowSize }, () => generator()));\n\n useEffect(() => {\n const id = setInterval(() => {\n setSeries((current) => [...current.slice(1), generator()]);\n }, intervalMs);\n return () => clearInterval(id);\n }, [generator, intervalMs]);\n\n const options: ApexOptions = {\n chart: {\n type: 'line',\n animations: { enabled: true, dynamicAnimation: { enabled: true, speed: 800 } },\n toolbar: { show: false },\n zoom: { enabled: false },\n fontFamily: 'inherit',\n },\n colors: [brand],\n stroke: { curve: 'smooth', width: 2 },\n dataLabels: { enabled: false },\n grid,\n xaxis: {\n type: 'numeric',\n labels: { show: false },\n axisBorder: { show: false },\n axisTicks: { show: false },\n },\n yaxis: { min: 0, max: 100, labels: axisLabels },\n annotations: {\n yaxis: [\n {\n y: warnThreshold,\n borderColor: '#f59e0b',\n label: { text: 'WARN', style: { color: '#fff', background: '#f59e0b' } },\n },\n {\n y: critThreshold,\n borderColor: '#ef4444',\n label: { text: 'CRIT', style: { color: '#fff', background: '#ef4444' } },\n },\n ],\n },\n tooltip: { theme: 'dark' },\n };\n\n return (\n <ReactApexChart\n type=\"line\"\n options={options}\n series={[{ name: 'value', data: series }]}\n height={height}\n width={width}\n />\n );\n};\n","import type { ApexOptions } from 'apexcharts';\nimport 'apexcharts/radialBar';\nimport ReactApexChart from 'react-apexcharts/core';\nimport { useChartTheme } from './theme';\nimport type { ChartSize } from './types';\n\nexport type RadialBarChartProps = ChartSize & {\n series: number[];\n labels: string[];\n};\n\nexport const RadialBarChart = ({\n series,\n labels,\n height = 320,\n width = '100%',\n}: RadialBarChartProps) => {\n const { palette } = useChartTheme();\n const options: ApexOptions = {\n chart: { type: 'radialBar', fontFamily: 'inherit' },\n colors: palette,\n labels,\n plotOptions: {\n radialBar: {\n track: { background: 'rgba(150,150,150,0.15)' },\n dataLabels: {\n name: { fontSize: '12px' },\n value: { fontSize: '14px', formatter: (v) => `${v}%` },\n total: {\n show: true,\n label: 'Avg',\n formatter: () => `${Math.round(series.reduce((a, b) => a + b, 0) / series.length)}%`,\n },\n },\n },\n },\n };\n return (\n <ReactApexChart\n type=\"radialBar\"\n options={options}\n series={series}\n height={height}\n width={width}\n />\n );\n};\n","import type { ApexOptions } from 'apexcharts';\nimport 'apexcharts/radialBar';\nimport ReactApexChart from 'react-apexcharts/core';\nimport { useChartTheme } from './theme';\nimport type { ChartSize } from './types';\n\nexport type GradientRadialProps = ChartSize & {\n value: number;\n label?: string;\n};\n\nexport const GradientRadial = ({\n value,\n label = 'Score',\n height = 280,\n width = '100%',\n}: GradientRadialProps) => {\n const { brand } = useChartTheme();\n const options: ApexOptions = {\n chart: { type: 'radialBar', fontFamily: 'inherit' },\n colors: [brand],\n fill: {\n type: 'gradient',\n gradient: {\n shade: 'dark',\n type: 'horizontal',\n shadeIntensity: 0.5,\n gradientToColors: ['#10b981'],\n inverseColors: false,\n opacityFrom: 1,\n opacityTo: 1,\n stops: [0, 100],\n },\n },\n plotOptions: {\n radialBar: {\n hollow: { size: '70%' },\n dataLabels: {\n name: { fontSize: '12px', offsetY: -10 },\n value: { fontSize: '32px', fontWeight: 700, formatter: (v) => `${v}%` },\n },\n },\n },\n labels: [label],\n };\n return (\n <ReactApexChart\n type=\"radialBar\"\n options={options}\n series={[value]}\n height={height}\n width={width}\n />\n );\n};\n","import type { ApexOptions } from 'apexcharts';\nimport 'apexcharts/radialBar';\nimport ReactApexChart from 'react-apexcharts/core';\nimport { useChartTheme } from './theme';\nimport type { ChartSize } from './types';\n\nexport type SemiCircleGaugeProps = ChartSize & {\n value: number;\n label?: string;\n color?: string;\n};\n\nexport const SemiCircleGauge = ({\n value,\n label = '',\n color,\n height = 200,\n width = '100%',\n}: SemiCircleGaugeProps) => {\n const { brand } = useChartTheme();\n const options: ApexOptions = {\n chart: { type: 'radialBar', fontFamily: 'inherit', sparkline: { enabled: true } },\n colors: [color ?? brand],\n plotOptions: {\n radialBar: {\n startAngle: -90,\n endAngle: 90,\n track: { background: 'rgba(150,150,150,0.15)', strokeWidth: '100%' },\n dataLabels: {\n name: { offsetY: -10, fontSize: '12px' },\n value: { offsetY: -45, fontSize: '24px', fontWeight: 700, formatter: (v) => `${v}%` },\n },\n },\n },\n labels: [label],\n };\n return (\n <ReactApexChart\n type=\"radialBar\"\n options={options}\n series={[value]}\n height={height}\n width={width}\n />\n );\n};\n","import type { ApexOptions } from 'apexcharts';\nimport 'apexcharts/radialBar';\nimport ReactApexChart from 'react-apexcharts/core';\nimport { useChartTheme } from './theme';\nimport type { ChartSize } from './types';\n\nexport type StrokedGaugeProps = ChartSize & {\n value: number;\n label?: string;\n};\n\nexport const StrokedGauge = ({\n value,\n label = '',\n height = 280,\n width = '100%',\n}: StrokedGaugeProps) => {\n const { brand } = useChartTheme();\n const options: ApexOptions = {\n chart: { type: 'radialBar', fontFamily: 'inherit' },\n colors: [brand],\n stroke: { lineCap: 'round', dashArray: 4 },\n plotOptions: {\n radialBar: {\n hollow: { size: '70%' },\n track: { background: 'rgba(150,150,150,0.15)', strokeWidth: '100%' },\n dataLabels: {\n name: { fontSize: '12px', offsetY: -10 },\n value: { fontSize: '32px', fontWeight: 700, formatter: (v) => `${v}%` },\n },\n },\n },\n labels: [label],\n };\n return (\n <ReactApexChart\n type=\"radialBar\"\n options={options}\n series={[value]}\n height={height}\n width={width}\n />\n );\n};\n","import type { ApexOptions } from 'apexcharts';\nimport 'apexcharts/donut';\nimport 'apexcharts/features/legend';\nimport ReactApexChart from 'react-apexcharts/core';\nimport { useChartTheme } from './theme';\nimport type { ChartSize } from './types';\n\nexport type DonutChartProps = ChartSize & {\n series: number[];\n labels: string[];\n /** Whether to show the right-side legend (default: bottom). */\n rightLegend?: boolean;\n};\n\nexport const DonutChart = ({\n series,\n labels,\n rightLegend = false,\n height = 280,\n width = '100%',\n}: DonutChartProps) => {\n const { palette } = useChartTheme();\n const options: ApexOptions = {\n chart: { type: 'donut', fontFamily: 'inherit' },\n colors: palette,\n labels,\n legend: { position: rightLegend ? 'right' : 'bottom' },\n dataLabels: { enabled: false },\n plotOptions: {\n pie: {\n donut: { size: '68%', labels: { show: true, total: { show: true, label: 'Total' } } },\n },\n },\n };\n return (\n <ReactApexChart type=\"donut\" options={options} series={series} height={height} width={width} />\n );\n};\n\nexport const DonutRightLegend = (props: Omit<DonutChartProps, 'rightLegend'>) => (\n <DonutChart {...props} rightLegend />\n);\n","import type { ApexOptions } from 'apexcharts';\nimport 'apexcharts/line';\nimport ReactApexChart from 'react-apexcharts/core';\nimport { useChartTheme } from './theme';\nimport type { ChartSize } from './types';\n\nexport type SparklineProps = ChartSize & {\n data: number[];\n color?: string;\n variant?: 'line' | 'area';\n};\n\nexport const Sparkline = ({\n data,\n color,\n variant = 'area',\n height = 60,\n width = '100%',\n}: SparklineProps) => {\n const { brand } = useChartTheme();\n const options: ApexOptions = {\n chart: { sparkline: { enabled: true }, fontFamily: 'inherit', type: variant },\n colors: [color ?? brand],\n stroke: { curve: 'smooth', width: 2 },\n fill:\n variant === 'area'\n ? { type: 'gradient', gradient: { opacityFrom: 0.45, opacityTo: 0.05 } }\n : undefined,\n tooltip: { fixed: { enabled: false }, x: { show: false }, marker: { show: false } },\n };\n return (\n <ReactApexChart\n type={variant}\n options={options}\n series={[{ name: 'value', data }]}\n height={height}\n width={width}\n />\n );\n};\n\nexport type SparklineGroupItem = {\n label: string;\n value: number | string;\n data: number[];\n color?: string;\n};\n\nexport const SparklineGroup = ({\n items,\n className,\n}: {\n items: SparklineGroupItem[];\n className?: string;\n}) => (\n <div\n className={className}\n style={{\n display: 'grid',\n gap: '1rem',\n gridTemplateColumns: 'repeat(auto-fit, minmax(180px, 1fr))',\n }}\n >\n {items.map((it) => (\n <div\n key={it.label}\n className=\"rounded-2xl border border-gray-200 bg-white p-4 dark:border-gray-800 dark:bg-gray-900\"\n >\n <p className=\"text-xs font-medium tracking-wider text-gray-500 uppercase dark:text-gray-400\">\n {it.label}\n </p>\n <p className=\"mt-1 text-2xl font-bold text-gray-900 dark:text-white\">{it.value}</p>\n <Sparkline data={it.data} color={it.color} height={50} />\n </div>\n ))}\n </div>\n);\n","import type { ApexOptions } from 'apexcharts';\nimport 'apexcharts/treemap';\nimport ReactApexChart from 'react-apexcharts/core';\nimport { useChartTheme } from './theme';\nimport type { ChartSize } from './types';\n\nexport type TreemapDatum = { x: string; y: number };\n\nexport type TreemapChartProps = ChartSize & {\n series: { name?: string; data: TreemapDatum[] }[];\n};\n\nexport const TreemapChart = ({ series, height = 320, width = '100%' }: TreemapChartProps) => {\n const { palette } = useChartTheme();\n const options: ApexOptions = {\n chart: { type: 'treemap', fontFamily: 'inherit', toolbar: { show: false } },\n colors: palette,\n legend: { show: false },\n dataLabels: { enabled: true, style: { fontSize: '12px' } },\n plotOptions: { treemap: { distributed: true, enableShades: false } },\n };\n return (\n <ReactApexChart\n type=\"treemap\"\n options={options}\n series={series}\n height={height}\n width={width}\n />\n );\n};\n","import type { ApexOptions } from 'apexcharts';\nimport 'apexcharts/bar';\nimport 'apexcharts/features/legend';\nimport ReactApexChart from 'react-apexcharts/core';\nimport { useChartTheme } from './theme';\nimport type { ChartSize } from './types';\n\nexport type BarChartOrientation = 'vertical' | 'horizontal';\n\nexport type BarChartProps = ChartSize & {\n series: { name: string; data: number[] }[];\n categories: (string | number)[];\n /** `vertical` (default) draws bars upward; `horizontal` draws them rightward. */\n orientation?: BarChartOrientation;\n /** Stack multi-series bars instead of grouping them side-by-side. */\n stacked?: boolean;\n /** Override the default Cosmos palette. */\n colors?: string[];\n /** Format the numeric axis labels (and tooltip values). */\n formatValue?: (value: number) => string;\n /** Show the legend (auto-true when 2+ series). */\n showLegend?: boolean;\n /** Tailwind border-radius applied to bar tops. Default 4. */\n borderRadius?: number;\n};\n\nexport const BarChart = ({\n series,\n categories,\n orientation = 'vertical',\n stacked = false,\n colors,\n formatValue,\n showLegend,\n borderRadius = 4,\n height = 320,\n width = '100%',\n}: BarChartProps) => {\n const { grid, axisLabels, palette } = useChartTheme();\n const horizontal = orientation === 'horizontal';\n const legendVisible = showLegend ?? series.length > 1;\n\n const valueFormatter = formatValue ?? ((v: number) => String(v));\n\n const options: ApexOptions = {\n chart: {\n type: 'bar',\n toolbar: { show: false },\n zoom: { enabled: false },\n stacked,\n fontFamily: 'inherit',\n },\n colors: colors ?? palette,\n dataLabels: { enabled: false },\n plotOptions: {\n bar: {\n horizontal,\n borderRadius,\n borderRadiusApplication: 'end',\n columnWidth: '55%',\n },\n },\n grid,\n xaxis: {\n categories,\n labels: {\n ...axisLabels,\n formatter: horizontal ? (val) => valueFormatter(Number(val)) : undefined,\n },\n axisBorder: { show: false },\n axisTicks: { show: false },\n },\n yaxis: {\n labels: {\n ...axisLabels,\n formatter: horizontal ? undefined : (val) => valueFormatter(Number(val)),\n },\n },\n legend: {\n show: legendVisible,\n position: 'top',\n horizontalAlign: 'right',\n labels: { colors: axisLabels.style.colors },\n markers: { size: 5 },\n },\n tooltip: {\n theme: 'dark',\n y: { formatter: (v) => valueFormatter(Number(v)) },\n },\n fill: { opacity: 1 },\n stroke: { show: false },\n };\n\n return (\n <ReactApexChart type=\"bar\" options={options} series={series} height={height} width={width} />\n );\n};\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sckyzo/cosmos-charts",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Cosmos charts — opinionated ApexCharts wrappers themed for the Cosmos design system",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "SckyzO",
|
|
7
|
+
"homepage": "https://github.com/SckyzO/cosmos/tree/main/packages/charts",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/SckyzO/cosmos.git",
|
|
11
|
+
"directory": "packages/charts"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"main": "./dist/index.cjs",
|
|
15
|
+
"module": "./dist/index.js",
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"import": "./dist/index.js",
|
|
21
|
+
"require": "./dist/index.cjs"
|
|
22
|
+
},
|
|
23
|
+
"./package.json": "./package.json"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist/",
|
|
27
|
+
"README.md",
|
|
28
|
+
"CHANGELOG.md",
|
|
29
|
+
"LICENSE"
|
|
30
|
+
],
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"react": "^19.0.0",
|
|
33
|
+
"react-dom": "^19.0.0"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"apexcharts": "^5.12.0",
|
|
37
|
+
"clsx": "^2.1.1",
|
|
38
|
+
"react-apexcharts": "^2.1.0"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@storybook/react-vite": "^10.4.0",
|
|
42
|
+
"@types/react": "^19.2.15",
|
|
43
|
+
"@types/react-dom": "^19.2.3",
|
|
44
|
+
"react": "^19.2.6",
|
|
45
|
+
"react-dom": "^19.2.6",
|
|
46
|
+
"storybook": "^10.4.0",
|
|
47
|
+
"tsup": "^8.5.1",
|
|
48
|
+
"typescript": "^6.0.3",
|
|
49
|
+
"vitest": "^4.1.7"
|
|
50
|
+
},
|
|
51
|
+
"publishConfig": {
|
|
52
|
+
"access": "public"
|
|
53
|
+
},
|
|
54
|
+
"keywords": [
|
|
55
|
+
"design-system",
|
|
56
|
+
"react",
|
|
57
|
+
"react-19",
|
|
58
|
+
"charts",
|
|
59
|
+
"apexcharts",
|
|
60
|
+
"cosmos"
|
|
61
|
+
],
|
|
62
|
+
"scripts": {
|
|
63
|
+
"lint": "eslint src",
|
|
64
|
+
"lint:fix": "eslint src --fix",
|
|
65
|
+
"typecheck": "tsc --noEmit",
|
|
66
|
+
"test": "echo 'Stories tested via @cosmos/storybook addon-vitest (apps/storybook).'",
|
|
67
|
+
"build": "tsup",
|
|
68
|
+
"dev": "tsup --watch"
|
|
69
|
+
}
|
|
70
|
+
}
|