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:
@@ -193,13 +193,16 @@ nextTick(async () => {
|
|||||||
if ('screen' in window)
|
if ('screen' in window)
|
||||||
await until(store.dimensions).toMatch(({ height, width }) => !isNaN(width) && width > 0 && !isNaN(height) && height > 0)
|
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 = {
|
const instance: FlowInstance = {
|
||||||
fitView: (params = { padding: 0.1 }) => fitView(params),
|
fitView: (params = { padding: 0.1 }) => fitView(params),
|
||||||
zoomIn,
|
zoomIn,
|
||||||
zoomOut,
|
zoomOut,
|
||||||
zoomTo,
|
zoomTo,
|
||||||
setTransform,
|
setTransform,
|
||||||
|
getTransform,
|
||||||
|
setCenter,
|
||||||
|
fitBounds,
|
||||||
project: onLoadProject(store),
|
project: onLoadProject(store),
|
||||||
getElements: onLoadGetElements(store),
|
getElements: onLoadGetElements(store),
|
||||||
getNodes: onLoadGetNodes(store),
|
getNodes: onLoadGetNodes(store),
|
||||||
|
|||||||
Reference in New Issue
Block a user