@react-fabric/chart 1.0.0-beta.55 → 1.0.0-beta.57
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.
|
@@ -77,7 +77,7 @@ var CountSeriesChart = /*#__PURE__*/react.memo(function (_ref) {
|
|
|
77
77
|
}),
|
|
78
78
|
universalTransition: true
|
|
79
79
|
}] : sorted.map(function (item, index) {
|
|
80
|
-
var _item$
|
|
80
|
+
var _item$name2;
|
|
81
81
|
return {
|
|
82
82
|
id: item.id,
|
|
83
83
|
type: "bar",
|
|
@@ -92,7 +92,7 @@ var CountSeriesChart = /*#__PURE__*/react.memo(function (_ref) {
|
|
|
92
92
|
name: seriesName !== null && seriesName !== void 0 ? seriesName : "Count Series",
|
|
93
93
|
value: item.count
|
|
94
94
|
}],
|
|
95
|
-
name: (_item$
|
|
95
|
+
name: (_item$name2 = item.name) !== null && _item$name2 !== void 0 ? _item$name2 : item.id,
|
|
96
96
|
universalTransition: true
|
|
97
97
|
};
|
|
98
98
|
});
|
|
@@ -102,7 +102,7 @@ var CountSeriesChart = /*#__PURE__*/react.memo(function (_ref) {
|
|
|
102
102
|
xAxis: type === "pie" ? null : type === "bar" ? valueAxis : categoryAxis,
|
|
103
103
|
yAxis: type === "pie" ? null : type === "bar" ? categoryAxis : valueAxis
|
|
104
104
|
});
|
|
105
|
-
}, [_series,
|
|
105
|
+
}, [_series, seriesName, type, optionOverride], "CountChart options");
|
|
106
106
|
return /*#__PURE__*/jsxRuntime.jsxs(ChartContainer.ChartContainer, {
|
|
107
107
|
title: title,
|
|
108
108
|
onExport: onExport,
|
|
@@ -77,7 +77,7 @@ var CountSeriesChart = /*#__PURE__*/memo(function (_ref) {
|
|
|
77
77
|
}),
|
|
78
78
|
universalTransition: true
|
|
79
79
|
}] : sorted.map(function (item, index) {
|
|
80
|
-
var _item$
|
|
80
|
+
var _item$name2;
|
|
81
81
|
return {
|
|
82
82
|
id: item.id,
|
|
83
83
|
type: "bar",
|
|
@@ -92,7 +92,7 @@ var CountSeriesChart = /*#__PURE__*/memo(function (_ref) {
|
|
|
92
92
|
name: seriesName !== null && seriesName !== void 0 ? seriesName : "Count Series",
|
|
93
93
|
value: item.count
|
|
94
94
|
}],
|
|
95
|
-
name: (_item$
|
|
95
|
+
name: (_item$name2 = item.name) !== null && _item$name2 !== void 0 ? _item$name2 : item.id,
|
|
96
96
|
universalTransition: true
|
|
97
97
|
};
|
|
98
98
|
});
|
|
@@ -102,7 +102,7 @@ var CountSeriesChart = /*#__PURE__*/memo(function (_ref) {
|
|
|
102
102
|
xAxis: type === "pie" ? null : type === "bar" ? valueAxis : categoryAxis,
|
|
103
103
|
yAxis: type === "pie" ? null : type === "bar" ? categoryAxis : valueAxis
|
|
104
104
|
});
|
|
105
|
-
}, [_series,
|
|
105
|
+
}, [_series, seriesName, type, optionOverride], "CountChart options");
|
|
106
106
|
return /*#__PURE__*/jsxs(ChartContainer, {
|
|
107
107
|
title: title,
|
|
108
108
|
onExport: onExport,
|
|
@@ -1,48 +1,23 @@
|
|
|
1
1
|
import { type EChartOption, type EChartsType } from "echarts";
|
|
2
2
|
import { type FC, type Ref } from "react";
|
|
3
|
-
import {
|
|
4
|
-
export interface GenericProps extends
|
|
3
|
+
import { Theme } from "../types";
|
|
4
|
+
export interface GenericProps extends Omit<EChartOption, "title"> {
|
|
5
5
|
chartRef?: Ref<EChartsType>;
|
|
6
|
-
|
|
7
|
-
toolbox?: EChartOption["toolbox"];
|
|
8
|
-
tooltip?: EChartOption["tooltip"];
|
|
6
|
+
title?: string;
|
|
9
7
|
actions?: JSX.Element;
|
|
10
8
|
/**
|
|
11
|
-
*
|
|
9
|
+
* The theme to be applied to the chart.
|
|
10
|
+
* This can be one of the predefined themes or a custom theme object.
|
|
11
|
+
* Predefined themes include "default", "activity", "cloud", "qualitative", "diverging", "sequential",
|
|
12
|
+
* "spectral", "uber", "fireice", "warming", "sunrise", "ocean", "wine", "red", "green", and "blue".
|
|
12
13
|
*/
|
|
13
|
-
|
|
14
|
+
theme?: Theme;
|
|
14
15
|
/**
|
|
15
|
-
*
|
|
16
|
+
* Whether to show the theme selector in the chart.
|
|
17
|
+
* This is useful for allowing users to switch between different themes.
|
|
18
|
+
* If set to true, the chart will render a toggle button group to select the theme.
|
|
16
19
|
*/
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* chart series
|
|
20
|
-
*/
|
|
21
|
-
series?: EChartOption["series"];
|
|
22
|
-
/**
|
|
23
|
-
* polar series
|
|
24
|
-
*/
|
|
25
|
-
polar?: EChartOption["polar"];
|
|
26
|
-
/**
|
|
27
|
-
* polar axis
|
|
28
|
-
*/
|
|
29
|
-
angleAxis?: EChartOption["angleAxis"];
|
|
30
|
-
/**
|
|
31
|
-
* polar axis
|
|
32
|
-
*/
|
|
33
|
-
radiusAxis?: EChartOption["radiusAxis"];
|
|
34
|
-
/**
|
|
35
|
-
* radar series
|
|
36
|
-
*/
|
|
37
|
-
radar?: EChartOption["radar"];
|
|
38
|
-
/**
|
|
39
|
-
* paarllel series
|
|
40
|
-
*/
|
|
41
|
-
parallel?: EChartOption["parallel"];
|
|
42
|
-
/**
|
|
43
|
-
* parallel axis
|
|
44
|
-
*/
|
|
45
|
-
parallelAxis?: EChartOption["parallelAxis"];
|
|
20
|
+
showThemeSelector?: boolean;
|
|
46
21
|
onClick?: (e: KeyValue) => void;
|
|
47
22
|
onRendered?: (e: KeyValue) => void;
|
|
48
23
|
onBrush?: (e: KeyValue) => void;
|
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.57",
|
|
4
4
|
"description": "RUF: Charting package",
|
|
5
5
|
"author": "Adarsh Pastakia <adarshpastakia@outlook.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"watch": "npm-run-all -p watch:rollup watch:dts"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@react-fabric/core": "^1.0.0-beta.
|
|
38
|
+
"@react-fabric/core": "^1.0.0-beta.57",
|
|
39
39
|
"@react-fabric/utilities": "^1.0.0-beta.52",
|
|
40
40
|
"classnames": "^2.5.1",
|
|
41
41
|
"color": "^4.2.3",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"node": ">=18.12.0",
|
|
57
57
|
"npm": ">=8.19.0"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "9b596a0a8d6cecaa8479f80c495b64fb42ce739f"
|
|
60
60
|
}
|
|
@@ -126,7 +126,7 @@ const CountSeriesChart: FC<CountSeriesProps> = memo(
|
|
|
126
126
|
value: item.count,
|
|
127
127
|
},
|
|
128
128
|
],
|
|
129
|
-
name: item.
|
|
129
|
+
name: item.name ?? item.id,
|
|
130
130
|
universalTransition: true,
|
|
131
131
|
}));
|
|
132
132
|
return {
|
|
@@ -139,7 +139,7 @@ const CountSeriesChart: FC<CountSeriesProps> = memo(
|
|
|
139
139
|
type === "pie" ? null : type === "bar" ? categoryAxis : valueAxis,
|
|
140
140
|
};
|
|
141
141
|
},
|
|
142
|
-
[_series,
|
|
142
|
+
[_series, seriesName, type, optionOverride],
|
|
143
143
|
"CountChart options",
|
|
144
144
|
);
|
|
145
145
|
|
package/src/charts/Generic.tsx
CHANGED
|
@@ -31,59 +31,31 @@ import {
|
|
|
31
31
|
type FC,
|
|
32
32
|
type Ref,
|
|
33
33
|
} from "react";
|
|
34
|
-
import {
|
|
34
|
+
import { Theme } from "../types";
|
|
35
35
|
import { ChartContainer } from "../wrapper/ChartContainer";
|
|
36
36
|
import { ChartWrapper } from "../wrapper/ChartWrapper";
|
|
37
37
|
import { PaletteSelect } from "../wrapper/PaletteSelect";
|
|
38
38
|
|
|
39
|
-
export interface GenericProps extends
|
|
39
|
+
export interface GenericProps extends Omit<EChartOption, "title"> {
|
|
40
40
|
chartRef?: Ref<EChartsType>;
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
toolbox?: EChartOption["toolbox"];
|
|
44
|
-
tooltip?: EChartOption["tooltip"];
|
|
42
|
+
title?: string;
|
|
45
43
|
|
|
46
44
|
actions?: JSX.Element;
|
|
47
45
|
|
|
48
46
|
/**
|
|
49
|
-
*
|
|
47
|
+
* The theme to be applied to the chart.
|
|
48
|
+
* This can be one of the predefined themes or a custom theme object.
|
|
49
|
+
* Predefined themes include "default", "activity", "cloud", "qualitative", "diverging", "sequential",
|
|
50
|
+
* "spectral", "uber", "fireice", "warming", "sunrise", "ocean", "wine", "red", "green", and "blue".
|
|
50
51
|
*/
|
|
51
|
-
|
|
52
|
+
theme?: Theme;
|
|
52
53
|
/**
|
|
53
|
-
*
|
|
54
|
+
* Whether to show the theme selector in the chart.
|
|
55
|
+
* This is useful for allowing users to switch between different themes.
|
|
56
|
+
* If set to true, the chart will render a toggle button group to select the theme.
|
|
54
57
|
*/
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* chart series
|
|
58
|
-
*/
|
|
59
|
-
series?: EChartOption["series"];
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* polar series
|
|
63
|
-
*/
|
|
64
|
-
polar?: EChartOption["polar"];
|
|
65
|
-
/**
|
|
66
|
-
* polar axis
|
|
67
|
-
*/
|
|
68
|
-
angleAxis?: EChartOption["angleAxis"];
|
|
69
|
-
/**
|
|
70
|
-
* polar axis
|
|
71
|
-
*/
|
|
72
|
-
radiusAxis?: EChartOption["radiusAxis"];
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* radar series
|
|
76
|
-
*/
|
|
77
|
-
radar?: EChartOption["radar"];
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* paarllel series
|
|
81
|
-
*/
|
|
82
|
-
parallel?: EChartOption["parallel"];
|
|
83
|
-
/**
|
|
84
|
-
* parallel axis
|
|
85
|
-
*/
|
|
86
|
-
parallelAxis?: EChartOption["parallelAxis"];
|
|
58
|
+
showThemeSelector?: boolean;
|
|
87
59
|
|
|
88
60
|
onClick?: (e: KeyValue) => void;
|
|
89
61
|
onRendered?: (e: KeyValue) => void;
|