archaeopteryx 3.7.0 → 3.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -343,8 +343,9 @@ so more tips than the target may stay.
343
343
 
344
344
  The tips kept show as search A's hits, with its colour, hit count and
345
345
  step-through, and a summary offers **Create tree**: a tree of only those tips,
346
- added to the tree picker and opened drawn as the tree was (phylogram, aligned
347
- or cladogram). It is named after the tree and the count, as in
346
+ added to the tree picker and opened drawn as the tree was — the same layout
347
+ and display type (phylogram, aligned or cladogram). It is named after the
348
+ tree and the count, as in
348
349
  `mammals_233reps`, and its description says how it was made. An internal node
349
350
  left with one child is replaced by that child, whose branch gains the node's
350
351
  length; the new root keeps the original root's own branch length. The original
@@ -460,6 +461,12 @@ keeps the view in the hash too, so the same file reopened at that address
460
461
  comes back as you left it. Zoom, pan, the legend's position and the node
461
462
  selection are not part of a view; a shared view opens fitted.
462
463
 
464
+ In a file holding **several trees** each tree keeps its own view, so moving
465
+ between them with the picker brings each tree back as you had it (see
466
+ **Reading trees** below). The hash holds the view of the tree on screen, so
467
+ a link opens that tree the way it looks; the other trees' views last as long
468
+ as the page does.
469
+
463
470
  Embedders get the same four pieces: the handle's `getViewState()` and
464
471
  `applyViewState(state)`, the config's `view` (open straight into one) and
465
472
  `onViewChange(state, encoded)` (called when it changes), and
@@ -540,7 +547,12 @@ youngest tip and labels that age (the ammonite demo ends at the K-Pg, 66).
540
547
 
541
548
  Nodes with a date **range** (`minimum`/`maximum` — minimum is the younger
542
549
  bound) draw uncertainty bars: translucent blue **HPD age bars** on internal
543
- nodes, sepia **fossil-range (FAD/LAD) bars with end caps** on tips. Node
550
+ nodes, and on tips whatever the axis says the range means. On **geologic**
551
+ time it is a fossil's observed range: sepia **fossil-range (FAD/LAD) bars with
552
+ end caps**. On **calendar** time it is the uncertainty of a **sampling date**
553
+ — a virus sample dated only to its month or year — drawn like an age bar,
554
+ slimmer, and only when it has a width: a tip dated to the day draws nothing.
555
+ Node
544
556
  tooltips show the date. The **Time Axis** checkbox under Display Data toggles
545
557
  everything; the axis needs a phylogram (branch lengths carry the time) and
546
558
  the rectangular layout. **Time Grid** (off by default, like the desktop's
@@ -734,8 +746,15 @@ a name ending in `xml` as phyloXML, anything else as New Hampshire (Newick).
734
746
  A file holding **several trees** — a Nexus TREES block, a Newick file with one
735
747
  tree per `;`, a phyloXML with several phylogenies — opens on the first, and a
736
748
  picker with previous / next buttons at the top of the control panel moves
737
- between them; each tree opens fresh under the same config, nothing collapsed, the way a new tab
738
- does on the desktop. A protein/DNA/RNA characters matrix in a Nexus file
749
+ between them (also ⌘⇧< / ⌘⇧>). **Each tree is its own workspace:** you leave
750
+ a tree as you had it — layout, display type, labels, colours, sizes, tracks,
751
+ both searches, the clade you switched to and the ones you collapsed — and it
752
+ comes back that way. A tree you have not opened yet starts on its own
753
+ presets, read from its own content, in the layout and sizes you are already
754
+ using: stepping through ten trees of one file keeps them all circular, while
755
+ each still labels and colours itself its own way. Zoom and pan are not kept
756
+ (a tree opens fitted), and the views last as long as the page.
757
+ A protein/DNA/RNA characters matrix in a Nexus file
739
758
  (sequential or interleaved) lands on the tips as an aligned `mol_seq`, so the
740
759
  alignment track appears just as it does for phyloXML.
741
760
 
@@ -757,9 +776,34 @@ BEAST, BEAST 2, TreeAnnotator, FigTree and MrBayes — `posterior`, `prob`
757
776
  (median/mean) with its `95%_HPD` (or range) becomes the node date the age
758
777
  bars draw, FigTree's `!color` becomes the branch colour, and every other
759
778
  field (`rate`, traits, ...) becomes a `beast:<key>` node property for
760
- Color-by and search. Classic `[&&NHX:...]` tags map to their phyloXML
779
+ Color-by and search (`mutations`, `mcc` and FigTree's `!`-prefixed display
780
+ directives are always text, never a gradient). **TreeTime**'s trees open as
781
+ what they are: its `timetree.nexus` carries dates only as `date=` annotations,
782
+ and those become node dates — calendar axis and all — where the date
783
+ differences reproduce the branch lengths, which is true of the time tree and
784
+ not of `divergence_tree.nexus`, though both carry the same annotations. Its
785
+ annotations land as `treetime:<key>` rather than `beast:<key>`, and its
786
+ `auspice_tree.json` opens as the Auspice dataset it is. FigTree's colour on a **taxon** — `'name'[&!color=...]` in the
787
+ TAXLABELS block — is that tip's **label** colour, carried as the desktop's
788
+ `style:font_color` property and drawn by Visual Styles. A number is a plain
789
+ decimal with an optional exponent: `0x1A` and `3f` are text.
790
+ **Auspice's "download Nexus"** annotations land where the
791
+ Auspice JSON reader puts the same dataset, so one Nextstrain build opens the
792
+ same way in either format: `num_date` is the node's date in years (and a
793
+ `nextstrain:num_date` property), `num_date_CI={lo,hi}` its interval — on a tip
794
+ too, where it is the sampling-date uncertainty — and `div` a
795
+ `nextstrain:div` property — but only on a tree that is actually time-scaled,
796
+ since Auspice writes the same annotations on its divergence tree: where the
797
+ year differences do not reproduce the branch lengths the dates stay properties
798
+ and no calendar axis is drawn. Inside an annotation a quote opens a string
799
+ only where a value starts, so a bare `country=Côte d'Ivoire` is one field with
800
+ an apostrophe in it. Classic `[&&NHX:...]` tags map to their phyloXML
761
801
  equivalents (`S=` taxonomy, `T=` taxonomy id, `B=` support, `D=`
762
- duplication/speciation event, `GN=`/`AC=` sequence name/accession). Plain
802
+ duplication/speciation event, `GN=`/`AC=` sequence name/accession), read as
803
+ the desktop reads them: unquoted whitespace is formatting noise (`S=Homo
804
+ sapiens` is `Homosapiens`), a quoted value keeps its content
805
+ (`S="Homo sapiens"` is `Homo sapiens`), and the quotes themselves are never
806
+ part of the value. Plain
763
807
  `[number]` brackets keep their old meaning (confidence values).
