@trackunit/react-chart-components 0.0.155 → 0.0.161
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 +8 -2
- package/index.esm.js +8 -2
- package/package.json +1 -1
- package/src/Chart/Chart.d.ts +5 -1
package/index.cjs.js
CHANGED
|
@@ -42,7 +42,7 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
|
42
42
|
* @param {ChartProps} props - The props for the Chart component
|
|
43
43
|
* @returns {JSX.Element} Chart component
|
|
44
44
|
*/
|
|
45
|
-
const Chart = ({ options, showLoading, className, style, onChartReady, onClick, onDataZoom, onBrush, onBrushSelected, mouseLeaveChart, mouseMoveChart, mouseOverChart, merge = true, loadingOption, timezoneLabel, renderer = "canvas", dataTestId, }) => {
|
|
45
|
+
const Chart = ({ options, showLoading, className, style, onChartReady, onClick, onDataZoom, onBrush, onBrushSelected, mouseLeaveChart, mouseMoveChart, mouseOverChart, mouseOutChart, merge = true, loadingOption, timezoneLabel, renderer = "canvas", dataTestId, }) => {
|
|
46
46
|
var _a, _b;
|
|
47
47
|
const echartsRef = React__namespace.useRef(null);
|
|
48
48
|
const eventHandlers = React__namespace.useMemo(() => {
|
|
@@ -71,8 +71,14 @@ const Chart = ({ options, showLoading, className, style, onChartReady, onClick,
|
|
|
71
71
|
mouseOverChart(event, (_a = echartsRef === null || echartsRef === void 0 ? void 0 : echartsRef.current) === null || _a === void 0 ? void 0 : _a.getEchartsInstance());
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
|
+
if (mouseOutChart !== undefined) {
|
|
75
|
+
values.mouseOut = (event) => {
|
|
76
|
+
var _a;
|
|
77
|
+
mouseOutChart(event, (_a = echartsRef === null || echartsRef === void 0 ? void 0 : echartsRef.current) === null || _a === void 0 ? void 0 : _a.getEchartsInstance());
|
|
78
|
+
};
|
|
79
|
+
}
|
|
74
80
|
return values;
|
|
75
|
-
}, [onDataZoom, onBrush, onBrushSelected, mouseLeaveChart, mouseMoveChart, mouseOverChart]);
|
|
81
|
+
}, [onDataZoom, onBrush, onBrushSelected, mouseLeaveChart, mouseMoveChart, mouseOutChart, mouseOverChart]);
|
|
76
82
|
React__namespace.useEffect(() => {
|
|
77
83
|
var _a;
|
|
78
84
|
const instance = (_a = echartsRef === null || echartsRef === void 0 ? void 0 : echartsRef.current) === null || _a === void 0 ? void 0 : _a.getEchartsInstance();
|
package/index.esm.js
CHANGED
|
@@ -15,7 +15,7 @@ import { DEFAULT_CHART_COLORS } from '@trackunit/ui-design-tokens';
|
|
|
15
15
|
* @param {ChartProps} props - The props for the Chart component
|
|
16
16
|
* @returns {JSX.Element} Chart component
|
|
17
17
|
*/
|
|
18
|
-
const Chart = ({ options, showLoading, className, style, onChartReady, onClick, onDataZoom, onBrush, onBrushSelected, mouseLeaveChart, mouseMoveChart, mouseOverChart, merge = true, loadingOption, timezoneLabel, renderer = "canvas", dataTestId, }) => {
|
|
18
|
+
const Chart = ({ options, showLoading, className, style, onChartReady, onClick, onDataZoom, onBrush, onBrushSelected, mouseLeaveChart, mouseMoveChart, mouseOverChart, mouseOutChart, merge = true, loadingOption, timezoneLabel, renderer = "canvas", dataTestId, }) => {
|
|
19
19
|
var _a, _b;
|
|
20
20
|
const echartsRef = React.useRef(null);
|
|
21
21
|
const eventHandlers = React.useMemo(() => {
|
|
@@ -44,8 +44,14 @@ const Chart = ({ options, showLoading, className, style, onChartReady, onClick,
|
|
|
44
44
|
mouseOverChart(event, (_a = echartsRef === null || echartsRef === void 0 ? void 0 : echartsRef.current) === null || _a === void 0 ? void 0 : _a.getEchartsInstance());
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
+
if (mouseOutChart !== undefined) {
|
|
48
|
+
values.mouseOut = (event) => {
|
|
49
|
+
var _a;
|
|
50
|
+
mouseOutChart(event, (_a = echartsRef === null || echartsRef === void 0 ? void 0 : echartsRef.current) === null || _a === void 0 ? void 0 : _a.getEchartsInstance());
|
|
51
|
+
};
|
|
52
|
+
}
|
|
47
53
|
return values;
|
|
48
|
-
}, [onDataZoom, onBrush, onBrushSelected, mouseLeaveChart, mouseMoveChart, mouseOverChart]);
|
|
54
|
+
}, [onDataZoom, onBrush, onBrushSelected, mouseLeaveChart, mouseMoveChart, mouseOutChart, mouseOverChart]);
|
|
49
55
|
React.useEffect(() => {
|
|
50
56
|
var _a;
|
|
51
57
|
const instance = (_a = echartsRef === null || echartsRef === void 0 ? void 0 : echartsRef.current) === null || _a === void 0 ? void 0 : _a.getEchartsInstance();
|
package/package.json
CHANGED
package/src/Chart/Chart.d.ts
CHANGED
|
@@ -41,6 +41,10 @@ export interface ChartProps extends CommonProps {
|
|
|
41
41
|
* Event fired when mouse enters the chart.
|
|
42
42
|
*/
|
|
43
43
|
mouseOverChart?: (event: any, chart: EChartsType | undefined) => void;
|
|
44
|
+
/**
|
|
45
|
+
* Event fired when mouse enters the chart.
|
|
46
|
+
*/
|
|
47
|
+
mouseOutChart?: (event: any, chart: EChartsType | undefined) => void;
|
|
44
48
|
/**
|
|
45
49
|
* CSS styles for the chart.
|
|
46
50
|
*/
|
|
@@ -82,4 +86,4 @@ export interface ChartProps extends CommonProps {
|
|
|
82
86
|
* @param {ChartProps} props - The props for the Chart component
|
|
83
87
|
* @returns {JSX.Element} Chart component
|
|
84
88
|
*/
|
|
85
|
-
export declare const Chart: ({ options, showLoading, className, style, onChartReady, onClick, onDataZoom, onBrush, onBrushSelected, mouseLeaveChart, mouseMoveChart, mouseOverChart, merge, loadingOption, timezoneLabel, renderer, dataTestId, }: ChartProps) => JSX.Element;
|
|
89
|
+
export declare const Chart: ({ options, showLoading, className, style, onChartReady, onClick, onDataZoom, onBrush, onBrushSelected, mouseLeaveChart, mouseMoveChart, mouseOverChart, mouseOutChart, merge, loadingOption, timezoneLabel, renderer, dataTestId, }: ChartProps) => JSX.Element;
|