@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.
- package/{src/wrapper/Chart.module.css → css/_chart.css} +5 -5
- package/css/styles.css +24 -0
- package/dist/cjs/charts/ActivityMap.js +22 -1
- package/dist/cjs/charts/CountSeries.js +27 -1
- package/dist/cjs/charts/DataSeries.js +26 -1
- package/dist/cjs/charts/Generic.js +14 -0
- package/dist/cjs/charts/MapSeries.js +24 -1
- package/dist/cjs/charts/TimeSeries.js +24 -1
- package/dist/cjs/charts/TimeSlider.js +21 -1
- package/dist/cjs/charts/WordBubble.js +25 -1
- package/dist/cjs/wrapper/ChartContainer.js +1 -2
- package/dist/cjs/wrapper/ChartToolbar.js +1 -2
- package/dist/esm/charts/ActivityMap.js +22 -1
- package/dist/esm/charts/CountSeries.js +27 -1
- package/dist/esm/charts/DataSeries.js +26 -1
- package/dist/esm/charts/Generic.js +14 -0
- package/dist/esm/charts/MapSeries.js +24 -1
- package/dist/esm/charts/TimeSeries.js +24 -1
- package/dist/esm/charts/TimeSlider.js +21 -1
- package/dist/esm/charts/WordBubble.js +25 -1
- package/dist/esm/wrapper/ChartContainer.js +1 -2
- package/dist/esm/wrapper/ChartToolbar.js +1 -2
- package/dist/types/charts/ActivityMap.d.ts +22 -1
- package/dist/types/charts/CountSeries.d.ts +27 -1
- package/dist/types/charts/DataSeries.d.ts +26 -1
- package/dist/types/charts/Generic.d.ts +15 -2
- package/dist/types/charts/MapSeries.d.ts +24 -1
- package/dist/types/charts/TimeSeries.d.ts +24 -1
- package/dist/types/charts/TimeSlider.d.ts +21 -1
- package/dist/types/charts/WordBubble.d.ts +25 -1
- package/dist/types/types/world.svg.d.ts +1 -1
- package/dist/types/wrapper/ChartContainer.d.ts +2 -2
- package/dist/types/wrapper/ChartWrapper.d.ts +0 -1
- package/package.json +11 -9
- package/src/charts/ActivityMap.tsx +22 -1
- package/src/charts/CountSeries.tsx +27 -1
- package/src/charts/DataSeries.tsx +26 -1
- package/src/charts/Generic.tsx +15 -2
- package/src/charts/MapSeries.tsx +24 -1
- package/src/charts/TimeSeries.tsx +24 -1
- package/src/charts/TimeSlider.tsx +21 -1
- package/src/charts/WordBubble.tsx +25 -1
- package/src/wrapper/ChartContainer.tsx +3 -4
- package/src/wrapper/ChartToolbar.tsx +1 -2
- package/dist/cjs/wrapper/Chart.module.css +0 -1
- package/dist/esm/wrapper/Chart.module.css +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type EChartOption, type EChartsType } from "echarts";
|
|
2
2
|
import "echarts-wordcloud";
|
|
3
|
-
import { type
|
|
3
|
+
import { type Ref } from "react";
|
|
4
4
|
import { type Theme } from "../types";
|
|
5
5
|
export declare const ChartContainer: import("react").MemoExoticComponent<({ theme, title, options, children, onResize, onClick, onExport, isEmpty, emptyIcon, chartRef: _ref, dataTableRenderer, }: {
|
|
6
6
|
title?: string;
|
|
@@ -9,7 +9,7 @@ export declare const ChartContainer: import("react").MemoExoticComponent<({ them
|
|
|
9
9
|
emptyIcon?: string;
|
|
10
10
|
options: EChartOption;
|
|
11
11
|
children?: AnyObject;
|
|
12
|
-
chartRef?:
|
|
12
|
+
chartRef?: Ref<EChartsType>;
|
|
13
13
|
onClick?: (event: AnyObject) => void;
|
|
14
14
|
onExport?: (event: AnyObject) => void;
|
|
15
15
|
dataTableRenderer?: (opt: KeyValue) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-fabric/chart",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.52",
|
|
4
4
|
"description": "RUF: Charting package",
|
|
5
5
|
"author": "Adarsh Pastakia <adarshpastakia@outlook.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,9 +11,11 @@
|
|
|
11
11
|
"types": "dist/types/index.d.ts",
|
|
12
12
|
"directories": {
|
|
13
13
|
"src": "src",
|
|
14
|
+
"styles": "css",
|
|
14
15
|
"test": "tests"
|
|
15
16
|
},
|
|
16
17
|
"files": [
|
|
18
|
+
"css",
|
|
17
19
|
"src",
|
|
18
20
|
"dist"
|
|
19
21
|
],
|
|
@@ -33,19 +35,19 @@
|
|
|
33
35
|
"watch": "npm-run-all -p watch:rollup watch:dts"
|
|
34
36
|
},
|
|
35
37
|
"dependencies": {
|
|
36
|
-
"@react-fabric/core": "^1.0.0-beta.
|
|
37
|
-
"@react-fabric/utilities": "^1.0.0-beta.
|
|
38
|
+
"@react-fabric/core": "^1.0.0-beta.52",
|
|
39
|
+
"@react-fabric/utilities": "^1.0.0-beta.52",
|
|
38
40
|
"classnames": "^2.5.1",
|
|
39
41
|
"color": "^4.2.3",
|
|
40
42
|
"date-fns": "^4.0.0",
|
|
41
|
-
"echarts": "^5.
|
|
43
|
+
"echarts": "^5.6.0",
|
|
42
44
|
"echarts-wordcloud": "^2.1.0"
|
|
43
45
|
},
|
|
44
46
|
"peerDependencies": {
|
|
45
|
-
"i18next": "^
|
|
46
|
-
"react": "
|
|
47
|
-
"react-dom": "
|
|
48
|
-
"react-i18next": "^15.
|
|
47
|
+
"i18next": "^25.2.1",
|
|
48
|
+
"react": "^19.0.0",
|
|
49
|
+
"react-dom": "^19.0.0",
|
|
50
|
+
"react-i18next": "^15.5.2"
|
|
49
51
|
},
|
|
50
52
|
"devDependencies": {
|
|
51
53
|
"@types/echarts": "^4.9.22"
|
|
@@ -54,5 +56,5 @@
|
|
|
54
56
|
"node": ">=18.12.0",
|
|
55
57
|
"npm": ">=8.19.0"
|
|
56
58
|
},
|
|
57
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "0eabb9d88d91af93d657bcc209b226fd576e8260"
|
|
58
60
|
}
|
|
@@ -286,7 +286,28 @@ const ActivityMapChart = memo(
|
|
|
286
286
|
ActivityMapChart.displayName = "ActivityMapChart";
|
|
287
287
|
|
|
288
288
|
/**
|
|
289
|
-
*
|
|
289
|
+
* ActivityMap component renders a chart that visualizes activity data
|
|
290
|
+
* over time, using either a scatter plot or a heatmap.
|
|
291
|
+
* It allows users to switch between different types of visualizations
|
|
292
|
+
* and customize the color palette used in the chart.
|
|
293
|
+
*
|
|
294
|
+
* @param {ActivityMapProps} props - The properties for the ActivityMap component.
|
|
295
|
+
* @returns {JSX.Element} The rendered ActivityMap component.
|
|
296
|
+
*
|
|
297
|
+
* @example
|
|
298
|
+
* ```jsx
|
|
299
|
+
* <ActivityMap
|
|
300
|
+
* data={activityData}
|
|
301
|
+
* time="day-hour"
|
|
302
|
+
* type="heatmap"
|
|
303
|
+
* heatmapPalette={["#f0f8ff", "#faebd7", "#00ffff", "#7fffd4"]}
|
|
304
|
+
* highLabels={["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]}
|
|
305
|
+
* 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"]}
|
|
306
|
+
* onClick={(highIndex, lowIndex) => console.log(`Clicked on: ${highIndex}, ${lowIndex}`)}
|
|
307
|
+
* />
|
|
308
|
+
* ```
|
|
309
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/charts-activitymap--docs} for more details on the properties.
|
|
310
|
+
* @see {@link https://echarts.apache.org/en/option.html#series-scatter} for more details on the ECharts scatter series.
|
|
290
311
|
*/
|
|
291
312
|
export const ActivityMap: FC<ActivityMapProps> = (props) => (
|
|
292
313
|
<ChartWrapper>
|
|
@@ -177,7 +177,33 @@ const CountSeriesChart: FC<CountSeriesProps> = memo(
|
|
|
177
177
|
CountSeriesChart.displayName = "CountSeriesChart";
|
|
178
178
|
|
|
179
179
|
/**
|
|
180
|
-
*
|
|
180
|
+
* CountSeries component renders a chart that displays counts of items in various formats.
|
|
181
|
+
* It supports pie, bar, and column charts.
|
|
182
|
+
* It can be used to visualize the distribution of counts across different categories.
|
|
183
|
+
* It allows users to switch between different types of visualizations and customize the color palette used in the chart.
|
|
184
|
+
*
|
|
185
|
+
* @param {CountSeriesProps} props - The properties for the CountSeries component.
|
|
186
|
+
* @returns {JSX.Element} The rendered CountSeries component.
|
|
187
|
+
*
|
|
188
|
+
* @example
|
|
189
|
+
* ```jsx
|
|
190
|
+
* <CountSeries
|
|
191
|
+
* data={[
|
|
192
|
+
* { id: "A", label: "Category A", count: 10 },
|
|
193
|
+
* { id: "B", label: "Category B", count: 20 },
|
|
194
|
+
* { id: "C", label: "Category C", count: 30 },
|
|
195
|
+
* ]}
|
|
196
|
+
* title="Count Distribution"
|
|
197
|
+
* onExport={() => console.log("Exporting chart data")}
|
|
198
|
+
* theme="light"
|
|
199
|
+
* type="pie"
|
|
200
|
+
* onClick={(key) => console.log("Clicked on:", key)}
|
|
201
|
+
* />
|
|
202
|
+
* ```
|
|
203
|
+
*
|
|
204
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/charts-countseries--docs} for more details on the properties.
|
|
205
|
+
* @see {@link https://echarts.apache.org/en/option.html#series-pie} for more details on the ECharts pie series options.
|
|
206
|
+
* @see {@link https://echarts.apache.org/en/option.html#series-bar} for more details on the ECharts bar series options.
|
|
181
207
|
*/
|
|
182
208
|
export const CountSeries: FC<CountSeriesProps> = (props) => (
|
|
183
209
|
<ChartWrapper>
|
|
@@ -219,7 +219,32 @@ const DataSeriesChart: FC<DataSeriesProps> = memo(
|
|
|
219
219
|
DataSeriesChart.displayName = "DataSeriesChart";
|
|
220
220
|
|
|
221
221
|
/**
|
|
222
|
-
*
|
|
222
|
+
* DataSeries component renders a chart for visualizing data series.
|
|
223
|
+
* It supports various chart types such as column, line, bar, radar, and stacked variants.
|
|
224
|
+
* It allows users to click on data points to trigger custom actions.
|
|
225
|
+
*
|
|
226
|
+
* @param {DataSeriesProps} props - The properties for the DataSeries component.
|
|
227
|
+
* @returns {JSX.Element} The rendered DataSeries component.
|
|
228
|
+
*
|
|
229
|
+
* @example
|
|
230
|
+
* ```jsx
|
|
231
|
+
* <DataSeries
|
|
232
|
+
* data={[{ id: "1", label: "Series 1", values: [10, 20, 30] }]}
|
|
233
|
+
* categories={["Category 1", "Category 2", "Category 3"]}
|
|
234
|
+
* categoryAxisName="Categories"
|
|
235
|
+
* valueAxisName="Values"
|
|
236
|
+
* title="Data Series Example"
|
|
237
|
+
* type="column"
|
|
238
|
+
* onClick={(data) => console.log("Clicked data:", data)}
|
|
239
|
+
* onExport={() => console.log("Exporting chart data")}
|
|
240
|
+
* theme="light"
|
|
241
|
+
* />
|
|
242
|
+
* ```
|
|
243
|
+
*
|
|
244
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/charts-dataseries--docs} for more details on the properties.
|
|
245
|
+
* @see {@link https://echarts.apache.org/en/option.html#series-bar} for ECharts bar series options.
|
|
246
|
+
* @see {@link https://echarts.apache.org/en/option.html#series-line} for ECharts line series options.
|
|
247
|
+
* @see {@link https://echarts.apache.org/en/option.html#series-radar} for ECharts radar series options.
|
|
223
248
|
*/
|
|
224
249
|
export const DataSeries: FC<DataSeriesProps> = (props) => (
|
|
225
250
|
<ChartWrapper>
|
package/src/charts/Generic.tsx
CHANGED
|
@@ -28,14 +28,14 @@ import {
|
|
|
28
28
|
useImperativeHandle,
|
|
29
29
|
useRef,
|
|
30
30
|
type FC,
|
|
31
|
-
type
|
|
31
|
+
type Ref,
|
|
32
32
|
} from "react";
|
|
33
33
|
import { type BaseChart } from "../types";
|
|
34
34
|
import { ChartContainer } from "../wrapper/ChartContainer";
|
|
35
35
|
import { ChartWrapper } from "../wrapper/ChartWrapper";
|
|
36
36
|
|
|
37
37
|
export interface GenericProps extends BaseChart {
|
|
38
|
-
chartRef?:
|
|
38
|
+
chartRef?: Ref<EChartsType>;
|
|
39
39
|
|
|
40
40
|
legend?: EChartOption["legend"];
|
|
41
41
|
toolbox?: EChartOption["toolbox"];
|
|
@@ -183,6 +183,19 @@ const GenericChartBase: FC<GenericProps> = memo(
|
|
|
183
183
|
);
|
|
184
184
|
GenericChartBase.displayName = "GenericChart";
|
|
185
185
|
|
|
186
|
+
/**
|
|
187
|
+
* GenericChart component renders a generic chart using ECharts.
|
|
188
|
+
* It accepts various chart options and configurations, allowing for flexible chart rendering.
|
|
189
|
+
* It supports click events, brush events, and custom actions.
|
|
190
|
+
* It can be used to create a wide range of chart types by passing the appropriate ECharts options.
|
|
191
|
+
*
|
|
192
|
+
* @param props - The properties for the GenericChart component, including chart options, event handlers, and custom actions.
|
|
193
|
+
* @returns A React functional component that renders the chart within a ChartWrapper.
|
|
194
|
+
*
|
|
195
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/charts-genericchart--docs} for more details on the properties.
|
|
196
|
+
* @see {@link https://echarts.apache.org/en/option.html} for ECharts options documentation.
|
|
197
|
+
* @see {@link https://echarts.apache.org/en/api.html#echartsInstance} for ECharts instance methods and properties.
|
|
198
|
+
*/
|
|
186
199
|
export const GenericChart: FC<GenericProps> = (props) => (
|
|
187
200
|
<ChartWrapper>
|
|
188
201
|
<GenericChartBase {...props} />
|
package/src/charts/MapSeries.tsx
CHANGED
|
@@ -208,7 +208,30 @@ const MapSeriesChart: FC<MapSeriesProps> = memo(
|
|
|
208
208
|
MapSeriesChart.displayName = "MapSeriesChart";
|
|
209
209
|
|
|
210
210
|
/**
|
|
211
|
-
*
|
|
211
|
+
* MapSeries component renders a map chart using ECharts.
|
|
212
|
+
* It displays data on a world map, allowing users to visualize counts or other metrics by country.
|
|
213
|
+
* It supports zooming and switching between map and column views.
|
|
214
|
+
*
|
|
215
|
+
* @param {MapSeriesProps} props - The properties for the MapSeries component.
|
|
216
|
+
* @returns {JSX.Element} The rendered MapSeries component.
|
|
217
|
+
*
|
|
218
|
+
* @example
|
|
219
|
+
* ```jsx
|
|
220
|
+
* <MapSeries
|
|
221
|
+
* data={[
|
|
222
|
+
* { id: "US", label: "United States", count: 100 },
|
|
223
|
+
* { id: "IN", label: "India", count: 200 },
|
|
224
|
+
* { id: "CN", label: "China", count: 300 },
|
|
225
|
+
* ]}
|
|
226
|
+
* onExport={() => console.log("Exporting chart")}
|
|
227
|
+
* title="World Map Series"
|
|
228
|
+
* onClick={(key) => console.log("Clicked country:", key)}
|
|
229
|
+
* theme="light"
|
|
230
|
+
* />
|
|
231
|
+
* ```
|
|
232
|
+
*
|
|
233
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/charts-mapseries--docs} for more details on the properties.
|
|
234
|
+
* @see {@link https://echarts.apache.org/en/option.html#series-map} for ECharts map series options documentation.
|
|
212
235
|
*/
|
|
213
236
|
export const MapSeries: FC<MapSeriesProps> = (props) => (
|
|
214
237
|
<ChartWrapper>
|
|
@@ -227,7 +227,30 @@ const TimeSeriesChart: FC<TimeSeriesProps> = memo(
|
|
|
227
227
|
TimeSeriesChart.displayName = "TimeSeriesChart";
|
|
228
228
|
|
|
229
229
|
/**
|
|
230
|
-
*
|
|
230
|
+
* TimeSeries component renders a time series chart using the provided data and options.
|
|
231
|
+
* It supports different chart types such as line, column, and stacked variants.
|
|
232
|
+
* It also allows for interaction through click and brush events.
|
|
233
|
+
*
|
|
234
|
+
* @param {TimeSeriesProps} props - The properties for the TimeSeries component.
|
|
235
|
+
* @returns {JSX.Element} The rendered TimeSeries component.
|
|
236
|
+
*
|
|
237
|
+
* @example
|
|
238
|
+
* ```jsx
|
|
239
|
+
* <TimeSeries
|
|
240
|
+
* data={data}
|
|
241
|
+
* onExport={handleExport}
|
|
242
|
+
* categoryAxisName="Time"
|
|
243
|
+
* valueAxisName="Value"
|
|
244
|
+
* title="Time Series Chart"
|
|
245
|
+
* type="line"
|
|
246
|
+
* onClick={(data) => console.log(data)}
|
|
247
|
+
* onBrush={(range) => console.log(range)}
|
|
248
|
+
* />
|
|
249
|
+
* ```
|
|
250
|
+
*
|
|
251
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/charts-timeseries--docs} for more details on the properties.
|
|
252
|
+
* @see {@link https://echarts.apache.org/en/option.html#series-line} for more details on the ECharts line series options.
|
|
253
|
+
* @see {@link https://echarts.apache.org/en/option.html#series-bar} for more details on the ECharts bar series options.
|
|
231
254
|
*/
|
|
232
255
|
export const TimeSeries: FC<TimeSeriesProps> = (props) => (
|
|
233
256
|
<ChartWrapper>
|
|
@@ -227,7 +227,27 @@ const TimeSliderChart: FC<TimeSliderProps> = memo(
|
|
|
227
227
|
TimeSliderChart.displayName = "TimeSliderChart";
|
|
228
228
|
|
|
229
229
|
/**
|
|
230
|
-
*
|
|
230
|
+
* TimeSlider component renders a time slider chart.
|
|
231
|
+
* It allows users to visualize time-based data and interactively select a range.
|
|
232
|
+
* The chart supports brushing to select a specific time range,
|
|
233
|
+
* and it emits an event when the range is changed.
|
|
234
|
+
*
|
|
235
|
+
* @param {TimeSliderProps} props - The properties for the TimeSlider component.
|
|
236
|
+
* @returns {JSX.Element} The rendered TimeSlider component.
|
|
237
|
+
*
|
|
238
|
+
* @example
|
|
239
|
+
* ```jsx
|
|
240
|
+
* <TimeSlider
|
|
241
|
+
* data={data}
|
|
242
|
+
* range={{ start: new Date("2023-01-01"), end: new Date("2023-12-31") }}
|
|
243
|
+
* onBrush={(range) => console.log("Selected range:", range)}
|
|
244
|
+
* />
|
|
245
|
+
* ```
|
|
246
|
+
*
|
|
247
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/charts-timeslider--docs} for more details on the properties.
|
|
248
|
+
* @see {@link https://echarts.apache.org/en/option.html#dataZoom} for more details on the ECharts dataZoom feature.
|
|
249
|
+
* @see {@link https://echarts.apache.org/en/option.html#series-line} for more details on the ECharts line series.
|
|
250
|
+
*/
|
|
231
251
|
export const TimeSlider: FC<TimeSliderProps> = (props) => (
|
|
232
252
|
<ChartWrapper>
|
|
233
253
|
<TimeSliderChart {...props} />
|
|
@@ -96,7 +96,31 @@ const WordBubbleChart: FC<WordBubbleProps> = memo(
|
|
|
96
96
|
WordBubbleChart.displayName = "WordBubbleChart";
|
|
97
97
|
|
|
98
98
|
/**
|
|
99
|
-
*
|
|
99
|
+
* WordBubble component renders a word cloud chart using ECharts.
|
|
100
|
+
* It displays words with sizes proportional to their frequency in the data.
|
|
101
|
+
* Users can click on words to trigger an action, such as filtering or navigating.
|
|
102
|
+
* It also supports exporting the chart and displays an empty state when no data is available.
|
|
103
|
+
*
|
|
104
|
+
* @param {WordBubbleProps} props - The properties for the WordBubble component.
|
|
105
|
+
* @returns {JSX.Element} The rendered WordBubble component.
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```jsx
|
|
109
|
+
* <WordBubble
|
|
110
|
+
* data={[
|
|
111
|
+
* { id: "1", label: "Word One", count: 10 },
|
|
112
|
+
* { id: "2", label: "Word Two", count: 20 },
|
|
113
|
+
* { id: "3", label: "Word Three", count: 30 },
|
|
114
|
+
* ]}
|
|
115
|
+
* title="Word Frequency"
|
|
116
|
+
* onExport={() => console.log("Exporting chart...")}
|
|
117
|
+
* onClick={(key) => console.log("Clicked word:", key)}
|
|
118
|
+
* theme="light"
|
|
119
|
+
* />
|
|
120
|
+
* ```
|
|
121
|
+
*
|
|
122
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/charts-wordbubble--docs} for the properties that can be passed to this component.
|
|
123
|
+
* @see {@link https://github.com/ecomfe/echarts-wordcloud} for the underlying chart implementation.
|
|
100
124
|
*/
|
|
101
125
|
export const WordBubble: FC<WordBubbleProps> = (props) => (
|
|
102
126
|
<ChartWrapper>
|
|
@@ -41,11 +41,10 @@ import {
|
|
|
41
41
|
useImperativeHandle,
|
|
42
42
|
useMemo,
|
|
43
43
|
useState,
|
|
44
|
-
type
|
|
44
|
+
type Ref,
|
|
45
45
|
} from "react";
|
|
46
46
|
import { type Theme } from "../types";
|
|
47
47
|
import echarts from "../types/charts";
|
|
48
|
-
import classes from "./Chart.module.css";
|
|
49
48
|
import { ChartToolbar } from "./ChartToolbar";
|
|
50
49
|
|
|
51
50
|
const defaultOptions = {
|
|
@@ -100,7 +99,7 @@ export const ChartContainer = memo(
|
|
|
100
99
|
emptyIcon?: string;
|
|
101
100
|
options: EChartOption;
|
|
102
101
|
children?: AnyObject;
|
|
103
|
-
chartRef?:
|
|
102
|
+
chartRef?: Ref<EChartsType>;
|
|
104
103
|
onClick?: (event: AnyObject) => void;
|
|
105
104
|
onExport?: (event: AnyObject) => void;
|
|
106
105
|
dataTableRenderer?: (opt: KeyValue) => string;
|
|
@@ -198,7 +197,7 @@ export const ChartContainer = memo(
|
|
|
198
197
|
<div
|
|
199
198
|
ref={containerRef}
|
|
200
199
|
className={classNames(
|
|
201
|
-
|
|
200
|
+
"rf-chartContainer",
|
|
202
201
|
"overflow-hidden area-content",
|
|
203
202
|
)}
|
|
204
203
|
/>
|
|
@@ -24,14 +24,13 @@
|
|
|
24
24
|
import { type ChildrenProp } from "@react-fabric/core/dist/types/types";
|
|
25
25
|
import classNames from "classnames";
|
|
26
26
|
import { type FC } from "react";
|
|
27
|
-
import classes from "./Chart.module.css";
|
|
28
27
|
|
|
29
28
|
export const ChartToolbar: FC<ChildrenProp> = ({ children }) => {
|
|
30
29
|
return (
|
|
31
30
|
<div
|
|
32
31
|
className={classNames(
|
|
33
32
|
"flex flex-nowrap items-center justify-end bg-base area-head",
|
|
34
|
-
|
|
33
|
+
"rf-chartToolbar",
|
|
35
34
|
)}
|
|
36
35
|
>
|
|
37
36
|
{children}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.chartContainer{&>div:last-child:not(:first-child)>:last-child{bottom:unset!important;inset-inline-end:0!important;left:unset!important;padding:.5rem;right:unset!important;top:0;&>div{float:unset!important;margin:0!important}}}.chartToolbar{input[type=range]{appearance:none;border-radius:999px;color:theme(colors.primary.500);overflow:hidden;position:relative;&::-webkit-slider-thumb{appearance:none;background:theme(colors.primary.500);border:1px solid theme(colors.tint.50);border-radius:.5rem;box-shadow:calc(-100vmax - 1rem) 0 0 100vmax currentColor;clip-path:polygon(100% -1px,.125rem -1px,0 .375rem,-100vmax .375rem,-100vmax .625rem,0 .625rem,.125rem 100%,calc(100% + 1px) calc(100% + 1px));cursor:pointer;filter:brightness(100%);height:1rem;opacity:.7;position:relative;width:1rem;&:hover{background:theme(colors.primary.600)}}&&::-webkit-slider-runnable-track{background:linear-gradient(theme(colors.tint.100) 0 0) scroll no-repeat 50% /100% .25rem;border-radius:99px;height:1rem}}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.chartContainer{&>div:last-child:not(:first-child)>:last-child{bottom:unset!important;inset-inline-end:0!important;left:unset!important;padding:.5rem;right:unset!important;top:0;&>div{float:unset!important;margin:0!important}}}.chartToolbar{input[type=range]{appearance:none;border-radius:999px;color:theme(colors.primary.500);overflow:hidden;position:relative;&::-webkit-slider-thumb{appearance:none;background:theme(colors.primary.500);border:1px solid theme(colors.tint.50);border-radius:.5rem;box-shadow:calc(-100vmax - 1rem) 0 0 100vmax currentColor;clip-path:polygon(100% -1px,.125rem -1px,0 .375rem,-100vmax .375rem,-100vmax .625rem,0 .625rem,.125rem 100%,calc(100% + 1px) calc(100% + 1px));cursor:pointer;filter:brightness(100%);height:1rem;opacity:.7;position:relative;width:1rem;&:hover{background:theme(colors.primary.600)}}&&::-webkit-slider-runnable-track{background:linear-gradient(theme(colors.tint.100) 0 0) scroll no-repeat 50% /100% .25rem;border-radius:99px;height:1rem}}}
|