@trackunit/react-chart-components 1.3.202 → 1.3.204-alpha-717bec89481.0
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/index.cjs.js +4 -1
- package/index.esm.js +4 -1
- package/package.json +8 -8
- package/src/Chart/Chart.d.ts +5 -2
- package/src/EChart/EChart.d.ts +8 -1
package/index.cjs.js
CHANGED
|
@@ -62,7 +62,10 @@ const EChart = ({ option, style, className, onChartReady, onClick, onEvents, not
|
|
|
62
62
|
if (eventName !== "click" || !onClick) {
|
|
63
63
|
// Don't double-register click if onClick is provided
|
|
64
64
|
chart.on(eventName, function (event) {
|
|
65
|
-
if (
|
|
65
|
+
if (eventName === "brush" || eventName === "brushselected") {
|
|
66
|
+
handler(event);
|
|
67
|
+
}
|
|
68
|
+
else if (isECElementEvent(event)) {
|
|
66
69
|
handler(event);
|
|
67
70
|
}
|
|
68
71
|
});
|
package/index.esm.js
CHANGED
|
@@ -41,7 +41,10 @@ const EChart = ({ option, style, className, onChartReady, onClick, onEvents, not
|
|
|
41
41
|
if (eventName !== "click" || !onClick) {
|
|
42
42
|
// Don't double-register click if onClick is provided
|
|
43
43
|
chart.on(eventName, function (event) {
|
|
44
|
-
if (
|
|
44
|
+
if (eventName === "brush" || eventName === "brushselected") {
|
|
45
|
+
handler(event);
|
|
46
|
+
}
|
|
47
|
+
else if (isECElementEvent(event)) {
|
|
45
48
|
handler(event);
|
|
46
49
|
}
|
|
47
50
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-chart-components",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.204-alpha-717bec89481.0",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"echarts": "5.6.0",
|
|
11
11
|
"react": "19.0.0",
|
|
12
|
-
"@trackunit/date-and-time-utils": "1.3.
|
|
13
|
-
"@trackunit/react-date-and-time-hooks": "1.3.
|
|
14
|
-
"@trackunit/ui-design-tokens": "1.3.
|
|
15
|
-
"@trackunit/shared-utils": "1.5.
|
|
16
|
-
"@trackunit/css-class-variance-utilities": "1.3.
|
|
17
|
-
"@trackunit/react-components": "1.4.
|
|
18
|
-
"@trackunit/react-test-setup": "1.0.
|
|
12
|
+
"@trackunit/date-and-time-utils": "1.3.156-alpha-717bec89481.0",
|
|
13
|
+
"@trackunit/react-date-and-time-hooks": "1.3.184-alpha-717bec89481.0",
|
|
14
|
+
"@trackunit/ui-design-tokens": "1.3.154-alpha-717bec89481.0",
|
|
15
|
+
"@trackunit/shared-utils": "1.5.156-alpha-717bec89481.0",
|
|
16
|
+
"@trackunit/css-class-variance-utilities": "1.3.156-alpha-717bec89481.0",
|
|
17
|
+
"@trackunit/react-components": "1.4.191-alpha-717bec89481.0",
|
|
18
|
+
"@trackunit/react-test-setup": "1.0.46-alpha-717bec89481.0"
|
|
19
19
|
},
|
|
20
20
|
"module": "./index.esm.js",
|
|
21
21
|
"main": "./index.cjs.js",
|
package/src/Chart/Chart.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CommonProps } from "@trackunit/react-components";
|
|
2
2
|
import type { ECElementEvent, ECharts, EChartsOption } from "echarts";
|
|
3
3
|
import { CSSProperties, ReactElement, ReactNode } from "react";
|
|
4
|
-
import { type EventName } from "../EChart/EChart";
|
|
4
|
+
import { BrushEvent, type EventName } from "../EChart/EChart";
|
|
5
5
|
export type ChartProps = CommonProps & {
|
|
6
6
|
/**
|
|
7
7
|
* Option values for EChart.
|
|
@@ -26,7 +26,10 @@ export type ChartProps = CommonProps & {
|
|
|
26
26
|
/**
|
|
27
27
|
* Event handlers for the chart.
|
|
28
28
|
*/
|
|
29
|
-
onEvents?: Partial<Record<EventName, (event: ECElementEvent) => void
|
|
29
|
+
onEvents?: Partial<Omit<Record<EventName, (event: ECElementEvent) => void>, "brush" | "brushselected"> & {
|
|
30
|
+
brush: (event: BrushEvent) => void;
|
|
31
|
+
brushselected: (event: BrushEvent) => void;
|
|
32
|
+
}>;
|
|
30
33
|
/**
|
|
31
34
|
* Whether to merge with previous option.
|
|
32
35
|
*
|
package/src/EChart/EChart.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { CommonProps } from "@trackunit/react-components";
|
|
2
2
|
import type { ECElementEvent, ECharts, EChartsOption } from "echarts";
|
|
3
|
+
import BrushArea from "echarts/types/src/component/brush/BrushModel";
|
|
3
4
|
import { CSSProperties, ReactElement } from "react";
|
|
4
5
|
/**
|
|
5
6
|
* https://echarts.apache.org/en/api.html#events
|
|
6
7
|
*/
|
|
8
|
+
export type BrushEvent = {
|
|
9
|
+
areas: Array<BrushArea>;
|
|
10
|
+
};
|
|
7
11
|
export type EventName = "click" | "dblclick" | "mousewheel" | "mouseout" | "mouseover" | "mouseup" | "mousedown" | "mousemove" | "contextmenu" | "drag" | "dragstart" | "dragend" | "dragenter" | "dragleave" | "dragover" | "drop" | "brush" | "brushselected" | "brushend" | "globalout" | "datarangeselected" | "legendselectchanged" | "datazoom";
|
|
8
12
|
export interface EChartProps extends CommonProps {
|
|
9
13
|
/**
|
|
@@ -25,7 +29,10 @@ export interface EChartProps extends CommonProps {
|
|
|
25
29
|
/**
|
|
26
30
|
* Event handlers for the chart.
|
|
27
31
|
*/
|
|
28
|
-
onEvents?: Partial<Record<EventName, (event: ECElementEvent) => void
|
|
32
|
+
onEvents?: Partial<Omit<Record<EventName, (event: ECElementEvent) => void>, "brush" | "brushselected"> & {
|
|
33
|
+
brush: (event: BrushEvent) => void;
|
|
34
|
+
brushselected: (event: BrushEvent) => void;
|
|
35
|
+
}>;
|
|
29
36
|
/**
|
|
30
37
|
* Whether to merge with previous option.
|
|
31
38
|
*/
|