@react-fabric/chart 1.0.0-beta.5 → 1.0.0-beta.52

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.
Files changed (46) hide show
  1. package/{src/wrapper/Chart.module.css → css/_chart.css} +5 -5
  2. package/css/styles.css +24 -0
  3. package/dist/cjs/charts/ActivityMap.js +22 -1
  4. package/dist/cjs/charts/CountSeries.js +27 -1
  5. package/dist/cjs/charts/DataSeries.js +26 -1
  6. package/dist/cjs/charts/Generic.js +14 -0
  7. package/dist/cjs/charts/MapSeries.js +24 -1
  8. package/dist/cjs/charts/TimeSeries.js +24 -1
  9. package/dist/cjs/charts/TimeSlider.js +21 -1
  10. package/dist/cjs/charts/WordBubble.js +25 -1
  11. package/dist/cjs/wrapper/ChartContainer.js +1 -2
  12. package/dist/cjs/wrapper/ChartToolbar.js +1 -2
  13. package/dist/esm/charts/ActivityMap.js +22 -1
  14. package/dist/esm/charts/CountSeries.js +27 -1
  15. package/dist/esm/charts/DataSeries.js +26 -1
  16. package/dist/esm/charts/Generic.js +14 -0
  17. package/dist/esm/charts/MapSeries.js +24 -1
  18. package/dist/esm/charts/TimeSeries.js +24 -1
  19. package/dist/esm/charts/TimeSlider.js +21 -1
  20. package/dist/esm/charts/WordBubble.js +25 -1
  21. package/dist/esm/wrapper/ChartContainer.js +1 -2
  22. package/dist/esm/wrapper/ChartToolbar.js +1 -2
  23. package/dist/types/charts/ActivityMap.d.ts +22 -1
  24. package/dist/types/charts/CountSeries.d.ts +27 -1
  25. package/dist/types/charts/DataSeries.d.ts +26 -1
  26. package/dist/types/charts/Generic.d.ts +15 -2
  27. package/dist/types/charts/MapSeries.d.ts +24 -1
  28. package/dist/types/charts/TimeSeries.d.ts +24 -1
  29. package/dist/types/charts/TimeSlider.d.ts +21 -1
  30. package/dist/types/charts/WordBubble.d.ts +25 -1
  31. package/dist/types/types/world.svg.d.ts +1 -1
  32. package/dist/types/wrapper/ChartContainer.d.ts +2 -2
  33. package/dist/types/wrapper/ChartWrapper.d.ts +0 -1
  34. package/package.json +11 -9
  35. package/src/charts/ActivityMap.tsx +22 -1
  36. package/src/charts/CountSeries.tsx +27 -1
  37. package/src/charts/DataSeries.tsx +26 -1
  38. package/src/charts/Generic.tsx +15 -2
  39. package/src/charts/MapSeries.tsx +24 -1
  40. package/src/charts/TimeSeries.tsx +24 -1
  41. package/src/charts/TimeSlider.tsx +21 -1
  42. package/src/charts/WordBubble.tsx +25 -1
  43. package/src/wrapper/ChartContainer.tsx +3 -4
  44. package/src/wrapper/ChartToolbar.tsx +1 -2
  45. package/dist/cjs/wrapper/Chart.module.css +0 -1
  46. package/dist/esm/wrapper/Chart.module.css +0 -1
@@ -44,7 +44,7 @@
44
44
 
45
45
  overflow: hidden;
46
46
 
47
- color: theme(colors.primary.500);
47
+ color: var(--color-primary-500);
48
48
 
49
49
  appearance: none;
50
50
  border-radius: 999px;
@@ -59,7 +59,7 @@
59
59
 
60
60
  appearance: none;
61
61
  opacity: 0.7;
62
- background: theme(colors.primary.500);
62
+ background: var(--color-primary-500);
63
63
  clip-path: polygon(
64
64
  100% -1px,
65
65
  0.125rem -1px,
@@ -71,18 +71,18 @@
71
71
  calc(100% + 1px) calc(100% + 1px)
72
72
  );
73
73
  filter: brightness(100%);
74
- border: 1px solid theme(colors.tint.50);
74
+ border: 1px solid var(--color-tint-50);
75
75
  border-radius: 0.5rem;
76
76
  box-shadow: calc(-100vmax - 1rem) 0 0 100vmax currentColor;
77
77
 
78
78
  &:hover {
79
- background: theme(colors.primary.600);
79
+ background: var(--color-primary-600);
80
80
  }
