feat(onLoad): add setTransform function #358

This commit is contained in:
moklick
2020-07-25 13:38:55 +02:00
parent 8c565e4a27
commit 2fee4c35ae
2 changed files with 3 additions and 0 deletions
+2
View File
@@ -183,6 +183,8 @@ const GraphView = memo(
zoomOut: () => zoom(-0.2),
project,
getElements,
setTransform: (transform: FlowTransform) =>
setInitTransform({ x: transform.x, y: transform.y, k: transform.zoom }),
});
}
+1
View File
@@ -175,6 +175,7 @@ type OnLoadParams = {
fitView: FitViewFunc;
project: ProjectFunc;
getElements: () => Elements;
setTransform: (transform: FlowTransform) => void;
};
export type OnLoadFunc = (params: OnLoadParams) => void;