SurfaceOptions

Configuration options for a drawing surface (see example).

click? (e: SurfaceEvent) => void

The handler for the click event.

height? string (default: "100%")

The height of the surface element. By default, the surface expands to fill the height of the first positioned container.

mouseenter? (e: SurfaceEvent) => void

The handler for the mouseenter event.

mouseleave? (e: SurfaceEvent) => void

The handler for the mouseleave event.

mousemove? (e: SurfaceEvent) => void

The handler for the mousemove event.

type? "svg" | "canvas"

The preferred type of surface to create. If not supported by the browser, the option will be ignored.

width? string (default: "100%")

The width of the surface element. By default, the surface expands to fill the width of the first positioned container.