Start here
  • InstallationAdd Nelumbo to a shadcn project
  • ThemingBrand accent, neutrals, dynamic color
  • Biology componentsSequences, maps, plates and trees
  • katalyx.bio

    Phylo Tree

    A phylogenetic tree from Newick, rectangular or circular, with branch lengths or without. Branches meet in rounded elbows, and pointing at a node lights the path to every leaf below it. Color is kept for the clades you name.

    Install

    npx shadcn@latest add @nelumbo/phylo-tree

    A dated tree

    Thirteen vertebrates at their divergence times, with scale="time" counting back from today. Point at a node, or tab in and use the arrows; click a clade or press Enter to fold it.

    Layout
    Branches
    435Mya, Vertebrates
    13 species, TimeTree median dates

    Support

    Bootstrap support printed at the nodes, hidden under supportThreshold (70 here). support="dots" trades the numbers for marks. The human globins; the support values are illustrative.

    From distances

    neighborJoining builds a tree from a distance matrix (distances computes one from aligned sequences), and reroot hangs it from an outgroup. This is the textbook example.

    Distances
    abcde
    a05998
    b5010109
    c910087
    d910803
    e89730
    Outgroup
    (d:2,e:1,(c:4,(a:2,b:3):3):2);

    Props

    PropTypeDefaultNotes
    treestring | PhyloNodeNewick, or a parsed tree.
    layout"rectangular" | "circular""rectangular"Circular puts the root at the center.
    branchLengthsbooleantrueA phylogram; false lines the leaves up as a cladogram.
    alignLabelsbooleanfalseLeaves in one column, with dotted leaders.
    ladderizebooleantrueChildren ordered by size.
    support"values" | "dots" | false"values"Support at internal nodes. Circular uses dots.
    supportThresholdnumber70Hide support below this.
    scale"bar" | "time" | false"bar"A scale bar, or an axis counting back from the tips.
    unitstringFor the scale: Mya, substitutions/site.
    clades{ taxa, label, color?, collapsed? }[]Shaded clades, found as the common ancestor of taxa.
    highlightstring[]Leaves set in bold.
    italicbooleanfalseSpecies names in italics.
    collapsiblebooleanfalseFold and unfold clades by click or Enter.
    rowHeight / sizenumber24 / 560Row height; the circular diameter cap.
    selectablebooleanfalseKeyboard focus: up and down through nodes, left to the parent, right to a child.
    onActiveChange(focus: { node, taxa, depth, clade } | null) => voidThe node pointed at or focused.
    HelpersparseNewick, toNewick, ladderize, leafNames, reroot, distances, neighborJoiningParse and write Newick; order, root and build trees.