feat(onLoad): add setTransform function #358
This commit is contained in:
@@ -183,6 +183,8 @@ const GraphView = memo(
|
|||||||
zoomOut: () => zoom(-0.2),
|
zoomOut: () => zoom(-0.2),
|
||||||
project,
|
project,
|
||||||
getElements,
|
getElements,
|
||||||
|
setTransform: (transform: FlowTransform) =>
|
||||||
|
setInitTransform({ x: transform.x, y: transform.y, k: transform.zoom }),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -175,6 +175,7 @@ type OnLoadParams = {
|
|||||||
fitView: FitViewFunc;
|
fitView: FitViewFunc;
|
||||||
project: ProjectFunc;
|
project: ProjectFunc;
|
||||||
getElements: () => Elements;
|
getElements: () => Elements;
|
||||||
|
setTransform: (transform: FlowTransform) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type OnLoadFunc = (params: OnLoadParams) => void;
|
export type OnLoadFunc = (params: OnLoadParams) => void;
|
||||||
|
|||||||
Reference in New Issue
Block a user