Merge branch 'main' into refactor/promised-panzoom
This commit is contained in:
@@ -69,6 +69,7 @@ export function XYPanZoom({
|
||||
);
|
||||
|
||||
const d3ZoomHandler = d3Selection.on('wheel.zoom')!;
|
||||
const d3DblClickZoomHandler = d3Selection.on('dblclick.zoom')!;
|
||||
d3ZoomInstance.wheelDelta(wheelDelta);
|
||||
|
||||
function setTransform(transform: ZoomTransform, options?: PanZoomTransformOptions) {
|
||||
@@ -172,6 +173,15 @@ export function XYPanZoom({
|
||||
lib,
|
||||
});
|
||||
d3ZoomInstance.filter(filter);
|
||||
|
||||
// We cannot add zoomOnDoubleClick to the filter above because
|
||||
// double tapping on touch screens circumvents the filter and
|
||||
// dblclick.zoom is fired on the selection directly
|
||||
if (zoomOnDoubleClick) {
|
||||
d3Selection.on('dblclick.zoom', d3DblClickZoomHandler);
|
||||
} else {
|
||||
d3Selection.on('dblclick.zoom', null);
|
||||
}
|
||||
}
|
||||
|
||||
function destroy() {
|
||||
@@ -211,6 +221,7 @@ export function XYPanZoom({
|
||||
currentTransform.x !== viewport.x ||
|
||||
currentTransform.y !== viewport.y
|
||||
) {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
d3ZoomInstance?.transform(d3Selection, nextTransform, null, { sync: true });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user