feat(interaction): add paneMoveable prop #377

This commit is contained in:
moklick
2020-07-30 11:10:41 +02:00
parent f4d1af6589
commit f84eff1a8c
5 changed files with 30 additions and 3 deletions
+4 -2
View File
@@ -60,6 +60,7 @@ export interface GraphViewProps {
markerEndId?: string;
zoomOnScroll: boolean;
zoomOnDoubleClick: boolean;
paneMoveable: boolean;
}
const GraphView = ({
@@ -98,6 +99,7 @@ const GraphView = ({
markerEndId,
zoomOnScroll,
zoomOnDoubleClick,
paneMoveable,
}: GraphViewProps) => {
const zoomPane = useRef<HTMLDivElement>(null);
const rendererNode = useRef<HTMLDivElement>(null);
@@ -141,7 +143,6 @@ const GraphView = ({
updateDimensions();
window.onresize = updateDimensions;
if (rendererNode.current) {
resizeObserver = new ResizeObserver((entries) => {
for (let _ of entries) {
@@ -169,6 +170,7 @@ const GraphView = ({
selectionKeyPressed,
zoomOnScroll,
zoomOnDoubleClick,
paneMoveable,
});
useEffect(() => {
@@ -196,7 +198,7 @@ const GraphView = ({
}
}
}, [d3Initialised, onLoad]);
useEffect(() => {
if (onConnect) {
setOnConnect(onConnect);