Skip to content

Commit

Permalink
Fix docs for draw-edge function in tree library (#747)
Browse files Browse the repository at this point in the history
Fix the signature of `draw-edge` function argument in the `tree` library to correctly specify that it actually accepts 4 arguments.
  • Loading branch information
Lipen authored Nov 21, 2024
1 parent 4b6da3e commit d717502
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/tree.typ
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
///
/// - root (array): A nested array of content that describes the structure the tree should take. Example: `([root], [child 1], ([child 2], [grandchild 1]))`
/// - draw-node (auto,function): The function to call to draw a node. The function will be passed two positional arguments, the node to draw and the node's parent, and is expected to return elements (`(node, parent-node) => elements`). The node's position is accessible through the "center" anchor or by using the previous position coordinate `()`. If `auto` is given, just the node's value will be drawn as content. The following predefined styles can be used:
/// - draw-edge (none,auto,function): The function to call draw an edge between two nodes. The function will be passed the name of the starting node, the name of the ending node, and the end node and is expected to return elements (`(source-name, target-name, target-node) => elements`). If `auto` is given, a straight line will be drawn between nodes.
/// - draw-edge (none,auto,function): The function to call draw an edge between two nodes. The function will be passed the name of the starting node, the name of the ending node, the start node, the end node, and is expected to return elements (`(source-name, target-name, parent-node, child-node) => elements`). If `auto` is given, a straight line will be drawn between nodes.
/// - direction (str): A string describing the direction the tree should grow in ("up", "down", "left", "right")
/// - parent-position (str): Positioning of parent nodes (begin, center, end)
/// - grow (float): Depth grow factor
Expand Down

0 comments on commit d717502

Please sign in to comment.