Reports the resolved width and height of a named viewport (or grob) and what
determined them — the layout track it was placed in, or the units of its own
width/height. The layout companion to the visual render(scene, debug = TRUE)
overlay; together they make coordinate debugging first-class rather than an
exercise in archaeology.
Arguments
- scene
A
vl_scene()(or anything with anas_vellum_scene()method).- name
A node name (set via the
nameargument of a viewport/grob).
Value
A vellum_why_size record (a list with name, width_mm,
height_mm, and determined_by), printed legibly.
Examples
s <- vl_scene(4, 3) |>
push(vl_viewport(name = "panel", width = vl_unit(2, "in"), height = vl_unit(1, "in")))
why_size(s, "panel")
#>
#> ── why_size("panel")
#> Resolved size: 50.8 mm wide x 25.4 mm tall
#> Determined by: placed by size: width = 2in, height = 1in
