A stable hash of everything that defines the scene — geometry, style, page size, background. Two scenes that would render identically hash identically; any change to what is drawn changes the hash.
Arguments
- scene
A
vl_scene(), or anything with anas_vellum_scene()method.
Details
Useful for caching (has this scene changed since I last rendered it?) and for asserting in tests that a refactor did not alter the scene.
See also
scene_diff() to see what changed, as_scene_spec().
Examples
a <- vl_scene(2, 2) |> draw(circle_grob(gp = vl_gpar(fill = "red")))
b <- vl_scene(2, 2) |> draw(circle_grob(gp = vl_gpar(fill = "blue")))
scene_hash(a) == scene_hash(a)
#> [1] TRUE
scene_hash(a) == scene_hash(b)
#> [1] FALSE
