-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to combine multiple subnodes into a fat node? #32
Comments
You could try making the composite node one node with a table as content. This solution still requires you to manually position edges, but that's easier than manually joining nodes. #import "@preview/fletcher:0.4.4" as fletcher: diagram, node, edge, draw
#let label = table(
columns: (12mm, 4mm, 4mm, 4mm),
`Node`, none, `4`, none,
stroke: (x, y) => if 0 < x and x < 3 { (x: 1pt) },
)
#diagram(
node-stroke: 1pt,
edge-stroke: 1pt,
mark-scale: 50%,
node((0,0), label, inset: 0pt, corner-radius: 3pt),
edge((0.09,0), (0,1), "*-straight", snap-to: ((99,99), auto)),
edge((0.41,0), (1,1), "*-straight", snap-to: ((99,99), auto)),
node((0,1), `Subnode`),
) I've used It would be really cool to support something like pinit for doing something like this more automatically, though. |
@waterlens I'm going to assume that the table-in-a-node trick worked fine, so that we don't need to add a new kind of 'fat' node or 'subnode' :) |
I'm trying to draw a diagram similar to this one:
My plan is to regard it as separate 4 nodes which are close enough together.
However, I found it hard to specify the distance between nodes in fletcher because I cannot directly get the size of a node.
And I don't know if I can let all nodes share the same height automatically.
Is it possible to add support to such a diagram, through a new concept of fat nodes and subnodes in fletcher?
Currently, I can get a scribbled diagram using fletcher,
with this code:
The text was updated successfully, but these errors were encountered: