Closed OrangeX4 closed 4 months ago
This is done in ea781e7ef1ce0b3ba9d5200ab8d10d2c25e7c8cb. :)
Because fletcher nodes and edges aren’t plain cetz arrays, but their own special thing, I needed to add a fletcher.hide(bounds: bool)
function (which wraps the output in cetz.draw.hide(bounds: bool)
.
It now works with the following reducer:
#let fletcher-diagram = touying-reducer.with(reduce: fletcher.diagram, cover: fletcher.hide)
Thanks for such a quick implementation!
In cetz version 0.2.1, a
bounds
parameter was added to thehide
function, as seen in https://github.com/johannes-wolf/cetz/pull/499. This enhancement allows us to hide elements without affecting bounds calculations, ensuring that the final outcome remains consistent with the built-inhide
function in Typst. Here's an example:Therefore, it is also convenient to use Touying to achieve wonderful animations (preserving spaces):
As fletcher lacks a hide function similar to cetz, the final animation may be suboptimal and unable to preserve spaces:
If fletcher could also provide a hide function, we could achieve a better animation feature.