81
81
  }
82
82
 
83
83
  &&::-webkit-slider-runnable-track {
84
84
  height: 1rem;
85
- background: linear-gradient(theme(colors.tint.100) 0 0) scroll no-repeat
85
+ background: linear-gradient(var(--color-tint-100) 0 0) scroll no-repeat
86
86
  center / 100% 0.25rem;
87
87
  border-radius: 99px;
88
88
  }
package/css/styles.css ADDED
@@ -0,0 +1,24 @@
1
+ /*
2
+ * React Fabric
3
+ * @version: 1.0.0
4
+ *
5
+ *
6
+ * The MIT License (MIT)
7
+ * Copyright (c) 2025 Adarsh Pastakia
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
10
+ * and associated documentation files (the "Software"), to deal in the Software without restriction,
11
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
12
+ * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
13
+ * subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all copies or substantial
16
+ * portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
19
+ * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ */
23
+
24
+ @import "./_chart.css";
@@ -172,7 +172,28 @@ var ActivityMapChart = /*#__PURE__*/react.memo(function (_ref) {
172
172
  ActivityMapChart.displayName = "ActivityMapChart";
173
173
 
174
174
  /**
175
- * Chart showing activity map
175
+ * ActivityMap component renders a chart that visualizes activity data
176
+ * over time, using either a scatter plot or a heatmap.
177
+ * It allows users to switch between different types of visualizations
178
+ * and customize the color palette used in the chart.
179
+ *
180
+ * @param {ActivityMapProps} props - The properties for the ActivityMap component.
181
+ * @returns {JSX.Element} The rendered ActivityMap component.
182
+ *
183
+ * @example
184
+ * ```jsx
185
+ * <ActivityMap
186
+ * data={activityData}
187
+ * time="day-hour"
188
+ * type="heatmap"
189
+ * heatmapPalette={["#f0f8ff", "#faebd7", "#00ffff", "#7fffd4"]}
190
+ * highLabels={["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]}
191
+ * lowLabels={["12a", "1a", "2a", "3a", "4a", "5a", "6a", "7a", "8a", "9a", "10a", "11a", "12p", "1p", "2p", "3p", "4p", "5p", "6p", "7p", "8p", "9p", "10p", "11p"]}
192
+ * onClick={(highIndex, lowIndex) => console.log(`Clicked on: ${highIndex}, ${lowIndex}`)}
193
+ * />
194
+ * ```
195
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/charts-activitymap--docs} for more details on the properties.
196
+ * @see {@link https://echarts.apache.org/en/option.html#series-scatter} for more details on the ECharts scatter series.
176
197
  */
177
198
  var ActivityMap = function ActivityMap(props) {
178
199
  return /*#__PURE__*/jsxRuntime.jsx(ChartWrapper.ChartWrapper, {
@@ -145,7 +145,33 @@ var CountSeriesChart = /*#__PURE__*/react.memo(function (_ref) {
145
145
  CountSeriesChart.displayName = "CountSeriesChart";
146
146
 
147
147
  /**
148
- * Chart to display simple data count series
148
+ * CountSeries component renders a chart that displays counts of items in various formats.
149
+ * It supports pie, bar, and column charts.
150
+ * It can be used to visualize the distribution of counts across different categories.
151
+ * It allows users to switch between different types of visualizations and customize the color palette used in the chart.
152
+ *
153
+ * @param {CountSeriesProps} props - The properties for the CountSeries component.
154
+ * @returns {JSX.Element} The rendered CountSeries component.
155
+ *
156
+ * @example
157
+ * ```jsx
158
+ * <CountSeries
159
+ * data={[
160
+ * { id: "A", label: "Category A", count: 10 },
161
+ * { id: "B", label: "Category B", count: 20 },
162
+ * { id: "C", label: "Category C", count: 30 },
163
+ * ]}
164
+ * title="Count Distribution"
165
+ * onExport={() => console.log("Exporting chart data")}
166
+ * theme="light"
167
+ * type="pie"
168
+ * onClick={(key) => console.log("Clicked on:", key)}
169
+ * />
170
+ * ```
171
+ *
172
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/charts-countseries--docs} for more details on the properties.
173
+ * @see {@link https://echarts.apache.org/en/option.html#series-pie} for more details on the ECharts pie series options.
174
+ * @see {@link https://echarts.apache.org/en/option.html#series-bar} for more details on the ECharts bar series options.
149
175
  */
150
176
  var CountSeries = function CountSeries(props) {
151
177
  return /*#__PURE__*/jsxRuntime.jsx(ChartWrapper.ChartWrapper, {
@@ -174,7 +174,32 @@ var DataSeriesChart = /*#__PURE__*/react.memo(function (_ref) {
174
174
  DataSeriesChart.displayName = "DataSeriesChart";
175
175
 
176
176
  /**
177
- * Chart to display simple data category series
177
+ * DataSeries component renders a chart for visualizing data series.
178
+ * It supports various chart types such as column, line, bar, radar, and stacked variants.
179
+ * It allows users to click on data points to trigger custom actions.
180
+ *
181
+ * @param {DataSeriesProps} props - The properties for the DataSeries component.
182
+ * @returns {JSX.Element} The rendered DataSeries component.
183
+ *
184
+ * @example
185
+ * ```jsx
186
+ * <DataSeries
187
+ * data={[{ id: "1", label: "Series 1", values: [10, 20, 30] }]}
188
+ * categories={["Category 1", "Category 2", "Category 3"]}
189
+ * categoryAxisName="Categories"
190
+ * valueAxisName="Values"
191
+ * title="Data Series Example"
192
+ * type="column"
193
+ * onClick={(data) => console.log("Clicked data:", data)}
194
+ * onExport={() => console.log("Exporting chart data")}
195
+ * theme="light"
196
+ * />
197
+ * ```
198
+ *
199
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/charts-dataseries--docs} for more details on the properties.
200
+ * @see {@link https://echarts.apache.org/en/option.html#series-bar} for ECharts bar series options.
201
+ * @see {@link https://echarts.apache.org/en/option.html#series-line} for ECharts line series options.
202
+ * @see {@link https://echarts.apache.org/en/option.html#series-radar} for ECharts radar series options.
178
203
  */
179
204
  var DataSeries = function DataSeries(props) {
180
205
  return /*#__PURE__*/jsxRuntime.jsx(ChartWrapper.ChartWrapper, {
@@ -81,6 +81,20 @@ var GenericChartBase = /*#__PURE__*/react.memo(function (_ref2) {
81
81
  });
82
82
  });
83
83
  GenericChartBase.displayName = "GenericChart";
84
+
85
+ /**
86
+ * GenericChart component renders a generic chart using ECharts.
87
+ * It accepts various chart options and configurations, allowing for flexible chart rendering.
88
+ * It supports click events, brush events, and custom actions.
89
+ * It can be used to create a wide range of chart types by passing the appropriate ECharts options.
90
+ *
91
+ * @param props - The properties for the GenericChart component, including chart options, event handlers, and custom actions.
92
+ * @returns A React functional component that renders the chart within a ChartWrapper.
93
+ *
94
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/charts-genericchart--docs} for more details on the properties.
95
+ * @see {@link https://echarts.apache.org/en/option.html} for ECharts options documentation.
96
+ * @see {@link https://echarts.apache.org/en/api.html#echartsInstance} for ECharts instance methods and properties.
97
+ */
84
98
  var GenericChart = function GenericChart(props) {
85
99
  return /*#__PURE__*/jsxRuntime.jsx(ChartWrapper.ChartWrapper, {
86
100
  children: /*#__PURE__*/jsxRuntime.jsx(GenericChartBase, _objectSpread({}, props))
@@ -204,7 +204,30 @@ var MapSeriesChart = /*#__PURE__*/react.memo(function (_ref) {
204
204
  MapSeriesChart.displayName = "MapSeriesChart";
205
205
 
206
206
  /**
207
- * Chart to display simple map data series
207
+ * MapSeries component renders a map chart using ECharts.
208
+ * It displays data on a world map, allowing users to visualize counts or other metrics by country.
209
+ * It supports zooming and switching between map and column views.
210
+ *
211
+ * @param {MapSeriesProps} props - The properties for the MapSeries component.
212
+ * @returns {JSX.Element} The rendered MapSeries component.
213
+ *
214
+ * @example
215
+ * ```jsx
216
+ * <MapSeries
217
+ * data={[
218
+ * { id: "US", label: "United States", count: 100 },
219
+ * { id: "IN", label: "India", count: 200 },
220
+ * { id: "CN", label: "China", count: 300 },
221
+ * ]}
222
+ * onExport={() => console.log("Exporting chart")}
223
+ * title="World Map Series"
224
+ * onClick={(key) => console.log("Clicked country:", key)}
225
+ * theme="light"
226
+ * />
227
+ * ```
228
+ *
229
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/charts-mapseries--docs} for more details on the properties.
230
+ * @see {@link https://echarts.apache.org/en/option.html#series-map} for ECharts map series options documentation.
208
231
  */
209
232
  var MapSeries = function MapSeries(props) {
210
233
  return /*#__PURE__*/jsxRuntime.jsx(ChartWrapper.ChartWrapper, {
@@ -202,7 +202,30 @@ var TimeSeriesChart = /*#__PURE__*/react.memo(function (_ref) {
202
202
  TimeSeriesChart.displayName = "TimeSeriesChart";
203
203
 
204
204
  /**
205
- * Chart to display simple data time series
205
+ * TimeSeries component renders a time series chart using the provided data and options.
206
+ * It supports different chart types such as line, column, and stacked variants.
207
+ * It also allows for interaction through click and brush events.
208
+ *
209
+ * @param {TimeSeriesProps} props - The properties for the TimeSeries component.
210
+ * @returns {JSX.Element} The rendered TimeSeries component.
211
+ *
212
+ * @example
213
+ * ```jsx
214
+ * <TimeSeries
215
+ * data={data}
216
+ * onExport={handleExport}
217
+ * categoryAxisName="Time"
218
+ * valueAxisName="Value"
219
+ * title="Time Series Chart"
220
+ * type="line"
221
+ * onClick={(data) => console.log(data)}
222
+ * onBrush={(range) => console.log(range)}
223
+ * />
224
+ * ```
225
+ *
226
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/charts-timeseries--docs} for more details on the properties.
227
+ * @see {@link https://echarts.apache.org/en/option.html#series-line} for more details on the ECharts line series options.
228
+ * @see {@link https://echarts.apache.org/en/option.html#series-bar} for more details on the ECharts bar series options.
206
229
  */
207
230
  var TimeSeries = function TimeSeries(props) {
208
231
  return /*#__PURE__*/jsxRuntime.jsx(ChartWrapper.ChartWrapper, {
@@ -184,7 +184,27 @@ var TimeSliderChart = /*#__PURE__*/react.memo(function (_ref) {
184
184
  TimeSliderChart.displayName = "TimeSliderChart";
185
185
 
186
186
  /**
187
- * Chart to display time scale data with zoom and brush */
187
+ * TimeSlider component renders a time slider chart.
188
+ * It allows users to visualize time-based data and interactively select a range.
189
+ * The chart supports brushing to select a specific time range,
190
+ * and it emits an event when the range is changed.
191
+ *
192
+ * @param {TimeSliderProps} props - The properties for the TimeSlider component.
193
+ * @returns {JSX.Element} The rendered TimeSlider component.
194
+ *
195
+ * @example
196
+ * ```jsx
197
+ * <TimeSlider
198
+ * data={data}
199
+ * range={{ start: new Date("2023-01-01"), end: new Date("2023-12-31") }}
200
+ * onBrush={(range) => console.log("Selected range:", range)}
201
+ * />
202
+ * ```
203
+ *
204
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/charts-timeslider--docs} for more details on the properties.
205
+ * @see {@link https://echarts.apache.org/en/option.html#dataZoom} for more details on the ECharts dataZoom feature.
206
+ * @see {@link https://echarts.apache.org/en/option.html#series-line} for more details on the ECharts line series.
207
+ */
188
208
  var TimeSlider = function TimeSlider(props) {
189
209
  return /*#__PURE__*/jsxRuntime.jsx(ChartWrapper.ChartWrapper, {
190
210
  children: /*#__PURE__*/jsxRuntime.jsx(TimeSliderChart, _objectSpread({}, props))
@@ -69,7 +69,31 @@ var WordBubbleChart = /*#__PURE__*/react.memo(function (_ref) {
69
69
  WordBubbleChart.displayName = "WordBubbleChart";
70
70
 
71
71
  /**
72
- * Chart to display simple word cloud
72
+ * WordBubble component renders a word cloud chart using ECharts.
73
+ * It displays words with sizes proportional to their frequency in the data.
74
+ * Users can click on words to trigger an action, such as filtering or navigating.
75
+ * It also supports exporting the chart and displays an empty state when no data is available.
76
+ *
77
+ * @param {WordBubbleProps} props - The properties for the WordBubble component.
78
+ * @returns {JSX.Element} The rendered WordBubble component.
79
+ *
80
+ * @example
81
+ * ```jsx
82
+ * <WordBubble
83
+ * data={[
84
+ * { id: "1", label: "Word One", count: 10 },
85
+ * { id: "2", label: "Word Two", count: 20 },
86
+ * { id: "3", label: "Word Three", count: 30 },
87
+ * ]}
88
+ * title="Word Frequency"
89
+ * onExport={() => console.log("Exporting chart...")}
90
+ * onClick={(key) => console.log("Clicked word:", key)}
91
+ * theme="light"
92
+ * />
93
+ * ```
94
+ *
95
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/charts-wordbubble--docs} for the properties that can be passed to this component.
96
+ * @see {@link https://github.com/ecomfe/echarts-wordcloud} for the underlying chart implementation.
73
97
  */
74
98
  var WordBubble = function WordBubble(props) {
75
99
  return /*#__PURE__*/jsxRuntime.jsx(ChartWrapper.ChartWrapper, {
@@ -7,7 +7,6 @@ var classNames = require('classnames');
7
7
  require('echarts-wordcloud');
8
8
  var react = require('react');
9
9
  require('../types/charts.js');
10
- var Chart_module = require('./Chart.module.css');
11
10
  var ChartToolbar = require('./ChartToolbar.js');
12
11
  var jsxRuntime = require('react/jsx-runtime');
13
12
  var echarts = require('echarts');
@@ -156,7 +155,7 @@ var ChartContainer = /*#__PURE__*/react.memo(function (_ref2) {
156
155
  })]
157
156
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
158
157
  ref: containerRef,
159
- className: classNames(Chart_module.chartContainer, "overflow-hidden area-content")
158
+ className: classNames("rf-chartContainer", "overflow-hidden area-content")
160
159
  }), isEmpty && /*#__PURE__*/jsxRuntime.jsx("div", {
161
160
  className: "absolute inset-0 bg-base grid place-content-center",
162
161
  children: /*#__PURE__*/jsxRuntime.jsx(core.EmptyContent, {
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
 
3
3
  var classNames = require('classnames');
4
- var Chart_module = require('./Chart.module.css');
5
4
  var jsxRuntime = require('react/jsx-runtime');
6
5
 
7
6
  /*
@@ -30,7 +29,7 @@ var jsxRuntime = require('react/jsx-runtime');
30
29
  var ChartToolbar = function ChartToolbar(_ref) {
31
30
  var children = _ref.children;
32
31
  return /*#__PURE__*/jsxRuntime.jsx("div", {
33
- className: classNames("flex flex-nowrap items-center justify-end bg-base area-head", Chart_module.chartToolbar),
32
+ className: classNames("flex flex-nowrap items-center justify-end bg-base area-head", "rf-chartToolbar"),
34
33
  children: children
35
34
  });
36
35
  };
@@ -172,7 +172,28 @@ var ActivityMapChart = /*#__PURE__*/memo(function (_ref) {
172
172
  ActivityMapChart.displayName = "ActivityMapChart";
173
173
 
174
174
  /**
175
- * Chart showing activity map
175
+ * ActivityMap component renders a chart that visualizes activity data
176
+ * over time, using either a scatter plot or a heatmap.
177
+ * It allows users to switch between different types of visualizations
178
+ * and customize the color palette used in the chart.
179
+ *
180
+ * @param {ActivityMapProps} props - The properties for the ActivityMap component.
181
+ * @returns {JSX.Element} The rendered ActivityMap component.
182
+ *
183
+ * @example
184
+ * ```jsx
185
+ * <ActivityMap
186
+ * data={activityData}
187
+ * time="day-hour"
188
+ * type="heatmap"
189
+ * heatmapPalette={["#f0f8ff", "#faebd7", "#00ffff", "#7fffd4"]}
190
+ * highLabels={["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]}
191
+ * lowLabels={["12a", "1a", "2a", "3a", "4a", "5a", "6a", "7a", "8a", "9a", "10a", "11a", "12p", "1p", "2p", "3p", "4p", "5p", "6p", "7p", "8p", "9p", "10p", "11p"]}
192
+ * onClick={(highIndex, lowIndex) => console.log(`Clicked on: ${highIndex}, ${lowIndex}`)}
193
+ * />
194
+ * ```
195
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/charts-activitymap--docs} for more details on the properties.
196
+ * @see {@link https://echarts.apache.org/en/option.html#series-scatter} for more details on the ECharts scatter series.
176
197
  */
177
198
  var ActivityMap = function ActivityMap(props) {
178
199
  return /*#__PURE__*/jsx(ChartWrapper, {
@@ -145,7 +145,33 @@ var CountSeriesChart = /*#__PURE__*/memo(function (_ref) {
145
145
  CountSeriesChart.displayName = "CountSeriesChart";
146
146
 
147
147
  /**
148
- * Chart to display simple data count series
148
+ * CountSeries component renders a chart that displays counts of items in various formats.
149
+ * It supports pie, bar, and column charts.
150
+ * It can be used to visualize the distribution of counts across different categories.
151
+ * It allows users to switch between different types of visualizations and customize the color palette used in the chart.
152
+ *
153
+ * @param {CountSeriesProps} props - The properties for the CountSeries component.
154
+ * @returns {JSX.Element} The rendered CountSeries component.
155
+ *
156
+ * @example
157
+ * ```jsx
158
+ * <CountSeries
159
+ * data={[
160
+ * { id: "A", label: "Category A", count: 10 },
161
+ * { id: "B", label: "Category B", count: 20 },
162
+ * { id: "C", label: "Category C", count: 30 },
163
+ * ]}
164
+ * title="Count Distribution"
165
+ * onExport={() => console.log("Exporting chart data")}
166
+ * theme="light"
167
+ * type="pie"
168
+ * onClick={(key) => console.log("Clicked on:", key)}
169
+ * />
170
+ * ```
171
+ *
172
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/charts-countseries--docs} for more details on the properties.
173
+ * @see {@link https://echarts.apache.org/en/option.html#series-pie} for more details on the ECharts pie series options.
174
+ * @see {@link https://echarts.apache.org/en/option.html#series-bar} for more details on the ECharts bar series options.
149
175
  */
150
176
  var CountSeries = function CountSeries(props) {
151
177
  return /*#__PURE__*/jsx(ChartWrapper, {
@@ -174,7 +174,32 @@ var DataSeriesChart = /*#__PURE__*/memo(function (_ref) {
174
174
  DataSeriesChart.displayName = "DataSeriesChart";
175
175
 
176
176
  /**
177
- * Chart to display simple data category series
177
+ * DataSeries component renders a chart for visualizing data series.
178
+ * It supports various chart types such as column, line, bar, radar, and stacked variants.
179
+ * It allows users to click on data points to trigger custom actions.
180
+ *
181
+ * @param {DataSeriesProps} props - The properties for the DataSeries component.
182
+ * @returns {JSX.Element} The rendered DataSeries component.
183
+ *
184
+ * @example
185
+ * ```jsx
186
+ * <DataSeries
187
+ * data={[{ id: "1", label: "Series 1", values: [10, 20, 30] }]}
188
+ * categories={["Category 1", "Category 2", "Category 3"]}
189
+ * categoryAxisName="Categories"
190
+ * valueAxisName="Values"
191
+ * title="Data Series Example"
192
+ * type="column"
193
+ * onClick={(data) => console.log("Clicked data:", data)}
194
+ * onExport={() => console.log("Exporting chart data")}
195
+ * theme="light"
196
+ * />
197
+ * ```
198
+ *
199
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/charts-dataseries--docs} for more details on the properties.
200
+ * @see {@link https://echarts.apache.org/en/option.html#series-bar} for ECharts bar series options.
201
+ * @see {@link https://echarts.apache.org/en/option.html#series-line} for ECharts line series options.
202
+ * @see {@link https://echarts.apache.org/en/option.html#series-radar} for ECharts radar series options.
178
203
  */
179
204
  var DataSeries = function DataSeries(props) {
180
205
  return /*#__PURE__*/jsx(ChartWrapper, {
@@ -81,6 +81,20 @@ var GenericChartBase = /*#__PURE__*/memo(function (_ref2) {
81
81
  });
82
82
  });
83
83
  GenericChartBase.displayName = "GenericChart";
84
+
85
+ /**
86
+ * GenericChart component renders a generic chart using ECharts.
87
+ * It accepts various chart options and configurations, allowing for flexible chart rendering.
88
+ * It supports click events, brush events, and custom actions.
89
+ * It can be used to create a wide range of chart types by passing the appropriate ECharts options.
90
+ *
91
+ * @param props - The properties for the GenericChart component, including chart options, event handlers, and custom actions.
92
+ * @returns A React functional component that renders the chart within a ChartWrapper.
93
+ *
94
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/charts-genericchart--docs} for more details on the properties.
95
+ * @see {@link https://echarts.apache.org/en/option.html} for ECharts options documentation.
96
+ * @see {@link https://echarts.apache.org/en/api.html#echartsInstance} for ECharts instance methods and properties.
97
+ */
84
98
  var GenericChart = function GenericChart(props) {
85
99
  return /*#__PURE__*/jsx(ChartWrapper, {
86
100
  children: /*#__PURE__*/jsx(GenericChartBase, _objectSpread({}, props))
@@ -185,7 +185,30 @@ var MapSeriesChart = /*#__PURE__*/memo(function (_ref) {
185
185
  MapSeriesChart.displayName = "MapSeriesChart";
186
186
 
187
187
  /**
188
- * Chart to display simple map data series
188
+ * MapSeries component renders a map chart using ECharts.
189
+ * It displays data on a world map, allowing users to visualize counts or other metrics by country.
190
+ * It supports zooming and switching between map and column views.
191
+ *
192
+ * @param {MapSeriesProps} props - The properties for the MapSeries component.
193
+ * @returns {JSX.Element} The rendered MapSeries component.
194
+ *
195
+ * @example
196
+ * ```jsx
197
+ * <MapSeries
198
+ * data={[
199
+ * { id: "US", label: "United States", count: 100 },
200
+ * { id: "IN", label: "India", count: 200 },
201
+ * { id: "CN", label: "China", count: 300 },
202
+ * ]}
203
+ * onExport={() => console.log("Exporting chart")}
204
+ * title="World Map Series"
205
+ * onClick={(key) => console.log("Clicked country:", key)}
206
+ * theme="light"
207
+ * />
208
+ * ```
209
+ *
210
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/charts-mapseries--docs} for more details on the properties.
211
+ * @see {@link https://echarts.apache.org/en/option.html#series-map} for ECharts map series options documentation.
189
212
  */
190
213
  var MapSeries = function MapSeries(props) {
191
214
  return /*#__PURE__*/jsx(ChartWrapper, {
@@ -202,7 +202,30 @@ var TimeSeriesChart = /*#__PURE__*/memo(function (_ref) {
202
202
  TimeSeriesChart.displayName = "TimeSeriesChart";
203
203
 
204
204
  /**
205
- * Chart to display simple data time series
205
+ * TimeSeries component renders a time series chart using the provided data and options.
206
+ * It supports different chart types such as line, column, and stacked variants.
207
+ * It also allows for interaction through click and brush events.
208
+ *
209
+ * @param {TimeSeriesProps} props - The properties for the TimeSeries component.
210
+ * @returns {JSX.Element} The rendered TimeSeries component.
211
+ *
212
+ * @example
213
+ * ```jsx
214
+ * <TimeSeries
215
+ * data={data}
216
+ * onExport={handleExport}
217
+ * categoryAxisName="Time"
218
+ * valueAxisName="Value"
219
+ * title="Time Series Chart"
220
+ * type="line"
221
+ * onClick={(data) => console.log(data)}
222
+ * onBrush={(range) => console.log(range)}
223
+ * />
224
+ * ```
225
+ *
226
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/charts-timeseries--docs} for more details on the properties.
227
+ * @see {@link https://echarts.apache.org/en/option.html#series-line} for more details on the ECharts line series options.
228
+ * @see {@link https://echarts.apache.org/en/option.html#series-bar} for more details on the ECharts bar series options.
206
229
  */
207
230
  var TimeSeries = function TimeSeries(props) {
208
231
  return /*#__PURE__*/jsx(ChartWrapper, {
@@ -184,7 +184,27 @@ var TimeSliderChart = /*#__PURE__*/memo(function (_ref) {
184
184
  TimeSliderChart.displayName = "TimeSliderChart";
185
185
 
186
186
  /**
187
- * Chart to display time scale data with zoom and brush */
187
+ * TimeSlider component renders a time slider chart.
188
+ * It allows users to visualize time-based data and interactively select a range.
189
+ * The chart supports brushing to select a specific time range,
190
+ * and it emits an event when the range is changed.
191
+ *
192
+ * @param {TimeSliderProps} props - The properties for the TimeSlider component.
193
+ * @returns {JSX.Element} The rendered TimeSlider component.
194
+ *
195
+ * @example
196
+ * ```jsx
197
+ * <TimeSlider
198
+ * data={data}
199
+ * range={{ start: new Date("2023-01-01"), end: new Date("2023-12-31") }}
200
+ * onBrush={(range) => console.log("Selected range:", range)}
201
+ * />
202
+ * ```
203
+ *
204
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/charts-timeslider--docs} for more details on the properties.
205
+ * @see {@link https://echarts.apache.org/en/option.html#dataZoom} for more details on the ECharts dataZoom feature.
206
+ * @see {@link https://echarts.apache.org/en/option.html#series-line} for more details on the ECharts line series.
207
+ */
188
208
  var TimeSlider = function TimeSlider(props) {
189
209
  return /*#__PURE__*/jsx(ChartWrapper, {
190
210
  children: /*#__PURE__*/jsx(TimeSliderChart, _objectSpread({}, props))
@@ -69,7 +69,31 @@ var WordBubbleChart = /*#__PURE__*/memo(function (_ref) {
69
69
  WordBubbleChart.displayName = "WordBubbleChart";
70
70
 
71
71
  /**
72
- * Chart to display simple word cloud
72
+ * WordBubble component renders a word cloud chart using ECharts.
73
+ * It displays words with sizes proportional to their frequency in the data.
74
+ * Users can click on words to trigger an action, such as filtering or navigating.
75
+ * It also supports exporting the chart and displays an empty state when no data is available.
76
+ *
77
+ * @param {WordBubbleProps} props - The properties for the WordBubble component.
78
+ * @returns {JSX.Element} The rendered WordBubble component.
79
+ *
80
+ * @example
81
+ * ```jsx
82
+ * <WordBubble
83
+ * data={[
84
+ * { id: "1", label: "Word One", count: 10 },
85
+ * { id: "2", label: "Word Two", count: 20 },
86
+ * { id: "3", label: "Word Three", count: 30 },
87
+ * ]}
88
+ * title="Word Frequency"
89
+ * onExport={() => console.log("Exporting chart...")}
90
+ * onClick={(key) => console.log("Clicked word:", key)}
91
+ * theme="light"
92
+ * />
93
+ * ```
94
+ *
95
+ * @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/charts-wordbubble--docs} for the properties that can be passed to this component.
96
+ * @see {@link https://github.com/ecomfe/echarts-wordcloud} for the underlying chart implementation.
73
97
  */
74
98
  var WordBubble = function WordBubble(props) {
75
99
  return /*#__PURE__*/jsx(ChartWrapper, {
@@ -7,7 +7,6 @@ import classNames from 'classnames';
7
7
  import 'echarts-wordcloud';
8
8
  import { memo, useState, useCallback, useImperativeHandle, useMemo, useEffect, Fragment } from 'react';
9
9
  import '../types/charts.js';
10
- import classes from './Chart.module.css';
11
10
  import { ChartToolbar } from './ChartToolbar.js';
12
11
  import { jsxs, jsx } from 'react/jsx-runtime';
13
12
  import * as echarts from 'echarts';
@@ -137,7 +136,7 @@ var ChartContainer = /*#__PURE__*/memo(function (_ref2) {
137
136
  })]
138
137
  }), /*#__PURE__*/jsx("div", {
139
138
  ref: containerRef,
140
- className: classNames(classes.chartContainer, "overflow-hidden area-content")
139
+ className: classNames("rf-chartContainer", "overflow-hidden area-content")
141
140
  }), isEmpty && /*#__PURE__*/jsx("div", {
142
141
  className: "absolute inset-0 bg-base grid place-content-center",
143
142
  children: /*#__PURE__*/jsx(EmptyContent, {
@@ -1,7 +1,6 @@
1
1
  'use client';
2
2
 
3
3
  import classNames from 'classnames';
4
- import classes from './Chart.module.css';
5
4
  import { jsx } from 'react/jsx-runtime';
6
5
 
7
6
  /*
@@ -30,7 +29,7 @@ import { jsx } from 'react/jsx-runtime';
30
29
  var ChartToolbar = function ChartToolbar(_ref) {
31
30
  var children = _ref.children;
32
31
  return /*#__PURE__*/jsx("div", {
33
- className: classNames("flex flex-nowrap items-center justify-end bg-base area-head", classes.chartToolbar),
32
+ className: classNames("flex flex-nowrap items-center justify-end bg-base area-head", "rf-chartToolbar"),
34
33
  children: children
35
34
  });
36
35
  };