react-cheminfo 0.47.0 → 0.49.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 +71 -2
- package/bin/check-seo.mjs +4 -3
- package/lib/core.d.ts +1 -0
- package/lib/core.d.ts.map +1 -1
- package/lib/core.js +1 -0
- package/lib/core.js.map +1 -1
- package/lib/download/core/cssPaint.d.ts +27 -0
- package/lib/download/core/cssPaint.d.ts.map +1 -0
- package/lib/download/core/cssPaint.js +63 -0
- package/lib/download/core/cssPaint.js.map +1 -0
- package/lib/download/core/drawingMarkup.d.ts +11 -0
- package/lib/download/core/drawingMarkup.d.ts.map +1 -0
- package/lib/download/core/drawingMarkup.js +32 -0
- package/lib/download/core/drawingMarkup.js.map +1 -0
- package/lib/download/core/figureHtml.d.ts +25 -0
- package/lib/download/core/figureHtml.d.ts.map +1 -0
- package/lib/download/core/figureHtml.js +174 -0
- package/lib/download/core/figureHtml.js.map +1 -0
- package/lib/download/core/figureHtmlMarkup.d.ts +107 -0
- package/lib/download/core/figureHtmlMarkup.d.ts.map +1 -0
- package/lib/download/core/figureHtmlMarkup.js +75 -0
- package/lib/download/core/figureHtmlMarkup.js.map +1 -0
- package/lib/download/core/figureSvg.d.ts.map +1 -1
- package/lib/download/core/figureSvg.js +16 -35
- package/lib/download/core/figureSvg.js.map +1 -1
- package/lib/download/core/figureSvgDocument.d.ts +3 -3
- package/lib/download/core/figureSvgDocument.d.ts.map +1 -1
- package/lib/download/core/figureTarget.d.ts +14 -3
- package/lib/download/core/figureTarget.d.ts.map +1 -1
- package/lib/download/core/figureTarget.js +42 -3
- package/lib/download/core/figureTarget.js.map +1 -1
- package/lib/download/core/index.d.ts +1 -1
- package/lib/download/core/index.d.ts.map +1 -1
- package/lib/download/core/index.js +1 -1
- package/lib/download/core/index.js.map +1 -1
- package/lib/download/core/textLines.d.ts +27 -0
- package/lib/download/core/textLines.d.ts.map +1 -0
- package/lib/download/core/textLines.js +51 -0
- package/lib/download/core/textLines.js.map +1 -0
- package/lib/ecosystem/core/lookup.d.ts +2 -1
- package/lib/ecosystem/core/lookup.d.ts.map +1 -1
- package/lib/ecosystem/core/lookup.js +10 -3
- package/lib/ecosystem/core/lookup.js.map +1 -1
- package/lib/ecosystem/core/types.d.ts +2 -2
- package/lib/ecosystem/core/types.d.ts.map +1 -1
- package/lib/ecosystem/core/unlistedSites.d.ts +9 -0
- package/lib/ecosystem/core/unlistedSites.d.ts.map +1 -0
- package/lib/ecosystem/core/unlistedSites.js +35 -0
- package/lib/ecosystem/core/unlistedSites.js.map +1 -0
- package/lib/ecosystem/ui/glyphs.d.ts.map +1 -1
- package/lib/ecosystem/ui/glyphs.js +7 -0
- package/lib/ecosystem/ui/glyphs.js.map +1 -1
- package/lib/i18n/core/chromeCatalog.d.ts +1 -1
- package/lib/i18n/core/chromeCatalog.d.ts.map +1 -1
- package/lib/locales/de.json +55 -1
- package/lib/locales/en.json +55 -1
- package/lib/locales/es.json +55 -1
- package/lib/locales/fr.json +55 -1
- package/lib/locales/it.json +55 -1
- package/lib/periodic/ui/PeriodicTable.d.ts +3 -107
- package/lib/periodic/ui/PeriodicTable.d.ts.map +1 -1
- package/lib/periodic/ui/PeriodicTable.js +5 -82
- package/lib/periodic/ui/PeriodicTable.js.map +1 -1
- package/lib/periodic/ui/PeriodicTableChrome.d.ts.map +1 -1
- package/lib/periodic/ui/PeriodicTableChrome.js +3 -25
- package/lib/periodic/ui/PeriodicTableChrome.js.map +1 -1
- package/lib/periodic/ui/SelectAllCorner.d.ts +23 -0
- package/lib/periodic/ui/SelectAllCorner.d.ts.map +1 -0
- package/lib/periodic/ui/SelectAllCorner.js +40 -0
- package/lib/periodic/ui/SelectAllCorner.js.map +1 -0
- package/lib/periodic/ui/headerStyles.d.ts +17 -0
- package/lib/periodic/ui/headerStyles.d.ts.map +1 -0
- package/lib/periodic/ui/headerStyles.js +19 -0
- package/lib/periodic/ui/headerStyles.js.map +1 -0
- package/lib/periodic/ui/periodicTableProps.d.ts +115 -0
- package/lib/periodic/ui/periodicTableProps.d.ts.map +1 -0
- package/lib/periodic/ui/periodicTableProps.js +8 -0
- package/lib/periodic/ui/periodicTableProps.js.map +1 -0
- package/lib/periodic/ui/tableLayout.d.ts +26 -0
- package/lib/periodic/ui/tableLayout.d.ts.map +1 -0
- package/lib/periodic/ui/tableLayout.js +86 -0
- package/lib/periodic/ui/tableLayout.js.map +1 -0
- package/lib/seo/core/routes.d.ts +1 -1
- package/lib/seo/core/routes.js +1 -1
- package/lib/seo/vite/prerender.d.ts +6 -0
- package/lib/seo/vite/prerender.d.ts.map +1 -1
- package/lib/seo/vite/prerender.js +7 -1
- package/lib/seo/vite/prerender.js.map +1 -1
- package/lib/split/ui/SplitColumn.d.ts +0 -1
- package/lib/split/ui/SplitColumn.d.ts.map +1 -1
- package/lib/split/ui/SplitColumn.js +0 -1
- package/lib/split/ui/SplitColumn.js.map +1 -1
- package/lib/split/ui/SplitRow.d.ts +0 -1
- package/lib/split/ui/SplitRow.d.ts.map +1 -1
- package/lib/split/ui/SplitRow.js +0 -1
- package/lib/split/ui/SplitRow.js.map +1 -1
- package/lib/split/ui/splitPanes.d.ts +12 -1
- package/lib/split/ui/splitPanes.d.ts.map +1 -1
- package/lib/split/ui/splitPanes.js +1 -4
- package/lib/split/ui/splitPanes.js.map +1 -1
- package/lib/taxonomy/core/index.d.ts +8 -0
- package/lib/taxonomy/core/index.d.ts.map +1 -0
- package/lib/taxonomy/core/index.js +5 -0
- package/lib/taxonomy/core/index.js.map +1 -0
- package/lib/taxonomy/core/lineage.d.ts +83 -0
- package/lib/taxonomy/core/lineage.d.ts.map +1 -0
- package/lib/taxonomy/core/lineage.js +126 -0
- package/lib/taxonomy/core/lineage.js.map +1 -0
- package/lib/taxonomy/core/ncbi.d.ts +8 -0
- package/lib/taxonomy/core/ncbi.d.ts.map +1 -0
- package/lib/taxonomy/core/ncbi.js +10 -0
- package/lib/taxonomy/core/ncbi.js.map +1 -0
- package/lib/taxonomy/core/organismName.d.ts +28 -0
- package/lib/taxonomy/core/organismName.d.ts.map +1 -0
- package/lib/taxonomy/core/organismName.js +188 -0
- package/lib/taxonomy/core/organismName.js.map +1 -0
- package/lib/taxonomy/core/organismWords.d.ts +20 -0
- package/lib/taxonomy/core/organismWords.d.ts.map +1 -0
- package/lib/taxonomy/core/organismWords.js +86 -0
- package/lib/taxonomy/core/organismWords.js.map +1 -0
- package/lib/taxonomy/core/ranks.d.ts +51 -0
- package/lib/taxonomy/core/ranks.d.ts.map +1 -0
- package/lib/taxonomy/core/ranks.js +123 -0
- package/lib/taxonomy/core/ranks.js.map +1 -0
- package/lib/taxonomy/ui/OrganismName.d.ts +28 -0
- package/lib/taxonomy/ui/OrganismName.d.ts.map +1 -0
- package/lib/taxonomy/ui/OrganismName.js +28 -0
- package/lib/taxonomy/ui/OrganismName.js.map +1 -0
- package/lib/taxonomy/ui/TaxonLineage.d.ts +67 -0
- package/lib/taxonomy/ui/TaxonLineage.d.ts.map +1 -0
- package/lib/taxonomy/ui/TaxonLineage.js +45 -0
- package/lib/taxonomy/ui/TaxonLineage.js.map +1 -0
- package/lib/taxonomy/ui/index.d.ts +6 -0
- package/lib/taxonomy/ui/index.d.ts.map +1 -0
- package/lib/taxonomy/ui/index.js +4 -0
- package/lib/taxonomy/ui/index.js.map +1 -0
- package/lib/taxonomy/ui/rankLabel.d.ts +17 -0
- package/lib/taxonomy/ui/rankLabel.d.ts.map +1 -0
- package/lib/taxonomy/ui/rankLabel.js +77 -0
- package/lib/taxonomy/ui/rankLabel.js.map +1 -0
- package/lib/ui.d.ts +1 -0
- package/lib/ui.d.ts.map +1 -1
- package/lib/ui.js +1 -0
- package/lib/ui.js.map +1 -1
- package/package.json +1 -1
- package/src/core.ts +1 -0
- package/src/download/core/cssPaint.ts +71 -0
- package/src/download/core/drawingMarkup.ts +35 -0
- package/src/download/core/figureHtml.ts +214 -0
- package/src/download/core/figureHtmlMarkup.ts +187 -0
- package/src/download/core/figureSvg.ts +17 -38
- package/src/download/core/figureSvgDocument.ts +3 -3
- package/src/download/core/figureTarget.ts +41 -8
- package/src/download/core/index.ts +1 -0
- package/src/download/core/textLines.ts +67 -0
- package/src/ecosystem/core/lookup.ts +11 -3
- package/src/ecosystem/core/types.ts +4 -2
- package/src/ecosystem/core/unlistedSites.ts +37 -0
- package/src/ecosystem/ui/glyphs.tsx +44 -0
- package/src/locales/de.json +55 -1
- package/src/locales/en.json +55 -1
- package/src/locales/es.json +55 -1
- package/src/locales/fr.json +55 -1
- package/src/locales/it.json +55 -1
- package/src/periodic/ui/PeriodicTable.tsx +16 -204
- package/src/periodic/ui/PeriodicTableChrome.tsx +3 -24
- package/src/periodic/ui/SelectAllCorner.tsx +65 -0
- package/src/periodic/ui/headerStyles.ts +23 -0
- package/src/periodic/ui/periodicTableProps.ts +117 -0
- package/src/periodic/ui/tableLayout.ts +96 -0
- package/src/seo/core/routes.ts +1 -1
- package/src/seo/vite/prerender.ts +7 -1
- package/src/split/ui/SplitColumn.tsx +0 -1
- package/src/split/ui/SplitRow.tsx +0 -1
- package/src/split/ui/splitPanes.tsx +21 -5
- package/src/taxonomy/core/index.ts +20 -0
- package/src/taxonomy/core/lineage.ts +161 -0
- package/src/taxonomy/core/ncbi.ts +9 -0
- package/src/taxonomy/core/organismName.ts +217 -0
- package/src/taxonomy/core/organismWords.ts +86 -0
- package/src/taxonomy/core/ranks.ts +134 -0
- package/src/taxonomy/ui/OrganismName.tsx +59 -0
- package/src/taxonomy/ui/TaxonLineage.tsx +183 -0
- package/src/taxonomy/ui/index.ts +5 -0
- package/src/taxonomy/ui/rankLabel.ts +81 -0
- package/src/ui.ts +1 -0
- package/styles/chrome.css +135 -6
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How the table is laid out: the box it measures, the grid its cells sit on,
|
|
3
|
+
* and the block a caller may write in.
|
|
4
|
+
*/
|
|
5
|
+
import { COLUMN_COUNT, EMPTY_BLOCK } from "../core/layout.js";
|
|
6
|
+
import { ROW_SHARE } from "./cellType.js";
|
|
7
|
+
import { ofWidth } from "./unit.js";
|
|
8
|
+
/**
|
|
9
|
+
* Where what the caller writes in the empty block is placed.
|
|
10
|
+
* @param offset - 1 when the table draws its header strips, 0 otherwise.
|
|
11
|
+
* @returns The style of the slot.
|
|
12
|
+
*/
|
|
13
|
+
export function insetStyle(offset) {
|
|
14
|
+
return {
|
|
15
|
+
alignItems: 'center',
|
|
16
|
+
display: 'flex',
|
|
17
|
+
// A column of air on each side, so the writing reads as sitting in the
|
|
18
|
+
// block rather than as running into the cells beside it.
|
|
19
|
+
padding: `0 ${ofWidth(2.4)}`,
|
|
20
|
+
gridColumn: `${String(EMPTY_BLOCK.column + offset)} / span ${String(EMPTY_BLOCK.columnSpan)}`,
|
|
21
|
+
gridRow: `${String(EMPTY_BLOCK.row + offset)} / span ${String(EMPTY_BLOCK.rowSpan)}`,
|
|
22
|
+
// A share of the table, with a floor, exactly as a cell sizes its symbol:
|
|
23
|
+
// the block holds the same three rows at every width, so what is written
|
|
24
|
+
// in it has to shrink with them.
|
|
25
|
+
fontSize: `max(0.6rem, ${ofWidth(1.8)})`,
|
|
26
|
+
lineHeight: 1.35,
|
|
27
|
+
minWidth: 0,
|
|
28
|
+
overflow: 'hidden',
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/** Narrowest the table is ever drawn; under it the type stops being readable. */
|
|
32
|
+
const MIN_WIDTH = 280;
|
|
33
|
+
/**
|
|
34
|
+
* How tall one row of elements is, as a share of the table's width.
|
|
35
|
+
*
|
|
36
|
+
* A column is about 5.2% of that width, so a cell is a third taller than it is
|
|
37
|
+
* wide — the proportion of a wall chart, and the room the three bands of a
|
|
38
|
+
* cell need to be read from the back of a room. It is the same height in every
|
|
39
|
+
* table: a cell keeps the band it writes a value in whether or not that table
|
|
40
|
+
* writes one.
|
|
41
|
+
*/
|
|
42
|
+
const ROW_HEIGHT = ofWidth(ROW_SHARE);
|
|
43
|
+
/** The band the two inner-transition series were lifted out across. */
|
|
44
|
+
const SERIES_GAP = `max(6px, ${ofWidth(1.1)})`;
|
|
45
|
+
export const rootStyle = {
|
|
46
|
+
display: 'flex',
|
|
47
|
+
flexDirection: 'column',
|
|
48
|
+
gap: 8,
|
|
49
|
+
minWidth: MIN_WIDTH,
|
|
50
|
+
// Everything inside — the height of a row as much as the type in a cell — is
|
|
51
|
+
// a share of this box rather than of the page, so the same table reads at
|
|
52
|
+
// 280px beside a chart and fills a lecture-hall screen at twice that. The
|
|
53
|
+
// share is measured (see `unit.ts`); the container is what the `1cqw`
|
|
54
|
+
// fallback and a site's own `@container` rules are answered by, and it keeps
|
|
55
|
+
// this box's width independent of what is written inside it.
|
|
56
|
+
containerType: 'inline-size',
|
|
57
|
+
};
|
|
58
|
+
const baseGridStyle = {
|
|
59
|
+
display: 'grid',
|
|
60
|
+
gap: 2,
|
|
61
|
+
minWidth: MIN_WIDTH,
|
|
62
|
+
width: '100%',
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* The grid the cells are placed on.
|
|
66
|
+
* @param headers - Whether a leading column and row hold the period and group
|
|
67
|
+
* numbers.
|
|
68
|
+
* @returns The style of the grid.
|
|
69
|
+
*/
|
|
70
|
+
export function gridStyle(headers) {
|
|
71
|
+
// The eighth row is the gap the inner-transition series are lifted out into.
|
|
72
|
+
const rows = `repeat(7, ${ROW_HEIGHT}) ${SERIES_GAP} repeat(2, ${ROW_HEIGHT})`;
|
|
73
|
+
if (!headers) {
|
|
74
|
+
return {
|
|
75
|
+
...baseGridStyle,
|
|
76
|
+
gridTemplateColumns: `repeat(${String(COLUMN_COUNT)}, minmax(0, 1fr))`,
|
|
77
|
+
gridTemplateRows: rows,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
...baseGridStyle,
|
|
82
|
+
gridTemplateColumns: `max(14px, ${ofWidth(2.4)}) repeat(${String(COLUMN_COUNT)}, minmax(0, 1fr))`,
|
|
83
|
+
gridTemplateRows: `max(12px, ${ofWidth(2)}) ${rows}`,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=tableLayout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tableLayout.js","sourceRoot":"","sources":["../../../src/periodic/ui/tableLayout.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,MAAc;IACvC,OAAO;QACL,UAAU,EAAE,QAAQ;QACpB,OAAO,EAAE,MAAM;QACf,uEAAuE;QACvE,yDAAyD;QACzD,OAAO,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,EAAE;QAC5B,UAAU,EAAE,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,GAAG,MAAM,CAAC,WAAW,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE;QAC7F,OAAO,EAAE,GAAG,MAAM,CAAC,WAAW,CAAC,GAAG,GAAG,MAAM,CAAC,WAAW,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE;QACpF,0EAA0E;QAC1E,yEAAyE;QACzE,iCAAiC;QACjC,QAAQ,EAAE,eAAe,OAAO,CAAC,GAAG,CAAC,GAAG;QACxC,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,QAAQ;KACnB,CAAC;AACJ,CAAC;AAED,iFAAiF;AACjF,MAAM,SAAS,GAAG,GAAG,CAAC;AAEtB;;;;;;;;GAQG;AACH,MAAM,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AAEtC,uEAAuE;AACvE,MAAM,UAAU,GAAG,YAAY,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;AAE/C,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,OAAO,EAAE,MAAM;IACf,aAAa,EAAE,QAAQ;IACvB,GAAG,EAAE,CAAC;IACN,QAAQ,EAAE,SAAS;IACnB,6EAA6E;IAC7E,0EAA0E;IAC1E,0EAA0E;IAC1E,sEAAsE;IACtE,6EAA6E;IAC7E,6DAA6D;IAC7D,aAAa,EAAE,aAAa;CACI,CAAC;AAEnC,MAAM,aAAa,GAAG;IACpB,OAAO,EAAE,MAAM;IACf,GAAG,EAAE,CAAC;IACN,QAAQ,EAAE,SAAS;IACnB,KAAK,EAAE,MAAM;CACmB,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAC,OAAgB;IACxC,6EAA6E;IAC7E,MAAM,IAAI,GAAG,aAAa,UAAU,KAAK,UAAU,cAAc,UAAU,GAAG,CAAC;IAC/E,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO;YACL,GAAG,aAAa;YAChB,mBAAmB,EAAE,UAAU,MAAM,CAAC,YAAY,CAAC,mBAAmB;YACtE,gBAAgB,EAAE,IAAI;SACvB,CAAC;IACJ,CAAC;IACD,OAAO;QACL,GAAG,aAAa;QAChB,mBAAmB,EAAE,aAAa,OAAO,CAAC,GAAG,CAAC,YAAY,MAAM,CAAC,YAAY,CAAC,mBAAmB;QACjG,gBAAgB,EAAE,aAAa,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;KACrD,CAAC;AACJ,CAAC"}
|
package/lib/seo/core/routes.d.ts
CHANGED
|
@@ -113,7 +113,7 @@ export declare function homeRoute(routes: readonly RouteMeta[]): RouteMeta;
|
|
|
113
113
|
* only the first entry describes, and one carrying a `..` segment writes its
|
|
114
114
|
* file outside the build output. Two addresses that differ only in an empty
|
|
115
115
|
* segment or in case are the same defect wearing a disguise: `//x` and `/x`
|
|
116
|
-
* both write `dist/x
|
|
116
|
+
* both write `dist/x.html`, and so do `/About` and `/about` on the
|
|
117
117
|
* case-insensitive filesystem macOS and Windows ship by default — one file, two
|
|
118
118
|
* sitemap entries, and only one of the two descriptions survives. All of it is
|
|
119
119
|
* author configuration read at build time, so it is refused where it is written
|
package/lib/seo/core/routes.js
CHANGED
|
@@ -93,7 +93,7 @@ export function homeRoute(routes) {
|
|
|
93
93
|
* only the first entry describes, and one carrying a `..` segment writes its
|
|
94
94
|
* file outside the build output. Two addresses that differ only in an empty
|
|
95
95
|
* segment or in case are the same defect wearing a disguise: `//x` and `/x`
|
|
96
|
-
* both write `dist/x
|
|
96
|
+
* both write `dist/x.html`, and so do `/About` and `/about` on the
|
|
97
97
|
* case-insensitive filesystem macOS and Windows ship by default — one file, two
|
|
98
98
|
* sitemap entries, and only one of the two descriptions survives. All of it is
|
|
99
99
|
* author configuration read at build time, so it is refused where it is written
|
|
@@ -15,6 +15,12 @@
|
|
|
15
15
|
* Every address the tool answers is on disk, so an address that is *not* on
|
|
16
16
|
* disk is genuinely not a page and must 404 rather than serving the tool under
|
|
17
17
|
* a name it does not have.
|
|
18
|
+
*
|
|
19
|
+
* `/about` is written to `about.html`, never `about/index.html`: a static host
|
|
20
|
+
* serves a folder's index at `/about/` and redirects the address every link and
|
|
21
|
+
* canonical uses to it (Cloudflare Pages does, with no way to turn it off),
|
|
22
|
+
* while `about.html` is served at `/about` itself by Pages, static-web-server
|
|
23
|
+
* and `vite preview` alike.
|
|
18
24
|
*/
|
|
19
25
|
import type { Plugin } from 'vite';
|
|
20
26
|
import type { SiteId, SiteRecord } from '../../ecosystem/core/sites.ts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prerender.d.ts","sourceRoot":"","sources":["../../../src/seo/vite/prerender.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"prerender.d.ts","sourceRoot":"","sources":["../../../src/seo/vite/prerender.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAKH,OAAO,KAAK,EAAU,MAAM,EAAE,MAAM,MAAM,CA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AAQ,KAAK,WAAW,GAAG,SAAS,CAAC;IAC5E;;;;;;;;;;OAUG;IACH,SAAS,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAC;CACjC;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CA2HnE"}
|
|
@@ -15,6 +15,12 @@
|
|
|
15
15
|
* Every address the tool answers is on disk, so an address that is *not* on
|
|
16
16
|
* disk is genuinely not a page and must 404 rather than serving the tool under
|
|
17
17
|
* a name it does not have.
|
|
18
|
+
*
|
|
19
|
+
* `/about` is written to `about.html`, never `about/index.html`: a static host
|
|
20
|
+
* serves a folder's index at `/about/` and redirects the address every link and
|
|
21
|
+
* canonical uses to it (Cloudflare Pages does, with no way to turn it off),
|
|
22
|
+
* while `about.html` is served at `/about` itself by Pages, static-web-server
|
|
23
|
+
* and `vite preview` alike.
|
|
18
24
|
*/
|
|
19
25
|
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
20
26
|
import { dirname, join, resolve } from 'node:path';
|
|
@@ -105,7 +111,7 @@ export function cheminfoPrerender(options) {
|
|
|
105
111
|
root = true;
|
|
106
112
|
write(route, language, address === '/'
|
|
107
113
|
? join(out, 'index.html')
|
|
108
|
-
: join(out, address.slice(1)
|
|
114
|
+
: join(out, `${address.slice(1)}.html`));
|
|
109
115
|
written++;
|
|
110
116
|
}
|
|
111
117
|
// The file a static server hands out for the mount itself. A table
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prerender.js","sourceRoot":"","sources":["../../../src/seo/vite/prerender.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"prerender.js","sourceRoot":"","sources":["../../../src/seo/vite/prerender.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EAAE,OAAO,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E,4EAA4E;IAC5E,4EAA4E;IAC5E,0DAA0D;IAC1D,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAC9C,GAAG,KAAK;QACR,IAAI,EAAE,gBAAgB,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC;KAC7C,CAAC,CAAC,CAAC;IACJ,OAAO,aAAa,CAAC;QACnB,IAAI;QACJ,MAAM;QACN,GAAG,KAAK;QACR,MAAM,EAAE,IAAI;QACZ,OAAO;QACP,QAAQ;KACT,CAAC,CAAC;AACL,CAAC;AAED,4EAA4E;AAC5E,4EAA4E;AAC5E,6EAA6E;AAC7E,SAAS,eAAe,CACtB,MAA4B,EAC5B,UAAgC,EAChC,QAAkB;IAElB,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3D,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAChE,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CACb,OAAO,QAAQ,wGAAwG,CACxH,CAAC;IACJ,CAAC;AACH,CAAC;AAED,2EAA2E;AAC3E,+EAA+E;AAC/E,+BAA+B;AAC/B,SAAS,YAAY,CAAC,QAAgB,EAAE,QAAkB;IACxD,OAAO,QAAQ,CAAC,OAAO,CACrB,0CAA0C,EAC1C,4BAA4B,QAAQ,GAAG,CACxC,CAAC;AACJ,CAAC"}
|
|
@@ -21,7 +21,6 @@ export type SplitColumnProps = SplitPanesProps;
|
|
|
21
21
|
* no height to divide, it measures nothing, says nothing about it, and simply
|
|
22
22
|
* stacks the two panes with no splitter, which is what an ordinary page wanted
|
|
23
23
|
* anyway.
|
|
24
|
-
*
|
|
25
24
|
* @param props - See {@link SplitColumnProps}.
|
|
26
25
|
* @returns The two panes with the splitter between them, the two stacked where
|
|
27
26
|
* there is no height to divide, or whichever one a link left, alone.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SplitColumn.d.ts","sourceRoot":"","sources":["../../../src/split/ui/SplitColumn.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGxD;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAE/C
|
|
1
|
+
{"version":3,"file":"SplitColumn.d.ts","sourceRoot":"","sources":["../../../src/split/ui/SplitColumn.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGxD;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAE/C;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,YAAY,GAAG,IAAI,CAExE"}
|
|
@@ -9,7 +9,6 @@ import { SplitPanes } from "./splitPanes.js";
|
|
|
9
9
|
* no height to divide, it measures nothing, says nothing about it, and simply
|
|
10
10
|
* stacks the two panes with no splitter, which is what an ordinary page wanted
|
|
11
11
|
* anyway.
|
|
12
|
-
*
|
|
13
12
|
* @param props - See {@link SplitColumnProps}.
|
|
14
13
|
* @returns The two panes with the splitter between them, the two stacked where
|
|
15
14
|
* there is no height to divide, or whichever one a link left, alone.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SplitColumn.js","sourceRoot":"","sources":["../../../src/split/ui/SplitColumn.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAkB,CAAC;AAQ9C
|
|
1
|
+
{"version":3,"file":"SplitColumn.js","sourceRoot":"","sources":["../../../src/split/ui/SplitColumn.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAkB,CAAC;AAQ9C;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,WAAW,CAAC,KAAuB;IACjD,OAAO,KAAC,UAAU,IAAC,SAAS,EAAC,UAAU,KAAK,KAAK,GAAI,CAAC;AACxD,CAAC"}
|
|
@@ -19,7 +19,6 @@ export type SplitRowProps = SplitPanesProps;
|
|
|
19
19
|
* of forms dragged past about half the row does not grow: the labels stay put
|
|
20
20
|
* and the fields stretch to a width nobody types into, so the room becomes
|
|
21
21
|
* empty card. The figure beside it is what the drag exists to enlarge.
|
|
22
|
-
*
|
|
23
22
|
* @param props - See {@link SplitRowProps}.
|
|
24
23
|
* @returns The two panes with the splitter between them, the two stacked on a
|
|
25
24
|
* narrow screen, or whichever one a link left on the page, alone.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SplitRow.d.ts","sourceRoot":"","sources":["../../../src/split/ui/SplitRow.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGxD;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,eAAe,CAAC;AAE5C
|
|
1
|
+
{"version":3,"file":"SplitRow.d.ts","sourceRoot":"","sources":["../../../src/split/ui/SplitRow.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGxD;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,eAAe,CAAC;AAE5C;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,YAAY,GAAG,IAAI,CAElE"}
|
package/lib/split/ui/SplitRow.js
CHANGED
|
@@ -7,7 +7,6 @@ import { SplitPanes } from "./splitPanes.js";
|
|
|
7
7
|
* of forms dragged past about half the row does not grow: the labels stay put
|
|
8
8
|
* and the fields stretch to a width nobody types into, so the room becomes
|
|
9
9
|
* empty card. The figure beside it is what the drag exists to enlarge.
|
|
10
|
-
*
|
|
11
10
|
* @param props - See {@link SplitRowProps}.
|
|
12
11
|
* @returns The two panes with the splitter between them, the two stacked on a
|
|
13
12
|
* narrow screen, or whichever one a link left on the page, alone.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SplitRow.js","sourceRoot":"","sources":["../../../src/split/ui/SplitRow.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAkB,CAAC;AAQ9C
|
|
1
|
+
{"version":3,"file":"SplitRow.js","sourceRoot":"","sources":["../../../src/split/ui/SplitRow.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAkB,CAAC;AAQ9C;;;;;;;;;;GAUG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAoB;IAC3C,OAAO,KAAC,UAAU,IAAC,SAAS,EAAC,YAAY,KAAK,KAAK,GAAI,CAAC;AAC1D,CAAC"}
|
|
@@ -13,6 +13,18 @@
|
|
|
13
13
|
* everything one pane holds leaves the other the whole of it rather than a
|
|
14
14
|
* share.
|
|
15
15
|
*
|
|
16
|
+
* **Several bars on one page make a grid, and a grid has to read as one.** Three
|
|
17
|
+
* panes are one of these nested inside the other, and the shares are numbered in
|
|
18
|
+
* reading order — `split` for the first bar a reader meets going left to right
|
|
19
|
+
* and then down, `split2` for the next. Two rules keep that from coming apart:
|
|
20
|
+
* **at most two bars on a page**, because a third is a window manager rather
|
|
21
|
+
* than a tool and every bar is one more thing to understand before the page can
|
|
22
|
+
* be used; and **never a bar across two columns of the same row**, because two
|
|
23
|
+
* of them at independent heights do not read as a grid, they read as a page that
|
|
24
|
+
* has come apart. Divide the column that holds the figures and leave its
|
|
25
|
+
* neighbours whole — or, where both genuinely want the same line, give them one
|
|
26
|
+
* share and one parameter so it runs straight across.
|
|
27
|
+
*
|
|
16
28
|
* The bar itself is react-science's `SplitPane`, and it keeps react-science's
|
|
17
29
|
* look — barely visible on purpose, found by the pointer that changes over it
|
|
18
30
|
* rather than by the eye. All `chrome.css` says about it is that eleven pixels
|
|
@@ -63,7 +75,6 @@ interface InternalProps extends SplitPanesProps {
|
|
|
63
75
|
}
|
|
64
76
|
/**
|
|
65
77
|
* The two panes, divided where the address says.
|
|
66
|
-
*
|
|
67
78
|
* @param props - See {@link SplitPanesProps}.
|
|
68
79
|
* @returns The panes with the splitter between them, the two stacked where
|
|
69
80
|
* there is no room for both, or whichever one a link left, alone.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"splitPanes.d.ts","sourceRoot":"","sources":["../../../src/split/ui/splitPanes.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"splitPanes.d.ts","sourceRoot":"","sources":["../../../src/split/ui/splitPanes.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,EAAiB,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGnD,gCAAgC;AAChC,MAAM,WAAW,eAAgB,SAAQ,UAAU;IACjD;;;OAGG;IACH,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,yDAAyD;IACzD,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACxC,gFAAgF;IAChF,KAAK,EAAE,SAAS,CAAC;IACjB,iEAAiE;IACjE,GAAG,EAAE,SAAS,CAAC;IACf;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,gEAAgE;AAChE,UAAU,aAAc,SAAQ,eAAe;IAC7C,kCAAkC;IAClC,SAAS,EAAE,YAAY,GAAG,UAAU,CAAC;CACtC;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,aAAa,GAAG,YAAY,GAAG,IAAI,CAoGpE"}
|
|
@@ -5,7 +5,6 @@ import { useResizeObserver } from "../../hooks/ui/useResizeObserver.js";
|
|
|
5
5
|
import { clampSplit } from "../core/split.js";
|
|
6
6
|
/**
|
|
7
7
|
* The two panes, divided where the address says.
|
|
8
|
-
*
|
|
9
8
|
* @param props - See {@link SplitPanesProps}.
|
|
10
9
|
* @returns The panes with the splitter between them, the two stacked where
|
|
11
10
|
* there is no room for both, or whichever one a link left, alone.
|
|
@@ -34,7 +33,7 @@ export function SplitPanes(props) {
|
|
|
34
33
|
return (_jsxs("div", { ref: box, style: { ...STACK, gap: stackedGap }, children: [startPane, endPane] }));
|
|
35
34
|
}
|
|
36
35
|
const share = clampSplit(dragged ?? ratio ?? defaultRatio, { min, max });
|
|
37
|
-
return (_jsx("div", { ref: box, className:
|
|
36
|
+
return (_jsx("div", { ref: box, className: across ? 'split-row' : 'split-row split-row--down', style: across ? undefined : FILL, children: _jsxs(SplitPane, { direction: direction, controlledSide: "start", size: `${share}%`,
|
|
38
37
|
// Held open, so the only layout a visitor can reach is one the address
|
|
39
38
|
// describes: left to itself a double click collapses a pane, and a link
|
|
40
39
|
// shared from there would open with the pane back. The double click is
|
|
@@ -52,7 +51,6 @@ export function SplitPanes(props) {
|
|
|
52
51
|
}
|
|
53
52
|
/**
|
|
54
53
|
* The share a splitter asked for.
|
|
55
|
-
*
|
|
56
54
|
* @param asked - What it reported, a percentage because that is what it was
|
|
57
55
|
* given.
|
|
58
56
|
* @param current - The share in force, kept when the report is not a number.
|
|
@@ -68,7 +66,6 @@ function shareOf(asked, current, range) {
|
|
|
68
66
|
* measured. Reading it rather than starting at zero is what keeps a wide page
|
|
69
67
|
* from laying itself out stacked and splitting a frame later, which would build
|
|
70
68
|
* both figures twice on every load.
|
|
71
|
-
*
|
|
72
69
|
* @param across - Whether the box is divided across or down.
|
|
73
70
|
* @param fallback - What to answer where there is no window to read — a test,
|
|
74
71
|
* or a page rendered to a string.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"splitPanes.js","sourceRoot":"","sources":["../../../src/split/ui/splitPanes.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"splitPanes.js","sourceRoot":"","sources":["../../../src/split/ui/splitPanes.tsx"],"names":[],"mappings":";AAkCA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAExE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AA6C9C;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,KAAoB;IAC7C,MAAM,EACJ,SAAS,EACT,KAAK,EACL,YAAY,EACZ,OAAO,EACP,KAAK,EACL,GAAG,EACH,GAAG,EACH,GAAG,EACH,UAAU,GAAG,SAAS,KAAK,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,UAAU,EACnE,MAAM,GAAG,MAAM,EACf,UAAU,GAAG,WAAW,GACzB,GAAG,KAAK,CAAC;IACV,MAAM,MAAM,GAAG,SAAS,KAAK,YAAY,CAAC;IAC1C,MAAM,GAAG,GAAG,MAAM,CAAiB,IAAI,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ChB,CAAC,CAAC,cAAc;YAChB,CAAC,CAAC,aAAa;QACjB,CAAC,CAAC,IAAI,KAAK,OAAO;YAChB,CAAC,CAAC,eAAe;YACjB,CAAC,CAAC,YAAY,CAAC;IACnB,OAAO;QACL,OAAO,EAAE,MAAM;QACf,IAAI,EAAE,QAAQ;QACd,aAAa,EAAE,QAAQ;QACvB,QAAQ,EAAE,CAAC;QACX,SAAS,EAAE,CAAC;QACZ,CAAC,IAAI,CAAC,EAAE,MAAM;KACf,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type { Taxon, TaxonLineage, TaxonNode } from './lineage.ts';
|
|
2
|
+
export { genusOrBelow, isPlaceholderTaxon, lineageFromNodes, lineageFromRanks, principalLineage, } from './lineage.ts';
|
|
3
|
+
export { ncbiTaxonomyUrl } from './ncbi.ts';
|
|
4
|
+
export type { OrganismNamePart } from './organismName.ts';
|
|
5
|
+
export { splitOrganismName } from './organismName.ts';
|
|
6
|
+
export type { TaxonRank } from './ranks.ts';
|
|
7
|
+
export { PRINCIPAL_RANKS, TAXON_RANKS, isAboveGenus, isGenusOrBelow, isPrincipalRank, rankOrder, } from './ranks.ts';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/taxonomy/core/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EACL,eAAe,EACf,WAAW,EACX,YAAY,EACZ,cAAc,EACd,eAAe,EACf,SAAS,GACV,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { genusOrBelow, isPlaceholderTaxon, lineageFromNodes, lineageFromRanks, principalLineage, } from "./lineage.js";
|
|
2
|
+
export { ncbiTaxonomyUrl } from "./ncbi.js";
|
|
3
|
+
export { splitOrganismName } from "./organismName.js";
|
|
4
|
+
export { PRINCIPAL_RANKS, TAXON_RANKS, isAboveGenus, isGenusOrBelow, isPrincipalRank, rankOrder, } from "./ranks.js";
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/taxonomy/core/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EACL,eAAe,EACf,WAAW,EACX,YAAY,EACZ,cAAc,EACd,eAAe,EACf,SAAS,GACV,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A lineage: the taxa from the top of the tree of life down to one of them.
|
|
3
|
+
*
|
|
4
|
+
* It is read three ways, because the family meets it in three shapes: a map of
|
|
5
|
+
* NCBI nodes each pointing at its parent (what a database built on the NCBI
|
|
6
|
+
* dump answers), a record of names by rank (what octochemdb stores), or a list
|
|
7
|
+
* already in order.
|
|
8
|
+
*/
|
|
9
|
+
/** One taxon of a lineage. */
|
|
10
|
+
export interface Taxon {
|
|
11
|
+
/** The rank, as NCBI writes it: `genus`, `no rank`, `clade`… */
|
|
12
|
+
rank: string;
|
|
13
|
+
/** The scientific name. */
|
|
14
|
+
name: string;
|
|
15
|
+
/**
|
|
16
|
+
* The NCBI Taxonomy id.
|
|
17
|
+
* @default undefined — the taxon is known by its name alone
|
|
18
|
+
*/
|
|
19
|
+
taxId?: number;
|
|
20
|
+
}
|
|
21
|
+
/** The taxa from the top of the tree down to one of them, in that order. */
|
|
22
|
+
export type TaxonLineage = readonly Taxon[];
|
|
23
|
+
/** A taxon of the NCBI tree, as a map of nodes holds it. */
|
|
24
|
+
export interface TaxonNode {
|
|
25
|
+
/** The scientific name. */
|
|
26
|
+
name: string;
|
|
27
|
+
/** The rank, as NCBI writes it. */
|
|
28
|
+
rank: string;
|
|
29
|
+
/** The id of the taxon above; the root is its own parent. */
|
|
30
|
+
parentId: number;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The taxa a lineage is summarised by: those of a principal rank (domain,
|
|
34
|
+
* kingdom, phylum, class, order, family, genus, species), and the last one
|
|
35
|
+
* whatever its rank, since it is the taxon the lineage leads to.
|
|
36
|
+
*
|
|
37
|
+
* An NCBI placeholder for an unidentified species ('Streptomyces sp.') says
|
|
38
|
+
* no more than its genus, so it is left out and the genus is the leaf. The
|
|
39
|
+
* root, 'cellular organisms', the clades and the steps of no rank above the
|
|
40
|
+
* leaf never show.
|
|
41
|
+
* @param lineage - The lineage, from the top down.
|
|
42
|
+
* @returns The taxa kept, in the same order.
|
|
43
|
+
*/
|
|
44
|
+
export declare function principalLineage(lineage: TaxonLineage): Taxon[];
|
|
45
|
+
/**
|
|
46
|
+
* Whether a taxon is an NCBI placeholder for an unidentified species of a
|
|
47
|
+
* genus: a species named the genus and 'sp.', such as 'Streptomyces sp.'.
|
|
48
|
+
* One named for a strain ('Streptomyces sp. CNQ-509') is a taxon of its own.
|
|
49
|
+
* @param taxon - The taxon.
|
|
50
|
+
* @returns Whether it is one.
|
|
51
|
+
*/
|
|
52
|
+
export declare function isPlaceholderTaxon(taxon: Taxon): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* The lineage of a taxon, walked up a map of NCBI nodes to the root.
|
|
55
|
+
* @param nodes - The nodes, by id: a record keyed by the id written as a
|
|
56
|
+
* string, as JSON delivers it, or a map keyed by the number.
|
|
57
|
+
* @param taxId - The taxon to start from.
|
|
58
|
+
* @returns Every taxon from the root down to it, each with its id; empty when
|
|
59
|
+
* the map does not hold the taxon.
|
|
60
|
+
*/
|
|
61
|
+
export declare function lineageFromNodes(nodes: Readonly<Record<string, TaxonNode>> | ReadonlyMap<number, TaxonNode>, taxId: number): Taxon[];
|
|
62
|
+
/**
|
|
63
|
+
* The lineage written by a record of names by rank, the shape octochemdb
|
|
64
|
+
* stores (`{ kingdom: 'Fungi', genus: 'Penicillium', … }`).
|
|
65
|
+
*
|
|
66
|
+
* A key is matched whatever its case, so `superKingdom` reads as
|
|
67
|
+
* `superkingdom`; a key that names no rank, and an empty name, are left out.
|
|
68
|
+
* @param ranks - The names, by rank.
|
|
69
|
+
* @returns The taxa, from the top down.
|
|
70
|
+
*/
|
|
71
|
+
export declare function lineageFromRanks(ranks: Readonly<Record<string, string | null | undefined>>): Taxon[];
|
|
72
|
+
/**
|
|
73
|
+
* Which taxa of a lineage sit at the genus or under it — the ones whose names
|
|
74
|
+
* nomenclature sets in italics.
|
|
75
|
+
*
|
|
76
|
+
* A taxon with no rank (a clade, a strain NCBI left unranked) takes the place
|
|
77
|
+
* of the taxa above it: under a genus it is one of the genus's, above it it is
|
|
78
|
+
* a clade like Embryophyta, written upright.
|
|
79
|
+
* @param lineage - The lineage, from the top down.
|
|
80
|
+
* @returns One flag per taxon.
|
|
81
|
+
*/
|
|
82
|
+
export declare function genusOrBelow(lineage: TaxonLineage): boolean[];
|
|
83
|
+
//# sourceMappingURL=lineage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lineage.d.ts","sourceRoot":"","sources":["../../../src/taxonomy/core/lineage.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AASH,8BAA8B;AAC9B,MAAM,WAAW,KAAK;IACpB,gEAAgE;IAChE,IAAI,EAAE,MAAM,CAAC;IACb,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,4EAA4E;AAC5E,MAAM,MAAM,YAAY,GAAG,SAAS,KAAK,EAAE,CAAC;AAE5C,4DAA4D;AAC5D,MAAM,WAAW,SAAS;IACxB,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,YAAY,GAAG,KAAK,EAAE,CAc/D;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAExD;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,EAC3E,KAAK,EAAE,MAAM,GACZ,KAAK,EAAE,CAiBT;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC,GACzD,KAAK,EAAE,CAcT;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,EAAE,CAY7D"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A lineage: the taxa from the top of the tree of life down to one of them.
|
|
3
|
+
*
|
|
4
|
+
* It is read three ways, because the family meets it in three shapes: a map of
|
|
5
|
+
* NCBI nodes each pointing at its parent (what a database built on the NCBI
|
|
6
|
+
* dump answers), a record of names by rank (what octochemdb stores), or a list
|
|
7
|
+
* already in order.
|
|
8
|
+
*/
|
|
9
|
+
import { TAXON_RANKS, isGenusOrBelow, isPrincipalRank, rankOrder, } from "./ranks.js";
|
|
10
|
+
/**
|
|
11
|
+
* The taxa a lineage is summarised by: those of a principal rank (domain,
|
|
12
|
+
* kingdom, phylum, class, order, family, genus, species), and the last one
|
|
13
|
+
* whatever its rank, since it is the taxon the lineage leads to.
|
|
14
|
+
*
|
|
15
|
+
* An NCBI placeholder for an unidentified species ('Streptomyces sp.') says
|
|
16
|
+
* no more than its genus, so it is left out and the genus is the leaf. The
|
|
17
|
+
* root, 'cellular organisms', the clades and the steps of no rank above the
|
|
18
|
+
* leaf never show.
|
|
19
|
+
* @param lineage - The lineage, from the top down.
|
|
20
|
+
* @returns The taxa kept, in the same order.
|
|
21
|
+
*/
|
|
22
|
+
export function principalLineage(lineage) {
|
|
23
|
+
const kept = [];
|
|
24
|
+
let last = lineage.length - 1;
|
|
25
|
+
if (last > 0 && isPlaceholderTaxon(lineage[last])) {
|
|
26
|
+
// The genus becomes the leaf, past 'unclassified Streptomyces'.
|
|
27
|
+
last--;
|
|
28
|
+
while (last > 0 && !isPrincipalRank(lineage[last].rank))
|
|
29
|
+
last--;
|
|
30
|
+
}
|
|
31
|
+
for (let index = 0; index <= last; index++) {
|
|
32
|
+
const taxon = lineage[index];
|
|
33
|
+
if (index < last && isPlaceholderTaxon(taxon))
|
|
34
|
+
continue;
|
|
35
|
+
if (index === last || isPrincipalRank(taxon.rank))
|
|
36
|
+
kept.push(taxon);
|
|
37
|
+
}
|
|
38
|
+
return kept;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Whether a taxon is an NCBI placeholder for an unidentified species of a
|
|
42
|
+
* genus: a species named the genus and 'sp.', such as 'Streptomyces sp.'.
|
|
43
|
+
* One named for a strain ('Streptomyces sp. CNQ-509') is a taxon of its own.
|
|
44
|
+
* @param taxon - The taxon.
|
|
45
|
+
* @returns Whether it is one.
|
|
46
|
+
*/
|
|
47
|
+
export function isPlaceholderTaxon(taxon) {
|
|
48
|
+
return taxon.rank === 'species' && /\ssp\.$/.test(taxon.name);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The lineage of a taxon, walked up a map of NCBI nodes to the root.
|
|
52
|
+
* @param nodes - The nodes, by id: a record keyed by the id written as a
|
|
53
|
+
* string, as JSON delivers it, or a map keyed by the number.
|
|
54
|
+
* @param taxId - The taxon to start from.
|
|
55
|
+
* @returns Every taxon from the root down to it, each with its id; empty when
|
|
56
|
+
* the map does not hold the taxon.
|
|
57
|
+
*/
|
|
58
|
+
export function lineageFromNodes(nodes, taxId) {
|
|
59
|
+
const read = nodes instanceof Map
|
|
60
|
+
? (id) => nodes.get(id)
|
|
61
|
+
: (id) => nodes[String(id)];
|
|
62
|
+
const upward = [];
|
|
63
|
+
const seen = new Set();
|
|
64
|
+
let id = taxId;
|
|
65
|
+
while (!seen.has(id)) {
|
|
66
|
+
const node = read(id);
|
|
67
|
+
if (node === undefined)
|
|
68
|
+
break;
|
|
69
|
+
seen.add(id);
|
|
70
|
+
upward.push({ rank: node.rank, name: node.name, taxId: id });
|
|
71
|
+
id = node.parentId;
|
|
72
|
+
}
|
|
73
|
+
return upward.toReversed();
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The lineage written by a record of names by rank, the shape octochemdb
|
|
77
|
+
* stores (`{ kingdom: 'Fungi', genus: 'Penicillium', … }`).
|
|
78
|
+
*
|
|
79
|
+
* A key is matched whatever its case, so `superKingdom` reads as
|
|
80
|
+
* `superkingdom`; a key that names no rank, and an empty name, are left out.
|
|
81
|
+
* @param ranks - The names, by rank.
|
|
82
|
+
* @returns The taxa, from the top down.
|
|
83
|
+
*/
|
|
84
|
+
export function lineageFromRanks(ranks) {
|
|
85
|
+
const byRank = new Map();
|
|
86
|
+
for (const key of Object.keys(ranks)) {
|
|
87
|
+
const name = ranks[key]?.trim();
|
|
88
|
+
if (name === undefined || name === '')
|
|
89
|
+
continue;
|
|
90
|
+
const rank = key.toLowerCase();
|
|
91
|
+
if (rankOrder(rank) !== undefined)
|
|
92
|
+
byRank.set(rank, name);
|
|
93
|
+
}
|
|
94
|
+
const lineage = [];
|
|
95
|
+
for (const rank of TAXON_RANKS) {
|
|
96
|
+
const name = byRank.get(rank);
|
|
97
|
+
if (name !== undefined)
|
|
98
|
+
lineage.push({ rank, name });
|
|
99
|
+
}
|
|
100
|
+
return lineage;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Which taxa of a lineage sit at the genus or under it — the ones whose names
|
|
104
|
+
* nomenclature sets in italics.
|
|
105
|
+
*
|
|
106
|
+
* A taxon with no rank (a clade, a strain NCBI left unranked) takes the place
|
|
107
|
+
* of the taxa above it: under a genus it is one of the genus's, above it it is
|
|
108
|
+
* a clade like Embryophyta, written upright.
|
|
109
|
+
* @param lineage - The lineage, from the top down.
|
|
110
|
+
* @returns One flag per taxon.
|
|
111
|
+
*/
|
|
112
|
+
export function genusOrBelow(lineage) {
|
|
113
|
+
const flags = [];
|
|
114
|
+
let below = false;
|
|
115
|
+
for (const taxon of lineage) {
|
|
116
|
+
if (isGenusOrBelow(taxon.rank)) {
|
|
117
|
+
below = true;
|
|
118
|
+
}
|
|
119
|
+
else if (rankOrder(taxon.rank) !== undefined) {
|
|
120
|
+
below = false;
|
|
121
|
+
}
|
|
122
|
+
flags.push(below);
|
|
123
|
+
}
|
|
124
|
+
return flags;
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=lineage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lineage.js","sourceRoot":"","sources":["../../../src/taxonomy/core/lineage.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,WAAW,EACX,cAAc,EACd,eAAe,EACf,SAAS,GACV,MAAM,YAAY,CAAC;AA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AI,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC9B,IAAI,IAAI,KAAK,SAAS;YAAE,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IACvD,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,YAAY,CAAC,OAAqB;IAChD,MAAM,KAAK,GAAc,EAAE,CAAC;IAC5B,IAAI,KAAK,GAAG,KAAK,CAAC;IAClB,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,IAAI,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAC/B,KAAK,GAAG,IAAI,CAAC;QACf,CAAC;aAAM,IAAI,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;YAC/C,KAAK,GAAG,KAAK,CAAC;QAChB,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The page of a taxon in the NCBI Taxonomy Browser.
|
|
3
|
+
* @param taxId - The NCBI Taxonomy id.
|
|
4
|
+
* @returns Its address, e.g.
|
|
5
|
+
* `https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id=5076`.
|
|
6
|
+
*/
|
|
7
|
+
export declare function ncbiTaxonomyUrl(taxId: number): string;
|
|
8
|
+
//# sourceMappingURL=ncbi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ncbi.d.ts","sourceRoot":"","sources":["../../../src/taxonomy/core/ncbi.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAErD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The page of a taxon in the NCBI Taxonomy Browser.
|
|
3
|
+
* @param taxId - The NCBI Taxonomy id.
|
|
4
|
+
* @returns Its address, e.g.
|
|
5
|
+
* `https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id=5076`.
|
|
6
|
+
*/
|
|
7
|
+
export function ncbiTaxonomyUrl(taxId) {
|
|
8
|
+
return `https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id=${encodeURIComponent(String(taxId))}`;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=ncbi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ncbi.js","sourceRoot":"","sources":["../../../src/taxonomy/core/ncbi.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,KAAa;IAC3C,OAAO,+DAA+D,kBAAkB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;AAC5G,CAAC"}
|