feat(interaction): add zoomOnScroll property closes #331

This commit is contained in:
moklick
2020-07-14 13:28:59 +02:00
parent 0593db289a
commit 65764fbefb
5 changed files with 29 additions and 3 deletions
+3 -1
View File
@@ -54,6 +54,7 @@ export interface GraphViewProps {
defaultZoom: number;
arrowHeadColor: string;
markerEndId?: string;
zoomOnScroll: boolean;
}
const GraphView = memo(
@@ -88,6 +89,7 @@ const GraphView = memo(
defaultZoom,
arrowHeadColor,
markerEndId,
zoomOnScroll,
}: GraphViewProps) => {
const zoomPane = useRef<HTMLDivElement>(null);
const rendererNode = useRef<HTMLDivElement>(null);
@@ -158,7 +160,7 @@ const GraphView = memo(
};
}, []);
useD3Zoom({ zoomPane, onMove, selectionKeyPressed });
useD3Zoom({ zoomPane, onMove, selectionKeyPressed, zoomOnScroll });
useEffect(() => {
if (d3Initialised && onLoad) {