update(zoom): Add new zoom pan helper functions to instance

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2021-12-20 19:29:52 +01:00
parent 4065354c10
commit 55b843482b
+4 -1
View File
@@ -193,13 +193,16 @@ nextTick(async () => {
if ('screen' in window)
await until(store.dimensions).toMatch(({ height, width }) => !isNaN(width) && width > 0 && !isNaN(height) && height > 0)
const { zoomIn, zoomOut, zoomTo, transform: setTransform, fitView } = useZoomPanHelper(store)
const { zoomIn, zoomOut, zoomTo, setTransform, getTransform, fitView, fitBounds, setCenter } = useZoomPanHelper(store)
const instance: FlowInstance = {
fitView: (params = { padding: 0.1 }) => fitView(params),
zoomIn,
zoomOut,
zoomTo,
setTransform,
getTransform,
setCenter,
fitBounds,
project: onLoadProject(store),
getElements: onLoadGetElements(store),
getNodes: onLoadGetNodes(store),