app.components.viewer

Top-level viewer components that compose the tree visualization.

Contains PixelGrid, ScaleBar, ScaleGridlines, TreeViewer, TreeContainer, and EmptyState. TreeContainer reads state from React context and derives the positioned tree, passing everything as props to the pure TreeViewer.

EmptyState

(EmptyState props__5701__auto__)

Placeholder shown when no tree is loaded. Displays a centered message with the app header and toolbar.

PixelGrid

(PixelGrid props__5701__auto__)

SVG debug grid showing pixel coordinates.

Renders light dashed lines at regular intervals with axis labels, useful for development and layout troubleshooting. Rendered in raw SVG pixel space (not affected by tree transforms).

Props: - :width - SVG canvas width in pixels - :height - SVG canvas height in pixels - :spacing - grid line spacing in pixels (default 50)

ScaleBar

(ScaleBar props__5701__auto__)

Renders a solid scale bar with tick marks and labels.

When scale-units-label is non-empty, a units label is rendered as a static <text> element just past the right end of the scale bar.

ScaleGridlines

(ScaleGridlines props__5701__auto__)

ScaleGridlines*

(ScaleGridlines* props__5701__auto__)

Renders evolutionary-distance gridlines as dashed vertical SVG lines.

Computes human-friendly tick intervals via scale/calculate-scale-unit and scale/get-ticks, then draws one dashed line per tick across the full tree-height. Intended to be placed as a sibling of the tree and metadata in the SVG, inside the translated coordinate group.

Props (see ::app.specs/scale-gridlines-props): - :max-depth - maximum x-coordinate in the tree - :x-scale - horizontal scaling factor (pixels per branch-length unit) - :tree-height - total height in pixels to span - :scale-origin - :tips or :root for tick placement

TreeContainer

(TreeContainer props__5701__auto__)

TreeContainer*

(TreeContainer* props__5701__auto__)

Intermediate component that bridges state context and pure rendering.

Reads raw state from context via state/use-app-state, derives the positioned tree via tree/parse-and-position or tree/position-tree (when a pre-parsed tree is available, e.g. from Nextstrain import), and enriches leaves via tree/enrich-leaves. Both stages are memoized separately so that metadata changes don’t re-parse the Newick string. When no tree is available, renders EmptyState instead.

TreeViewer

(TreeViewer props__5701__auto__)

TreeViewer*

(TreeViewer* props__5701__auto__)

Top-level visualization shell that combines toolbar, metadata header, and a scrollable SVG viewport containing the tree, gridlines, and metadata columns.

Props (see :app.specs/tree-viewer-props): - :tree - positioned root node - :tips - flat vector of enriched leaf nodes - :max-depth - maximum x-coordinate in the tree - :active-cols - vector of column config maps - :x-mult - horizontal zoom multiplier - :y-mult - vertical tip spacing - :show-internal-markers - whether to show circles on internal nodes - :show-scale-gridlines - whether to show evolutionary distance gridlines - :scale-origin - :tips or :root for scale labeling - :show-distance-from-origin - whether to show internal node distances from origin - :show-pixel-grid - whether to show pixel coordinate debug grid - :col-spacing - extra horizontal spacing between metadata columns - :width-px - total available width in pixels - :component-height-px - total available height in pixels - :highlights - map of {leaf-name -> color} for persistent highlights - :color-by-enabled? - whether metadata color-by is active - :color-by-field - keyword for the metadata field to color by - :color-by-palette - palette id keyword for auto-coloring - :color-by-type-override - type override (:auto, :categorical, :numeric, :date) - :selected-ids - set of leaf names currently selected in the grid - :metadata-panel-collapsed - whether the metadata grid panel is collapsed - :metadata-panel-height - current height of the metadata grid panel - :metadata-panel-last-drag-height - last height set by dragging - :set-metadata-panel-height! - setter for panel height - :set-metadata-panel-last-drag-height! - setter for last drag height