fit view
This commit is contained in:
parent
b5f10b68d0
commit
057a02c90c
2 changed files with 2 additions and 0 deletions
|
|
@ -21,6 +21,7 @@ import {
|
||||||
downloadFlowsFromDatabase,
|
downloadFlowsFromDatabase,
|
||||||
uploadFlowsToDatabase,
|
uploadFlowsToDatabase,
|
||||||
} from "../controllers/API";
|
} from "../controllers/API";
|
||||||
|
import _ from "lodash";
|
||||||
|
|
||||||
const uid = new ShortUniqueId({ length: 5 });
|
const uid = new ShortUniqueId({ length: 5 });
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -127,6 +127,7 @@ export default function Page({ flow }: { flow: FlowType }) {
|
||||||
setEdges(flow?.data?.edges ?? []);
|
setEdges(flow?.data?.edges ?? []);
|
||||||
if (reactFlowInstance) {
|
if (reactFlowInstance) {
|
||||||
setViewport(flow?.data?.viewport ?? { x: 1, y: 0, zoom: 0.5 });
|
setViewport(flow?.data?.viewport ?? { x: 1, y: 0, zoom: 0.5 });
|
||||||
|
reactFlowInstance.fitView();
|
||||||
}
|
}
|
||||||
}, [flow, reactFlowInstance, setEdges, setNodes, setViewport]);
|
}, [flow, reactFlowInstance, setEdges, setNodes, setViewport]);
|
||||||
//set extra sidebar
|
//set extra sidebar
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue