Skip to main content

Module canvas

Module canvas 

Source
Expand description

Canvas renderer for the browser. Uses plotters-canvas::CanvasBackend and the shared draw_on dispatch in crate::draw, so a chart rendered into a <canvas> looks identical to its SVG twin.

Only compiles under feature canvas, which is enabled by the nomisync-frontend WASM crate.

Functionsยง

render_canvas
Render spec into canvas via plotters-canvas. Sizes the backing canvas to device_pixel_ratio so the chart stays crisp on HiDPI screens; the caller is expected to set the CSS width/height to the logical size before calling.