@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.
@@ -0,0 +1,206 @@
1
+ /**
2
+ * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ import React from 'react';
19
+ import { Tooltip } from 'recharts';
20
+ export interface PieChartProps {
21
+ /**
22
+ * Data to be displayed in the chart.
23
+ */
24
+ data?: any[];
25
+ /**
26
+ * Configuration for the pies in the chart.
27
+ */
28
+ pies?: Array<{
29
+ dataKey: string;
30
+ nameKey?: string;
31
+ name?: string;
32
+ cx?: number | string;
33
+ cy?: number | string;
34
+ innerRadius?: number | string;
35
+ outerRadius?: number | string;
36
+ paddingAngle?: number;
37
+ startAngle?: number;
38
+ endAngle?: number;
39
+ cornerRadius?: number | string;
40
+ minAngle?: number;
41
+ isAnimationActive?: boolean;
42
+ animationDuration?: number;
43
+ animationBegin?: number;
44
+ animationEasing?: 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear';
45
+ label?: any;
46
+ labelLine?: any;
47
+ onClick?: (data: any, index: number, event: React.MouseEvent) => void;
48
+ onMouseEnter?: (data: any, index: number, event: React.MouseEvent) => void;
49
+ onMouseLeave?: (data: any, index: number, event: React.MouseEvent) => void;
50
+ onMouseDown?: (data: any, index: number, event: React.MouseEvent) => void;
51
+ onMouseUp?: (data: any, index: number, event: React.MouseEvent) => void;
52
+ onMouseMove?: (data: any, index: number, event: React.MouseEvent) => void;
53
+ onContextMenu?: (data: any, index: number, event: React.MouseEvent) => void;
54
+ onDoubleClick?: (data: any, index: number, event: React.MouseEvent) => void;
55
+ }>;
56
+ /**
57
+ * Default key of each sector's name in data.
58
+ */
59
+ nameKey?: string;
60
+ /**
61
+ * Height of the chart.
62
+ * @default 300
63
+ */
64
+ height?: number | `${number}%`;
65
+ /**
66
+ * Width of the chart.
67
+ * @default '100%'
68
+ */
69
+ width?: number | `${number}%`;
70
+ /**
71
+ * Legend configuration.
72
+ */
73
+ legend?: {
74
+ show?: boolean;
75
+ align?: 'left' | 'center' | 'right';
76
+ verticalAlign?: 'top' | 'middle' | 'bottom';
77
+ };
78
+ /**
79
+ * Tooltip configuration.
80
+ */
81
+ tooltip?: {
82
+ show?: boolean;
83
+ } & React.ComponentProps<typeof Tooltip>;
84
+ /**
85
+ * Margin around the chart.
86
+ */
87
+ margin?: {
88
+ top?: number;
89
+ right?: number;
90
+ bottom?: number;
91
+ left?: number;
92
+ };
93
+ /**
94
+ * Default x-coordinate of center.
95
+ * @default '50%'
96
+ */
97
+ cx?: number | string;
98
+ /**
99
+ * Default y-coordinate of center.
100
+ * @default '50%'
101
+ */
102
+ cy?: number | string;
103
+ /**
104
+ * Default angle in degrees from which the chart should start.
105
+ * @default 0
106
+ */
107
+ startAngle?: number;
108
+ /**
109
+ * Default angle, in degrees, at which the chart should end.
110
+ * @default 360
111
+ */
112
+ endAngle?: number;
113
+ /**
114
+ * Default inner radius of all the sectors.
115
+ * @default 0
116
+ */
117
+ innerRadius?: number | string;
118
+ /**
119
+ * Default outer radius of all the sectors.
120
+ * @default '80%'
121
+ */
122
+ outerRadius?: number | string;
123
+ /**
124
+ * Default padding angle between sectors.
125
+ * @default 0
126
+ */
127
+ paddingAngle?: number;
128
+ /**
129
+ * Default corner radius of all the sectors.
130
+ * @default 0
131
+ */
132
+ cornerRadius?: number | string;
133
+ /**
134
+ * Default minimum angle of each unzero data.
135
+ * @default 0
136
+ */
137
+ minAngle?: number;
138
+ /**
139
+ * If true, the chart will be animated by default.
140
+ * @default true
141
+ */
142
+ isAnimationActive?: boolean;
143
+ /**
144
+ * Default duration of the animation in ms.
145
+ * @default 1500
146
+ */
147
+ animationDuration?: number;
148
+ /**
149
+ * Default delay before the animation begins in ms.
150
+ * @default 0
151
+ */
152
+ animationBegin?: number;
153
+ /**
154
+ * Default easing function for the animation.
155
+ * @default 'ease'
156
+ */
157
+ animationEasing?: 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear';
158
+ /**
159
+ * Custom colors for the sectors.
160
+ */
161
+ colors?: string[];
162
+ /**
163
+ * Default labels for each pie sector.
164
+ */
165
+ label?: any;
166
+ /**
167
+ * Default label lines.
168
+ */
169
+ labelLine?: any;
170
+ /**
171
+ * Default click event handler.
172
+ */
173
+ onClick?: (data: any, index: number, event: React.MouseEvent) => void;
174
+ /**
175
+ * Default mouse enter event handler.
176
+ */
177
+ onMouseEnter?: (data: any, index: number, event: React.MouseEvent) => void;
178
+ /**
179
+ * Default mouse leave event handler.
180
+ */
181
+ onMouseLeave?: (data: any, index: number, event: React.MouseEvent) => void;
182
+ /**
183
+ * Default mouse down event handler.
184
+ */
185
+ onMouseDown?: (data: any, index: number, event: React.MouseEvent) => void;
186
+ /**
187
+ * Default mouse up event handler.
188
+ */
189
+ onMouseUp?: (data: any, index: number, event: React.MouseEvent) => void;
190
+ /**
191
+ * Default mouse move event handler.
192
+ */
193
+ onMouseMove?: (data: any, index: number, event: React.MouseEvent) => void;
194
+ /**
195
+ * Default context menu event handler.
196
+ */
197
+ onContextMenu?: (data: any, index: number, event: React.MouseEvent) => void;
198
+ /**
199
+ * Default double click event handler.
200
+ */
201
+ onDoubleClick?: (data: any, index: number, event: React.MouseEvent) => void;
202
+ /**
203
+ * Optional children for composition.
204
+ */
205
+ children?: React.ReactNode;
206
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ export { default } from './PieChart';
19
+ export * from './PieChart';
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ import React from 'react';
19
+ import { RadarChartProps } from './RadarChart.types';
20
+ /**
21
+ * RadarChart component for Oxygen UI powered by Recharts.
22
+ */
23
+ declare const RadarChart: {
24
+ ({ data, radars, radialBars, angleKey, height, width, legend, tooltip, innerRadius, outerRadius, cx, cy, startAngle, endAngle, margin, polarGrid, polarAngleAxis, polarRadiusAxis, syncId, syncMethod, role, title, desc, id, className, style, tabIndex, layout, stackOffset, reverseStackOrder, barSize, barCategoryGap, barGap, maxBarSize, onClick, onMouseDown, onMouseUp, onMouseMove, onMouseEnter, onMouseLeave, onContextMenu, onDoubleClick, accessibilityLayer, colors: customColors, children, }: RadarChartProps): React.ReactElement;
25
+ displayName: string;
26
+ };
27
+ export default RadarChart;
@@ -0,0 +1,303 @@
1
+ /**
2
+ * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ import React from 'react';
19
+ import { Tooltip } from 'recharts';
20
+ export interface RadarChartProps {
21
+ /**
22
+ * Data to be displayed in the chart.
23
+ */
24
+ data?: any[];
25
+ /**
26
+ * Configuration for the radars in the chart.
27
+ */
28
+ radars?: Array<{
29
+ dataKey: string;
30
+ name?: string;
31
+ stroke?: string;
32
+ strokeWidth?: number;
33
+ strokeDasharray?: string | number;
34
+ fill?: string;
35
+ fillOpacity?: number;
36
+ /**
37
+ * If true, the radar will be hidden.
38
+ */
39
+ hide?: boolean;
40
+ /**
41
+ * Configuration for the radar's label.
42
+ */
43
+ label?: boolean | any;
44
+ /**
45
+ * If false, dots will not be drawn.
46
+ * @default true
47
+ */
48
+ dot?: boolean | any;
49
+ /**
50
+ * The dot is shown when user enter a radar chart and this chart has tooltip.
51
+ * @default true
52
+ */
53
+ activeDot?: boolean | any;
54
+ /**
55
+ * Whether to connect the radar across null points.
56
+ * @default false
57
+ */
58
+ connectNulls?: boolean;
59
+ /**
60
+ * The type of icon in legend.
61
+ */
62
+ legendType?: 'line' | 'plainline' | 'square' | 'rect' | 'circle' | 'cross' | 'diamond' | 'star' | 'triangle' | 'wye' | 'none';
63
+ /**
64
+ * The type of tooltip.
65
+ */
66
+ tooltipType?: 'none';
67
+ /**
68
+ * Event handlers for individual radars.
69
+ */
70
+ onMouseEnter?: (props: any, e: React.MouseEvent) => void;
71
+ onMouseLeave?: (props: any, e: React.MouseEvent) => void;
72
+ onClick?: (props: any, e: React.MouseEvent) => void;
73
+ /**
74
+ * If true, the radar will be animated.
75
+ * @default true
76
+ */
77
+ isAnimationActive?: boolean;
78
+ /**
79
+ * Duration of the animation in ms.
80
+ * @default 1500
81
+ */
82
+ animationDuration?: number;
83
+ /**
84
+ * Delay before the animation begins in ms.
85
+ * @default 0
86
+ */
87
+ animationBegin?: number;
88
+ /**
89
+ * Easing function for the animation.
90
+ * @default 'ease'
91
+ */
92
+ animationEasing?: 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear';
93
+ }>;
94
+ /**
95
+ * Custom colors for the radars.
96
+ */
97
+ colors?: string[];
98
+ /**
99
+ * Configuration for radial bars in the chart.
100
+ */
101
+ radialBars?: Array<{
102
+ dataKey: string;
103
+ name?: string;
104
+ fill?: string;
105
+ background?: boolean | any;
106
+ cornerRadius?: number | string;
107
+ minPointSize?: number;
108
+ maxBarSize?: number;
109
+ hide?: boolean;
110
+ label?: boolean | any;
111
+ stackId?: string | number;
112
+ isAnimationActive?: boolean;
113
+ animationDuration?: number;
114
+ animationBegin?: number;
115
+ animationEasing?: 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear';
116
+ onClick?: (props: any, e: React.MouseEvent) => void;
117
+ onMouseEnter?: (props: any, e: React.MouseEvent) => void;
118
+ onMouseLeave?: (props: any, e: React.MouseEvent) => void;
119
+ }>;
120
+ /**
121
+ * The key of each sector's label in data.
122
+ */
123
+ angleKey?: string;
124
+ /**
125
+ * Height of the chart.
126
+ * @default 300
127
+ */
128
+ height?: number | `${number}%`;
129
+ /**
130
+ * Width of the chart.
131
+ * @default '100%'
132
+ */
133
+ width?: number | `${number}%`;
134
+ /**
135
+ * Legend configuration.
136
+ */
137
+ legend?: {
138
+ show?: boolean;
139
+ align?: 'left' | 'center' | 'right';
140
+ verticalAlign?: 'top' | 'middle' | 'bottom';
141
+ layout?: 'horizontal' | 'vertical';
142
+ iconType?: 'line' | 'plainline' | 'square' | 'rect' | 'circle' | 'cross' | 'diamond' | 'star' | 'triangle' | 'wye';
143
+ };
144
+ /**
145
+ * Tooltip configuration.
146
+ */
147
+ tooltip?: {
148
+ show?: boolean;
149
+ } & React.ComponentProps<typeof Tooltip>;
150
+ /**
151
+ * Inner radius of the chart.
152
+ * @default 0
153
+ */
154
+ innerRadius?: number | string;
155
+ /**
156
+ * Outer radius of the chart.
157
+ * @default '80%'
158
+ */
159
+ outerRadius?: number | string;
160
+ /**
161
+ * The x-coordinate of center.
162
+ * @default '50%'
163
+ */
164
+ cx?: number | string;
165
+ /**
166
+ * The y-coordinate of center.
167
+ * @default '50%'
168
+ */
169
+ cy?: number | string;
170
+ /**
171
+ * Angle in degrees from which the chart should start.
172
+ * @default 90
173
+ */
174
+ startAngle?: number;
175
+ /**
176
+ * Angle, in degrees, at which the chart should end.
177
+ * @default -270
178
+ */
179
+ endAngle?: number;
180
+ /**
181
+ * Margin around the chart.
182
+ */
183
+ margin?: {
184
+ top?: number;
185
+ right?: number;
186
+ bottom?: number;
187
+ left?: number;
188
+ };
189
+ /**
190
+ * Grid configuration.
191
+ */
192
+ polarGrid?: {
193
+ show?: boolean;
194
+ gridType?: 'polygon' | 'circle';
195
+ radialLines?: boolean;
196
+ polarAngles?: number[];
197
+ polarRadius?: number[];
198
+ };
199
+ /**
200
+ * Angle axis configuration.
201
+ */
202
+ polarAngleAxis?: {
203
+ show?: boolean;
204
+ dataKey?: string;
205
+ tick?: boolean | any;
206
+ axisLine?: boolean | any;
207
+ axisLineType?: 'polygon' | 'circle';
208
+ orientation?: 'inner' | 'outer';
209
+ ticks?: Array<{
210
+ value: any;
211
+ coordinate: number;
212
+ }>;
213
+ };
214
+ /**
215
+ * Radius axis configuration.
216
+ */
217
+ polarRadiusAxis?: {
218
+ show?: boolean;
219
+ angle?: number;
220
+ domain?: [any, any];
221
+ tick?: boolean | any;
222
+ axisLine?: boolean | any;
223
+ orientation?: 'left' | 'right' | 'middle';
224
+ reversed?: boolean;
225
+ ticks?: Array<{
226
+ value: any;
227
+ coordinate: number;
228
+ }>;
229
+ };
230
+ /**
231
+ * Charts with the same syncId will synchronize Tooltip and Brush events.
232
+ */
233
+ syncId?: number | string;
234
+ /**
235
+ * Customize how the charts will synchronize tooltips and brushes.
236
+ * @default 'index'
237
+ */
238
+ syncMethod?: 'index' | 'value' | ((ticks: readonly any[], data: any) => number);
239
+ /**
240
+ * ARIA role for the chart.
241
+ */
242
+ role?: string;
243
+ /**
244
+ * Accessible title and description.
245
+ */
246
+ title?: string;
247
+ desc?: string;
248
+ id?: string;
249
+ className?: string;
250
+ style?: React.CSSProperties;
251
+ tabIndex?: number;
252
+ /**
253
+ * The layout of chart defines the orientation of axes, graphical items, and tooltip.
254
+ * @default 'centric'
255
+ */
256
+ layout?: 'centric' | 'radial';
257
+ /**
258
+ * Determines how values are stacked.
259
+ * @default 'none'
260
+ */
261
+ stackOffset?: 'expand' | 'none' | 'wiggle' | 'silhouette' | 'sign' | 'positive';
262
+ /**
263
+ * If false, the stack will be ordered from bottom to top.
264
+ * @default false
265
+ */
266
+ reverseStackOrder?: boolean;
267
+ /**
268
+ * Fixed bar size for radial bars.
269
+ */
270
+ barSize?: number | string;
271
+ /**
272
+ * Gap between two bar categories.
273
+ */
274
+ barCategoryGap?: number | string;
275
+ /**
276
+ * Gap between two bars in the same category.
277
+ */
278
+ barGap?: number | string;
279
+ /**
280
+ * Maximum bar size.
281
+ */
282
+ maxBarSize?: number;
283
+ /**
284
+ * Event handlers for the entire chart.
285
+ */
286
+ onClick?: (data: any, event: React.MouseEvent) => void;
287
+ onMouseDown?: (data: any, event: React.MouseEvent) => void;
288
+ onMouseUp?: (data: any, event: React.MouseEvent) => void;
289
+ onMouseMove?: (data: any, event: React.MouseEvent) => void;
290
+ onMouseEnter?: (data: any, event: React.MouseEvent) => void;
291
+ onMouseLeave?: (data: any, event: React.MouseEvent) => void;
292
+ onContextMenu?: (data: any, event: React.MouseEvent) => void;
293
+ onDoubleClick?: (data: any, event: React.MouseEvent) => void;
294
+ /**
295
+ * If true, an accessibility layer will be added to the chart.
296
+ * @default true
297
+ */
298
+ accessibilityLayer?: boolean;
299
+ /**
300
+ * Optional children for composition.
301
+ */
302
+ children?: React.ReactNode;
303
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ export { default as RadarChart } from './RadarChart';
19
+ export * from './RadarChart';
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ import React from 'react';
19
+ import { RadialBarChartProps } from './RadialBarChart.types';
20
+ /**
21
+ * RadialBarChart component for Oxygen UI powered by Recharts.
22
+ */
23
+ declare const RadialBarChart: {
24
+ ({ data, radialBars, height, width, legend, tooltip, innerRadius, outerRadius, cx, cy, startAngle, endAngle, margin, barSize, barCategoryGap, barGap, maxBarSize, polarGrid, polarAngleAxis, polarRadiusAxis, syncId, syncMethod, role, title, desc, id, className, style, tabIndex, stackOffset, reverseStackOrder, onClick, onMouseDown, onMouseUp, onMouseMove, onMouseEnter, onMouseLeave, onContextMenu, onDoubleClick, accessibilityLayer, colors: customColors, children, }: RadialBarChartProps): React.ReactElement;
25
+ displayName: string;
26
+ };
27
+ export default RadialBarChart;