@react-fabric/chart 1.0.0-beta.53 → 1.0.0-beta.55
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/dist/cjs/charts/ActivityMap.js +16 -15
- package/dist/cjs/charts/CountSeries.js +20 -18
- package/dist/cjs/charts/DataSeries.js +23 -23
- package/dist/cjs/charts/MapSeries.js +6 -6
- package/dist/cjs/charts/TimeSeries.js +24 -24
- package/dist/cjs/charts/TimeSlider.js +9 -9
- package/dist/cjs/charts/WordBubble.js +5 -5
- package/dist/cjs/theme/darkBase.js +13 -5
- package/dist/cjs/theme/index.js +3 -3
- package/dist/cjs/theme/lightBase.js +18 -10
- package/dist/cjs/wrapper/ChartContainer.js +5 -5
- package/dist/esm/charts/ActivityMap.js +16 -15
- package/dist/esm/charts/CountSeries.js +20 -18
- package/dist/esm/charts/DataSeries.js +23 -23
- package/dist/esm/charts/MapSeries.js +6 -6
- package/dist/esm/charts/TimeSeries.js +24 -24
- package/dist/esm/charts/TimeSlider.js +9 -9
- package/dist/esm/charts/WordBubble.js +5 -5
- package/dist/esm/theme/darkBase.js +13 -5
- package/dist/esm/theme/index.js +3 -3
- package/dist/esm/theme/lightBase.js +18 -10
- package/dist/esm/wrapper/ChartContainer.js +5 -5
- package/dist/types/charts/ActivityMap.d.ts +1 -1
- package/dist/types/charts/CountSeries.d.ts +1 -0
- package/dist/types/charts/MapSeries.d.ts +7 -2
- package/dist/types/charts/TimeSlider.d.ts +1 -1
- package/dist/types/charts/WordBubble.d.ts +7 -2
- package/dist/types/theme/darkBase.d.ts +8 -0
- package/dist/types/theme/lightBase.d.ts +8 -0
- package/dist/types/types/index.d.ts +27 -11
- package/package.json +3 -3
- package/src/charts/ActivityMap.tsx +25 -22
- package/src/charts/CountSeries.tsx +27 -19
- package/src/charts/DataSeries.tsx +39 -21
- package/src/charts/MapSeries.tsx +8 -7
- package/src/charts/TimeSeries.tsx +49 -41
- package/src/charts/TimeSlider.tsx +12 -9
- package/src/charts/WordBubble.tsx +8 -7
- package/src/theme/darkBase.ts +12 -4
- package/src/theme/index.ts +3 -3
- package/src/theme/lightBase.ts +17 -9
- package/src/types/index.ts +34 -3
- package/src/wrapper/ChartContainer.tsx +5 -3
|
@@ -51,12 +51,13 @@ export interface DataSeriesProps extends BaseChart, SeriesType {
|
|
|
51
51
|
|
|
52
52
|
const DataSeriesChart: FC<DataSeriesProps> = memo(
|
|
53
53
|
({
|
|
54
|
-
|
|
54
|
+
series: _series,
|
|
55
55
|
onExport,
|
|
56
56
|
categories,
|
|
57
57
|
categoryAxisName,
|
|
58
58
|
valueAxisName,
|
|
59
59
|
title,
|
|
60
|
+
options: optionOverride,
|
|
60
61
|
showThemeSelector,
|
|
61
62
|
showTypeSelector,
|
|
62
63
|
theme: chartTheme,
|
|
@@ -76,7 +77,7 @@ const DataSeriesChart: FC<DataSeriesProps> = memo(
|
|
|
76
77
|
|
|
77
78
|
const options = useMemoDebugger<EChartOption>(
|
|
78
79
|
() => {
|
|
79
|
-
if (isEmpty(
|
|
80
|
+
if (isEmpty(_series)) {
|
|
80
81
|
chartRef.current?.clear();
|
|
81
82
|
return {};
|
|
82
83
|
}
|
|
@@ -84,7 +85,9 @@ const DataSeriesChart: FC<DataSeriesProps> = memo(
|
|
|
84
85
|
const stack = type.includes("stacked") ? "stack" : undefined;
|
|
85
86
|
|
|
86
87
|
const [_type, stacked] = type.split("-");
|
|
87
|
-
const categoryAxis: AnyObject =
|
|
88
|
+
const categoryAxis: AnyObject = Object.assign(
|
|
89
|
+
{},
|
|
90
|
+
optionOverride?.xAxis,
|
|
88
91
|
_type === "radar"
|
|
89
92
|
? undefined
|
|
90
93
|
: ({
|
|
@@ -96,8 +99,11 @@ const DataSeriesChart: FC<DataSeriesProps> = memo(
|
|
|
96
99
|
show: false,
|
|
97
100
|
},
|
|
98
101
|
data: categories,
|
|
99
|
-
} as EChartOption.XAxis)
|
|
100
|
-
|
|
102
|
+
} as EChartOption.XAxis),
|
|
103
|
+
);
|
|
104
|
+
const valueAxis: AnyObject = Object.assign(
|
|
105
|
+
{},
|
|
106
|
+
optionOverride?.yAxis,
|
|
101
107
|
_type === "radar"
|
|
102
108
|
? undefined
|
|
103
109
|
: ({
|
|
@@ -105,18 +111,19 @@ const DataSeriesChart: FC<DataSeriesProps> = memo(
|
|
|
105
111
|
type: "value",
|
|
106
112
|
nameGap: 32,
|
|
107
113
|
nameLocation: "center",
|
|
108
|
-
} as EChartOption.YAxis)
|
|
114
|
+
} as EChartOption.YAxis),
|
|
115
|
+
);
|
|
109
116
|
const radar =
|
|
110
117
|
_type !== "radar"
|
|
111
118
|
? undefined
|
|
112
|
-
: ({
|
|
119
|
+
: Object.assign({}, optionOverride?.radar, {
|
|
113
120
|
shape: "circle",
|
|
114
121
|
indicator: categories?.map((c) => ({ name: c })),
|
|
115
122
|
} as AnyObject);
|
|
116
123
|
|
|
117
|
-
const series =
|
|
118
|
-
|
|
119
|
-
stack,
|
|
124
|
+
const series = _series?.map((item, index) => ({
|
|
125
|
+
...item,
|
|
126
|
+
stack: item.stack ?? stack,
|
|
120
127
|
areaStyle: stacked ? {} : undefined,
|
|
121
128
|
type: _type === "column" ? "bar" : _type,
|
|
122
129
|
name: item.label ?? item.id,
|
|
@@ -125,28 +132,39 @@ const DataSeriesChart: FC<DataSeriesProps> = memo(
|
|
|
125
132
|
_type === "radar"
|
|
126
133
|
? [
|
|
127
134
|
{
|
|
128
|
-
value: item.
|
|
135
|
+
value: item.data,
|
|
129
136
|
id: item.id,
|
|
130
|
-
name: item.
|
|
137
|
+
name: item.name ?? item.id,
|
|
131
138
|
},
|
|
132
139
|
]
|
|
133
|
-
: item.
|
|
140
|
+
: item.data,
|
|
134
141
|
}));
|
|
135
142
|
|
|
136
143
|
return {
|
|
144
|
+
...optionOverride,
|
|
137
145
|
xAxis: type.startsWith("bar") ? valueAxis : categoryAxis,
|
|
138
146
|
yAxis: type.startsWith("bar") ? categoryAxis : valueAxis,
|
|
139
147
|
radar,
|
|
140
148
|
series,
|
|
141
|
-
tooltip:
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
149
|
+
tooltip: Object.assign(
|
|
150
|
+
{
|
|
151
|
+
trigger: _type === "radar" ? "item" : "axis",
|
|
152
|
+
confine: true,
|
|
153
|
+
position: "top",
|
|
154
|
+
appendToBody: true,
|
|
155
|
+
} as AnyObject,
|
|
156
|
+
optionOverride?.tooltip,
|
|
157
|
+
),
|
|
147
158
|
};
|
|
148
159
|
},
|
|
149
|
-
[
|
|
160
|
+
[
|
|
161
|
+
_series,
|
|
162
|
+
type,
|
|
163
|
+
categories,
|
|
164
|
+
categoryAxisName,
|
|
165
|
+
valueAxisName,
|
|
166
|
+
optionOverride,
|
|
167
|
+
],
|
|
150
168
|
"DataChart options",
|
|
151
169
|
);
|
|
152
170
|
|
|
@@ -157,7 +175,7 @@ const DataSeriesChart: FC<DataSeriesProps> = memo(
|
|
|
157
175
|
theme={theme}
|
|
158
176
|
options={options}
|
|
159
177
|
chartRef={chartRef}
|
|
160
|
-
isEmpty={isEmpty(
|
|
178
|
+
isEmpty={isEmpty(_series)}
|
|
161
179
|
emptyIcon={CoreIcons.chartColumn}
|
|
162
180
|
dataTableRenderer={seriesRenderer}
|
|
163
181
|
onClick={(e) => onClick?.({ category: e.name, series: e.seriesId })}
|
package/src/charts/MapSeries.tsx
CHANGED
|
@@ -45,13 +45,14 @@ import {
|
|
|
45
45
|
import WorldMap from "../types/world.svg";
|
|
46
46
|
echarts.registerMap("world", { svg: WorldMap });
|
|
47
47
|
|
|
48
|
-
export interface MapSeriesProps extends BaseChart
|
|
48
|
+
export interface MapSeriesProps extends BaseChart {
|
|
49
|
+
series: Array<{ id: string; label?: string; count: number }>;
|
|
49
50
|
onClick?: (key: string) => void;
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
const MapSeriesChart: FC<MapSeriesProps> = memo(
|
|
53
54
|
({
|
|
54
|
-
|
|
55
|
+
series,
|
|
55
56
|
onExport,
|
|
56
57
|
theme: chartTheme,
|
|
57
58
|
showTypeSelector,
|
|
@@ -64,15 +65,15 @@ const MapSeriesChart: FC<MapSeriesProps> = memo(
|
|
|
64
65
|
|
|
65
66
|
const options = useMemoDebugger<EChartOption>(
|
|
66
67
|
() => {
|
|
67
|
-
if (isEmpty(
|
|
68
|
+
if (isEmpty(series)) return {};
|
|
68
69
|
|
|
69
|
-
const sorted =
|
|
70
|
+
const sorted = series
|
|
70
71
|
.map((d) => ({
|
|
71
72
|
...d,
|
|
72
73
|
label: d.label ?? Countries.name(d.id),
|
|
73
74
|
}))
|
|
74
75
|
.sort(compareValues("desc", "count"));
|
|
75
|
-
const valueMap =
|
|
76
|
+
const valueMap = series.map((d) => d.count);
|
|
76
77
|
|
|
77
78
|
if (type === "column") {
|
|
78
79
|
return {
|
|
@@ -155,13 +156,13 @@ const MapSeriesChart: FC<MapSeriesProps> = memo(
|
|
|
155
156
|
],
|
|
156
157
|
};
|
|
157
158
|
},
|
|
158
|
-
[
|
|
159
|
+
[series, title, type],
|
|
159
160
|
"MapChart options",
|
|
160
161
|
);
|
|
161
162
|
|
|
162
163
|
useEffect(() => {
|
|
163
164
|
setZoom(1.25);
|
|
164
|
-
}, [
|
|
165
|
+
}, [series, type]);
|
|
165
166
|
|
|
166
167
|
useEffect(() => {
|
|
167
168
|
chartRef.current?.setOption({
|
|
@@ -45,7 +45,7 @@ export interface TimeSeriesProps extends BaseChart, TimeSeriesType {
|
|
|
45
45
|
|
|
46
46
|
const TimeSeriesChart: FC<TimeSeriesProps> = memo(
|
|
47
47
|
({
|
|
48
|
-
|
|
48
|
+
series: _series,
|
|
49
49
|
onExport,
|
|
50
50
|
categoryAxisName,
|
|
51
51
|
valueAxisName,
|
|
@@ -54,6 +54,7 @@ const TimeSeriesChart: FC<TimeSeriesProps> = memo(
|
|
|
54
54
|
showTypeSelector,
|
|
55
55
|
theme: chartTheme,
|
|
56
56
|
type: chartType = "column",
|
|
57
|
+
options: optionOverride,
|
|
57
58
|
onClick,
|
|
58
59
|
onBrush,
|
|
59
60
|
}: TimeSeriesProps) => {
|
|
@@ -108,7 +109,7 @@ const TimeSeriesChart: FC<TimeSeriesProps> = memo(
|
|
|
108
109
|
|
|
109
110
|
const options = useMemoDebugger<EChartOption>(
|
|
110
111
|
() => {
|
|
111
|
-
if (isEmpty(
|
|
112
|
+
if (isEmpty(_series)) {
|
|
112
113
|
chartRef.current?.clear();
|
|
113
114
|
return {};
|
|
114
115
|
}
|
|
@@ -116,66 +117,73 @@ const TimeSeriesChart: FC<TimeSeriesProps> = memo(
|
|
|
116
117
|
const stack = type.includes("stacked") ? "stack" : undefined;
|
|
117
118
|
|
|
118
119
|
const [_type, stacked] = type.split("-");
|
|
119
|
-
const categoryAxis: AnyObject =
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
120
|
+
const categoryAxis: AnyObject = Object.assign(
|
|
121
|
+
{},
|
|
122
|
+
optionOverride?.xAxis,
|
|
123
|
+
{
|
|
124
|
+
name: categoryAxisName,
|
|
125
|
+
type: "time",
|
|
126
|
+
nameGap: 32,
|
|
127
|
+
nameLocation: "center",
|
|
128
|
+
axisTick: {
|
|
129
|
+
show: false,
|
|
130
|
+
},
|
|
131
|
+
axisLabel: {
|
|
132
|
+
formatter: {
|
|
133
|
+
year: "{yyyy}",
|
|
134
|
+
month: "{MMM}",
|
|
135
|
+
day: "{d}",
|
|
136
|
+
hour: "{HH}:{mm}",
|
|
137
|
+
minute: "{HH}:{mm}",
|
|
138
|
+
second: "{HH}:{mm}:{ss}",
|
|
139
|
+
millisecond: "{hh}:{mm}:{ss} {SSS}",
|
|
140
|
+
none: "{yyyy}-{MM}-{dd} {hh}:{mm}:{ss} {SSS}",
|
|
141
|
+
} as AnyObject,
|
|
142
|
+
},
|
|
143
|
+
} as EChartOption.XAxis,
|
|
144
|
+
);
|
|
145
|
+
const valueAxis: AnyObject = Object.assign({}, optionOverride?.yAxis, {
|
|
141
146
|
name: valueAxisName,
|
|
142
147
|
type: "value",
|
|
143
148
|
nameGap: 32,
|
|
144
149
|
nameLocation: "center",
|
|
145
|
-
} as EChartOption.YAxis;
|
|
150
|
+
} as EChartOption.YAxis);
|
|
146
151
|
|
|
147
|
-
const series =
|
|
152
|
+
const series = _series?.map(
|
|
148
153
|
(item) =>
|
|
149
154
|
({
|
|
150
|
-
|
|
151
|
-
stack,
|
|
155
|
+
...item,
|
|
156
|
+
stack: item.stack ?? stack,
|
|
152
157
|
areaStyle: stacked ? {} : undefined,
|
|
153
158
|
symbol: "none",
|
|
154
159
|
type: _type === "column" ? "bar" : _type,
|
|
155
|
-
name: item.
|
|
156
|
-
data: item.values,
|
|
160
|
+
name: item.name ?? item.id,
|
|
157
161
|
universalTransition: true,
|
|
158
162
|
}) as AnyObject,
|
|
159
163
|
);
|
|
160
164
|
|
|
161
165
|
return {
|
|
162
|
-
xAxis: categoryAxis,
|
|
163
|
-
yAxis: valueAxis,
|
|
164
|
-
series,
|
|
165
166
|
brush: {
|
|
166
167
|
toolbox: ["lineX", "clear"],
|
|
167
168
|
brushType: "lineX",
|
|
168
169
|
xAxisIndex: 0,
|
|
169
170
|
},
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
171
|
+
...optionOverride,
|
|
172
|
+
tooltip: Object.assign(
|
|
173
|
+
{
|
|
174
|
+
trigger: "axis",
|
|
175
|
+
confine: true,
|
|
176
|
+
position: "top",
|
|
177
|
+
appendToBody: true,
|
|
178
|
+
} as EChartOption.Tooltip,
|
|
179
|
+
optionOverride?.tooltip,
|
|
180
|
+
),
|
|
181
|
+
xAxis: categoryAxis,
|
|
182
|
+
yAxis: valueAxis,
|
|
183
|
+
series,
|
|
176
184
|
};
|
|
177
185
|
},
|
|
178
|
-
[
|
|
186
|
+
[_series, type, categoryAxisName, valueAxisName, optionOverride],
|
|
179
187
|
"TimeChart options",
|
|
180
188
|
);
|
|
181
189
|
|
|
@@ -186,7 +194,7 @@ const TimeSeriesChart: FC<TimeSeriesProps> = memo(
|
|
|
186
194
|
theme={theme}
|
|
187
195
|
options={options}
|
|
188
196
|
chartRef={chartRef}
|
|
189
|
-
isEmpty={isEmpty(
|
|
197
|
+
isEmpty={isEmpty(_series)}
|
|
190
198
|
emptyIcon={CoreIcons.chartColumn}
|
|
191
199
|
dataTableRenderer={timeSeriesRenderer}
|
|
192
200
|
onClick={(e) => onClick?.({ category: e.data[0], series: e.seriesId })}
|
|
@@ -35,13 +35,13 @@ import { ChartContainer } from "../wrapper/ChartContainer";
|
|
|
35
35
|
import { ChartWrapper } from "../wrapper/ChartWrapper";
|
|
36
36
|
|
|
37
37
|
export interface TimeSliderProps extends BaseChart {
|
|
38
|
-
|
|
38
|
+
series: Array<[Date, number]>;
|
|
39
39
|
range?: { start: Date; end: Date };
|
|
40
40
|
onBrush?: (range: { start: Date; end: Date }) => void;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
const TimeSliderChart: FC<TimeSliderProps> = memo(
|
|
44
|
-
({
|
|
44
|
+
({ series: dataSeries, range: sliderRange, onBrush }: TimeSliderProps) => {
|
|
45
45
|
const chartRef = useRef<EChartsType>(null);
|
|
46
46
|
|
|
47
47
|
const [range, setRange] = useState({ startValue: 0, endValue: 0 });
|
|
@@ -53,9 +53,12 @@ const TimeSliderChart: FC<TimeSliderProps> = memo(
|
|
|
53
53
|
);
|
|
54
54
|
|
|
55
55
|
useEffect(() => {
|
|
56
|
-
const defaultStart =
|
|
56
|
+
const defaultStart =
|
|
57
|
+
dataSeries.length > 0 ? dataSeries?.[0]?.[0]?.getTime() : 0;
|
|
57
58
|
const defaultEnd =
|
|
58
|
-
|
|
59
|
+
dataSeries.length > 0
|
|
60
|
+
? dataSeries?.[dataSeries.length - 1]?.[0]?.getTime()
|
|
61
|
+
: 32;
|
|
59
62
|
|
|
60
63
|
const getRangeValue = (v: number = 0, def = 0) =>
|
|
61
64
|
v >= defaultStart && v <= defaultEnd ? v : def;
|
|
@@ -63,7 +66,7 @@ const TimeSliderChart: FC<TimeSliderProps> = memo(
|
|
|
63
66
|
startValue: getRangeValue(sliderRange?.start.getTime(), defaultStart),
|
|
64
67
|
endValue: getRangeValue(sliderRange?.end.getTime(), defaultEnd),
|
|
65
68
|
});
|
|
66
|
-
}, [sliderRange,
|
|
69
|
+
}, [sliderRange, dataSeries]);
|
|
67
70
|
|
|
68
71
|
const enableBrush = useCallback(() => {
|
|
69
72
|
chartRef.current?.dispatchAction({
|
|
@@ -107,7 +110,7 @@ const TimeSliderChart: FC<TimeSliderProps> = memo(
|
|
|
107
110
|
|
|
108
111
|
const options = useMemoDebugger<EChartOption>(
|
|
109
112
|
() => {
|
|
110
|
-
if (isEmpty(
|
|
113
|
+
if (isEmpty(dataSeries)) {
|
|
111
114
|
chartRef.current?.clear();
|
|
112
115
|
return {};
|
|
113
116
|
}
|
|
@@ -152,7 +155,7 @@ const TimeSliderChart: FC<TimeSliderProps> = memo(
|
|
|
152
155
|
type: "line",
|
|
153
156
|
smooth: true,
|
|
154
157
|
lineStyle: { width: 2 },
|
|
155
|
-
data,
|
|
158
|
+
data: dataSeries,
|
|
156
159
|
} as AnyObject,
|
|
157
160
|
];
|
|
158
161
|
|
|
@@ -194,7 +197,7 @@ const TimeSliderChart: FC<TimeSliderProps> = memo(
|
|
|
194
197
|
} as AnyObject,
|
|
195
198
|
};
|
|
196
199
|
},
|
|
197
|
-
[
|
|
200
|
+
[dataSeries],
|
|
198
201
|
"TimeSlider options",
|
|
199
202
|
);
|
|
200
203
|
|
|
@@ -219,7 +222,7 @@ const TimeSliderChart: FC<TimeSliderProps> = memo(
|
|
|
219
222
|
<ChartContainer
|
|
220
223
|
options={options}
|
|
221
224
|
chartRef={chartRef}
|
|
222
|
-
isEmpty={isEmpty(
|
|
225
|
+
isEmpty={isEmpty(dataSeries)}
|
|
223
226
|
/>
|
|
224
227
|
);
|
|
225
228
|
},
|
|
@@ -26,22 +26,23 @@ import { compareValues, isEmpty } from "@react-fabric/utilities";
|
|
|
26
26
|
import { type EChartOption } from "echarts";
|
|
27
27
|
import { memo, type FC } from "react";
|
|
28
28
|
import { ChartPalette } from "../theme/palettes";
|
|
29
|
-
import { type BaseChart
|
|
29
|
+
import { type BaseChart } from "../types";
|
|
30
30
|
import { countRenderer } from "../types/utils";
|
|
31
31
|
import { ChartContainer } from "../wrapper/ChartContainer";
|
|
32
32
|
import { ChartWrapper } from "../wrapper/ChartWrapper";
|
|
33
33
|
|
|
34
|
-
export interface WordBubbleProps extends Omit<BaseChart, "theme"
|
|
34
|
+
export interface WordBubbleProps extends Omit<BaseChart, "theme"> {
|
|
35
|
+
series: Array<{ id: string; label?: string; count: number }>;
|
|
35
36
|
onClick?: (key: string) => void;
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
const WordBubbleChart: FC<WordBubbleProps> = memo(
|
|
39
|
-
({
|
|
40
|
+
({ series, title, onExport, onClick }: WordBubbleProps) => {
|
|
40
41
|
const isDark = useIsDark();
|
|
41
42
|
|
|
42
43
|
const options = useMemoDebugger<EChartOption>(
|
|
43
44
|
() => {
|
|
44
|
-
if (isEmpty(
|
|
45
|
+
if (isEmpty(series)) return {};
|
|
45
46
|
|
|
46
47
|
const palette = isDark
|
|
47
48
|
? ChartPalette.CloudDark
|
|
@@ -72,7 +73,7 @@ const WordBubbleChart: FC<WordBubbleProps> = memo(
|
|
|
72
73
|
color: ({ dataIndex }: KeyValue) =>
|
|
73
74
|
palette[dataIndex % palette.length],
|
|
74
75
|
},
|
|
75
|
-
data:
|
|
76
|
+
data: series
|
|
76
77
|
.sort(compareValues("desc", "count"))
|
|
77
78
|
.map(({ id: key, label, count }, index) => ({
|
|
78
79
|
name: label ?? key,
|
|
@@ -82,7 +83,7 @@ const WordBubbleChart: FC<WordBubbleProps> = memo(
|
|
|
82
83
|
],
|
|
83
84
|
};
|
|
84
85
|
},
|
|
85
|
-
[
|
|
86
|
+
[series, title, isDark],
|
|
86
87
|
"WordChart options",
|
|
87
88
|
);
|
|
88
89
|
|
|
@@ -91,7 +92,7 @@ const WordBubbleChart: FC<WordBubbleProps> = memo(
|
|
|
91
92
|
title={title}
|
|
92
93
|
onExport={onExport}
|
|
93
94
|
options={options}
|
|
94
|
-
isEmpty={isEmpty(
|
|
95
|
+
isEmpty={isEmpty(series)}
|
|
95
96
|
emptyIcon={CoreIcons.chartActivityScatter}
|
|
96
97
|
dataTableRenderer={countRenderer}
|
|
97
98
|
onClick={(e) => onClick?.(e?.name ?? "")}
|
package/src/theme/darkBase.ts
CHANGED
|
@@ -195,7 +195,7 @@ export const DarkThemeBase = {
|
|
|
195
195
|
splitLine: {
|
|
196
196
|
show: true,
|
|
197
197
|
lineStyle: {
|
|
198
|
-
color: ["#
|
|
198
|
+
color: ["#363636"],
|
|
199
199
|
},
|
|
200
200
|
},
|
|
201
201
|
splitArea: {
|
|
@@ -229,7 +229,7 @@ export const DarkThemeBase = {
|
|
|
229
229
|
splitLine: {
|
|
230
230
|
show: true,
|
|
231
231
|
lineStyle: {
|
|
232
|
-
color: ["#
|
|
232
|
+
color: ["#363636"],
|
|
233
233
|
},
|
|
234
234
|
},
|
|
235
235
|
splitArea: {
|
|
@@ -263,7 +263,7 @@ export const DarkThemeBase = {
|
|
|
263
263
|
splitLine: {
|
|
264
264
|
show: true,
|
|
265
265
|
lineStyle: {
|
|
266
|
-
color: ["#
|
|
266
|
+
color: ["#363636"],
|
|
267
267
|
},
|
|
268
268
|
},
|
|
269
269
|
splitArea: {
|
|
@@ -297,7 +297,7 @@ export const DarkThemeBase = {
|
|
|
297
297
|
splitLine: {
|
|
298
298
|
show: true,
|
|
299
299
|
lineStyle: {
|
|
300
|
-
color: ["#
|
|
300
|
+
color: ["#363636"],
|
|
301
301
|
},
|
|
302
302
|
},
|
|
303
303
|
splitArea: {
|
|
@@ -319,9 +319,17 @@ export const DarkThemeBase = {
|
|
|
319
319
|
},
|
|
320
320
|
legend: {
|
|
321
321
|
inactiveColor: "rgb(192 192 192 / .75)",
|
|
322
|
+
itemHeight: 8,
|
|
322
323
|
textStyle: {
|
|
324
|
+
fontSize: 10,
|
|
323
325
|
color: "#5d6d7d6",
|
|
324
326
|
},
|
|
327
|
+
pageTextStyle: {
|
|
328
|
+
fontSize: 8,
|
|
329
|
+
},
|
|
330
|
+
pageIconSize: 8,
|
|
331
|
+
pageIconColor: "#6997A3",
|
|
332
|
+
pageIconInactiveColor: "#474B4A",
|
|
325
333
|
},
|
|
326
334
|
tooltip: {
|
|
327
335
|
backgroundColor: "#0C141D",
|
package/src/theme/index.ts
CHANGED
|
@@ -178,17 +178,17 @@ export const registerThemes = (echarts: AnyObject) => {
|
|
|
178
178
|
ChartPalette.Wine[3],
|
|
179
179
|
ChartPalette.Wine[5],
|
|
180
180
|
]);
|
|
181
|
-
registerTheme(echarts, "blue", ChartPalette.GreenBlue, [
|
|
181
|
+
registerTheme(echarts, "blue", ChartPalette.GreenBlue.slice().reverse(), [
|
|
182
182
|
ChartPalette.GreenBlue[6],
|
|
183
183
|
ChartPalette.GreenBlue[3],
|
|
184
184
|
ChartPalette.GreenBlue[0],
|
|
185
185
|
]);
|
|
186
|
-
registerTheme(echarts, "green", ChartPalette.YellowGreen, [
|
|
186
|
+
registerTheme(echarts, "green", ChartPalette.YellowGreen.slice().reverse(), [
|
|
187
187
|
ChartPalette.YellowGreen[6],
|
|
188
188
|
ChartPalette.YellowGreen[3],
|
|
189
189
|
ChartPalette.YellowGreen[0],
|
|
190
190
|
]);
|
|
191
|
-
registerTheme(echarts, "red", ChartPalette.OrangeRed, [
|
|
191
|
+
registerTheme(echarts, "red", ChartPalette.OrangeRed.slice().reverse(), [
|
|
192
192
|
ChartPalette.OrangeRed[6],
|
|
193
193
|
ChartPalette.OrangeRed[3],
|
|
194
194
|
ChartPalette.OrangeRed[0],
|
package/src/theme/lightBase.ts
CHANGED
|
@@ -62,7 +62,7 @@ export const LightThemeBase = {
|
|
|
62
62
|
splitLine: {
|
|
63
63
|
show: true,
|
|
64
64
|
lineStyle: {
|
|
65
|
-
color: ["#
|
|
65
|
+
color: ["#d9d9d9"],
|
|
66
66
|
},
|
|
67
67
|
},
|
|
68
68
|
splitArea: {
|
|
@@ -174,7 +174,7 @@ export const LightThemeBase = {
|
|
|
174
174
|
axisLine: {
|
|
175
175
|
show: true,
|
|
176
176
|
lineStyle: {
|
|
177
|
-
color: "#
|
|
177
|
+
color: "#c5c5c5",
|
|
178
178
|
},
|
|
179
179
|
},
|
|
180
180
|
axisTick: {
|
|
@@ -193,7 +193,7 @@ export const LightThemeBase = {
|
|
|
193
193
|
splitLine: {
|
|
194
194
|
show: true,
|
|
195
195
|
lineStyle: {
|
|
196
|
-
color: ["#
|
|
196
|
+
color: ["#d9d9d9"],
|
|
197
197
|
},
|
|
198
198
|
},
|
|
199
199
|
splitArea: {
|
|
@@ -208,7 +208,7 @@ export const LightThemeBase = {
|
|
|
208
208
|
axisLine: {
|
|
209
209
|
show: true,
|
|
210
210
|
lineStyle: {
|
|
211
|
-
color: "#
|
|
211
|
+
color: "#c5c5c5",
|
|
212
212
|
},
|
|
213
213
|
},
|
|
214
214
|
axisTick: {
|
|
@@ -227,7 +227,7 @@ export const LightThemeBase = {
|
|
|
227
227
|
splitLine: {
|
|
228
228
|
show: true,
|
|
229
229
|
lineStyle: {
|
|
230
|
-
color: ["#
|
|
230
|
+
color: ["#d9d9d9"],
|
|
231
231
|
},
|
|
232
232
|
},
|
|
233
233
|
splitArea: {
|
|
@@ -242,7 +242,7 @@ export const LightThemeBase = {
|
|
|
242
242
|
axisLine: {
|
|
243
243
|
show: true,
|
|
244
244
|
lineStyle: {
|
|
245
|
-
color: "#
|
|
245
|
+
color: "#969696",
|
|
246
246
|
},
|
|
247
247
|
},
|
|
248
248
|
axisTick: {
|
|
@@ -261,7 +261,7 @@ export const LightThemeBase = {
|
|
|
261
261
|
splitLine: {
|
|
262
262
|
show: true,
|
|
263
263
|
lineStyle: {
|
|
264
|
-
color: ["#
|
|
264
|
+
color: ["#d9d9d9"],
|
|
265
265
|
},
|
|
266
266
|
},
|
|
267
267
|
splitArea: {
|
|
@@ -276,7 +276,7 @@ export const LightThemeBase = {
|
|
|
276
276
|
axisLine: {
|
|
277
277
|
show: true,
|
|
278
278
|
lineStyle: {
|
|
279
|
-
color: "#
|
|
279
|
+
color: "#969696",
|
|
280
280
|
},
|
|
281
281
|
},
|
|
282
282
|
axisTick: {
|
|
@@ -295,7 +295,7 @@ export const LightThemeBase = {
|
|
|
295
295
|
splitLine: {
|
|
296
296
|
show: true,
|
|
297
297
|
lineStyle: {
|
|
298
|
-
color: ["#
|
|
298
|
+
color: ["#d9d9d9"],
|
|
299
299
|
},
|
|
300
300
|
},
|
|
301
301
|
splitArea: {
|
|
@@ -317,9 +317,17 @@ export const LightThemeBase = {
|
|
|
317
317
|
},
|
|
318
318
|
legend: {
|
|
319
319
|
inactiveColor: "rgb(96 96 96 / .75)",
|
|
320
|
+
itemHeight: 8,
|
|
320
321
|
textStyle: {
|
|
322
|
+
fontSize: 10,
|
|
321
323
|
color: "#565656",
|
|
322
324
|
},
|
|
325
|
+
pageTextStyle: {
|
|
326
|
+
fontSize: 8,
|
|
327
|
+
},
|
|
328
|
+
pageIconSize: 8,
|
|
329
|
+
pageIconColor: "#487884",
|
|
330
|
+
pageIconInactiveColor: "#CCD3D1",
|
|
323
331
|
},
|
|
324
332
|
tooltip: {
|
|
325
333
|
backgroundColor: "#FCFDFD",
|