archaeopteryx 3.25.0 → 3.27.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/forester.js CHANGED
@@ -20,7 +20,7 @@
20
20
  *
21
21
  */
22
22
 
23
- // v 3.25.0
23
+ // v 3.27.0
24
24
  // 2026-09-17
25
25
  //
26
26
  // forester.js is a general suite for dealing with phylogenetic trees.
@@ -102,6 +102,13 @@
102
102
 
103
103
  const NUMBERS_ONLY_PATTERN = /^[-+]?[0-9\\.]+$/;
104
104
 
105
+ // The release this file belongs to. archaeopteryx.js compares it with its
106
+ // own (archaeopteryx.doctor): the two are separate files, a site that
107
+ // concatenates its own bundle can pair them from different releases, and
108
+ // until this constant nothing could tell. Bumped with the other four
109
+ // places; test/visualization_test.js holds all five together.
110
+ forester.VERSION = '3.27.0';
111
+
105
112
 
106
113
  /**
107
114
  * Sets links to parent nodes for all nodes in a
@@ -8784,7 +8791,11 @@
8784
8791
  // -- 1, 2 or 5 times a power of ten -- chosen so the bar comes out about
8785
8792
  // targetPx long at pxPerUnit pixels per unit. Returns {length, label,
8786
8793
  // px}, or null when the scale is unusable (zero, negative or infinite).
8787
- forester.scaleBarLength = function (pxPerUnit, targetPx) {
8794
+ // The label carries the tree's stated unit after the number ("0.05
8795
+ // subs/site"), as the distance axis does at its end, and nothing when
8796
+ // the file states none: a tree that does not say what its lengths
8797
+ // measure gets no guess (a BV-BRC user asked for units, 2026-10-08).
8798
+ forester.scaleBarLength = function (pxPerUnit, targetPx, unit) {
8788
8799
  if (!(pxPerUnit > 0) || !isFinite(pxPerUnit)) {
8789
8800
  return null;
8790
8801
  }
@@ -8793,7 +8804,8 @@
8793
8804
  let base = raw / Math.pow(10, k);
8794
8805
  let nice = base < 1.5 ? 1 : (base < 3.5 ? 2 : (base < 7.5 ? 5 : 10));
8795
8806
  let length = Number((nice * Math.pow(10, k)).toPrecision(2));
8796
- return {length: length, label: String(length), px: length * pxPerUnit};
8807
+ let u = typeof unit === 'string' ? unit.trim() : '';
8808
+ return {length: length, label: String(length) + (u ? ' ' + u : ''), px: length * pxPerUnit};
8797
8809
  };
8798
8810
 
8799
8811
  // --------------------------------------------------------------
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "archaeopteryx",
3
- "version": "3.25.0",
3
+ "version": "3.27.0",
4
4
  "description": "Archaeopteryx.js is a software tool for the visualization and analysis of highly annotated phylogenetic trees.",
5
5
  "main": "archaeopteryx.js",
6
6
  "types": "archaeopteryx.d.ts",
@@ -20,7 +20,7 @@
20
20
  "LICENSE"
21
21
  ],
22
22
  "scripts": {
23
- "test": "node test/forester_test.js && node test/search_test.js && node test/visualization_test.js && node test/domain_test.js && node test/gene_test.js && node test/clock_test.js && node test/metadata_test.js && node test/heatmap_test.js && node test/clustering_test.js && node test/canvg_global_test.js",
23
+ "test": "node test/forester_test.js && node test/search_test.js && node test/visualization_test.js && node test/domain_test.js && node test/gene_test.js && node test/clock_test.js && node test/metadata_test.js && node test/heatmap_test.js && node test/clustering_test.js && node test/canvg_global_test.js && node test/doctor_test.js",
24
24
  "lint": "eslint .",
25
25
  "lint:fix": "eslint . --fix",
26
26
  "format": "prettier --write .",