764
808
 
765
809
  Both entry points **throw** on bad input — an undefined or empty tree, an
@@ -865,6 +909,21 @@ is always a fixed amount wider than the branch itself, so it tracks the
865
909
  Branch Width slider instead of sitting at one fixed size. A branch drawn
866
910
  shorter than the dot itself stays clean.
867
911
 
912
+ The **control panel itself** follows the same idea. It opens showing the
913
+ sections that describe the tree — what it can be coloured by, what it shows —
914
+ plus Search, and folds the ones that are adjustments to make later: Zoom,
915
+ Sizes and the domain controls. Whatever you open or close is then remembered, for the
916
+ page and across reloads, so a panel you have arranged stays arranged, even
917
+ when you switch to another tree. In a short window it also keeps itself to one
918
+ screen: opening a section folds the one you opened longest ago, but only while
919
+ the panel would not otherwise fit — on a tall screen nothing is ever folded for
920
+ you. Anything that puts something into a folded section opens it, so jumping to
921
+ the search box (⌘F / Ctrl+F), revealing Search B, or a tool reporting its
922
+ result as search hits all unfold Search. A host with little room to give can
923
+ also start the whole panel tighter and narrower with
924
+ [`panelDensity: 'compact'`](#configuration), or collapsed to its header bar
925
+ with `collapseControlPanel`.
926
+
868
927
  ## Configuration
869
928
 
870
929
  One object, passed as the third argument. It is optional, and the best
@@ -889,6 +948,7 @@ copy-pastable JSON.
889
948
  | Key | Default | What it does |
890
949
  | --- | --- | --- |
891
950
  | `collapseControlPanel` | `false` | Open with the control panel collapsed to just its header bar — the same state its own hide/show button toggles. |
951
+ | `panelDensity` | `'comfortable'` | `'compact'` tightens the control panel's spacing and narrows it from 214 to 196px, with the tree's left margin following. The same controls, nothing hidden — for a host page that has little room to give. |
892
952
  | `enableDynamicSizing` | `true` | Size the tree to its container, and follow window resizes. |
893
953
  | `displayWidth` | `800` | Width — only when dynamic sizing is off. |
894
954
  | `displayHeight` | `600` | Height — only when dynamic sizing is off. |
@@ -76,6 +76,9 @@ export interface ArchaeopteryxConfig {
76
76
  /** Called once per settled redraw when the view changed: the state as
77
77
  * getViewState() returns it, and its hash-ready string. */
78
78
  onViewChange?: ((state: ViewState, encoded: string) => void) | null;
79
+ /** 'compact' tightens the control panel's spacing and narrows it (the
80
+ * tree's left margin follows). The same controls, nothing hidden. */
81
+ panelDensity?: 'comfortable' | 'compact';
79
82
  pngExportScale?: number;
80
83
  rootOffset?: number;
81
84
  searchAinitialValue?: string | null;
@@ -158,7 +161,9 @@ export interface ViewerHandle {
158
161
  /** Which of them is shown (0-based). */
159
162
  getTreeIndex(): number;
160
163
  /** Shows another tree of the launch in the same container under the
161
- * same config; it opens fresh. Returns the handle for the new viewer. */
164
+ * same config: as you left it, or -- a tree not opened yet -- on its own
165
+ * presets in the current layout and sizes. Returns the handle for the
166
+ * new viewer. */
162
167
  showTree(index: number): ViewerHandle;
163
168
  /** The view as the panel left it (see ViewState). */
164
169
  getViewState(): ViewState;