@wso2/oxygen-ui-charts-react 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs ADDED
@@ -0,0 +1,1558 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ Area: () => import_recharts7.Area,
34
+ AreaChart: () => AreaChart_default,
35
+ Bar: () => import_recharts7.Bar,
36
+ BarChart: () => BarChart_default,
37
+ CartesianGrid: () => import_recharts7.CartesianGrid,
38
+ Cell: () => import_recharts7.Cell,
39
+ ChartTooltip: () => import_recharts7.Tooltip,
40
+ Label: () => import_recharts7.Label,
41
+ LabelList: () => import_recharts7.LabelList,
42
+ Legend: () => import_recharts7.Legend,
43
+ Line: () => import_recharts7.Line,
44
+ LineChart: () => LineChart_default,
45
+ Pie: () => import_recharts7.Pie,
46
+ PieChart: () => PieChart_default,
47
+ PolarAngleAxis: () => import_recharts7.PolarAngleAxis,
48
+ PolarGrid: () => import_recharts7.PolarGrid,
49
+ PolarRadiusAxis: () => import_recharts7.PolarRadiusAxis,
50
+ Radar: () => import_recharts7.Radar,
51
+ RadarChart: () => RadarChart_default,
52
+ RadialBar: () => import_recharts7.RadialBar,
53
+ RadialBarChart: () => RadialBarChart_default,
54
+ ResponsiveContainer: () => import_recharts7.ResponsiveContainer,
55
+ Scatter: () => import_recharts7.Scatter,
56
+ XAxis: () => import_recharts7.XAxis,
57
+ YAxis: () => import_recharts7.YAxis,
58
+ ZAxis: () => import_recharts7.ZAxis
59
+ });
60
+ module.exports = __toCommonJS(index_exports);
61
+
62
+ // src/components/charts/BarChart/BarChart.tsx
63
+ var import_react = __toESM(require("react"), 1);
64
+ var import_styles = require("@mui/material/styles");
65
+ var import_oxygen_ui = require("@wso2/oxygen-ui");
66
+ var import_recharts = require("recharts");
67
+ var import_jsx_runtime = require("react/jsx-runtime");
68
+ var BarChart = ({
69
+ data,
70
+ bars,
71
+ xAxisDataKey,
72
+ height = 300,
73
+ width = "100%",
74
+ legend,
75
+ grid,
76
+ tooltip,
77
+ layout = "horizontal",
78
+ margin,
79
+ barCategoryGap,
80
+ barGap,
81
+ barSize,
82
+ maxBarSize,
83
+ stackOffset = "none",
84
+ accessibilityLayer = true,
85
+ xAxis,
86
+ yAxis,
87
+ isAnimationActive = true,
88
+ animationDuration = 1500,
89
+ animationBegin = 0,
90
+ animationEasing = "ease",
91
+ colors: customColors,
92
+ children,
93
+ onClick,
94
+ onMouseEnter,
95
+ onMouseLeave,
96
+ onMouseDown,
97
+ onMouseUp,
98
+ onMouseMove
99
+ }) => {
100
+ const theme = (0, import_styles.useTheme)();
101
+ const { mode, systemMode } = (0, import_oxygen_ui.useColorScheme)();
102
+ const isDark = mode === "dark" || mode === "system" && systemMode === "dark";
103
+ const colors = import_react.default.useMemo(() => {
104
+ const defaultColors = {
105
+ primary: isDark ? "#F87643" : "#fa7b3f",
106
+ background: isDark ? "#1e1e1e" : "#f5f5f5",
107
+ text: isDark ? "#d4d4d4" : "#24292e",
108
+ comment: isDark ? "#6a9955" : "#6a737d",
109
+ keyword: isDark ? "#569cd6" : "#d73a49",
110
+ string: isDark ? "#ce9178" : "#032f62",
111
+ function: isDark ? "#dcdcaa" : "#6f42c1",
112
+ number: isDark ? "#b5cea8" : "#005cc5",
113
+ operator: isDark ? "#d4d4d4" : "#d73a49"
114
+ };
115
+ const themeSyntax = isDark ? theme.vars?.syntax?.dark : theme.vars?.syntax?.light;
116
+ return {
117
+ ...defaultColors,
118
+ ...themeSyntax,
119
+ primary: theme.palette.primary?.main || themeSyntax?.primary || defaultColors.primary
120
+ };
121
+ }, [isDark, theme.palette.primary?.main, theme.vars]);
122
+ const barColors = import_react.default.useMemo(() => {
123
+ if (customColors && customColors.length > 0) return customColors;
124
+ return [
125
+ colors.primary,
126
+ colors.keyword,
127
+ colors.string,
128
+ colors.function,
129
+ colors.number,
130
+ colors.operator
131
+ ];
132
+ }, [
133
+ customColors,
134
+ colors.primary,
135
+ colors.keyword,
136
+ colors.string,
137
+ colors.function,
138
+ colors.number,
139
+ colors.operator
140
+ ]);
141
+ const legendConfig = import_react.default.useMemo(
142
+ () => ({ show: true, align: "center", verticalAlign: "bottom", ...legend }),
143
+ [legend]
144
+ );
145
+ const gridConfig = import_react.default.useMemo(() => ({ show: true, strokeDasharray: "3 3", ...grid }), [grid]);
146
+ const marginConfig = import_react.default.useMemo(
147
+ () => ({ top: 12, right: 24, left: 24, bottom: 40, ...margin }),
148
+ [margin]
149
+ );
150
+ const xAxisConfig = import_react.default.useMemo(() => ({ show: true, ...xAxis }), [xAxis]);
151
+ const yAxisConfig = import_react.default.useMemo(() => ({ show: true, ...yAxis }), [yAxis]);
152
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_recharts.ResponsiveContainer, { width, height, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
153
+ import_recharts.BarChart,
154
+ {
155
+ data,
156
+ layout,
157
+ margin: marginConfig,
158
+ barCategoryGap,
159
+ barGap,
160
+ barSize,
161
+ maxBarSize,
162
+ stackOffset,
163
+ accessibilityLayer,
164
+ children: [
165
+ gridConfig?.show && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
166
+ import_recharts.CartesianGrid,
167
+ {
168
+ strokeDasharray: gridConfig.strokeDasharray,
169
+ stroke: colors.text,
170
+ vertical: false
171
+ }
172
+ ),
173
+ xAxisConfig?.show && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
174
+ import_recharts.XAxis,
175
+ {
176
+ type: layout === "vertical" ? "number" : "category",
177
+ dataKey: layout === "vertical" ? void 0 : xAxisDataKey,
178
+ stroke: colors.text,
179
+ tick: {
180
+ fill: colors.text,
181
+ fontSize: 12
182
+ },
183
+ tickMargin: 8,
184
+ axisLine: { stroke: colors.text },
185
+ tickLine: { stroke: colors.text },
186
+ label: xAxisConfig.name ? {
187
+ value: xAxisConfig.name,
188
+ position: "insideBottom",
189
+ offset: -18,
190
+ fill: colors.text,
191
+ fontSize: 12
192
+ } : void 0
193
+ }
194
+ ),
195
+ yAxisConfig?.show && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
196
+ import_recharts.YAxis,
197
+ {
198
+ type: layout === "vertical" ? "category" : "number",
199
+ dataKey: layout === "vertical" ? xAxisDataKey : void 0,
200
+ stroke: colors.text,
201
+ tick: {
202
+ fill: colors.text,
203
+ fontSize: 12
204
+ },
205
+ tickMargin: 8,
206
+ axisLine: { stroke: colors.text },
207
+ tickLine: { stroke: colors.text },
208
+ label: yAxisConfig.name ? {
209
+ value: yAxisConfig.name,
210
+ angle: -90,
211
+ position: "insideLeft",
212
+ offset: 0,
213
+ fill: colors.text,
214
+ fontSize: 12
215
+ } : void 0
216
+ }
217
+ ),
218
+ tooltip?.show !== false && (() => {
219
+ const { contentStyle, itemStyle, labelStyle, show, ...rest } = tooltip || {};
220
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
221
+ import_recharts.Tooltip,
222
+ {
223
+ cursor: {
224
+ fill: isDark ? "rgba(255, 255, 255, 0.05)" : "rgba(0, 0, 0, 0.05)"
225
+ },
226
+ ...rest,
227
+ contentStyle: {
228
+ backgroundColor: colors.background,
229
+ border: `1px solid ${colors.text}`,
230
+ borderRadius: theme.shape.borderRadius ?? 8,
231
+ color: colors.text,
232
+ boxShadow: "0 4px 6px -1px rgb(0 0 0 / 0.1)",
233
+ ...contentStyle
234
+ },
235
+ itemStyle: {
236
+ color: colors.text,
237
+ fontSize: 12,
238
+ ...itemStyle
239
+ },
240
+ labelStyle: {
241
+ color: colors.text,
242
+ fontWeight: 600,
243
+ marginBottom: 4,
244
+ ...labelStyle
245
+ }
246
+ }
247
+ );
248
+ })(),
249
+ legendConfig.show && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
250
+ import_recharts.Legend,
251
+ {
252
+ align: legendConfig.align,
253
+ verticalAlign: legendConfig.verticalAlign,
254
+ iconType: "circle",
255
+ formatter: (value) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
256
+ "span",
257
+ {
258
+ style: {
259
+ color: colors.text,
260
+ fontSize: 13,
261
+ fontWeight: 500
262
+ },
263
+ children: value
264
+ }
265
+ ),
266
+ wrapperStyle: { paddingTop: 32 }
267
+ }
268
+ ),
269
+ bars?.map((bar, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
270
+ import_recharts.Bar,
271
+ {
272
+ dataKey: bar.dataKey,
273
+ name: bar.name,
274
+ fill: bar.fill || barColors[index % barColors.length],
275
+ radius: bar.radius ?? [4, 4, 0, 0],
276
+ stackId: bar.stackId,
277
+ hide: bar.hide,
278
+ label: bar.label,
279
+ isAnimationActive: bar.isAnimationActive ?? isAnimationActive,
280
+ animationDuration: bar.animationDuration ?? animationDuration,
281
+ animationBegin: bar.animationBegin ?? animationBegin,
282
+ animationEasing: bar.animationEasing ?? animationEasing,
283
+ onClick: bar.onClick || onClick,
284
+ onMouseEnter: bar.onMouseEnter || onMouseEnter,
285
+ onMouseLeave: bar.onMouseLeave || onMouseLeave,
286
+ onMouseDown: bar.onMouseDown || onMouseDown,
287
+ onMouseUp: bar.onMouseUp || onMouseUp,
288
+ onMouseMove: bar.onMouseMove || onMouseMove
289
+ },
290
+ `${bar.dataKey}-${index}`
291
+ )),
292
+ children
293
+ ]
294
+ }
295
+ ) });
296
+ };
297
+ BarChart.displayName = "BarChart";
298
+ var BarChart_default = BarChart;
299
+
300
+ // src/components/charts/PieChart/PieChart.tsx
301
+ var import_react2 = __toESM(require("react"), 1);
302
+ var import_styles2 = require("@mui/material/styles");
303
+ var import_oxygen_ui2 = require("@wso2/oxygen-ui");
304
+ var import_recharts2 = require("recharts");
305
+ var import_jsx_runtime2 = require("react/jsx-runtime");
306
+ var PieChart = ({
307
+ data = [],
308
+ pies,
309
+ nameKey,
310
+ height = 300,
311
+ width = "100%",
312
+ legend,
313
+ tooltip,
314
+ margin,
315
+ cx = "50%",
316
+ cy = "50%",
317
+ startAngle = 0,
318
+ endAngle = 360,
319
+ innerRadius = 0,
320
+ outerRadius = "80%",
321
+ paddingAngle = 0,
322
+ cornerRadius = 0,
323
+ minAngle = 0,
324
+ isAnimationActive = true,
325
+ animationDuration = 1500,
326
+ animationBegin = 0,
327
+ animationEasing = "ease",
328
+ colors: customColors,
329
+ label,
330
+ labelLine,
331
+ onClick,
332
+ onMouseEnter,
333
+ onMouseLeave,
334
+ onMouseDown,
335
+ onMouseUp,
336
+ onMouseMove,
337
+ onContextMenu,
338
+ onDoubleClick,
339
+ children
340
+ }) => {
341
+ const theme = (0, import_styles2.useTheme)();
342
+ const { mode, systemMode } = (0, import_oxygen_ui2.useColorScheme)();
343
+ const isDark = mode === "dark" || mode === "system" && systemMode === "dark";
344
+ const syntaxColors = import_react2.default.useMemo(() => {
345
+ const defaultColors = {
346
+ primary: isDark ? "#F87643" : "#fa7b3f",
347
+ background: isDark ? "#1e1e1e" : "#f5f5f5",
348
+ text: isDark ? "#d4d4d4" : "#24292e",
349
+ comment: isDark ? "#6a9955" : "#6a737d",
350
+ keyword: isDark ? "#569cd6" : "#d73a49",
351
+ string: isDark ? "#ce9178" : "#032f62",
352
+ function: isDark ? "#dcdcaa" : "#6f42c1",
353
+ number: isDark ? "#b5cea8" : "#005cc5",
354
+ operator: isDark ? "#d4d4d4" : "#d73a49"
355
+ };
356
+ const themeSyntax = isDark ? theme.vars?.syntax?.dark : theme.vars?.syntax?.light;
357
+ return {
358
+ ...defaultColors,
359
+ ...themeSyntax,
360
+ primary: theme.palette.primary?.main || themeSyntax?.primary || defaultColors.primary
361
+ };
362
+ }, [isDark, theme.palette.primary?.main, theme.vars]);
363
+ const chartColors = import_react2.default.useMemo(() => {
364
+ if (customColors && customColors.length > 0) return customColors;
365
+ return [
366
+ syntaxColors.primary,
367
+ syntaxColors.keyword,
368
+ syntaxColors.string,
369
+ syntaxColors.function,
370
+ syntaxColors.number,
371
+ syntaxColors.operator
372
+ ];
373
+ }, [
374
+ customColors,
375
+ syntaxColors.primary,
376
+ syntaxColors.keyword,
377
+ syntaxColors.string,
378
+ syntaxColors.function,
379
+ syntaxColors.number,
380
+ syntaxColors.operator
381
+ ]);
382
+ const legendConfig = import_react2.default.useMemo(
383
+ () => ({ show: true, align: "center", verticalAlign: "bottom", ...legend }),
384
+ [legend]
385
+ );
386
+ const marginConfig = import_react2.default.useMemo(
387
+ () => ({ top: 12, right: 24, left: 24, bottom: 40, ...margin }),
388
+ [margin]
389
+ );
390
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_recharts2.ResponsiveContainer, { width, height, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_recharts2.PieChart, { data, margin: marginConfig, children: [
391
+ pies?.map((pie, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
392
+ import_recharts2.Pie,
393
+ {
394
+ data,
395
+ dataKey: pie.dataKey,
396
+ nameKey: pie.nameKey || nameKey,
397
+ name: pie.name,
398
+ cx: pie.cx ?? cx,
399
+ cy: pie.cy ?? cy,
400
+ startAngle: pie.startAngle ?? startAngle,
401
+ endAngle: pie.endAngle ?? endAngle,
402
+ innerRadius: pie.innerRadius ?? innerRadius,
403
+ outerRadius: pie.outerRadius ?? outerRadius,
404
+ paddingAngle: pie.paddingAngle ?? paddingAngle,
405
+ cornerRadius: pie.cornerRadius ?? cornerRadius,
406
+ minAngle: pie.minAngle ?? minAngle,
407
+ isAnimationActive: pie.isAnimationActive ?? isAnimationActive,
408
+ animationDuration: pie.animationDuration ?? animationDuration,
409
+ animationBegin: pie.animationBegin ?? animationBegin,
410
+ animationEasing: pie.animationEasing ?? animationEasing,
411
+ label: pie.label ?? label,
412
+ labelLine: pie.labelLine ?? labelLine,
413
+ onClick: pie.onClick || onClick,
414
+ onMouseEnter: pie.onMouseEnter || onMouseEnter,
415
+ onMouseLeave: pie.onMouseLeave || onMouseLeave,
416
+ onMouseDown: pie.onMouseDown || onMouseDown,
417
+ onMouseUp: pie.onMouseUp || onMouseUp,
418
+ onMouseMove: pie.onMouseMove || onMouseMove,
419
+ onContextMenu: pie.onContextMenu || onContextMenu,
420
+ onDoubleClick: pie.onDoubleClick || onDoubleClick,
421
+ children: data.map((entry, index2) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_recharts2.Cell, { fill: chartColors[index2 % chartColors.length] }, `cell-${index2}`))
422
+ },
423
+ `${pie.dataKey}-${index}`
424
+ )),
425
+ tooltip?.show !== false && (() => {
426
+ const { contentStyle, itemStyle, labelStyle, show, ...rest } = tooltip || {};
427
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
428
+ import_recharts2.Tooltip,
429
+ {
430
+ ...rest,
431
+ contentStyle: {
432
+ backgroundColor: syntaxColors.background,
433
+ border: `1px solid ${syntaxColors.text}`,
434
+ borderRadius: theme.shape.borderRadius ?? 8,
435
+ color: syntaxColors.text,
436
+ boxShadow: "0 4px 6px -1px rgb(0 0 0 / 0.1)",
437
+ ...contentStyle
438
+ },
439
+ itemStyle: {
440
+ color: syntaxColors.text,
441
+ fontSize: 12,
442
+ ...itemStyle
443
+ },
444
+ labelStyle: {
445
+ color: syntaxColors.text,
446
+ fontWeight: 600,
447
+ marginBottom: 4,
448
+ ...labelStyle
449
+ }
450
+ }
451
+ );
452
+ })(),
453
+ legendConfig.show && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
454
+ import_recharts2.Legend,
455
+ {
456
+ align: legendConfig.align,
457
+ verticalAlign: legendConfig.verticalAlign,
458
+ iconType: "circle",
459
+ formatter: (value) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
460
+ "span",
461
+ {
462
+ style: {
463
+ color: syntaxColors.text,
464
+ fontSize: 13,
465
+ fontWeight: 500
466
+ },
467
+ children: value
468
+ }
469
+ ),
470
+ wrapperStyle: { paddingTop: 32 }
471
+ }
472
+ ),
473
+ children
474
+ ] }) });
475
+ };
476
+ PieChart.displayName = "PieChart";
477
+ var PieChart_default = PieChart;
478
+
479
+ // src/components/charts/LineChart/LineChart.tsx
480
+ var import_react3 = __toESM(require("react"), 1);
481
+ var import_styles3 = require("@mui/material/styles");
482
+ var import_oxygen_ui3 = require("@wso2/oxygen-ui");
483
+ var import_recharts3 = require("recharts");
484
+ var import_jsx_runtime3 = require("react/jsx-runtime");
485
+ var LineChart = ({
486
+ data,
487
+ lines,
488
+ xAxisDataKey,
489
+ height = 300,
490
+ width = "100%",
491
+ legend,
492
+ grid,
493
+ tooltip,
494
+ layout = "horizontal",
495
+ margin,
496
+ syncId,
497
+ syncMethod,
498
+ role,
499
+ title,
500
+ desc,
501
+ accessibilityLayer = true,
502
+ xAxis,
503
+ yAxis,
504
+ onClick,
505
+ onMouseDown,
506
+ onMouseUp,
507
+ onMouseMove,
508
+ onMouseEnter,
509
+ onMouseLeave,
510
+ isAnimationActive = true,
511
+ animationDuration = 1500,
512
+ animationBegin = 0,
513
+ animationEasing = "ease",
514
+ colors: customColors,
515
+ children
516
+ }) => {
517
+ const theme = (0, import_styles3.useTheme)();
518
+ const { mode, systemMode } = (0, import_oxygen_ui3.useColorScheme)();
519
+ const isDark = mode === "dark" || mode === "system" && systemMode === "dark";
520
+ const colors = import_react3.default.useMemo(() => {
521
+ const defaultColors = {
522
+ primary: isDark ? "#F87643" : "#fa7b3f",
523
+ background: isDark ? "#1e1e1e" : "#f5f5f5",
524
+ text: isDark ? "#d4d4d4" : "#24292e",
525
+ comment: isDark ? "#6a9955" : "#6a737d",
526
+ keyword: isDark ? "#569cd6" : "#d73a49",
527
+ string: isDark ? "#ce9178" : "#032f62",
528
+ function: isDark ? "#dcdcaa" : "#6f42c1",
529
+ number: isDark ? "#b5cea8" : "#005cc5",
530
+ operator: isDark ? "#d4d4d4" : "#d73a49"
531
+ };
532
+ const themeSyntax = isDark ? theme.vars?.syntax?.dark : theme.vars?.syntax?.light;
533
+ return {
534
+ ...defaultColors,
535
+ ...themeSyntax,
536
+ primary: theme.palette.primary?.main || themeSyntax?.primary || defaultColors.primary
537
+ };
538
+ }, [isDark, theme.palette.primary?.main, theme.vars]);
539
+ const lineColors = import_react3.default.useMemo(() => {
540
+ if (customColors && customColors.length > 0) return customColors;
541
+ return [
542
+ colors.primary,
543
+ colors.keyword,
544
+ colors.string,
545
+ colors.function,
546
+ colors.number,
547
+ colors.operator
548
+ ];
549
+ }, [
550
+ customColors,
551
+ colors.primary,
552
+ colors.keyword,
553
+ colors.string,
554
+ colors.function,
555
+ colors.number,
556
+ colors.operator
557
+ ]);
558
+ const legendConfig = import_react3.default.useMemo(
559
+ () => ({ show: true, align: "center", verticalAlign: "bottom", ...legend }),
560
+ [legend]
561
+ );
562
+ const gridConfig = import_react3.default.useMemo(() => ({ show: true, strokeDasharray: "3 3", ...grid }), [grid]);
563
+ const marginConfig = import_react3.default.useMemo(
564
+ () => ({ top: 12, right: 24, left: 24, bottom: 40, ...margin }),
565
+ [margin]
566
+ );
567
+ const xAxisConfig = import_react3.default.useMemo(() => ({ show: true, ...xAxis }), [xAxis]);
568
+ const yAxisConfig = import_react3.default.useMemo(() => ({ show: true, ...yAxis }), [yAxis]);
569
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_recharts3.ResponsiveContainer, { width, height, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
570
+ import_recharts3.LineChart,
571
+ {
572
+ data,
573
+ layout,
574
+ margin: marginConfig,
575
+ syncId,
576
+ syncMethod,
577
+ role,
578
+ title,
579
+ desc,
580
+ accessibilityLayer,
581
+ onClick,
582
+ onMouseDown,
583
+ onMouseUp,
584
+ onMouseMove,
585
+ onMouseEnter,
586
+ onMouseLeave,
587
+ children: [
588
+ gridConfig?.show && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
589
+ import_recharts3.CartesianGrid,
590
+ {
591
+ strokeDasharray: gridConfig.strokeDasharray,
592
+ stroke: colors.text,
593
+ vertical: false
594
+ }
595
+ ),
596
+ xAxisConfig?.show && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
597
+ import_recharts3.XAxis,
598
+ {
599
+ type: xAxisConfig.type || (layout === "vertical" ? "number" : "category"),
600
+ dataKey: layout === "vertical" ? void 0 : xAxisDataKey,
601
+ stroke: colors.text,
602
+ domain: xAxisConfig.domain,
603
+ tickCount: xAxisConfig.tickCount,
604
+ interval: xAxisConfig.interval,
605
+ tick: {
606
+ fill: colors.text,
607
+ fontSize: 12
608
+ },
609
+ tickMargin: 8,
610
+ axisLine: { stroke: colors.text },
611
+ tickLine: { stroke: colors.text },
612
+ label: xAxisConfig.name ? {
613
+ value: xAxisConfig.name,
614
+ position: "insideBottom",
615
+ offset: -18,
616
+ fill: colors.text,
617
+ fontSize: 12
618
+ } : void 0
619
+ }
620
+ ),
621
+ yAxisConfig?.show && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
622
+ import_recharts3.YAxis,
623
+ {
624
+ type: yAxisConfig.type || (layout === "vertical" ? "category" : "number"),
625
+ dataKey: layout === "vertical" ? xAxisDataKey : void 0,
626
+ stroke: colors.text,
627
+ domain: yAxisConfig.domain,
628
+ tickCount: yAxisConfig.tickCount,
629
+ interval: yAxisConfig.interval,
630
+ tick: {
631
+ fill: colors.text,
632
+ fontSize: 12
633
+ },
634
+ tickMargin: 8,
635
+ axisLine: { stroke: colors.text },
636
+ tickLine: { stroke: colors.text },
637
+ label: yAxisConfig.name ? {
638
+ value: yAxisConfig.name,
639
+ angle: -90,
640
+ position: "insideLeft",
641
+ offset: 0,
642
+ fill: colors.text,
643
+ fontSize: 12
644
+ } : void 0
645
+ }
646
+ ),
647
+ tooltip?.show !== false && (() => {
648
+ const { contentStyle, itemStyle, labelStyle, show, ...rest } = tooltip || {};
649
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
650
+ import_recharts3.Tooltip,
651
+ {
652
+ ...rest,
653
+ contentStyle: {
654
+ backgroundColor: colors.background,
655
+ border: `1px solid ${colors.text}`,
656
+ borderRadius: theme.shape.borderRadius ?? 8,
657
+ color: colors.text,
658
+ boxShadow: "0 4px 6px -1px rgb(0 0 0 / 0.1)",
659
+ ...contentStyle
660
+ },
661
+ itemStyle: {
662
+ color: colors.text,
663
+ fontSize: 12,
664
+ ...itemStyle
665
+ },
666
+ labelStyle: {
667
+ color: colors.text,
668
+ fontWeight: 600,
669
+ marginBottom: 4,
670
+ ...labelStyle
671
+ }
672
+ }
673
+ );
674
+ })(),
675
+ legendConfig.show && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
676
+ import_recharts3.Legend,
677
+ {
678
+ align: legendConfig.align,
679
+ verticalAlign: legendConfig.verticalAlign,
680
+ iconType: "circle",
681
+ formatter: (value) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
682
+ "span",
683
+ {
684
+ style: {
685
+ color: colors.text,
686
+ fontSize: 13,
687
+ fontWeight: 500
688
+ },
689
+ children: value
690
+ }
691
+ ),
692
+ wrapperStyle: { paddingTop: 32 }
693
+ }
694
+ ),
695
+ lines?.map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
696
+ import_recharts3.Line,
697
+ {
698
+ dataKey: line.dataKey,
699
+ name: line.name,
700
+ stroke: line.stroke || lineColors[index % lineColors.length],
701
+ strokeWidth: line.strokeWidth ?? 2,
702
+ strokeDasharray: line.strokeDasharray,
703
+ type: line.type || "monotone",
704
+ hide: line.hide,
705
+ label: line.label,
706
+ dot: line.dot ?? true,
707
+ activeDot: line.activeDot ?? true,
708
+ connectNulls: line.connectNulls,
709
+ unit: line.unit,
710
+ legendType: line.legendType || "line",
711
+ onClick: line.onClick,
712
+ onMouseDown: line.onMouseDown,
713
+ onMouseUp: line.onMouseUp,
714
+ onMouseMove: line.onMouseMove,
715
+ onMouseOver: line.onMouseOver,
716
+ onMouseOut: line.onMouseOut,
717
+ onMouseEnter: line.onMouseEnter,
718
+ onMouseLeave: line.onMouseLeave,
719
+ isAnimationActive: line.isAnimationActive ?? isAnimationActive,
720
+ animationDuration: line.animationDuration ?? animationDuration,
721
+ animationBegin: line.animationBegin ?? animationBegin,
722
+ animationEasing: line.animationEasing ?? animationEasing
723
+ },
724
+ `${line.dataKey}-${index}`
725
+ )),
726
+ children
727
+ ]
728
+ }
729
+ ) });
730
+ };
731
+ LineChart.displayName = "LineChart";
732
+ var LineChart_default = LineChart;
733
+
734
+ // src/components/charts/AreaChart/AreaChart.tsx
735
+ var import_react4 = __toESM(require("react"), 1);
736
+ var import_styles4 = require("@mui/material/styles");
737
+ var import_oxygen_ui4 = require("@wso2/oxygen-ui");
738
+ var import_recharts4 = require("recharts");
739
+ var import_jsx_runtime4 = require("react/jsx-runtime");
740
+ var AreaChart = ({
741
+ data,
742
+ areas,
743
+ xAxisDataKey,
744
+ height = 300,
745
+ width = "100%",
746
+ legend,
747
+ grid,
748
+ tooltip,
749
+ layout = "horizontal",
750
+ margin,
751
+ syncId,
752
+ syncMethod,
753
+ role,
754
+ title,
755
+ desc,
756
+ accessibilityLayer = true,
757
+ xAxis,
758
+ yAxis,
759
+ onClick,
760
+ onMouseDown,
761
+ onMouseUp,
762
+ onMouseMove,
763
+ onMouseEnter,
764
+ onMouseLeave,
765
+ isAnimationActive = true,
766
+ animationDuration = 1500,
767
+ animationBegin = 0,
768
+ animationEasing = "ease",
769
+ colors: customColors,
770
+ children
771
+ }) => {
772
+ const theme = (0, import_styles4.useTheme)();
773
+ const { mode, systemMode } = (0, import_oxygen_ui4.useColorScheme)();
774
+ const isDark = mode === "dark" || mode === "system" && systemMode === "dark";
775
+ const colors = import_react4.default.useMemo(() => {
776
+ const defaultColors = {
777
+ primary: isDark ? "#F87643" : "#fa7b3f",
778
+ background: isDark ? "#1e1e1e" : "#f5f5f5",
779
+ text: isDark ? "#d4d4d4" : "#24292e",
780
+ comment: isDark ? "#6a9955" : "#6a737d",
781
+ keyword: isDark ? "#569cd6" : "#d73a49",
782
+ string: isDark ? "#ce9178" : "#032f62",
783
+ function: isDark ? "#dcdcaa" : "#6f42c1",
784
+ number: isDark ? "#b5cea8" : "#005cc5",
785
+ operator: isDark ? "#d4d4d4" : "#d73a49"
786
+ };
787
+ const themeSyntax = isDark ? theme.vars?.syntax?.dark : theme.vars?.syntax?.light;
788
+ return {
789
+ ...defaultColors,
790
+ ...themeSyntax,
791
+ primary: theme.palette.primary?.main || themeSyntax?.primary || defaultColors.primary
792
+ };
793
+ }, [isDark, theme.palette.primary?.main, theme.vars]);
794
+ const idPrefix = import_react4.default.useId();
795
+ const areaColors = import_react4.default.useMemo(() => {
796
+ if (customColors && customColors.length > 0) return customColors;
797
+ return [
798
+ colors.primary,
799
+ colors.keyword,
800
+ colors.string,
801
+ colors.function,
802
+ colors.number,
803
+ colors.operator
804
+ ];
805
+ }, [
806
+ customColors,
807
+ colors.primary,
808
+ colors.keyword,
809
+ colors.string,
810
+ colors.function,
811
+ colors.number,
812
+ colors.operator
813
+ ]);
814
+ const legendConfig = import_react4.default.useMemo(
815
+ () => ({ show: true, align: "center", verticalAlign: "bottom", ...legend }),
816
+ [legend]
817
+ );
818
+ const gridConfig = import_react4.default.useMemo(() => ({ show: true, strokeDasharray: "3 3", ...grid }), [grid]);
819
+ const marginConfig = import_react4.default.useMemo(
820
+ () => ({ top: 12, right: 24, left: 24, bottom: 40, ...margin }),
821
+ [margin]
822
+ );
823
+ const xAxisConfig = import_react4.default.useMemo(() => ({ show: true, ...xAxis }), [xAxis]);
824
+ const yAxisConfig = import_react4.default.useMemo(() => ({ show: true, ...yAxis }), [yAxis]);
825
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_recharts4.ResponsiveContainer, { width, height, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
826
+ import_recharts4.AreaChart,
827
+ {
828
+ data,
829
+ layout,
830
+ margin: marginConfig,
831
+ syncId,
832
+ syncMethod,
833
+ role,
834
+ title,
835
+ desc,
836
+ accessibilityLayer,
837
+ children: [
838
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("defs", { children: areas?.map((area, index) => {
839
+ const color = area.fill || area.stroke || areaColors[index % areaColors.length];
840
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
841
+ "linearGradient",
842
+ {
843
+ id: `${idPrefix}-gradient-${area.dataKey}`,
844
+ x1: "0",
845
+ y1: "0",
846
+ x2: "0",
847
+ y2: "1",
848
+ children: [
849
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("stop", { offset: "5%", stopColor: color, stopOpacity: area.fillOpacity ?? 0.8 }),
850
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("stop", { offset: "95%", stopColor: color, stopOpacity: 0 })
851
+ ]
852
+ },
853
+ `${idPrefix}-gradient-${area.dataKey}`
854
+ );
855
+ }) }),
856
+ gridConfig?.show && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
857
+ import_recharts4.CartesianGrid,
858
+ {
859
+ strokeDasharray: gridConfig.strokeDasharray,
860
+ stroke: colors.text,
861
+ vertical: false
862
+ }
863
+ ),
864
+ xAxisConfig?.show && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
865
+ import_recharts4.XAxis,
866
+ {
867
+ type: xAxisConfig.type || (layout === "vertical" ? "number" : "category"),
868
+ dataKey: layout === "vertical" ? void 0 : xAxisDataKey,
869
+ stroke: colors.text,
870
+ domain: xAxisConfig.domain,
871
+ tickCount: xAxisConfig.tickCount,
872
+ interval: xAxisConfig.interval,
873
+ tick: {
874
+ fill: colors.text,
875
+ fontSize: 12
876
+ },
877
+ tickMargin: 8,
878
+ axisLine: { stroke: colors.text },
879
+ tickLine: { stroke: colors.text },
880
+ label: xAxisConfig.name ? {
881
+ value: xAxisConfig.name,
882
+ position: "insideBottom",
883
+ offset: -18,
884
+ fill: colors.text,
885
+ fontSize: 12
886
+ } : void 0
887
+ }
888
+ ),
889
+ yAxisConfig?.show && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
890
+ import_recharts4.YAxis,
891
+ {
892
+ type: yAxisConfig.type || (layout === "vertical" ? "category" : "number"),
893
+ dataKey: layout === "vertical" ? xAxisDataKey : void 0,
894
+ stroke: colors.text,
895
+ domain: yAxisConfig.domain,
896
+ tickCount: yAxisConfig.tickCount,
897
+ interval: yAxisConfig.interval,
898
+ tick: {
899
+ fill: colors.text,
900
+ fontSize: 12
901
+ },
902
+ tickMargin: 8,
903
+ axisLine: { stroke: colors.text },
904
+ tickLine: { stroke: colors.text },
905
+ label: yAxisConfig.name ? {
906
+ value: yAxisConfig.name,
907
+ angle: -90,
908
+ position: "insideLeft",
909
+ offset: 0,
910
+ fill: colors.text,
911
+ fontSize: 12
912
+ } : void 0
913
+ }
914
+ ),
915
+ tooltip?.show !== false && (() => {
916
+ const { contentStyle, itemStyle, labelStyle, show, ...rest } = tooltip || {};
917
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
918
+ import_recharts4.Tooltip,
919
+ {
920
+ ...rest,
921
+ contentStyle: {
922
+ backgroundColor: colors.background,
923
+ border: `1px solid ${colors.text}`,
924
+ borderRadius: theme.shape.borderRadius ?? 8,
925
+ color: colors.text,
926
+ boxShadow: "0 4px 6px -1px rgb(0 0 0 / 0.1)",
927
+ ...contentStyle
928
+ },
929
+ itemStyle: {
930
+ color: colors.text,
931
+ fontSize: 12,
932
+ ...itemStyle
933
+ },
934
+ labelStyle: {
935
+ color: colors.text,
936
+ fontWeight: 600,
937
+ marginBottom: 4,
938
+ ...labelStyle
939
+ }
940
+ }
941
+ );
942
+ })(),
943
+ legendConfig.show && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
944
+ import_recharts4.Legend,
945
+ {
946
+ align: legendConfig.align,
947
+ verticalAlign: legendConfig.verticalAlign,
948
+ iconType: "circle",
949
+ formatter: (value) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
950
+ "span",
951
+ {
952
+ style: {
953
+ color: colors.text,
954
+ fontSize: 13,
955
+ fontWeight: 500
956
+ },
957
+ children: value
958
+ }
959
+ ),
960
+ wrapperStyle: { paddingTop: 32 }
961
+ }
962
+ ),
963
+ areas?.map((area, index) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
964
+ import_recharts4.Area,
965
+ {
966
+ dataKey: area.dataKey,
967
+ name: area.name,
968
+ stroke: area.stroke || areaColors[index % areaColors.length],
969
+ fill: `url(#${idPrefix}-gradient-${area.dataKey})`,
970
+ strokeWidth: area.strokeWidth ?? 2,
971
+ strokeDasharray: area.strokeDasharray,
972
+ type: area.type || "monotone",
973
+ stackId: area.stackId,
974
+ hide: area.hide,
975
+ label: area.label,
976
+ dot: area.dot ?? true,
977
+ activeDot: area.activeDot ?? true,
978
+ connectNulls: area.connectNulls,
979
+ unit: area.unit,
980
+ legendType: area.legendType || "line",
981
+ onClick: area.onClick || onClick,
982
+ onMouseDown: area.onMouseDown || onMouseDown,
983
+ onMouseUp: area.onMouseUp || onMouseUp,
984
+ onMouseMove: area.onMouseMove || onMouseMove,
985
+ onMouseOver: area.onMouseOver,
986
+ onMouseOut: area.onMouseOut,
987
+ onMouseEnter: area.onMouseEnter || onMouseEnter,
988
+ onMouseLeave: area.onMouseLeave || onMouseLeave,
989
+ isAnimationActive: area.isAnimationActive ?? isAnimationActive,
990
+ animationDuration: area.animationDuration ?? animationDuration,
991
+ animationBegin: area.animationBegin ?? animationBegin,
992
+ animationEasing: area.animationEasing ?? animationEasing
993
+ },
994
+ `${area.dataKey}-${index}`
995
+ )),
996
+ children
997
+ ]
998
+ }
999
+ ) });
1000
+ };
1001
+ AreaChart.displayName = "AreaChart";
1002
+ var AreaChart_default = AreaChart;
1003
+
1004
+ // src/components/charts/RadarChart/RadarChart.tsx
1005
+ var import_react5 = __toESM(require("react"), 1);
1006
+ var import_styles5 = require("@mui/material/styles");
1007
+ var import_oxygen_ui5 = require("@wso2/oxygen-ui");
1008
+ var import_recharts5 = require("recharts");
1009
+ var import_jsx_runtime5 = require("react/jsx-runtime");
1010
+ var RadarChart = ({
1011
+ data,
1012
+ radars,
1013
+ radialBars,
1014
+ angleKey,
1015
+ height = 300,
1016
+ width = "100%",
1017
+ legend,
1018
+ tooltip,
1019
+ innerRadius = 0,
1020
+ outerRadius = "80%",
1021
+ cx = "50%",
1022
+ cy = "50%",
1023
+ startAngle = 90,
1024
+ endAngle = -270,
1025
+ margin,
1026
+ polarGrid,
1027
+ polarAngleAxis,
1028
+ polarRadiusAxis,
1029
+ syncId,
1030
+ syncMethod,
1031
+ role,
1032
+ title,
1033
+ desc,
1034
+ id,
1035
+ className,
1036
+ style,
1037
+ tabIndex,
1038
+ layout = "centric",
1039
+ stackOffset,
1040
+ reverseStackOrder,
1041
+ barSize,
1042
+ barCategoryGap,
1043
+ barGap,
1044
+ maxBarSize,
1045
+ onClick,
1046
+ onMouseDown,
1047
+ onMouseUp,
1048
+ onMouseMove,
1049
+ onMouseEnter,
1050
+ onMouseLeave,
1051
+ onContextMenu,
1052
+ onDoubleClick,
1053
+ accessibilityLayer = true,
1054
+ colors: customColors,
1055
+ children
1056
+ }) => {
1057
+ const theme = (0, import_styles5.useTheme)();
1058
+ const { mode, systemMode } = (0, import_oxygen_ui5.useColorScheme)();
1059
+ const isDark = mode === "dark" || mode === "system" && systemMode === "dark";
1060
+ const colors = import_react5.default.useMemo(() => {
1061
+ const defaultColors = {
1062
+ primary: isDark ? "#F87643" : "#fa7b3f",
1063
+ background: isDark ? "#1e1e1e" : "#f5f5f5",
1064
+ text: isDark ? "#d4d4d4" : "#24292e",
1065
+ comment: isDark ? "#6a9955" : "#6a737d",
1066
+ keyword: isDark ? "#569cd6" : "#d73a49",
1067
+ string: isDark ? "#ce9178" : "#032f62",
1068
+ function: isDark ? "#dcdcaa" : "#6f42c1",
1069
+ number: isDark ? "#b5cea8" : "#005cc5",
1070
+ operator: isDark ? "#d4d4d4" : "#d73a49"
1071
+ };
1072
+ const themeSyntax = isDark ? theme.vars?.syntax?.dark : theme.vars?.syntax?.light;
1073
+ return {
1074
+ ...defaultColors,
1075
+ ...themeSyntax,
1076
+ primary: theme.palette.primary?.main || themeSyntax?.primary || defaultColors.primary
1077
+ };
1078
+ }, [isDark, theme.palette.primary?.main, theme.vars]);
1079
+ const radarColors = import_react5.default.useMemo(() => {
1080
+ if (customColors && customColors.length > 0) return customColors;
1081
+ return [
1082
+ colors.primary,
1083
+ colors.keyword,
1084
+ colors.string,
1085
+ colors.function,
1086
+ colors.number,
1087
+ colors.operator
1088
+ ];
1089
+ }, [
1090
+ customColors,
1091
+ colors.primary,
1092
+ colors.keyword,
1093
+ colors.string,
1094
+ colors.function,
1095
+ colors.number,
1096
+ colors.operator
1097
+ ]);
1098
+ const legendConfig = import_react5.default.useMemo(
1099
+ () => ({ show: true, align: "center", verticalAlign: "bottom", ...legend }),
1100
+ [legend]
1101
+ );
1102
+ const marginConfig = import_react5.default.useMemo(
1103
+ () => ({ top: 20, right: 20, bottom: 20, left: 20, ...margin }),
1104
+ [margin]
1105
+ );
1106
+ const polarGridConfig = import_react5.default.useMemo(
1107
+ () => ({ show: true, gridType: "polygon", ...polarGrid }),
1108
+ [polarGrid]
1109
+ );
1110
+ const polarAngleAxisConfig = import_react5.default.useMemo(
1111
+ () => ({ show: true, ...polarAngleAxis }),
1112
+ [polarAngleAxis]
1113
+ );
1114
+ const polarRadiusAxisConfig = import_react5.default.useMemo(
1115
+ () => ({ show: false, ...polarRadiusAxis }),
1116
+ [polarRadiusAxis]
1117
+ );
1118
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_recharts5.ResponsiveContainer, { width, height, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1119
+ import_recharts5.RadarChart,
1120
+ {
1121
+ data,
1122
+ cx,
1123
+ cy,
1124
+ innerRadius,
1125
+ outerRadius,
1126
+ startAngle,
1127
+ endAngle,
1128
+ margin: marginConfig,
1129
+ syncId,
1130
+ syncMethod,
1131
+ role,
1132
+ title,
1133
+ desc,
1134
+ id,
1135
+ className,
1136
+ style,
1137
+ tabIndex,
1138
+ layout,
1139
+ stackOffset,
1140
+ reverseStackOrder,
1141
+ barSize,
1142
+ barCategoryGap,
1143
+ barGap,
1144
+ maxBarSize,
1145
+ onClick,
1146
+ onMouseDown,
1147
+ onMouseUp,
1148
+ onMouseMove,
1149
+ onMouseEnter,
1150
+ onMouseLeave,
1151
+ onContextMenu,
1152
+ onDoubleClick,
1153
+ accessibilityLayer,
1154
+ children: [
1155
+ polarGridConfig?.show && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1156
+ import_recharts5.PolarGrid,
1157
+ {
1158
+ gridType: polarGridConfig.gridType,
1159
+ radialLines: polarGridConfig.radialLines,
1160
+ polarAngles: polarGridConfig.polarAngles,
1161
+ polarRadius: polarGridConfig.polarRadius,
1162
+ stroke: colors.comment,
1163
+ strokeOpacity: 0.3
1164
+ }
1165
+ ),
1166
+ polarAngleAxisConfig?.show && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1167
+ import_recharts5.PolarAngleAxis,
1168
+ {
1169
+ dataKey: polarAngleAxisConfig.dataKey || angleKey,
1170
+ tick: polarAngleAxisConfig.tick ?? { fill: colors.text, fontSize: 12 },
1171
+ axisLine: polarAngleAxisConfig.axisLine ?? { stroke: colors.comment, strokeOpacity: 0.3 },
1172
+ axisLineType: polarAngleAxisConfig.axisLineType,
1173
+ orientation: polarAngleAxisConfig.orientation,
1174
+ ticks: polarAngleAxisConfig.ticks ? polarAngleAxisConfig.ticks.map((tick, index) => ({ ...tick, index })) : void 0
1175
+ }
1176
+ ),
1177
+ polarRadiusAxisConfig?.show && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1178
+ import_recharts5.PolarRadiusAxis,
1179
+ {
1180
+ angle: polarRadiusAxisConfig.angle,
1181
+ domain: polarRadiusAxisConfig.domain,
1182
+ tick: polarRadiusAxisConfig.tick ?? { fill: colors.text, fontSize: 10 },
1183
+ axisLine: polarRadiusAxisConfig.axisLine ?? { stroke: colors.comment, strokeOpacity: 0.3 },
1184
+ orientation: polarRadiusAxisConfig.orientation,
1185
+ reversed: polarRadiusAxisConfig.reversed,
1186
+ ticks: polarRadiusAxisConfig.ticks ? polarRadiusAxisConfig.ticks.map((tick, index) => ({
1187
+ ...tick,
1188
+ index
1189
+ })) : void 0
1190
+ }
1191
+ ),
1192
+ tooltip?.show !== false && (() => {
1193
+ const { contentStyle, itemStyle, labelStyle, show, ...rest } = tooltip || {};
1194
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1195
+ import_recharts5.Tooltip,
1196
+ {
1197
+ ...rest,
1198
+ contentStyle: {
1199
+ backgroundColor: colors.background,
1200
+ border: `1px solid ${colors.text}`,
1201
+ borderRadius: theme.shape.borderRadius || 8,
1202
+ color: colors.text,
1203
+ boxShadow: "0 4px 6px -1px rgb(0 0 0 / 0.1)",
1204
+ ...contentStyle
1205
+ },
1206
+ itemStyle: {
1207
+ color: colors.text,
1208
+ fontSize: 12,
1209
+ ...itemStyle
1210
+ },
1211
+ labelStyle: {
1212
+ color: colors.text,
1213
+ fontWeight: 600,
1214
+ marginBottom: 4,
1215
+ ...labelStyle
1216
+ }
1217
+ }
1218
+ );
1219
+ })(),
1220
+ legendConfig.show && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1221
+ import_recharts5.Legend,
1222
+ {
1223
+ align: legendConfig.align,
1224
+ verticalAlign: legendConfig.verticalAlign,
1225
+ layout: legendConfig.layout,
1226
+ iconType: legendConfig.iconType || "circle",
1227
+ formatter: (value) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { style: { color: colors.text, fontSize: 13, fontWeight: 500 }, children: value }),
1228
+ wrapperStyle: { paddingTop: 20 }
1229
+ }
1230
+ ),
1231
+ radars?.map((radar, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1232
+ import_recharts5.Radar,
1233
+ {
1234
+ name: radar.name,
1235
+ dataKey: radar.dataKey,
1236
+ stroke: radar.stroke || radarColors[index % radarColors.length],
1237
+ strokeWidth: radar.strokeWidth ?? 2,
1238
+ strokeDasharray: radar.strokeDasharray,
1239
+ fill: radar.fill || radarColors[index % radarColors.length],
1240
+ fillOpacity: radar.fillOpacity ?? 0.6,
1241
+ hide: radar.hide,
1242
+ label: radar.label,
1243
+ dot: radar.dot ?? true,
1244
+ activeDot: radar.activeDot ?? true,
1245
+ connectNulls: radar.connectNulls,
1246
+ legendType: radar.legendType,
1247
+ tooltipType: radar.tooltipType,
1248
+ onMouseEnter: radar.onMouseEnter,
1249
+ onMouseLeave: radar.onMouseLeave,
1250
+ onClick: radar.onClick,
1251
+ isAnimationActive: radar.isAnimationActive,
1252
+ animationDuration: radar.animationDuration,
1253
+ animationBegin: radar.animationBegin,
1254
+ animationEasing: radar.animationEasing
1255
+ },
1256
+ `${radar.dataKey}-${index}`
1257
+ )),
1258
+ radialBars?.map((bar, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1259
+ import_recharts5.RadialBar,
1260
+ {
1261
+ name: bar.name,
1262
+ dataKey: bar.dataKey,
1263
+ fill: bar.fill || radarColors[index % radarColors.length],
1264
+ background: bar.background,
1265
+ cornerRadius: bar.cornerRadius,
1266
+ minPointSize: bar.minPointSize,
1267
+ maxBarSize: bar.maxBarSize,
1268
+ hide: bar.hide,
1269
+ label: bar.label,
1270
+ stackId: bar.stackId,
1271
+ isAnimationActive: bar.isAnimationActive,
1272
+ animationDuration: bar.animationDuration,
1273
+ animationBegin: bar.animationBegin,
1274
+ animationEasing: bar.animationEasing,
1275
+ onClick: bar.onClick,
1276
+ onMouseEnter: bar.onMouseEnter,
1277
+ onMouseLeave: bar.onMouseLeave
1278
+ },
1279
+ `${bar.dataKey}-${index}`
1280
+ )),
1281
+ children
1282
+ ]
1283
+ }
1284
+ ) });
1285
+ };
1286
+ RadarChart.displayName = "RadarChart";
1287
+ var RadarChart_default = RadarChart;
1288
+
1289
+ // src/components/charts/RadialBarChart/RadialBarChart.tsx
1290
+ var import_react6 = __toESM(require("react"), 1);
1291
+ var import_styles6 = require("@mui/material/styles");
1292
+ var import_oxygen_ui6 = require("@wso2/oxygen-ui");
1293
+ var import_recharts6 = require("recharts");
1294
+ var import_jsx_runtime6 = require("react/jsx-runtime");
1295
+ var RadialBarChart = ({
1296
+ data,
1297
+ radialBars,
1298
+ height = 300,
1299
+ width = "100%",
1300
+ legend,
1301
+ tooltip,
1302
+ innerRadius = 0,
1303
+ outerRadius = "80%",
1304
+ cx = "50%",
1305
+ cy = "50%",
1306
+ startAngle = 0,
1307
+ endAngle = 360,
1308
+ margin,
1309
+ barSize,
1310
+ barCategoryGap,
1311
+ barGap,
1312
+ maxBarSize,
1313
+ polarGrid,
1314
+ polarAngleAxis,
1315
+ polarRadiusAxis,
1316
+ syncId,
1317
+ syncMethod,
1318
+ role,
1319
+ title,
1320
+ desc,
1321
+ id,
1322
+ className,
1323
+ style,
1324
+ tabIndex,
1325
+ stackOffset,
1326
+ reverseStackOrder,
1327
+ onClick,
1328
+ onMouseDown,
1329
+ onMouseUp,
1330
+ onMouseMove,
1331
+ onMouseEnter,
1332
+ onMouseLeave,
1333
+ onContextMenu,
1334
+ onDoubleClick,
1335
+ accessibilityLayer = true,
1336
+ colors: customColors,
1337
+ children
1338
+ }) => {
1339
+ const theme = (0, import_styles6.useTheme)();
1340
+ const { mode, systemMode } = (0, import_oxygen_ui6.useColorScheme)();
1341
+ const isDark = mode === "dark" || mode === "system" && systemMode === "dark";
1342
+ const colors = import_react6.default.useMemo(() => {
1343
+ const defaultColors = {
1344
+ primary: isDark ? "#F87643" : "#fa7b3f",
1345
+ background: isDark ? "#1e1e1e" : "#f5f5f5",
1346
+ text: isDark ? "#d4d4d4" : "#24292e",
1347
+ comment: isDark ? "#6a9955" : "#6a737d",
1348
+ keyword: isDark ? "#569cd6" : "#d73a49",
1349
+ string: isDark ? "#ce9178" : "#032f62",
1350
+ function: isDark ? "#dcdcaa" : "#6f42c1",
1351
+ number: isDark ? "#b5cea8" : "#005cc5",
1352
+ operator: isDark ? "#d4d4d4" : "#d73a49"
1353
+ };
1354
+ const themeSyntax = isDark ? theme.vars?.syntax?.dark : theme.vars?.syntax?.light;
1355
+ return {
1356
+ ...defaultColors,
1357
+ ...themeSyntax,
1358
+ primary: theme.palette.primary?.main || themeSyntax?.primary || defaultColors.primary
1359
+ };
1360
+ }, [isDark, theme.palette.primary?.main, theme.vars]);
1361
+ const barColors = import_react6.default.useMemo(() => {
1362
+ if (customColors && customColors.length > 0) return customColors;
1363
+ return [
1364
+ colors.primary,
1365
+ colors.keyword,
1366
+ colors.string,
1367
+ colors.function,
1368
+ colors.number,
1369
+ colors.operator
1370
+ ];
1371
+ }, [
1372
+ customColors,
1373
+ colors.primary,
1374
+ colors.keyword,
1375
+ colors.string,
1376
+ colors.function,
1377
+ colors.number,
1378
+ colors.operator
1379
+ ]);
1380
+ const legendConfig = import_react6.default.useMemo(
1381
+ () => ({ show: true, align: "center", verticalAlign: "bottom", ...legend }),
1382
+ [legend]
1383
+ );
1384
+ const marginConfig = import_react6.default.useMemo(
1385
+ () => ({ top: 20, right: 20, bottom: 20, left: 20, ...margin }),
1386
+ [margin]
1387
+ );
1388
+ const polarGridConfig = import_react6.default.useMemo(() => ({ show: false, ...polarGrid }), [polarGrid]);
1389
+ const polarAngleAxisConfig = import_react6.default.useMemo(
1390
+ () => ({ show: false, ...polarAngleAxis }),
1391
+ [polarAngleAxis]
1392
+ );
1393
+ const polarRadiusAxisConfig = import_react6.default.useMemo(
1394
+ () => ({ show: false, ...polarRadiusAxis }),
1395
+ [polarRadiusAxis]
1396
+ );
1397
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_recharts6.ResponsiveContainer, { width, height, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1398
+ import_recharts6.RadialBarChart,
1399
+ {
1400
+ data,
1401
+ cx,
1402
+ cy,
1403
+ innerRadius,
1404
+ outerRadius,
1405
+ startAngle,
1406
+ endAngle,
1407
+ margin: marginConfig,
1408
+ barSize,
1409
+ barCategoryGap,
1410
+ barGap,
1411
+ maxBarSize,
1412
+ syncId,
1413
+ syncMethod,
1414
+ role,
1415
+ title,
1416
+ desc,
1417
+ id,
1418
+ className,
1419
+ style,
1420
+ tabIndex,
1421
+ stackOffset,
1422
+ reverseStackOrder,
1423
+ onClick,
1424
+ onMouseDown,
1425
+ onMouseUp,
1426
+ onMouseMove,
1427
+ onMouseEnter,
1428
+ onMouseLeave,
1429
+ onContextMenu,
1430
+ onDoubleClick,
1431
+ accessibilityLayer,
1432
+ children: [
1433
+ polarGridConfig?.show && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1434
+ import_recharts6.PolarGrid,
1435
+ {
1436
+ gridType: polarGridConfig.gridType,
1437
+ radialLines: polarGridConfig.radialLines,
1438
+ polarAngles: polarGridConfig.polarAngles,
1439
+ polarRadius: polarGridConfig.polarRadius,
1440
+ stroke: colors.comment,
1441
+ strokeOpacity: 0.3
1442
+ }
1443
+ ),
1444
+ polarAngleAxisConfig?.show && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1445
+ import_recharts6.PolarAngleAxis,
1446
+ {
1447
+ dataKey: polarAngleAxisConfig.dataKey,
1448
+ tick: polarAngleAxisConfig.tick ?? { fill: colors.text, fontSize: 12 },
1449
+ axisLine: polarAngleAxisConfig.axisLine ?? { stroke: colors.comment, strokeOpacity: 0.3 },
1450
+ axisLineType: polarAngleAxisConfig.axisLineType,
1451
+ orientation: polarAngleAxisConfig.orientation,
1452
+ ticks: polarAngleAxisConfig.ticks ? polarAngleAxisConfig.ticks.map((tick, index) => {
1453
+ if (typeof tick === "object" && tick !== null) {
1454
+ return { ...tick, index };
1455
+ }
1456
+ return tick;
1457
+ }) : void 0
1458
+ }
1459
+ ),
1460
+ polarRadiusAxisConfig?.show && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1461
+ import_recharts6.PolarRadiusAxis,
1462
+ {
1463
+ angle: polarRadiusAxisConfig.angle,
1464
+ domain: polarRadiusAxisConfig.domain,
1465
+ tick: polarRadiusAxisConfig.tick ?? { fill: colors.text, fontSize: 10 },
1466
+ axisLine: polarRadiusAxisConfig.axisLine ?? { stroke: colors.comment, strokeOpacity: 0.3 },
1467
+ orientation: polarRadiusAxisConfig.orientation,
1468
+ reversed: polarRadiusAxisConfig.reversed,
1469
+ ticks: polarRadiusAxisConfig.ticks ? polarRadiusAxisConfig.ticks.map((tick, index) => {
1470
+ if (typeof tick === "object" && tick !== null) {
1471
+ return { ...tick, index };
1472
+ }
1473
+ return tick;
1474
+ }) : void 0
1475
+ }
1476
+ ),
1477
+ tooltip?.show !== false && (() => {
1478
+ const { contentStyle, itemStyle, labelStyle, show, ...rest } = tooltip || {};
1479
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1480
+ import_recharts6.Tooltip,
1481
+ {
1482
+ ...rest,
1483
+ contentStyle: {
1484
+ backgroundColor: colors.background,
1485
+ border: `1px solid ${colors.text}`,
1486
+ borderRadius: theme.shape.borderRadius ?? 8,
1487
+ color: colors.text,
1488
+ boxShadow: "0 4px 6px -1px rgb(0 0 0 / 0.1)",
1489
+ ...contentStyle
1490
+ },
1491
+ itemStyle: {
1492
+ color: colors.text,
1493
+ fontSize: 12,
1494
+ ...itemStyle
1495
+ },
1496
+ labelStyle: {
1497
+ color: colors.text,
1498
+ fontWeight: 600,
1499
+ marginBottom: 4,
1500
+ ...labelStyle
1501
+ }
1502
+ }
1503
+ );
1504
+ })(),
1505
+ legendConfig.show && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1506
+ import_recharts6.Legend,
1507
+ {
1508
+ align: legendConfig.align,
1509
+ verticalAlign: legendConfig.verticalAlign,
1510
+ layout: legendConfig.layout,
1511
+ iconType: legendConfig.iconType || "circle",
1512
+ formatter: (value) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { style: { color: colors.text, fontSize: 13, fontWeight: 500 }, children: value }),
1513
+ wrapperStyle: { paddingTop: 20 }
1514
+ }
1515
+ ),
1516
+ radialBars?.map((bar, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1517
+ import_recharts6.RadialBar,
1518
+ {
1519
+ name: bar.name,
1520
+ dataKey: bar.dataKey,
1521
+ fill: bar.fill || barColors[index % barColors.length],
1522
+ background: bar.background ?? { fill: colors.comment, opacity: 0.1 },
1523
+ cornerRadius: bar.cornerRadius,
1524
+ minPointSize: bar.minPointSize,
1525
+ maxBarSize: bar.maxBarSize,
1526
+ hide: bar.hide,
1527
+ label: bar.label,
1528
+ stackId: bar.stackId,
1529
+ legendType: bar.legendType,
1530
+ tooltipType: bar.tooltipType,
1531
+ isAnimationActive: bar.isAnimationActive,
1532
+ animationDuration: bar.animationDuration,
1533
+ animationBegin: bar.animationBegin,
1534
+ animationEasing: bar.animationEasing,
1535
+ onClick: bar.onClick,
1536
+ onMouseDown: bar.onMouseDown,
1537
+ onMouseUp: bar.onMouseUp,
1538
+ onMouseMove: bar.onMouseMove,
1539
+ onMouseOver: bar.onMouseOver,
1540
+ onMouseOut: bar.onMouseOut,
1541
+ onMouseEnter: bar.onMouseEnter,
1542
+ onMouseLeave: bar.onMouseLeave,
1543
+ onAnimationStart: bar.onAnimationStart,
1544
+ onAnimationEnd: bar.onAnimationEnd
1545
+ },
1546
+ `${bar.dataKey}-${index}`
1547
+ )),
1548
+ children
1549
+ ]
1550
+ }
1551
+ ) });
1552
+ };
1553
+ RadialBarChart.displayName = "RadialBarChart";
1554
+ var RadialBarChart_default = RadialBarChart;
1555
+
1556
+ // src/index.ts
1557
+ var import_recharts7 = require("recharts");
1558
+ //# sourceMappingURL=index.cjs.map