Description
The Controls component can be rendered using defaults by passing the “controls” prop to the Svelvet componet. Customize the Controls component by wrapping it around custom buttons. Zoom increment and position are configurable via props. Trigger the exposed functions via mouse, keyboard and touch events.MyControls.svelte
When passing the component to Svelvet, you must specify slot=“controls”
MyControls.svelte
Props
number
default:"0.1"
Controls strength of zoom. Default of 0.1 means each button click zooms the canvas by 10% in or
out.
boolean
default:"false"
Displays control buttons horizontally.
Functions
function
Used to trigger a zoom in on the canvas element.
function
Used to trigger a zoom out on the canvas element.
function
Adjusts scale and translation to fit all nodes within the viewport
function
Unhides all nodes. When using default Controls component, this button is only visible when Nodes
are hidden.

