@react-fabric/chart 1.0.0-beta.51 → 1.0.0-beta.53
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 +43 -13
- package/dist/cjs/charts/CountSeries.js +32 -4
- package/dist/cjs/charts/DataSeries.js +33 -5
- package/dist/cjs/charts/Generic.js +29 -5
- package/dist/cjs/charts/MapSeries.js +27 -3
- package/dist/cjs/charts/TimeSeries.js +31 -5
- package/dist/cjs/charts/TimeSlider.js +21 -1
- package/dist/cjs/charts/WordBubble.js +31 -1
- package/dist/cjs/theme/darkBase.js +0 -5
- package/dist/cjs/theme/index.js +38 -18
- package/dist/cjs/theme/lightBase.js +0 -5
- package/dist/cjs/theme/palettes.js +27 -27
- package/dist/cjs/types/charts.js +2 -2
- package/dist/cjs/wrapper/ChartContainer.js +2 -1
- package/dist/cjs/wrapper/ChartToolbar.js +1 -1
- package/dist/esm/charts/ActivityMap.js +43 -13
- package/dist/esm/charts/CountSeries.js +32 -4
- package/dist/esm/charts/DataSeries.js +33 -5
- package/dist/esm/charts/Generic.js +31 -7
- package/dist/esm/charts/MapSeries.js +27 -3
- package/dist/esm/charts/TimeSeries.js +31 -5
- package/dist/esm/charts/TimeSlider.js +21 -1
- package/dist/esm/charts/WordBubble.js +31 -1
- package/dist/esm/theme/darkBase.js +0 -5
- package/dist/esm/theme/index.js +38 -18
- package/dist/esm/theme/lightBase.js +0 -5
- package/dist/esm/theme/palettes.js +27 -27
- package/dist/esm/types/charts.js +2 -2
- package/dist/esm/wrapper/ChartContainer.js +2 -1
- package/dist/esm/wrapper/ChartToolbar.js +1 -1
- 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 +13 -0
- 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/theme/darkBase.d.ts +0 -5
- package/dist/types/theme/index.d.ts +1 -1
- package/dist/types/theme/lightBase.d.ts +0 -5
- package/dist/types/types/charts.d.ts +1 -1
- package/dist/types/types/index.d.ts +3 -1
- package/dist/types/types/world.svg.d.ts +1 -1
- package/package.json +4 -4
- package/src/charts/ActivityMap.tsx +75 -37
- package/src/charts/CountSeries.tsx +58 -26
- package/src/charts/DataSeries.tsx +86 -54
- package/src/charts/Generic.tsx +24 -4
- package/src/charts/MapSeries.tsx +50 -18
- package/src/charts/TimeSeries.tsx +64 -34
- package/src/charts/TimeSlider.tsx +21 -1
- package/src/charts/WordBubble.tsx +31 -1
- package/src/theme/darkBase.ts +0 -5
- package/src/theme/index.ts +94 -20
- package/src/theme/lightBase.ts +0 -5
- package/src/theme/palettes.ts +1 -52
- package/src/types/charts.ts +6 -2
- package/src/types/index.ts +6 -1
- package/src/wrapper/ChartContainer.tsx +1 -0
- package/src/wrapper/ChartToolbar.tsx +1 -1
|
@@ -50,6 +50,8 @@ const TimeSeriesChart: FC<TimeSeriesProps> = memo(
|
|
|
50
50
|
categoryAxisName,
|
|
51
51
|
valueAxisName,
|
|
52
52
|
title,
|
|
53
|
+
showThemeSelector,
|
|
54
|
+
showTypeSelector,
|
|
53
55
|
theme: chartTheme,
|
|
54
56
|
type: chartType = "column",
|
|
55
57
|
onClick,
|
|
@@ -169,7 +171,8 @@ const TimeSeriesChart: FC<TimeSeriesProps> = memo(
|
|
|
169
171
|
trigger: "axis",
|
|
170
172
|
confine: true,
|
|
171
173
|
position: "top",
|
|
172
|
-
|
|
174
|
+
appendToBody: true,
|
|
175
|
+
} as EChartOption.Tooltip,
|
|
173
176
|
};
|
|
174
177
|
},
|
|
175
178
|
[data, type, categoryAxisName, valueAxisName],
|
|
@@ -188,38 +191,42 @@ const TimeSeriesChart: FC<TimeSeriesProps> = memo(
|
|
|
188
191
|
dataTableRenderer={timeSeriesRenderer}
|
|
189
192
|
onClick={(e) => onClick?.({ category: e.data[0], series: e.seriesId })}
|
|
190
193
|
>
|
|
191
|
-
|
|
192
|
-
<
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
194
|
+
{showTypeSelector && (
|
|
195
|
+
<ToggleButtonGroup value={type} onChange={setType as AnyObject}>
|
|
196
|
+
<Button
|
|
197
|
+
size="sm"
|
|
198
|
+
variant="link"
|
|
199
|
+
icon={CoreIcons.chartLine}
|
|
200
|
+
value="line"
|
|
201
|
+
aria-label="line"
|
|
202
|
+
/>
|
|
203
|
+
<Button
|
|
204
|
+
size="sm"
|
|
205
|
+
variant="link"
|
|
206
|
+
icon={CoreIcons.chartColumn}
|
|
207
|
+
value="column"
|
|
208
|
+
aria-label="column"
|
|
209
|
+
/>
|
|
210
|
+
<Button
|
|
211
|
+
size="sm"
|
|
212
|
+
variant="link"
|
|
213
|
+
icon={CoreIcons.chartLineStacked}
|
|
214
|
+
value="line-stacked"
|
|
215
|
+
aria-label="line-stacked"
|
|
216
|
+
/>
|
|
217
|
+
<Button
|
|
218
|
+
size="sm"
|
|
219
|
+
variant="link"
|
|
220
|
+
icon={CoreIcons.chartColumnStacked}
|
|
221
|
+
value="column-stacked"
|
|
222
|
+
aria-label="column-stacked"
|
|
223
|
+
/>
|
|
224
|
+
</ToggleButtonGroup>
|
|
225
|
+
)}
|
|
226
|
+
{showTypeSelector && showThemeSelector && <Divider vertical />}
|
|
227
|
+
{showThemeSelector && (
|
|
228
|
+
<PaletteSelect theme={theme} onClick={setTheme} />
|
|
229
|
+
)}
|
|
223
230
|
</ChartContainer>
|
|
224
231
|
);
|
|
225
232
|
},
|
|
@@ -227,7 +234,30 @@ const TimeSeriesChart: FC<TimeSeriesProps> = memo(
|
|
|
227
234
|
TimeSeriesChart.displayName = "TimeSeriesChart";
|
|
228
235
|
|
|
229
236
|
/**
|
|
230
|
-
*
|
|
237
|
+
* TimeSeries component renders a time series chart using the provided data and options.
|
|
238
|
+
* It supports different chart types such as line, column, and stacked variants.
|
|
239
|
+
* It also allows for interaction through click and brush events.
|
|
240
|
+
*
|
|
241
|
+
* @param {TimeSeriesProps} props - The properties for the TimeSeries component.
|
|
242
|
+
* @returns {JSX.Element} The rendered TimeSeries component.
|
|
243
|
+
*
|
|
244
|
+
* @example
|
|
245
|
+
* ```jsx
|
|
246
|
+
* <TimeSeries
|
|
247
|
+
* data={data}
|
|
248
|
+
* onExport={handleExport}
|
|
249
|
+
* categoryAxisName="Time"
|
|
250
|
+
* valueAxisName="Value"
|
|
251
|
+
* title="Time Series Chart"
|
|
252
|
+
* type="line"
|
|
253
|
+
* onClick={(data) => console.log(data)}
|
|
254
|
+
* onBrush={(range) => console.log(range)}
|
|
255
|
+
* />
|
|
256
|
+
* ```
|
|
257
|
+
*
|
|
258
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/charts-timeseries--docs} for more details on the properties.
|
|
259
|
+
* @see {@link https://echarts.apache.org/en/option.html#series-line} for more details on the ECharts line series options.
|
|
260
|
+
* @see {@link https://echarts.apache.org/en/option.html#series-bar} for more details on the ECharts bar series options.
|
|
231
261
|
*/
|
|
232
262
|
export const TimeSeries: FC<TimeSeriesProps> = (props) => (
|
|
233
263
|
<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} />
|
|
@@ -49,6 +49,12 @@ const WordBubbleChart: FC<WordBubbleProps> = memo(
|
|
|
49
49
|
|
|
50
50
|
return {
|
|
51
51
|
legend: undefined,
|
|
52
|
+
tooltip: {
|
|
53
|
+
trigger: "axis",
|
|
54
|
+
confine: true,
|
|
55
|
+
position: "top",
|
|
56
|
+
appendToBody: true,
|
|
57
|
+
} as EChartOption.Tooltip,
|
|
52
58
|
series: [
|
|
53
59
|
{
|
|
54
60
|
name: title,
|
|
@@ -96,7 +102,31 @@ const WordBubbleChart: FC<WordBubbleProps> = memo(
|
|
|
96
102
|
WordBubbleChart.displayName = "WordBubbleChart";
|
|
97
103
|
|
|
98
104
|
/**
|
|
99
|
-
*
|
|
105
|
+
* WordBubble component renders a word cloud chart using ECharts.
|
|
106
|
+
* It displays words with sizes proportional to their frequency in the data.
|
|
107
|
+
* Users can click on words to trigger an action, such as filtering or navigating.
|
|
108
|
+
* It also supports exporting the chart and displays an empty state when no data is available.
|
|
109
|
+
*
|
|
110
|
+
* @param {WordBubbleProps} props - The properties for the WordBubble component.
|
|
111
|
+
* @returns {JSX.Element} The rendered WordBubble component.
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* ```jsx
|
|
115
|
+
* <WordBubble
|
|
116
|
+
* data={[
|
|
117
|
+
* { id: "1", label: "Word One", count: 10 },
|
|
118
|
+
* { id: "2", label: "Word Two", count: 20 },
|
|
119
|
+
* { id: "3", label: "Word Three", count: 30 },
|
|
120
|
+
* ]}
|
|
121
|
+
* title="Word Frequency"
|
|
122
|
+
* onExport={() => console.log("Exporting chart...")}
|
|
123
|
+
* onClick={(key) => console.log("Clicked word:", key)}
|
|
124
|
+
* theme="light"
|
|
125
|
+
* />
|
|
126
|
+
* ```
|
|
127
|
+
*
|
|
128
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/charts-wordbubble--docs} for the properties that can be passed to this component.
|
|
129
|
+
* @see {@link https://github.com/ecomfe/echarts-wordcloud} for the underlying chart implementation.
|
|
100
130
|
*/
|
|
101
131
|
export const WordBubble: FC<WordBubbleProps> = (props) => (
|
|
102
132
|
<ChartWrapper>
|
package/src/theme/darkBase.ts
CHANGED
package/src/theme/index.ts
CHANGED
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
+
import Color from "color";
|
|
24
25
|
import { DarkThemeBase } from "./darkBase";
|
|
25
26
|
import { LightThemeBase } from "./lightBase";
|
|
26
27
|
import { ChartPalette } from "./palettes";
|
|
27
|
-
import Color from "color";
|
|
28
28
|
|
|
29
29
|
const makePaletteSequence = (colors: string[]) => {
|
|
30
30
|
return [...colors, ...[...colors.slice(1, -1)].reverse()];
|
|
@@ -34,6 +34,7 @@ export const registerTheme = (
|
|
|
34
34
|
echarts: AnyObject,
|
|
35
35
|
key: string,
|
|
36
36
|
colors: string[],
|
|
37
|
+
heatmap: string[],
|
|
37
38
|
) => {
|
|
38
39
|
const base = colors[0];
|
|
39
40
|
const handles = Color(base).mix(Color("#f1f5f9"), 0.15).hex();
|
|
@@ -62,6 +63,17 @@ export const registerTheme = (
|
|
|
62
63
|
},
|
|
63
64
|
},
|
|
64
65
|
},
|
|
66
|
+
visualMap: {
|
|
67
|
+
textStyle: {
|
|
68
|
+
color: "#666",
|
|
69
|
+
},
|
|
70
|
+
inRange: {
|
|
71
|
+
color: heatmap,
|
|
72
|
+
},
|
|
73
|
+
outOfRange: {
|
|
74
|
+
color: "#d9d9d9",
|
|
75
|
+
},
|
|
76
|
+
},
|
|
65
77
|
color: makePaletteSequence(colors),
|
|
66
78
|
});
|
|
67
79
|
echarts.registerTheme(`${key}_dark`, {
|
|
@@ -86,6 +98,17 @@ export const registerTheme = (
|
|
|
86
98
|
},
|
|
87
99
|
},
|
|
88
100
|
},
|
|
101
|
+
visualMap: {
|
|
102
|
+
textStyle: {
|
|
103
|
+
color: "#eee",
|
|
104
|
+
},
|
|
105
|
+
inRange: {
|
|
106
|
+
color: heatmap,
|
|
107
|
+
},
|
|
108
|
+
outOfRange: {
|
|
109
|
+
color: "#363636",
|
|
110
|
+
},
|
|
111
|
+
},
|
|
89
112
|
color: makePaletteSequence(colors),
|
|
90
113
|
});
|
|
91
114
|
};
|
|
@@ -100,23 +123,74 @@ export const registerThemes = (echarts: AnyObject) => {
|
|
|
100
123
|
color: ChartPalette.Default,
|
|
101
124
|
});
|
|
102
125
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
registerTheme(echarts, "diverging", ChartPalette.Diverging
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
registerTheme(echarts, "
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
126
|
+
registerTheme(echarts, "activity", ChartPalette.Activity, [
|
|
127
|
+
ChartPalette.Activity[2],
|
|
128
|
+
ChartPalette.Activity[0],
|
|
129
|
+
ChartPalette.Activity[1],
|
|
130
|
+
]);
|
|
131
|
+
registerTheme(echarts, "qualitative", ChartPalette.Qualitative, [
|
|
132
|
+
ChartPalette.Qualitative[2],
|
|
133
|
+
ChartPalette.Qualitative[1],
|
|
134
|
+
ChartPalette.Qualitative[0],
|
|
135
|
+
]);
|
|
136
|
+
registerTheme(echarts, "diverging", ChartPalette.Diverging, [
|
|
137
|
+
ChartPalette.Diverging[0],
|
|
138
|
+
ChartPalette.Diverging[4],
|
|
139
|
+
ChartPalette.Diverging[10],
|
|
140
|
+
]);
|
|
141
|
+
registerTheme(echarts, "sequential", ChartPalette.Sequential, [
|
|
142
|
+
ChartPalette.Sequential[4],
|
|
143
|
+
ChartPalette.Sequential[2],
|
|
144
|
+
ChartPalette.Sequential[0],
|
|
145
|
+
]);
|
|
146
|
+
registerTheme(echarts, "spectral", ChartPalette.Spectral, [
|
|
147
|
+
ChartPalette.Spectral[9],
|
|
148
|
+
ChartPalette.Spectral[5],
|
|
149
|
+
ChartPalette.Spectral[1],
|
|
150
|
+
]);
|
|
151
|
+
registerTheme(echarts, "uber", ChartPalette.UberPool, [
|
|
152
|
+
ChartPalette.UberPool[1],
|
|
153
|
+
ChartPalette.UberPool[4],
|
|
154
|
+
ChartPalette.UberPool[8],
|
|
155
|
+
]);
|
|
156
|
+
registerTheme(echarts, "fireice", ChartPalette.FireIce, [
|
|
157
|
+
ChartPalette.FireIce[0],
|
|
158
|
+
ChartPalette.FireIce[4],
|
|
159
|
+
ChartPalette.FireIce[7],
|
|
160
|
+
]);
|
|
161
|
+
registerTheme(echarts, "warming", ChartPalette.GlobalWarming, [
|
|
162
|
+
ChartPalette.GlobalWarming[0],
|
|
163
|
+
ChartPalette.GlobalWarming[3],
|
|
164
|
+
ChartPalette.GlobalWarming[6],
|
|
165
|
+
]);
|
|
166
|
+
registerTheme(echarts, "sunrise", ChartPalette.Sunrise, [
|
|
167
|
+
ChartPalette.Sunrise[1],
|
|
168
|
+
ChartPalette.Sunrise[4],
|
|
169
|
+
ChartPalette.Sunrise[7],
|
|
170
|
+
]);
|
|
171
|
+
registerTheme(echarts, "ocean", ChartPalette.Ocean, [
|
|
172
|
+
ChartPalette.Ocean[1],
|
|
173
|
+
ChartPalette.Ocean[3],
|
|
174
|
+
ChartPalette.Ocean[5],
|
|
175
|
+
]);
|
|
176
|
+
registerTheme(echarts, "wine", ChartPalette.Wine, [
|
|
177
|
+
ChartPalette.Wine[1],
|
|
178
|
+
ChartPalette.Wine[3],
|
|
179
|
+
ChartPalette.Wine[5],
|
|
180
|
+
]);
|
|
181
|
+
registerTheme(echarts, "blue", ChartPalette.GreenBlue, [
|
|
182
|
+
ChartPalette.GreenBlue[6],
|
|
183
|
+
ChartPalette.GreenBlue[3],
|
|
184
|
+
ChartPalette.GreenBlue[0],
|
|
185
|
+
]);
|
|
186
|
+
registerTheme(echarts, "green", ChartPalette.YellowGreen, [
|
|
187
|
+
ChartPalette.YellowGreen[6],
|
|
188
|
+
ChartPalette.YellowGreen[3],
|
|
189
|
+
ChartPalette.YellowGreen[0],
|
|
190
|
+
]);
|
|
191
|
+
registerTheme(echarts, "red", ChartPalette.OrangeRed, [
|
|
192
|
+
ChartPalette.OrangeRed[6],
|
|
193
|
+
ChartPalette.OrangeRed[3],
|
|
194
|
+
ChartPalette.OrangeRed[0],
|
|
195
|
+
]);
|
|
122
196
|
};
|
package/src/theme/lightBase.ts
CHANGED
package/src/theme/palettes.ts
CHANGED
|
@@ -225,7 +225,7 @@ const Spectral = [
|
|
|
225
225
|
"#abdda4",
|
|
226
226
|
"#66c2a5",
|
|
227
227
|
"#3288bd",
|
|
228
|
-
"#
|
|
228
|
+
"#134F74",
|
|
229
229
|
];
|
|
230
230
|
|
|
231
231
|
const PurpleBlueYellow = [
|
|
@@ -236,11 +236,8 @@ const PurpleBlueYellow = [
|
|
|
236
236
|
"#5EA28D",
|
|
237
237
|
"#82BB92",
|
|
238
238
|
"#AECEA1",
|
|
239
|
-
"#D6DEBF",
|
|
240
239
|
];
|
|
241
240
|
const YellowGreen = [
|
|
242
|
-
"#ffffe5",
|
|
243
|
-
"#f7fcb9",
|
|
244
241
|
"#d9f0a3",
|
|
245
242
|
"#addd8e",
|
|
246
243
|
"#78c679",
|
|
@@ -250,8 +247,6 @@ const YellowGreen = [
|
|
|
250
247
|
"#004529",
|
|
251
248
|
];
|
|
252
249
|
const YellowGreenBlue = [
|
|
253
|
-
"#ffffd9",
|
|
254
|
-
"#edf8b1",
|
|
255
250
|
"#c7e9b4",
|
|
256
251
|
"#7fcdbb",
|
|
257
252
|
"#41b6c4",
|
|
@@ -261,8 +256,6 @@ const YellowGreenBlue = [
|
|
|
261
256
|
"#081d58",
|
|
262
257
|
];
|
|
263
258
|
const GreenBlue = [
|
|
264
|
-
"#f7fcf0",
|
|
265
|
-
"#e0f3db",
|
|
266
259
|
"#ccebc5",
|
|
267
260
|
"#a8ddb5",
|
|
268
261
|
"#7bccc4",
|
|
@@ -272,8 +265,6 @@ const GreenBlue = [
|
|
|
272
265
|
"#084081",
|
|
273
266
|
];
|
|
274
267
|
const BlueGreen = [
|
|
275
|
-
"#f7fcfd",
|
|
276
|
-
"#e5f5f9",
|
|
277
268
|
"#ccece6",
|
|
278
269
|
"#99d8c9",
|
|
279
270
|
"#66c2a4",
|
|
@@ -283,8 +274,6 @@ const BlueGreen = [
|
|
|
283
274
|
"#00441b",
|
|
284
275
|
];
|
|
285
276
|
const PurpleBlueGreen = [
|
|
286
|
-
"#fff7fb",
|
|
287
|
-
"#ece2f0",
|
|
288
277
|
"#d0d1e6",
|
|
289
278
|
"#a6bddb",
|
|
290
279
|
"#67a9cf",
|
|
@@ -294,8 +283,6 @@ const PurpleBlueGreen = [
|
|
|
294
283
|
"#014636",
|
|
295
284
|
];
|
|
296
285
|
const PurpleBlue = [
|
|
297
|
-
"#fff7fb",
|
|
298
|
-
"#ece7f2",
|
|
299
286
|
"#d0d1e6",
|
|
300
287
|
"#a6bddb",
|
|
301
288
|
"#74a9cf",
|
|
@@ -305,8 +292,6 @@ const PurpleBlue = [
|
|
|
305
292
|
"#023858",
|
|
306
293
|
];
|
|
307
294
|
const BluePurple = [
|
|
308
|
-
"#f7fcfd",
|
|
309
|
-
"#e0ecf4",
|
|
310
295
|
"#bfd3e6",
|
|
311
296
|
"#9ebcda",
|
|
312
297
|
"#8c96c6",
|
|
@@ -316,8 +301,6 @@ const BluePurple = [
|
|
|
316
301
|
"#4d004b",
|
|
317
302
|
];
|
|
318
303
|
const RedPurple = [
|
|
319
|
-
"#fff7f3",
|
|
320
|
-
"#fde0dd",
|
|
321
304
|
"#fcc5c0",
|
|
322
305
|
"#fa9fb5",
|
|
323
306
|
"#f768a1",
|
|
@@ -327,8 +310,6 @@ const RedPurple = [
|
|
|
327
310
|
"#49006a",
|
|
328
311
|
];
|
|
329
312
|
const PurpleRed = [
|
|
330
|
-
"#f7f4f9",
|
|
331
|
-
"#e7e1ef",
|
|
332
313
|
"#d4b9da",
|
|
333
314
|
"#c994c7",
|
|
334
315
|
"#df65b0",
|
|
@@ -338,8 +319,6 @@ const PurpleRed = [
|
|
|
338
319
|
"#67001f",
|
|
339
320
|
];
|
|
340
321
|
const OrangeRed = [
|
|
341
|
-
"#fff7ec",
|
|
342
|
-
"#fee8c8",
|
|
343
322
|
"#fdd49e",
|
|
344
323
|
"#fdbb84",
|
|
345
324
|
"#fc8d59",
|
|
@@ -349,8 +328,6 @@ const OrangeRed = [
|
|
|
349
328
|
"#7f0000",
|
|
350
329
|
];
|
|
351
330
|
const YellowOrangeRed = [
|
|
352
|
-
"#ffffcc",
|
|
353
|
-
"#ffeda0",
|
|
354
331
|
"#fed976",
|
|
355
332
|
"#feb24c",
|
|
356
333
|
"#fd8d3c",
|
|
@@ -360,8 +337,6 @@ const YellowOrangeRed = [
|
|
|
360
337
|
"#800026",
|
|
361
338
|
];
|
|
362
339
|
const YellowOrangeBrown = [
|
|
363
|
-
"#ffffe5",
|
|
364
|
-
"#fff7bc",
|
|
365
340
|
"#fee391",
|
|
366
341
|
"#fec44f",
|
|
367
342
|
"#fe9929",
|
|
@@ -371,8 +346,6 @@ const YellowOrangeBrown = [
|
|
|
371
346
|
"#662506",
|
|
372
347
|
];
|
|
373
348
|
const Purple = [
|
|
374
|
-
"#fcfbfd",
|
|
375
|
-
"#efedf5",
|
|
376
349
|
"#dadaeb",
|
|
377
350
|
"#bcbddc",
|
|
378
351
|
"#9e9ac8",
|
|
@@ -382,8 +355,6 @@ const Purple = [
|
|
|
382
355
|
"#3f007d",
|
|
383
356
|
];
|
|
384
357
|
const Blue = [
|
|
385
|
-
"#f7fbff",
|
|
386
|
-
"#deebf7",
|
|
387
358
|
"#c6dbef",
|
|
388
359
|
"#9ecae1",
|
|
389
360
|
"#6baed6",
|
|
@@ -393,8 +364,6 @@ const Blue = [
|
|
|
393
364
|
"#08306b",
|
|
394
365
|
];
|
|
395
366
|
const Green = [
|
|
396
|
-
"#f7fcf5",
|
|
397
|
-
"#e5f5e0",
|
|
398
367
|
"#c7e9c0",
|
|
399
368
|
"#a1d99b",
|
|
400
369
|
"#74c476",
|
|
@@ -404,8 +373,6 @@ const Green = [
|
|
|
404
373
|
"#00441b",
|
|
405
374
|
];
|
|
406
375
|
const Orange = [
|
|
407
|
-
"#fff5eb",
|
|
408
|
-
"#fee6ce",
|
|
409
376
|
"#fdd0a2",
|
|
410
377
|
"#fdae6b",
|
|
411
378
|
"#fd8d3c",
|
|
@@ -415,8 +382,6 @@ const Orange = [
|
|
|
415
382
|
"#7f2704",
|
|
416
383
|
];
|
|
417
384
|
const Red = [
|
|
418
|
-
"#fff5f0",
|
|
419
|
-
"#fee0d2",
|
|
420
385
|
"#fcbba1",
|
|
421
386
|
"#fc9272",
|
|
422
387
|
"#fb6a4a",
|
|
@@ -426,8 +391,6 @@ const Red = [
|
|
|
426
391
|
"#67000d",
|
|
427
392
|
];
|
|
428
393
|
const Grey = [
|
|
429
|
-
"#ffffff",
|
|
430
|
-
"#f0f0f0",
|
|
431
394
|
"#d9d9d9",
|
|
432
395
|
"#bdbdbd",
|
|
433
396
|
"#969696",
|
|
@@ -442,8 +405,6 @@ const OrangePurple = [
|
|
|
442
405
|
"#e08214",
|
|
443
406
|
"#fdb863",
|
|
444
407
|
"#fee0b6",
|
|
445
|
-
"#f7f7f7",
|
|
446
|
-
"#d8daeb",
|
|
447
408
|
"#b2abd2",
|
|
448
409
|
"#8073ac",
|
|
449
410
|
"#542788",
|
|
@@ -455,8 +416,6 @@ const BrownGreen = [
|
|
|
455
416
|
"#bf812d",
|
|
456
417
|
"#dfc27d",
|
|
457
418
|
"#f6e8c3",
|
|
458
|
-
"#f5f5f5",
|
|
459
|
-
"#c7eae5",
|
|
460
419
|
"#80cdc1",
|
|
461
420
|
"#35978f",
|
|
462
421
|
"#01665e",
|
|
@@ -467,8 +426,6 @@ const PurpleGreen = [
|
|
|
467
426
|
"#762a83",
|
|
468
427
|
"#9970ab",
|
|
469
428
|
"#c2a5cf",
|
|
470
|
-
"#e7d4e8",
|
|
471
|
-
"#f7f7f7",
|
|
472
429
|
"#d9f0d3",
|
|
473
430
|
"#a6dba0",
|
|
474
431
|
"#5aae61",
|
|
@@ -480,8 +437,6 @@ const PinkGreen = [
|
|
|
480
437
|
"#c51b7d",
|
|
481
438
|
"#de77ae",
|
|
482
439
|
"#f1b6da",
|
|
483
|
-
"#fde0ef",
|
|
484
|
-
"#f7f7f7",
|
|
485
440
|
"#e6f5d0",
|
|
486
441
|
"#b8e186",
|
|
487
442
|
"#7fbc41",
|
|
@@ -494,8 +449,6 @@ const RedBlue = [
|
|
|
494
449
|
"#d6604d",
|
|
495
450
|
"#f4a582",
|
|
496
451
|
"#fddbc7",
|
|
497
|
-
"#f7f7f7",
|
|
498
|
-
"#d1e5f0",
|
|
499
452
|
"#92c5de",
|
|
500
453
|
"#4393c3",
|
|
501
454
|
"#2166ac",
|
|
@@ -507,8 +460,6 @@ const RedGray = [
|
|
|
507
460
|
"#d6604d",
|
|
508
461
|
"#f4a582",
|
|
509
462
|
"#fddbc7",
|
|
510
|
-
"#ffffff",
|
|
511
|
-
"#e0e0e0",
|
|
512
463
|
"#bababa",
|
|
513
464
|
"#878787",
|
|
514
465
|
"#4d4d4d",
|
|
@@ -520,8 +471,6 @@ const RedYellowBlue = [
|
|
|
520
471
|
"#f46d43",
|
|
521
472
|
"#fdae61",
|
|
522
473
|
"#fee090",
|
|
523
|
-
"#ffffbf",
|
|
524
|
-
"#e0f3f8",
|
|
525
474
|
"#abd9e9",
|
|
526
475
|
"#74add1",
|
|
527
476
|
"#4575b4",
|
package/src/types/charts.ts
CHANGED
|
@@ -27,6 +27,10 @@ import { registerThemes, registerTheme as RT } from "../theme";
|
|
|
27
27
|
registerThemes(echarts);
|
|
28
28
|
|
|
29
29
|
export default echarts;
|
|
30
|
-
export const registerTheme = (
|
|
31
|
-
|
|
30
|
+
export const registerTheme = (
|
|
31
|
+
key: string,
|
|
32
|
+
colors: string[],
|
|
33
|
+
heatmap: string[],
|
|
34
|
+
) => {
|
|
35
|
+
RT(echarts, key, colors, heatmap);
|
|
32
36
|
};
|
package/src/types/index.ts
CHANGED
|
@@ -34,11 +34,16 @@ export type Theme =
|
|
|
34
34
|
| "warming"
|
|
35
35
|
| "sunrise"
|
|
36
36
|
| "ocean"
|
|
37
|
-
| "wine"
|
|
37
|
+
| "wine"
|
|
38
|
+
| "red"
|
|
39
|
+
| "green"
|
|
40
|
+
| "blue";
|
|
38
41
|
|
|
39
42
|
export interface BaseChart {
|
|
40
43
|
title?: string;
|
|
41
44
|
theme?: Theme;
|
|
45
|
+
showThemeSelector?: boolean;
|
|
46
|
+
showTypeSelector?: boolean;
|
|
42
47
|
onExport?: (chart: { title: string; image: string }) => void;
|
|
43
48
|
}
|
|
44
49
|
|