scene_model() walks a rendered scene and returns one row per drawn element of
the keyable marks (points, circles, rects, hexagons, sectors, segments),
pairing each element's grammar-supplied identity — its data key, free-form
meta, grob id/name, and enclosing panel — with its resolved device-pixel
bounding box. It is the host-agnostic bridge underlying interactivity: a host
renders the SVG (each element tagged with data-key, see scene_svg()) and
uses this table to map an event back to the originating datum.
Arguments
- scene
A
vl_scene()(or anything coercible viaas_vellum_scene()).
Value
A list with two data frames:
elements— one row per element:key,mark,id,name,panel, the device-px bboxx0,y0,x1,y1, its centre/sizex,y,w,h, and ametalist-column.panels— one row per named panel:nameand its elements' bounding boxx0,y0,x1,y1.
Details
Elements are returned in paint order. key/meta are NA/NULL for marks
drawn without them, so a plain scene still yields a geometry table.
