@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,267 @@
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 RadialBarChartProps {
21
+ /**
22
+ * Data to be displayed in the chart.
23
+ */
24
+ data?: any[];
25
+ /**
26
+ * Configuration for the radial bars in the chart.
27
+ */
28
+ radialBars?: Array<{
29
+ dataKey: string;
30
+ name?: string;
31
+ fill?: string;
32
+ background?: boolean | any;
33
+ cornerRadius?: number | string;
34
+ minPointSize?: number;
35
+ maxBarSize?: number;
36
+ /**
37
+ * If true, the radial bar will be hidden.
38
+ */
39
+ hide?: boolean;
40
+ /**
41
+ * Configuration for the radial bar's label.
42
+ */
43
+ label?: boolean | any;
44
+ /**
45
+ * The ID of stack.
46
+ */
47
+ stackId?: string | number;
48
+ /**
49
+ * The type of icon in legend.
50
+ */
51
+ legendType?: 'line' | 'plainline' | 'square' | 'rect' | 'circle' | 'cross' | 'diamond' | 'star' | 'triangle' | 'wye' | 'none';
52
+ /**
53
+ * The type of tooltip.
54
+ */
55
+ tooltipType?: 'none';
56
+ /**
57
+ * If true, the radial bar will be animated.
58
+ * @default true
59
+ */
60
+ isAnimationActive?: boolean;
61
+ /**
62
+ * Duration of the animation in ms.
63
+ * @default 1500
64
+ */
65
+ animationDuration?: number;
66
+ /**
67
+ * Delay before the animation begins in ms.
68
+ * @default 0
69
+ */
70
+ animationBegin?: number;
71
+ /**
72
+ * Easing function for the animation.
73
+ * @default 'ease'
74
+ */
75
+ animationEasing?: 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear';
76
+ /**
77
+ * Event handlers for individual radial bars.
78
+ */
79
+ onClick?: (props: any, index: number, e: React.MouseEvent) => void;
80
+ onMouseDown?: (props: any, index: number, e: React.MouseEvent) => void;
81
+ onMouseUp?: (props: any, index: number, e: React.MouseEvent) => void;
82
+ onMouseMove?: (props: any, index: number, e: React.MouseEvent) => void;
83
+ onMouseOver?: (props: any, index: number, e: React.MouseEvent) => void;
84
+ onMouseOut?: (props: any, index: number, e: React.MouseEvent) => void;
85
+ onMouseEnter?: (props: any, index: number, e: React.MouseEvent) => void;
86
+ onMouseLeave?: (props: any, index: number, e: React.MouseEvent) => void;
87
+ onAnimationStart?: () => void;
88
+ onAnimationEnd?: () => void;
89
+ }>;
90
+ /**
91
+ * Custom colors for the radial bars.
92
+ */
93
+ colors?: string[];
94
+ /**
95
+ * Height of the chart.
96
+ * @default 300
97
+ */
98
+ height?: number | `${number}%`;
99
+ /**
100
+ * Width of the chart.
101
+ * @default '100%'
102
+ */
103
+ width?: number | `${number}%`;
104
+ /**
105
+ * Legend configuration.
106
+ */
107
+ legend?: {
108
+ show?: boolean;
109
+ align?: 'left' | 'center' | 'right';
110
+ verticalAlign?: 'top' | 'middle' | 'bottom';
111
+ layout?: 'horizontal' | 'vertical';
112
+ iconType?: 'line' | 'plainline' | 'square' | 'rect' | 'circle' | 'cross' | 'diamond' | 'star' | 'triangle' | 'wye';
113
+ };
114
+ /**
115
+ * Tooltip configuration.
116
+ */
117
+ tooltip?: {
118
+ show?: boolean;
119
+ } & React.ComponentProps<typeof Tooltip>;
120
+ /**
121
+ * Inner radius of the chart.
122
+ * @default 0
123
+ */
124
+ innerRadius?: number | string;
125
+ /**
126
+ * Outer radius of the chart.
127
+ * @default '80%'
128
+ */
129
+ outerRadius?: number | string;
130
+ /**
131
+ * The x-coordinate of center.
132
+ * @default '50%'
133
+ */
134
+ cx?: number | string;
135
+ /**
136
+ * The y-coordinate of center.
137
+ * @default '50%'
138
+ */
139
+ cy?: number | string;
140
+ /**
141
+ * Angle in degrees from which the chart should start.
142
+ * @default 0
143
+ */
144
+ startAngle?: number;
145
+ /**
146
+ * Angle, in degrees, at which the chart should end.
147
+ * @default 360
148
+ */
149
+ endAngle?: number;
150
+ /**
151
+ * Margin around the chart.
152
+ */
153
+ margin?: {
154
+ top?: number;
155
+ right?: number;
156
+ bottom?: number;
157
+ left?: number;
158
+ };
159
+ /**
160
+ * Fixed bar size.
161
+ */
162
+ barSize?: number | string;
163
+ /**
164
+ * Gap between two bar categories.
165
+ */
166
+ barCategoryGap?: number | string;
167
+ /**
168
+ * Gap between two bars in the same category.
169
+ */
170
+ barGap?: number | string;
171
+ /**
172
+ * Maximum bar size.
173
+ */
174
+ maxBarSize?: number;
175
+ /**
176
+ * Grid configuration.
177
+ */
178
+ polarGrid?: {
179
+ show?: boolean;
180
+ gridType?: 'polygon' | 'circle';
181
+ radialLines?: boolean;
182
+ polarAngles?: number[];
183
+ polarRadius?: number[];
184
+ };
185
+ /**
186
+ * Angle axis configuration.
187
+ */
188
+ polarAngleAxis?: {
189
+ show?: boolean;
190
+ dataKey?: string;
191
+ tick?: boolean | any;
192
+ axisLine?: boolean | any;
193
+ axisLineType?: 'polygon' | 'circle';
194
+ orientation?: 'inner' | 'outer';
195
+ ticks?: Array<{
196
+ value: any;
197
+ coordinate: number;
198
+ }>;
199
+ };
200
+ /**
201
+ * Radius axis configuration.
202
+ */
203
+ polarRadiusAxis?: {
204
+ show?: boolean;
205
+ angle?: number;
206
+ domain?: [any, any];
207
+ tick?: boolean | any;
208
+ axisLine?: boolean | any;
209
+ orientation?: 'left' | 'right' | 'middle';
210
+ reversed?: boolean;
211
+ ticks?: Array<{
212
+ value: any;
213
+ coordinate: number;
214
+ }>;
215
+ };
216
+ /**
217
+ * Charts with the same syncId will synchronize Tooltip and Brush events.
218
+ */
219
+ syncId?: number | string;
220
+ /**
221
+ * Customize how the charts will synchronize tooltips and brushes.
222
+ */
223
+ syncMethod?: 'index' | 'value' | ((ticks: readonly any[], data: any) => number);
224
+ /**
225
+ * ARIA role for the chart.
226
+ */
227
+ role?: string;
228
+ /**
229
+ * Accessible title and description.
230
+ */
231
+ title?: string;
232
+ desc?: string;
233
+ id?: string;
234
+ className?: string;
235
+ style?: React.CSSProperties;
236
+ tabIndex?: number;
237
+ /**
238
+ * Determines how values are stacked.
239
+ * @default 'none'
240
+ */
241
+ stackOffset?: 'expand' | 'none' | 'wiggle' | 'silhouette' | 'sign' | 'positive';
242
+ /**
243
+ * If false, the stack will be ordered from bottom to top.
244
+ * @default false
245
+ */
246
+ reverseStackOrder?: boolean;
247
+ /**
248
+ * Event handlers for the entire chart.
249
+ */
250
+ onClick?: (data: any, event: React.MouseEvent) => void;
251
+ onMouseDown?: (data: any, event: React.MouseEvent) => void;
252
+ onMouseUp?: (data: any, event: React.MouseEvent) => void;
253
+ onMouseMove?: (data: any, event: React.MouseEvent) => void;
254
+ onMouseEnter?: (data: any, event: React.MouseEvent) => void;
255
+ onMouseLeave?: (data: any, event: React.MouseEvent) => void;
256
+ onContextMenu?: (data: any, event: React.MouseEvent) => void;
257
+ onDoubleClick?: (data: any, event: React.MouseEvent) => void;
258
+ /**
259
+ * If true, an accessibility layer will be added to the chart.
260
+ * @default true
261
+ */
262
+ accessibilityLayer?: boolean;
263
+ /**
264
+ * Optional children for composition.
265
+ */
266
+ children?: React.ReactNode;
267
+ }
@@ -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 RadialBarChart } from './RadialBarChart';
19
+ export * from './RadialBarChart';