Skip to content

Commit 484a484

Browse files
committed
feat: add effect-scatter, graph and heatmap charts
1 parent 5e6e697 commit 484a484

File tree

7 files changed

+1385
-210
lines changed

7 files changed

+1385
-210
lines changed

.storybook/preview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const preview: Preview = {
1616
},
1717
options: {
1818
storySort: {
19-
order: ['README', 'Line', 'Bar', 'Pie'],
19+
order: ['README', 'Line', 'Bar', 'Pie', 'Scatter'],
2020
},
2121
},
2222
} satisfies (CoreTypes & DocsTypes)['parameters'],

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@fanciers/echarts-react",
3-
"version": "0.0.3",
3+
"version": "0.0.4",
44
"description": "ECharts <3 React",
55
"author": "Tmk <i@tmk.im>",
66
"keywords": [
@@ -32,17 +32,17 @@
3232
"lint": "tsc --noEmit"
3333
},
3434
"devDependencies": {
35-
"@rsbuild/core": "^1.5.3",
35+
"@rsbuild/core": "^1.5.4",
3636
"@rsbuild/plugin-react": "^1.4.0",
37-
"@storybook/addon-docs": "^9.1.4",
38-
"@storybook/react": "^9.1.4",
37+
"@storybook/addon-docs": "^9.1.5",
38+
"@storybook/react": "^9.1.5",
3939
"@types/node": "^24.3.1",
4040
"@types/react": "^19.1.12",
4141
"@types/react-dom": "^19.1.9",
4242
"echarts": "^6.0.0",
4343
"react": "^19.1.1",
4444
"react-dom": "^19.1.1",
45-
"storybook": "^9.1.4",
45+
"storybook": "^9.1.5",
4646
"storybook-react-rsbuild": "^2.1.0",
4747
"swr": "^2.3.6",
4848
"tsdown": "^0.14.2",

pnpm-lock.yaml

Lines changed: 200 additions & 201 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/charts.tsx

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
import React from 'react';
2-
import type { BarSeriesOption, ComposeOption, GridComponentOption, ScatterSeriesOption } from 'echarts';
2+
import type {
3+
BarSeriesOption,
4+
ComposeOption,
5+
EffectScatterSeriesOption,
6+
GraphSeriesOption,
7+
GridComponentOption,
8+
HeatmapSeriesOption,
9+
ScatterSeriesOption,
10+
} from 'echarts';
311
import {
412
BarChart as EChartBarChart,
13+
EffectScatterChart as EChartEffectScatterChart,
14+
GraphChart as EChartGraphChart,
15+
HeatmapChart as EChartHeatmapChart,
516
LineChart as EChartLineChart,
617
PieChart as EChartPieChart,
718
ScatterChart as EChartScatterChart,
@@ -99,11 +110,23 @@ export const BarChart = /*#__PURE__*/ defineChart<BarSeriesOption | GridComponen
99110
GridComponent,
100111
]);
101112

113+
export const EffectScatterChart = /*#__PURE__*/ defineChart<EffectScatterSeriesOption | GridComponentOption>([
114+
EChartEffectScatterChart,
115+
GridComponent,
116+
]);
117+
118+
export const GraphChart = /*#__PURE__*/ defineChart<GraphSeriesOption>([EChartGraphChart]);
119+
120+
export const HeatmapChart = /*#__PURE__*/ defineChart<HeatmapSeriesOption>([EChartHeatmapChart]);
121+
102122
export const LineChart = /*#__PURE__*/ defineChart<LineSeriesOption | GridComponentOption>([
103123
EChartLineChart,
104124
GridComponent,
105125
]);
106126

107127
export const PieChart = /*#__PURE__*/ defineChart<PieSeriesOption>([EChartPieChart]);
108128

109-
export const ScatterChart = /*#__PURE__*/ defineChart<ScatterSeriesOption>([EChartScatterChart]);
129+
export const ScatterChart = /*#__PURE__*/ defineChart<ScatterSeriesOption | GridComponentOption>([
130+
EChartScatterChart,
131+
GridComponent,
132+
]);

src/components.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import type {
1212
MarkPointComponentOption,
1313
MatrixComponentOption,
1414
PolarComponentOption,
15+
SingleAxisComponentOption,
1516
TimelineComponentOption,
1617
TitleComponentOption,
1718
ToolboxComponentOption,
@@ -31,6 +32,7 @@ import {
3132
MarkPointComponent,
3233
MatrixComponent,
3334
PolarComponent,
35+
SingleAxisComponent,
3436
TimelineComponent,
3537
TitleComponent,
3638
ToolboxComponent,
@@ -82,6 +84,8 @@ export const Matrix = /*#__PURE__*/ defineComponent<MatrixComponentOption>(Matri
8284

8385
export const Polar = /*#__PURE__*/ defineComponent<PolarComponentOption>(PolarComponent);
8486

87+
export const SingleAxis = /*#__PURE__*/ defineComponent<SingleAxisComponentOption>(SingleAxisComponent);
88+
8589
export const Timeline = /*#__PURE__*/ defineComponent<TimelineComponentOption>(TimelineComponent);
8690

8791
export const Title = /*#__PURE__*/ defineComponent<TitleComponentOption>(TitleComponent);

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export { CanvasRenderer, SVGRenderer } from 'echarts/renderers';
2-
export { BarChart, LineChart, PieChart, ScatterChart } from './charts.js';
2+
export { BarChart, EffectScatterChart, GraphChart, HeatmapChart, LineChart, PieChart, ScatterChart } from './charts.js';
33
export {
44
Brush,
55
Calendar,
@@ -13,6 +13,7 @@ export {
1313
MarkPoint,
1414
Matrix,
1515
Polar,
16+
SingleAxis,
1617
Timeline,
1718
Title,
1819
Toolbox,

0 commit comments

Comments
 (0)