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