chore(svelte): revise useSvelteFlow example
This commit is contained in:
@@ -4,20 +4,24 @@
|
||||
Background,
|
||||
BackgroundVariant,
|
||||
Minimap,
|
||||
Panel,
|
||||
useSvelteFlow
|
||||
} from '../../lib/index';
|
||||
|
||||
const svelteFlow = useSvelteFlow();
|
||||
import Sidebar from './Sidebar.svelte';
|
||||
</script>
|
||||
|
||||
<SvelteFlow>
|
||||
<Controls />
|
||||
<Background variant={BackgroundVariant.Dots} />
|
||||
<Minimap />
|
||||
<Panel position="top-right">
|
||||
<button on:click={() => svelteFlow.zoomIn()}>zoom in</button>
|
||||
<button on:click={() => svelteFlow.zoomOut({ duration: 1000 })}>zoom out transition</button>
|
||||
<button on:click={() => svelteFlow.fitView()}>fitView</button>
|
||||
</Panel>
|
||||
</SvelteFlow>
|
||||
<main>
|
||||
<SvelteFlow
|
||||
fitView
|
||||
>
|
||||
<Controls />
|
||||
<Background variant={BackgroundVariant.Dots} />
|
||||
<Minimap />
|
||||
</SvelteFlow>
|
||||
<Sidebar />
|
||||
</main>
|
||||
|
||||
<style>
|
||||
main {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user