module
html
Mapping DSL elements to HTML: tags, attributes, and string rendering (used for server-side rendering and by the DOM host).
Functions
graphics_wrapper_attrs
pub fn graphics_wrapper_attrs(el: &VElement) -> Vec<(String, String)>The attributes of the element that wraps a drawing surface (canvas2d, scene3d…): its classes, size and accessible name.
host_tag
pub fn host_tag(el: &VElement) -> StringThe HTML tag for a DSL element. Unknown names pass through, so plain HTML tags (section, footer, …) work in templates.
html_attributes
pub fn html_attributes(el: &VElement) -> Vec<(String, String)>HTML attributes (in a stable order) for a non-graphics element.
html_layer_attrs
pub fn html_layer_attrs(h: &VElement, rel: &str) -> Vec<(String, String)>The DOM attributes of an html element's layer: its own class, style and ARIA, and where it is in the surface.
html_layers
pub fn html_layers(el: &VElement) -> Vec<(&VElement, String)>A scene's html elements and their paths within it ("2", "1/3").
is_svg_tag
pub fn is_svg_tag(tag: &str) -> boolWhether tag is SVG content (so all its attributes are kept).
needs_runtime
pub fn needs_runtime(roots: &[VNode]) -> boolWhether a rendered page needs the runtime (wasm) in the browser: it handles events, focuses something, draws on a surface (surfaces prerender empty) or animates. Without any of these, the prerendered HTML is the whole page.
orbit_controls
pub fn orbit_controls(el: &VElement) -> boolWhether a 3D scene has orbit controls (controls: "orbit").
proxy_style
pub fn proxy_style(r: &Rect, w: f32, h: f32) -> StringAbsolute-position CSS for an accessibility proxy, as percentages of the surface's logical w × h, so proxies follow responsive canvases.
Constants
BASE_CSS
pub const BASE_CSS: &str = …;Default styles for the built-in layout primitives and graphics proxies.
BOOLEAN
pub const BOOLEAN: &[&str] = _;HTML attributes written with no value when true, and left out when false.
ORBIT_HINT
pub const ORBIT_HINT: &str = "Drag or use the arrow keys to rotate; plus and minus zoom.";Attributes for the div wrapping a graphics surface. With a class the surface is sized by CSS; otherwise by its width/height. How to use orbit controls, for assistive technology.
PASSTHROUGH
pub const PASSTHROUGH: &[&str] = _;HTML attributes written as they are on HTML elements (others are left out, apart from class, style, role, aria-*, data-* and, inside svg, everything).