@rfkit/charts 1.9.0 → 1.9.1
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/components/PluginBox/index.d.ts +2 -1
- package/index.js +17 -1
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import React, { type ReactNode } from 'react';
|
|
1
|
+
import React, { type ReactNode, type WheelEventHandler } from 'react';
|
|
2
2
|
interface Props {
|
|
3
3
|
children: ReactNode;
|
|
4
|
+
onWheelCapture?: WheelEventHandler<HTMLDivElement>;
|
|
4
5
|
}
|
|
5
6
|
declare const _default: React.NamedExoticComponent<Props>;
|
|
6
7
|
export default _default;
|
package/index.js
CHANGED
|
@@ -23502,13 +23502,14 @@ const Boundary_Boundary = ()=>{
|
|
|
23502
23502
|
};
|
|
23503
23503
|
const Boundary = Boundary_Boundary;
|
|
23504
23504
|
const PluginBox_PluginBox = (props)=>{
|
|
23505
|
-
const { children } = props;
|
|
23505
|
+
const { children, onWheelCapture } = props;
|
|
23506
23506
|
const { pluginBoxWidth } = useAxisYWidth_useAxisYWidth();
|
|
23507
23507
|
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
|
|
23508
23508
|
className: "absolute right-0 top-0 m-0 h-full overflow-hidden p-0",
|
|
23509
23509
|
style: {
|
|
23510
23510
|
width: pluginBoxWidth
|
|
23511
23511
|
},
|
|
23512
|
+
onWheelCapture: onWheelCapture,
|
|
23512
23513
|
children: children
|
|
23513
23514
|
});
|
|
23514
23515
|
};
|
|
@@ -25408,6 +25409,20 @@ const Heatmap_Heatmap = (props)=>{
|
|
|
25408
25409
|
globalID
|
|
25409
25410
|
}
|
|
25410
25411
|
});
|
|
25412
|
+
const dispatchXYWheel = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>{
|
|
25413
|
+
const eventBusID = getEID(id);
|
|
25414
|
+
return throttle((wheel, coord)=>{
|
|
25415
|
+
createWheelEventManager(eventBusID)(wheel, coord);
|
|
25416
|
+
});
|
|
25417
|
+
}, [
|
|
25418
|
+
id
|
|
25419
|
+
]);
|
|
25420
|
+
const handleXYWheelCapture = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)((event)=>{
|
|
25421
|
+
event.stopPropagation();
|
|
25422
|
+
dispatchXYWheel(-1 * event.deltaY, calculateEventRelativePosition(event));
|
|
25423
|
+
}, [
|
|
25424
|
+
dispatchXYWheel
|
|
25425
|
+
]);
|
|
25411
25426
|
useWaterfallZoomEvent(id, xyZoom);
|
|
25412
25427
|
useModuleSubscription({
|
|
25413
25428
|
moduleType: constants_ModuleType.Heatmap,
|
|
@@ -25440,6 +25455,7 @@ const Heatmap_Heatmap = (props)=>{
|
|
|
25440
25455
|
chart: chart
|
|
25441
25456
|
}),
|
|
25442
25457
|
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)(PluginBox, {
|
|
25458
|
+
onWheelCapture: xyZoom ? handleXYWheelCapture : void 0,
|
|
25443
25459
|
children: [
|
|
25444
25460
|
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(Boundary, {}),
|
|
25445
25461
|
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(Chart, {}),
|