add examples
This commit is contained in:
@ -1,12 +1,15 @@
|
||||
<script>
|
||||
import { useSvelteFlow } from "@xyflow/svelte";
|
||||
import {nodes, auto} from './stores.js';
|
||||
import { nodes, auto, doFit } from "./stores.js";
|
||||
|
||||
const { zoomIn, zoomOut, setZoom, fitView, setCenter, setViewport, getViewport, viewport } =
|
||||
useSvelteFlow();
|
||||
|
||||
nodes.subscribe((n) => {
|
||||
if ($auto) fitView();
|
||||
});
|
||||
</script>
|
||||
nodes.subscribe((n) => {
|
||||
if ($auto) fitView();
|
||||
});
|
||||
|
||||
doFit.subscribe(() => {
|
||||
fitView();
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user