@mocanvas/editor · interface
interface EditorConfig extends TldrawOptionsThe editor's option bag.
TldrawOptions is the documented set — every behavioural knob the canvas exposes. This adds the handful mocanvas needs that the documented set has no name for: the renderer's clear colour, the zoom clamp, and the separate octave threshold the debounced-zoom tracker uses.
Properties · 6
allowVideoAutoplay: booleanWhether a video shape may start playing without a user gesture.
backgroundColor: [number, number, number, number]The page colour behind the canvas, as RGBA in 0–1.
@deprecated The canvas background is a *theme* colour — the theme carries
one for each colour mode and publishes it as --mocanvas-background,
which is what the container paints. This knob is honoured when it is set
to anything other than its default, so an app that configured it keeps the
colour it configured; a new app should set the theme, or pass
style={{ background }} to <Canvas>, either of which follows dark mode.
It is no longer the renderer's clear colour: the GPU layer clears
transparent, because anything it painted covered the grid and the
Background slot beneath it.
debouncedZoomOctaves: numberHow far the zoom must change, in octaves, before getDebouncedZoomLevel()
updates mid-movement. 0.5 is half a doubling.
Distinct from TldrawOptions.debouncedZoomThreshold, which is a *shape count*: the two answer different questions — when is a page busy enough to debounce at all, and how much movement is worth publishing.
zoomMax: numberHard upper bound on camera zoom.
zoomMin: numberHard lower bound on camera zoom, below the camera options' own steps.
zoomSteps: number[]The zoom levels the zoom-in / zoom-out steps land on.
Mentioned here
mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.