Open epatters opened 4 years ago
For now, I am going to delegate the placement of wire labels entirely to the backend, since the backend-agnostic layout provides only limited information about the routing of the wires, making label placement difficult at this stage.
Wires labels are implemented for TikZ diagrams.
In Compose.jl, wire labels will be more tedious to implement since all the positions have to be calculated manually. AFAIK, Compose does not provide functions to calculate relative positions along cubic Bezier curves. This requires computing the arc length of Bezier curves, which rarely has a closed form. A few helper functions can be found in Luxor.jl.
How do you enable labels on Tikz diagrams? to_tikz(d, labels=true)
throws a keyword unsupported error for me.
The keyword argument labels=true
works in the vignette so I think it should generally work. Can you provide a stack trace?
Note that there are two valid ways to call to_tikz
: with a morphism expression (to_tikz(f)
) or with a syntax module plus a wiring diagram (to_tikz(FreeCartesianCategory, d)
). The latter case is a shorthand of the composite of to_hom_expr
with to_tikz
.
The new wiring diagrams in Compose.jl and in TikZ do not yet support labels on the wires. This feature is crucial but hard to get right, and never worked well in the old TikZ wiring diagrams (see #16). I haven't yet decided how I want to approach this.