Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Pan and zoom the viewport
Viewport
interface Viewport { x: number y: number zoom: number }
editor.setViewport({ x: 0, y: 0, zoom: 1 }) editor.zoomIn()
<Tsdraw cameraOptions={{ zoomRange: { min: 0.5, max: 4 } }} />
import { screenToPage, pageToScreen } from '@tsdraw/core' const pagePoint = screenToPage(viewport, x, y)
<Tsdraw onCameraChange={(vp) => console.log(vp)} />