Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: support for invisible nodes / distinct directional bias #10

Open
kokic opened this issue Dec 11, 2024 · 0 comments
Open

feat: support for invisible nodes / distinct directional bias #10

kokic opened this issue Dec 11, 2024 · 0 comments

Comments

@kokic
Copy link

kokic commented Dec 11, 2024

This support is intended to allow the display of specified subtrees in their designated positions when drawing binary trees. For the current implementation, a simple approach is to make the branches connecting to a node disappear if the node's content is empty (exactly, space). Ideally, it should be adjusted to a uniquely designed type with a length.

For example:

let is_space = child.has("body") and child.at("body").has("amount")
if not is_space {
  place(line(stroke: stroke, start: (0pt+ child_width/2, lo), end: (children_width / 2 - x0+ child_width/2, hi)))
}

In this way, when we write #syntree("[A $quad$ B]"), we will obtain a binary tree with a distinct directional bias (node "A" nil (node "B" nil nil).

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant