feat(interaction): add zoomOnDoublickClick and fix behaviour closes #338

This commit is contained in:
moklick
2020-07-17 11:04:32 +02:00
parent a40f5adc03
commit 42f6336171
5 changed files with 47 additions and 16 deletions
+3 -1
View File
@@ -55,6 +55,7 @@ export interface GraphViewProps {
arrowHeadColor: string;
markerEndId?: string;
zoomOnScroll: boolean;
zoomOnDoubleClick: boolean;
}
const GraphView = memo(
@@ -90,6 +91,7 @@ const GraphView = memo(
arrowHeadColor,
markerEndId,
zoomOnScroll,
zoomOnDoubleClick,
}: GraphViewProps) => {
const zoomPane = useRef<HTMLDivElement>(null);
const rendererNode = useRef<HTMLDivElement>(null);
@@ -160,7 +162,7 @@ const GraphView = memo(
};
}, []);
useD3Zoom({ zoomPane, onMove, selectionKeyPressed, zoomOnScroll });
useD3Zoom({ zoomPane, onMove, selectionKeyPressed, zoomOnScroll, zoomOnDoubleClick });
useEffect(() => {
if (d3Initialised && onLoad) {