Idea borrowed from pointblank
list of emphatic objects
viewBox dimensions for SVG
frame duration in seconds. May be a single value used for all frames, or a vector of values (one duration value for each frame). Can be fractions of a second.
'click', 'infinite'
CSS font-size. Default: NULL means to not adjust font size.
Otherwise, use valid CSS font-size
specification e.g.
"3em", "22px" etc.
html tag styling to apply to the <pre>
wrapper for the
returned HTML
ID to use for the SVG tag. Default: NULL means to create a random ID
Should the SVG be rendered to the RStudio Viewer pane when when printed (instead of console output)? Default: FALSE
Character string containing an animated SVG representation displaying all elements sequentially
list(
hl_diff('hello', 'there'),
hl_diff('goodbye', 'good boy')
) |>
as_svg_anim() |>
cat()
#> <svg id="emphaticwl4dieex" fill="none" viewBox="0 0 1200 900" width="1200" height="900" xmlns="http://www.w3.org/2000/svg"><g visibility="hidden">
#> <foreignObject width="100%" height="100%">
#> <div xmlns="http://www.w3.org/1999/xhtml">
#> <pre style=''>
#> <span><span>[1] "</span></span><span style='color:#000000;'><span style='background-color:#9aff9a;'> </span></span><span><span>he</span></span><span style='color:#000000;'><span style='background-color:#97ffff;'>ll</span></span><span style='color:#000000;'><span style='background-color:#ff7f50;'>o</span></span><span><span>"</span></span><br/><span><span>[1] "</span></span><span style='color:#000000;'><span style='background-color:#9aff9a;'>t</span></span><span><span>he</span></span><span style='color:#000000;'><span style='background-color:#97ffff;'>re</span></span><span style='color:#000000;'><span style='background-color:#ff7f50;'> </span></span><span><span>"</span></span>
#> </pre>
#> </div>
#> </foreignObject>
#> <set id="emphaticwl4dieex001" attributeName="visibility" begin="0s;emphaticwl4dieex002.end"
#> to="visible" dur="1.000000s" />
#> </g><g visibility="hidden">
#> <foreignObject width="100%" height="100%">
#> <div xmlns="http://www.w3.org/1999/xhtml">
#> <pre style=''>
#> <span><span>[1] "good</span></span><span style='color:#000000;'><span style='background-color:#9aff9a;'> </span></span><span><span>b</span></span><span style='color:#000000;'><span style='background-color:#9aff9a;'> </span></span><span><span>y</span></span><span style='color:#000000;'><span style='background-color:#ff7f50;'>e</span></span><span><span>"</span></span><br/><span><span>[1] "good</span></span><span style='color:#000000;'><span style='background-color:#9aff9a;'> </span></span><span><span>b</span></span><span style='color:#000000;'><span style='background-color:#9aff9a;'>o</span></span><span><span>y</span></span><span style='color:#000000;'><span style='background-color:#ff7f50;'> </span></span><span><span>"</span></span>
#> </pre>
#> </div>
#> </foreignObject>
#> <set id="emphaticwl4dieex002" attributeName="visibility" begin="emphaticwl4dieex001.end"
#> to="visible" dur="1.000000s" />
#> </g></svg>