Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/marks/tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export function tree(
textAnchor,
treeLayout = Tree,
textLayout = treeLayout === Tree || treeLayout === Cluster ? "mirrored" : "normal",
tip,
...options
} = {}
) {
Expand Down Expand Up @@ -74,7 +75,7 @@ export function tree(
})
),
dotDot
? dot(data, treeNode({treeLayout, fill: fill === undefined ? "node:internal" : fill, title, ...options}))
? dot(data, treeNode({treeLayout, fill: fill === undefined ? "node:internal" : fill, title, tip, ...options}))
: null,
textText != null
? textLayout === "mirrored"
Expand Down
48 changes: 48 additions & 0 deletions test/output/greekGodsTip.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions test/plots/greek-gods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,25 @@ Chaos Tartarus`
});
}

export async function greekGodsTip() {
const gods = `Chaos Gaia Mountains
Chaos Gaia Pontus
Chaos Gaia Uranus
Chaos Eros
Chaos Erebus
Chaos Tartarus`
.split("\n")
.map((d) => d.replace(/\s+/g, "/"));
return Plot.plot({
axis: null,
insetLeft: 35,
insetTop: 20,
insetBottom: 20,
insetRight: 120,
marks: [Plot.tree(gods, {tip: true})]
});
}

export async function greekGodsExplicit() {
const gods = `Chaos Gaia Mountains
Chaos Gaia Pontus
Expand Down