Skip to content

Allow Outputting Anchors for Tree Nodes #700

Description

@johannes-wolf

Discussed in #698

Originally posted by noahjutz September 23, 2024
Is it possible to refer to a tree's node's position from outside of a tree?

When I try

cetz.tree.tree(
  // ...
  draw-node: (node, p) => {
    if node.content.text == "1" {circle((), radius: 0, name: "anchor_1")}
    else if node.content.text == "2" {circle((), radius: 0, name: "anchor_2")}
  }
)

line("anchor_1", "anchor_2")

I get Assertion failed: Unknown element 'anchor_1' in elements ().

Motivation: I want to draw arrows between sibling nodes in a tree.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

featureFeature Request

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions