react-cheminfo 0.46.0 → 0.48.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 +69 -0
- package/lib/chart/core/chartDomain.d.ts +14 -0
- package/lib/chart/core/chartDomain.d.ts.map +1 -1
- package/lib/chart/core/chartDomain.js +1 -0
- package/lib/chart/core/chartDomain.js.map +1 -1
- package/lib/chart/core/selectionGeometry.d.ts +4 -2
- package/lib/chart/core/selectionGeometry.d.ts.map +1 -1
- package/lib/chart/core/selectionGeometry.js +4 -2
- package/lib/chart/core/selectionGeometry.js.map +1 -1
- package/lib/chart/core/zoomDomain.d.ts +11 -1
- package/lib/chart/core/zoomDomain.d.ts.map +1 -1
- package/lib/chart/core/zoomDomain.js +25 -5
- package/lib/chart/core/zoomDomain.js.map +1 -1
- package/lib/chart/ui/chartGestures.d.ts +26 -1
- package/lib/chart/ui/chartGestures.d.ts.map +1 -1
- package/lib/chart/ui/chartGestures.js +21 -0
- package/lib/chart/ui/chartGestures.js.map +1 -1
- package/lib/chart/ui/index.d.ts +1 -1
- package/lib/chart/ui/index.d.ts.map +1 -1
- package/lib/chart/ui/index.js +1 -1
- package/lib/chart/ui/index.js.map +1 -1
- package/lib/chart/ui/useChartZoom.d.ts.map +1 -1
- package/lib/chart/ui/useChartZoom.js +17 -1
- package/lib/chart/ui/useChartZoom.js.map +1 -1
- 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/ir/core/irMode.d.ts.map +1 -1
- package/lib/ir/core/irMode.js +6 -1
- package/lib/ir/core/irMode.js.map +1 -1
- package/lib/locales/de.json +56 -1
- package/lib/locales/en.json +56 -1
- package/lib/locales/es.json +56 -1
- package/lib/locales/fr.json +56 -1
- package/lib/locales/it.json +56 -1
- package/lib/periodic/core/index.d.ts +1 -1
- package/lib/periodic/core/index.d.ts.map +1 -1
- package/lib/periodic/core/layout.d.ts +11 -0
- package/lib/periodic/core/layout.d.ts.map +1 -1
- package/lib/periodic/core/layout.js.map +1 -1
- package/lib/periodic/ui/ElementCell.d.ts +6 -2
- package/lib/periodic/ui/ElementCell.d.ts.map +1 -1
- package/lib/periodic/ui/ElementCell.js +2 -2
- package/lib/periodic/ui/ElementCell.js.map +1 -1
- package/lib/periodic/ui/PeriodicTable.d.ts +3 -98
- package/lib/periodic/ui/PeriodicTable.d.ts.map +1 -1
- package/lib/periodic/ui/PeriodicTable.js +9 -84
- package/lib/periodic/ui/PeriodicTable.js.map +1 -1
- package/lib/periodic/ui/PeriodicTableChrome.d.ts +13 -3
- package/lib/periodic/ui/PeriodicTableChrome.d.ts.map +1 -1
- package/lib/periodic/ui/PeriodicTableChrome.js +10 -20
- 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/split/ui/SplitColumn.d.ts +29 -0
- package/lib/split/ui/SplitColumn.d.ts.map +1 -0
- package/lib/split/ui/SplitColumn.js +19 -0
- package/lib/split/ui/SplitColumn.js.map +1 -0
- package/lib/split/ui/SplitRow.d.ts +14 -53
- package/lib/split/ui/SplitRow.d.ts.map +1 -1
- package/lib/split/ui/SplitRow.js +8 -90
- package/lib/split/ui/SplitRow.js.map +1 -1
- package/lib/split/ui/index.d.ts +3 -0
- package/lib/split/ui/index.d.ts.map +1 -1
- package/lib/split/ui/index.js +1 -0
- package/lib/split/ui/index.js.map +1 -1
- package/lib/split/ui/splitPanes.d.ts +84 -0
- package/lib/split/ui/splitPanes.d.ts.map +1 -0
- package/lib/split/ui/splitPanes.js +125 -0
- package/lib/split/ui/splitPanes.js.map +1 -0
- 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/chart/core/chartDomain.ts +15 -0
- package/src/chart/core/selectionGeometry.ts +4 -2
- package/src/chart/core/zoomDomain.ts +37 -5
- package/src/chart/ui/chartGestures.ts +41 -1
- package/src/chart/ui/index.ts +1 -1
- package/src/chart/ui/useChartZoom.ts +25 -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/ir/core/irMode.ts +6 -1
- package/src/locales/de.json +56 -1
- package/src/locales/en.json +56 -1
- package/src/locales/es.json +56 -1
- package/src/locales/fr.json +56 -1
- package/src/locales/it.json +56 -1
- package/src/periodic/core/index.ts +1 -1
- package/src/periodic/core/layout.ts +12 -0
- package/src/periodic/ui/ElementCell.tsx +8 -4
- package/src/periodic/ui/PeriodicTable.tsx +27 -197
- package/src/periodic/ui/PeriodicTableChrome.tsx +23 -20
- 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/split/ui/SplitColumn.tsx +35 -0
- package/src/split/ui/SplitRow.tsx +16 -208
- package/src/split/ui/index.ts +3 -0
- package/src/split/ui/splitPanes.tsx +283 -0
- 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,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ranks of the NCBI Taxonomy, from the top of the tree down.
|
|
3
|
+
*
|
|
4
|
+
* NCBI also files taxa under ranks that are not steps of a hierarchy — `no
|
|
5
|
+
* rank`, `clade`, the two roots — and those are deliberately absent here: a
|
|
6
|
+
* clade can sit anywhere, so it has no place in an order.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Every rank NCBI places in its hierarchy, from the top down.
|
|
10
|
+
*
|
|
11
|
+
* `realm` heads the viruses and `domain` the cellular organisms, the name NCBI
|
|
12
|
+
* gave in 2025 to what it called `superkingdom` before; all three stand at the
|
|
13
|
+
* top, so a lineage read from an older dump sorts the same way.
|
|
14
|
+
*/
|
|
15
|
+
export declare const TAXON_RANKS: readonly ["realm", "domain", "superkingdom", "kingdom", "subkingdom", "superphylum", "phylum", "subphylum", "superclass", "class", "subclass", "infraclass", "cohort", "subcohort", "superorder", "order", "suborder", "infraorder", "parvorder", "superfamily", "family", "subfamily", "tribe", "subtribe", "genus", "subgenus", "section", "subsection", "series", "subseries", "species group", "species subgroup", "species", "forma specialis", "subspecies", "varietas", "subvariety", "forma", "pathogroup", "serogroup", "serotype", "biotype", "genotype", "morph", "strain", "isolate"];
|
|
16
|
+
/** A rank of the NCBI hierarchy. */
|
|
17
|
+
export type TaxonRank = (typeof TAXON_RANKS)[number];
|
|
18
|
+
/**
|
|
19
|
+
* The ranks a lineage is summarised by: the eight a textbook names, with the
|
|
20
|
+
* three names the top of the tree goes by.
|
|
21
|
+
*/
|
|
22
|
+
export declare const PRINCIPAL_RANKS: readonly ["realm", "domain", "superkingdom", "kingdom", "phylum", "class", "order", "family", "genus", "species"];
|
|
23
|
+
/**
|
|
24
|
+
* Where a rank stands in the hierarchy.
|
|
25
|
+
* @param rank - The rank, as NCBI writes it.
|
|
26
|
+
* @returns Its position from the top, 0 for `realm`, or `undefined` for a
|
|
27
|
+
* rank that is not a step of the hierarchy (`no rank`, `clade`).
|
|
28
|
+
*/
|
|
29
|
+
export declare function rankOrder(rank: string): number | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Whether a rank is one a lineage is summarised by.
|
|
32
|
+
* @param rank - The rank, as NCBI writes it.
|
|
33
|
+
* @returns Whether it is one of {@link PRINCIPAL_RANKS}.
|
|
34
|
+
*/
|
|
35
|
+
export declare function isPrincipalRank(rank: string): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Whether a rank is the genus or one under it — the ranks whose names
|
|
38
|
+
* nomenclature sets in italics.
|
|
39
|
+
* @param rank - The rank, as NCBI writes it.
|
|
40
|
+
* @returns `false` for a rank above the genus and for one with no place in the
|
|
41
|
+
* hierarchy.
|
|
42
|
+
*/
|
|
43
|
+
export declare function isGenusOrBelow(rank: string): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Whether a rank stands above the genus, so its name is set upright.
|
|
46
|
+
* @param rank - The rank, as NCBI writes it.
|
|
47
|
+
* @returns `false` for the genus and below, and for a rank with no place in
|
|
48
|
+
* the hierarchy.
|
|
49
|
+
*/
|
|
50
|
+
export declare function isAboveGenus(rank: string): boolean;
|
|
51
|
+
//# sourceMappingURL=ranks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ranks.d.ts","sourceRoot":"","sources":["../../../src/taxonomy/core/ranks.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,mkBA+Cd,CAAC;AAEX,oCAAoC;AACpC,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAErD;;;GAGG;AACH,eAAO,MAAM,eAAe,mHAWa,CAAC;AAW1C;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE1D;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAErD;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGpD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGlD"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ranks of the NCBI Taxonomy, from the top of the tree down.
|
|
3
|
+
*
|
|
4
|
+
* NCBI also files taxa under ranks that are not steps of a hierarchy — `no
|
|
5
|
+
* rank`, `clade`, the two roots — and those are deliberately absent here: a
|
|
6
|
+
* clade can sit anywhere, so it has no place in an order.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Every rank NCBI places in its hierarchy, from the top down.
|
|
10
|
+
*
|
|
11
|
+
* `realm` heads the viruses and `domain` the cellular organisms, the name NCBI
|
|
12
|
+
* gave in 2025 to what it called `superkingdom` before; all three stand at the
|
|
13
|
+
* top, so a lineage read from an older dump sorts the same way.
|
|
14
|
+
*/
|
|
15
|
+
export const TAXON_RANKS = [
|
|
16
|
+
'realm',
|
|
17
|
+
'domain',
|
|
18
|
+
'superkingdom',
|
|
19
|
+
'kingdom',
|
|
20
|
+
'subkingdom',
|
|
21
|
+
'superphylum',
|
|
22
|
+
'phylum',
|
|
23
|
+
'subphylum',
|
|
24
|
+
'superclass',
|
|
25
|
+
'class',
|
|
26
|
+
'subclass',
|
|
27
|
+
'infraclass',
|
|
28
|
+
'cohort',
|
|
29
|
+
'subcohort',
|
|
30
|
+
'superorder',
|
|
31
|
+
'order',
|
|
32
|
+
'suborder',
|
|
33
|
+
'infraorder',
|
|
34
|
+
'parvorder',
|
|
35
|
+
'superfamily',
|
|
36
|
+
'family',
|
|
37
|
+
'subfamily',
|
|
38
|
+
'tribe',
|
|
39
|
+
'subtribe',
|
|
40
|
+
'genus',
|
|
41
|
+
'subgenus',
|
|
42
|
+
'section',
|
|
43
|
+
'subsection',
|
|
44
|
+
'series',
|
|
45
|
+
'subseries',
|
|
46
|
+
'species group',
|
|
47
|
+
'species subgroup',
|
|
48
|
+
'species',
|
|
49
|
+
'forma specialis',
|
|
50
|
+
'subspecies',
|
|
51
|
+
'varietas',
|
|
52
|
+
'subvariety',
|
|
53
|
+
'forma',
|
|
54
|
+
'pathogroup',
|
|
55
|
+
'serogroup',
|
|
56
|
+
'serotype',
|
|
57
|
+
'biotype',
|
|
58
|
+
'genotype',
|
|
59
|
+
'morph',
|
|
60
|
+
'strain',
|
|
61
|
+
'isolate',
|
|
62
|
+
];
|
|
63
|
+
/**
|
|
64
|
+
* The ranks a lineage is summarised by: the eight a textbook names, with the
|
|
65
|
+
* three names the top of the tree goes by.
|
|
66
|
+
*/
|
|
67
|
+
export const PRINCIPAL_RANKS = [
|
|
68
|
+
'realm',
|
|
69
|
+
'domain',
|
|
70
|
+
'superkingdom',
|
|
71
|
+
'kingdom',
|
|
72
|
+
'phylum',
|
|
73
|
+
'class',
|
|
74
|
+
'order',
|
|
75
|
+
'family',
|
|
76
|
+
'genus',
|
|
77
|
+
'species',
|
|
78
|
+
];
|
|
79
|
+
const ORDER = new Map();
|
|
80
|
+
for (let index = 0; index < TAXON_RANKS.length; index++) {
|
|
81
|
+
ORDER.set(TAXON_RANKS[index], index);
|
|
82
|
+
}
|
|
83
|
+
const PRINCIPAL = new Set(PRINCIPAL_RANKS);
|
|
84
|
+
const GENUS = ORDER.get('genus') ?? 0;
|
|
85
|
+
/**
|
|
86
|
+
* Where a rank stands in the hierarchy.
|
|
87
|
+
* @param rank - The rank, as NCBI writes it.
|
|
88
|
+
* @returns Its position from the top, 0 for `realm`, or `undefined` for a
|
|
89
|
+
* rank that is not a step of the hierarchy (`no rank`, `clade`).
|
|
90
|
+
*/
|
|
91
|
+
export function rankOrder(rank) {
|
|
92
|
+
return ORDER.get(rank);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Whether a rank is one a lineage is summarised by.
|
|
96
|
+
* @param rank - The rank, as NCBI writes it.
|
|
97
|
+
* @returns Whether it is one of {@link PRINCIPAL_RANKS}.
|
|
98
|
+
*/
|
|
99
|
+
export function isPrincipalRank(rank) {
|
|
100
|
+
return PRINCIPAL.has(rank);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Whether a rank is the genus or one under it — the ranks whose names
|
|
104
|
+
* nomenclature sets in italics.
|
|
105
|
+
* @param rank - The rank, as NCBI writes it.
|
|
106
|
+
* @returns `false` for a rank above the genus and for one with no place in the
|
|
107
|
+
* hierarchy.
|
|
108
|
+
*/
|
|
109
|
+
export function isGenusOrBelow(rank) {
|
|
110
|
+
const order = ORDER.get(rank);
|
|
111
|
+
return order !== undefined && order >= GENUS;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Whether a rank stands above the genus, so its name is set upright.
|
|
115
|
+
* @param rank - The rank, as NCBI writes it.
|
|
116
|
+
* @returns `false` for the genus and below, and for a rank with no place in
|
|
117
|
+
* the hierarchy.
|
|
118
|
+
*/
|
|
119
|
+
export function isAboveGenus(rank) {
|
|
120
|
+
const order = ORDER.get(rank);
|
|
121
|
+
return order !== undefined && order < GENUS;
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=ranks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ranks.js","sourceRoot":"","sources":["../../../src/taxonomy/core/ranks.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,OAAO;IACP,QAAQ;IACR,cAAc;IACd,SAAS;IACT,YAAY;IACZ,aAAa;IACb,QAAQ;IACR,WAAW;IACX,YAAY;IACZ,OAAO;IACP,UAAU;IACV,YAAY;IACZ,QAAQ;IACR,WAAW;IACX,YAAY;IACZ,OAAO;IACP,UAAU;IACV,YAAY;IACZ,WAAW;IACX,aAAa;IACb,QAAQ;IACR,WAAW;IACX,OAAO;IACP,UAAU;IACV,OAAO;IACP,UAAU;IACV,SAAS;IACT,YAAY;IACZ,QAAQ;IACR,WAAW;IACX,eAAe;IACf,kBAAkB;IAClB,SAAS;IAC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GAAG,CAAC,IAAI,CAAC,CAAC;IAC9B,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,GAAG,KAAK,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
/** What an {@link OrganismName} needs. */
|
|
3
|
+
export interface OrganismNameProps {
|
|
4
|
+
/** The name, as its source writes it. */
|
|
5
|
+
name: string;
|
|
6
|
+
/**
|
|
7
|
+
* The rank of the taxon the name belongs to. A name ranked above the genus
|
|
8
|
+
* (a family, an order) is set upright whatever its shape.
|
|
9
|
+
* @default undefined — the name is read by its shape alone
|
|
10
|
+
*/
|
|
11
|
+
rank?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Class names added to the root element.
|
|
14
|
+
* @default undefined
|
|
15
|
+
*/
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* An organism's name, with the genus and the epithets in italics and the
|
|
20
|
+
* authority, the strain and `sp.` upright, as nomenclature sets them.
|
|
21
|
+
*
|
|
22
|
+
* The italics are `<i>`, the element HTML names for a taxonomic designation,
|
|
23
|
+
* and the name keeps every character its source gave it.
|
|
24
|
+
* @param props - See {@link OrganismNameProps}.
|
|
25
|
+
* @returns The name.
|
|
26
|
+
*/
|
|
27
|
+
export declare function OrganismName(props: OrganismNameProps): ReactElement;
|
|
28
|
+
//# sourceMappingURL=OrganismName.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OrganismName.d.ts","sourceRoot":"","sources":["../../../src/taxonomy/ui/OrganismName.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,OAAO,CAAC;AAOrD,0CAA0C;AAC1C,MAAM,WAAW,iBAAiB;IAChC,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,YAAY,CAyBnE"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment } from 'react';
|
|
3
|
+
import { joinClassNames } from "../../shared/ui/joinClassNames.js";
|
|
4
|
+
import { splitOrganismName } from "../core/organismName.js";
|
|
5
|
+
import { isAboveGenus } from "../core/ranks.js";
|
|
6
|
+
/**
|
|
7
|
+
* An organism's name, with the genus and the epithets in italics and the
|
|
8
|
+
* authority, the strain and `sp.` upright, as nomenclature sets them.
|
|
9
|
+
*
|
|
10
|
+
* The italics are `<i>`, the element HTML names for a taxonomic designation,
|
|
11
|
+
* and the name keeps every character its source gave it.
|
|
12
|
+
* @param props - See {@link OrganismNameProps}.
|
|
13
|
+
* @returns The name.
|
|
14
|
+
*/
|
|
15
|
+
export function OrganismName(props) {
|
|
16
|
+
const { name, rank, className } = props;
|
|
17
|
+
const parts = rank !== undefined && isAboveGenus(rank)
|
|
18
|
+
? [{ text: name, italic: false }]
|
|
19
|
+
: splitOrganismName(name);
|
|
20
|
+
const children = [];
|
|
21
|
+
let offset = 0;
|
|
22
|
+
for (const part of parts) {
|
|
23
|
+
children.push(part.italic ? (_jsx("i", { children: part.text }, offset)) : (_jsx(Fragment, { children: part.text }, offset)));
|
|
24
|
+
offset += part.text.length;
|
|
25
|
+
}
|
|
26
|
+
return (_jsx("span", { className: joinClassNames('organism-name', className), children: children }));
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=OrganismName.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OrganismName.js","sourceRoot":"","sources":["../../../src/taxonomy/ui/OrganismName.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAmBhD;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAC,KAAwB;IACnD,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IACxC,MAAM,KAAK,GACT,IAAI,KAAK,SAAS,IAAI,YAAY,CAAC,IAAI,CAAC;QACtC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;QACjC,CAAC,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAE9B,MAAM,QAAQ,GAAgB,EAAE,CAAC;IACjC,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,QAAQ,CAAC,IAAI,CACX,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CACZ,sBAAiB,IAAI,CAAC,IAAI,IAAlB,MAAM,CAAiB,CAChC,CAAC,CAAC,CAAC,CACF,KAAC,QAAQ,cAAe,IAAI,CAAC,IAAI,IAAlB,MAAM,CAAwB,CAC9C,CACF,CAAC;QACF,MAAM,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;IAC7B,CAAC;IAED,OAAO,CACL,eAAM,SAAS,EAAE,cAAc,CAAC,eAAe,EAAE,SAAS,CAAC,YACxD,QAAQ,GACJ,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { Taxon, TaxonLineage as Lineage } from '../core/lineage.ts';
|
|
3
|
+
/** What a {@link TaxonLineage} needs. */
|
|
4
|
+
export interface TaxonLineageProps {
|
|
5
|
+
/** The lineage, from the top of the tree down to the taxon it leads to. */
|
|
6
|
+
lineage: Lineage;
|
|
7
|
+
/**
|
|
8
|
+
* Whether only the principal ranks are shown — domain, kingdom, phylum,
|
|
9
|
+
* class, order, family, genus, species — with the last taxon kept whatever
|
|
10
|
+
* its rank. Off, every taxon is shown, the clades included.
|
|
11
|
+
* @default true
|
|
12
|
+
*/
|
|
13
|
+
principal?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* The address of a taxon's page on the site. A taxon it answers `undefined`
|
|
16
|
+
* for is written as plain text, and so is every taxon without it.
|
|
17
|
+
* @default undefined
|
|
18
|
+
*/
|
|
19
|
+
taxonHref?: (taxon: Taxon) => string | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* What the site does when a taxon's link is followed with a plain click —
|
|
22
|
+
* move to its page without a reload. A modified click is left to the
|
|
23
|
+
* browser, so a taxon still opens in a tab of its own.
|
|
24
|
+
* @default undefined
|
|
25
|
+
*/
|
|
26
|
+
onTaxonSelect?: (taxon: Taxon) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Whether each taxon carries its rank as a small label over its name.
|
|
29
|
+
* Without it the rank is the taxon's tooltip, and is read to a screen reader
|
|
30
|
+
* after the name.
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
showRanks?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Whether a link to the last taxon's page in the NCBI Taxonomy Browser
|
|
36
|
+
* follows the lineage, when that taxon has an id.
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
39
|
+
ncbiLink?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Whether the last taxon is the page being read: it is then marked as the
|
|
42
|
+
* current page and is never a link.
|
|
43
|
+
* @default false
|
|
44
|
+
*/
|
|
45
|
+
current?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* What names the breadcrumb to a screen reader.
|
|
48
|
+
* @default the catalog's "Lineage"
|
|
49
|
+
*/
|
|
50
|
+
label?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Class names added to the root element.
|
|
53
|
+
* @default undefined
|
|
54
|
+
*/
|
|
55
|
+
className?: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* A lineage as a breadcrumb: the taxa from the top of the tree down, each
|
|
59
|
+
* named with its rank, the last one emphasised.
|
|
60
|
+
*
|
|
61
|
+
* The names under a genus are set in italics as nomenclature sets them, by
|
|
62
|
+
* {@link OrganismName}; the ranks are the chrome's words, translated with it.
|
|
63
|
+
* @param props - See {@link TaxonLineageProps}.
|
|
64
|
+
* @returns The breadcrumb, or nothing for an empty lineage.
|
|
65
|
+
*/
|
|
66
|
+
export declare function TaxonLineage(props: TaxonLineageProps): ReactElement | null;
|
|
67
|
+
//# sourceMappingURL=TaxonLineage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TaxonLineage.d.ts","sourceRoot":"","sources":["../../../src/taxonomy/ui/TaxonLineage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,OAAO,CAAC;AAKrD,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,IAAI,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAOzE,yCAAyC;AACzC,MAAM,WAAW,iBAAiB;IAChC,2EAA2E;IAC3E,OAAO,EAAE,OAAO,CAAC;IACjB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,MAAM,GAAG,SAAS,CAAC;IACjD;;;;;OAKG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACvC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,YAAY,GAAG,IAAI,CA0G1E"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { isModifiedClick } from "../../chrome/ui/navItem.js";
|
|
3
|
+
import { useChromeT } from "../../i18n/ui/useT.js";
|
|
4
|
+
import { joinClassNames } from "../../shared/ui/joinClassNames.js";
|
|
5
|
+
import { genusOrBelow, principalLineage } from "../core/lineage.js";
|
|
6
|
+
import { ncbiTaxonomyUrl } from "../core/ncbi.js";
|
|
7
|
+
import { OrganismName } from "./OrganismName.js";
|
|
8
|
+
import { rankLabel } from "./rankLabel.js";
|
|
9
|
+
/**
|
|
10
|
+
* A lineage as a breadcrumb: the taxa from the top of the tree down, each
|
|
11
|
+
* named with its rank, the last one emphasised.
|
|
12
|
+
*
|
|
13
|
+
* The names under a genus are set in italics as nomenclature sets them, by
|
|
14
|
+
* {@link OrganismName}; the ranks are the chrome's words, translated with it.
|
|
15
|
+
* @param props - See {@link TaxonLineageProps}.
|
|
16
|
+
* @returns The breadcrumb, or nothing for an empty lineage.
|
|
17
|
+
*/
|
|
18
|
+
export function TaxonLineage(props) {
|
|
19
|
+
const { lineage, principal = true, taxonHref, onTaxonSelect, showRanks = false, ncbiLink = false, current = false, label, className, } = props;
|
|
20
|
+
const t = useChromeT();
|
|
21
|
+
const shown = principal ? principalLineage(lineage) : lineage;
|
|
22
|
+
if (shown.length === 0)
|
|
23
|
+
return null;
|
|
24
|
+
const italic = genusOrBelow(shown);
|
|
25
|
+
const steps = [];
|
|
26
|
+
for (let index = 0; index < shown.length; index++) {
|
|
27
|
+
const taxon = shown[index];
|
|
28
|
+
const last = index === shown.length - 1;
|
|
29
|
+
const rank = rankLabel(t, taxon.rank);
|
|
30
|
+
const name = italic[index] ? (_jsx(OrganismName, { name: taxon.name })) : (taxon.name);
|
|
31
|
+
const isCurrent = last && current;
|
|
32
|
+
const href = isCurrent ? undefined : taxonHref?.(taxon);
|
|
33
|
+
steps.push(_jsxs("li", { className: joinClassNames('taxon-lineage__taxon', last && 'taxon-lineage__taxon--leaf'), title: showRanks ? undefined : rank, children: [_jsxs("span", { className: "taxon-lineage__step", children: [showRanks && _jsx("span", { className: "taxon-lineage__rank", children: rank }), href === undefined ? (_jsx("span", { className: "taxon-lineage__name", "aria-current": isCurrent ? 'page' : undefined, children: name })) : (_jsx("a", { className: "taxon-lineage__name", href: href, onClick: onTaxonSelect === undefined
|
|
34
|
+
? undefined
|
|
35
|
+
: (event) => {
|
|
36
|
+
if (isModifiedClick(event) || event.button !== 0)
|
|
37
|
+
return;
|
|
38
|
+
event.preventDefault();
|
|
39
|
+
onTaxonSelect(taxon);
|
|
40
|
+
}, children: name })), !showRanks && (_jsxs("span", { className: "taxon-lineage__spoken", children: [' ', t('taxonomy.rankNote', { rank })] }))] }), last ? (ncbiLink &&
|
|
41
|
+
taxon.taxId !== undefined && (_jsx("a", { className: "taxon-lineage__ncbi", href: ncbiTaxonomyUrl(taxon.taxId), target: "_blank", rel: "noreferrer", title: t('taxonomy.ncbiTitle', { name: taxon.name }), children: t('taxonomy.ncbi') }))) : (_jsx("span", { className: "taxon-lineage__separator", "aria-hidden": "true", children: "\u203A" }))] }, `${taxon.taxId ?? ''}:${taxon.rank}:${taxon.name}`));
|
|
42
|
+
}
|
|
43
|
+
return (_jsx("nav", { className: joinClassNames('taxon-lineage', showRanks && 'taxon-lineage--ranks', className), "aria-label": label ?? t('taxonomy.lineage'), children: _jsx("ol", { className: "taxon-lineage__list", children: steps }) }));
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=TaxonLineage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TaxonLineage.js","sourceRoot":"","sources":["../../../src/taxonomy/ui/TaxonLineage.tsx"],"names":[],"mappings":";AAEA,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,IAAI,EAAE,CAAC,IAC5B,CACR,IACI,EACN,IAAI,CAAC,CAAC,CAAC,CACN,QAAQ;oBACR,KAAK,CAAC,KAAK,KAAK,SAAS,IAAI,CAC3B,YACE,SAAS,EAAC,qBAAqB,EAC/B,IAAI,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,CAAC,EAClC,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,YAAY,EAChB,KAAK,EAAE,CAAC,CAAC,oBAAoB,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,YAEnD,CAAC,CAAC,eAAe,CAAC,GACjB,CACL,CACF,CAAC,CAAC,CAAC,CACF,eAAM,SAAS,EAAC,0BAA0B,iBAAa,MAAM,uBAEtD,CACR,KAzDI,GAAG,KAAK,CAAC,KAAK,IAAI,EAAE,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE,CA0DpD,CACN,CAAC;IACJ,CAAC;IAED,OAAO,CACL,cACE,SAAS,EAAE,cAAc,CACvB,eAAe,EACf,SAAS,IAAI,sBAAsB,EACnC,SAAS,CACV,gBACW,KAAK,IAAI,CAAC,CAAC,kBAAkB,CAAC,YAE1C,aAAI,SAAS,EAAC,qBAAqB,YAAE,KAAK,GAAM,GAC5C,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type { OrganismNameProps } from './OrganismName.tsx';
|
|
2
|
+
export { OrganismName } from './OrganismName.tsx';
|
|
3
|
+
export type { TaxonLineageProps } from './TaxonLineage.tsx';
|
|
4
|
+
export { TaxonLineage } from './TaxonLineage.tsx';
|
|
5
|
+
export { useRankLabel } from './rankLabel.ts';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/taxonomy/ui/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,YAAY,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/taxonomy/ui/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAoB,CAAC;AAElD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ChromeKey } from '../../i18n/core/chromeCatalog.ts';
|
|
2
|
+
import type { Translate } from '../../i18n/ui/useT.ts';
|
|
3
|
+
/**
|
|
4
|
+
* A rank as the reader's language names it.
|
|
5
|
+
* @param t - The chrome's formatter.
|
|
6
|
+
* @param rank - The rank, as NCBI writes it.
|
|
7
|
+
* @returns Its label, or the rank itself when the catalog has none for it.
|
|
8
|
+
*/
|
|
9
|
+
export declare function rankLabel(t: Translate<ChromeKey>, rank: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* The label of a rank in the reader's language, for a site writing a rank
|
|
12
|
+
* beside the lineage — a taxon's heading, a list of its children.
|
|
13
|
+
* @returns `label(rank)`: the rank as NCBI writes it, named the way the chrome
|
|
14
|
+
* names it; a rank the catalog does not know is returned as it is.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useRankLabel(): (rank: string) => string;
|
|
17
|
+
//# sourceMappingURL=rankLabel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rankLabel.d.ts","sourceRoot":"","sources":["../../../src/taxonomy/ui/rankLabel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AA2DvD;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAGvE;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,IAAI,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAGvD"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { useChromeT } from "../../i18n/ui/useT.js";
|
|
2
|
+
// Each rank NCBI writes, with the key its label is translated under. Written
|
|
3
|
+
// out rather than built from the rank, so a key the catalog lacks fails the
|
|
4
|
+
// type check instead of rendering raw.
|
|
5
|
+
const RANK_KEYS = {
|
|
6
|
+
realm: 'taxonomy.rank.realm',
|
|
7
|
+
domain: 'taxonomy.rank.domain',
|
|
8
|
+
superkingdom: 'taxonomy.rank.superkingdom',
|
|
9
|
+
kingdom: 'taxonomy.rank.kingdom',
|
|
10
|
+
subkingdom: 'taxonomy.rank.subkingdom',
|
|
11
|
+
superphylum: 'taxonomy.rank.superphylum',
|
|
12
|
+
phylum: 'taxonomy.rank.phylum',
|
|
13
|
+
subphylum: 'taxonomy.rank.subphylum',
|
|
14
|
+
superclass: 'taxonomy.rank.superclass',
|
|
15
|
+
class: 'taxonomy.rank.class',
|
|
16
|
+
subclass: 'taxonomy.rank.subclass',
|
|
17
|
+
infraclass: 'taxonomy.rank.infraclass',
|
|
18
|
+
cohort: 'taxonomy.rank.cohort',
|
|
19
|
+
subcohort: 'taxonomy.rank.subcohort',
|
|
20
|
+
superorder: 'taxonomy.rank.superorder',
|
|
21
|
+
order: 'taxonomy.rank.order',
|
|
22
|
+
suborder: 'taxonomy.rank.suborder',
|
|
23
|
+
infraorder: 'taxonomy.rank.infraorder',
|
|
24
|
+
parvorder: 'taxonomy.rank.parvorder',
|
|
25
|
+
superfamily: 'taxonomy.rank.superfamily',
|
|
26
|
+
family: 'taxonomy.rank.family',
|
|
27
|
+
subfamily: 'taxonomy.rank.subfamily',
|
|
28
|
+
tribe: 'taxonomy.rank.tribe',
|
|
29
|
+
subtribe: 'taxonomy.rank.subtribe',
|
|
30
|
+
genus: 'taxonomy.rank.genus',
|
|
31
|
+
subgenus: 'taxonomy.rank.subgenus',
|
|
32
|
+
section: 'taxonomy.rank.section',
|
|
33
|
+
subsection: 'taxonomy.rank.subsection',
|
|
34
|
+
series: 'taxonomy.rank.series',
|
|
35
|
+
subseries: 'taxonomy.rank.subseries',
|
|
36
|
+
'species group': 'taxonomy.rank.speciesGroup',
|
|
37
|
+
'species subgroup': 'taxonomy.rank.speciesSubgroup',
|
|
38
|
+
species: 'taxonomy.rank.species',
|
|
39
|
+
'forma specialis': 'taxonomy.rank.formaSpecialis',
|
|
40
|
+
subspecies: 'taxonomy.rank.subspecies',
|
|
41
|
+
varietas: 'taxonomy.rank.varietas',
|
|
42
|
+
subvariety: 'taxonomy.rank.subvariety',
|
|
43
|
+
forma: 'taxonomy.rank.forma',
|
|
44
|
+
pathogroup: 'taxonomy.rank.pathogroup',
|
|
45
|
+
serogroup: 'taxonomy.rank.serogroup',
|
|
46
|
+
serotype: 'taxonomy.rank.serotype',
|
|
47
|
+
biotype: 'taxonomy.rank.biotype',
|
|
48
|
+
genotype: 'taxonomy.rank.genotype',
|
|
49
|
+
morph: 'taxonomy.rank.morph',
|
|
50
|
+
strain: 'taxonomy.rank.strain',
|
|
51
|
+
isolate: 'taxonomy.rank.isolate',
|
|
52
|
+
'no rank': 'taxonomy.rank.noRank',
|
|
53
|
+
clade: 'taxonomy.rank.clade',
|
|
54
|
+
'cellular root': 'taxonomy.rank.cellularRoot',
|
|
55
|
+
'acellular root': 'taxonomy.rank.acellularRoot',
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* A rank as the reader's language names it.
|
|
59
|
+
* @param t - The chrome's formatter.
|
|
60
|
+
* @param rank - The rank, as NCBI writes it.
|
|
61
|
+
* @returns Its label, or the rank itself when the catalog has none for it.
|
|
62
|
+
*/
|
|
63
|
+
export function rankLabel(t, rank) {
|
|
64
|
+
const key = Object.hasOwn(RANK_KEYS, rank) ? RANK_KEYS[rank] : undefined;
|
|
65
|
+
return key === undefined ? rank : t(key);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The label of a rank in the reader's language, for a site writing a rank
|
|
69
|
+
* beside the lineage — a taxon's heading, a list of its children.
|
|
70
|
+
* @returns `label(rank)`: the rank as NCBI writes it, named the way the chrome
|
|
71
|
+
* names it; a rank the catalog does not know is returned as it is.
|
|
72
|
+
*/
|
|
73
|
+
export function useRankLabel() {
|
|
74
|
+
const t = useChromeT();
|
|
75
|
+
return (rank) => rankLabel(t, rank);
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=rankLabel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rankLabel.js","sourceRoot":"","sources":["../../../src/taxonomy/ui/rankLabel.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,6EAA6E;AAC7E,4EAA4E;AAC5E,uCAAuC;AACvC,MAAM,SAAS,GAAwC;IACrD,KAAK,EAAE,qBAAqB;IAC5B,MAAM,EAAE,sBAAsB;IAC9B,YAAY,EAAE,4BAA4B;IAC1C,OAAO,EAAE,uBAAuB;IAChC,UAAU,EAAE,0BAA0B;IACtC,WAAW,EAAE,2BAA2B;IACxC,MAAM,EAAE,sBAAsB;IAC9B,SAAS,EAAE,yBAAyB;IACpC,UAAU,EAAE,0BAA0B;IACtC,KAAK,EAAE,qBAAqB;IAC5B,QAAQ,EAAE,wBAAwB;IAClC,UAAU,EAAE,0BAA0B;IACtC,MAAM,EAAE,sBAAsB;IAC9B,SAAS,EAAE,yBAAyB;IACpC,UAAU,EAAE,0BAA0B;IACtC,KAAK,EAAE,qBAAqB;IAC5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AG,CAAC,CAAC;AAC3C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY;IAC1B,MAAM,CAAC,GAAG,UAAU,EAAE,CAAC;IACvB,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;AACtC,CAAC"}
|
package/lib/ui.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ export * from './scatter3d/ui/index.ts';
|
|
|
31
31
|
export * from './share/ui/index.ts';
|
|
32
32
|
export * from './shared/ui/index.ts';
|
|
33
33
|
export * from './split/ui/index.ts';
|
|
34
|
+
export * from './taxonomy/ui/index.ts';
|
|
34
35
|
export type { ConformerTableProps } from './structure/ui/ConformerTable.tsx';
|
|
35
36
|
export { ConformerTable } from './structure/ui/ConformerTable.tsx';
|
|
36
37
|
export type { ConformerColumn } from './structure/ui/conformerColumns.ts';
|
package/lib/ui.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;A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,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AAKvC,YAAY,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,YAAY,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EACL,uBAAuB,EACvB,cAAc,EACd,eAAe,GAChB,MAAM,oCAAoC,CAAC"}
|
package/lib/ui.js
CHANGED
|
@@ -31,6 +31,7 @@ export * from "./scatter3d/ui/index.js";
|
|
|
31
31
|
export * from "./share/ui/index.js";
|
|
32
32
|
export * from "./shared/ui/index.js";
|
|
33
33
|
export * from "./split/ui/index.js";
|
|
34
|
+
export * from "./taxonomy/ui/index.js";
|
|
34
35
|
export { ConformerTable } from "./structure/ui/ConformerTable.js";
|
|
35
36
|
export { CONFORMER_COLUMN_LABELS, PICKER_COLUMNS, RANKING_COLUMNS, } from "./structure/ui/conformerColumns.js";
|
|
36
37
|
//# sourceMappingURL=ui.js.map
|
package/lib/ui.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAA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,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AAMvC,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAmC,CAAC;AAEnE,OAAO,EACL,uBAAuB,EACvB,cAAc,EACd,eAAe,GAChB,MAAM,oCAAoC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-cheminfo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.48.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "React components, hooks and framework-free helpers shared by the cheminfo sites: site chrome, citations, sharing, routing, pedagogy, charts, and the structure, orbital and 3D molecule viewers",
|
|
6
6
|
"author": "Luc Patiny",
|
|
@@ -163,12 +163,27 @@ export interface ZoomGestures {
|
|
|
163
163
|
* @default true
|
|
164
164
|
*/
|
|
165
165
|
wheel?: boolean;
|
|
166
|
+
/**
|
|
167
|
+
* Whether the chart answers `f` with a window fitted to everything drawn.
|
|
168
|
+
*
|
|
169
|
+
* The same thing the double click does, reachable without a pointer — and the
|
|
170
|
+
* one gesture a reader cannot discover by trying, which is why the key is the
|
|
171
|
+
* same `f` on every chart of the family rather than each one choosing.
|
|
172
|
+
*
|
|
173
|
+
* Turned off by a viewer that already owns its keys: the infrared shell runs
|
|
174
|
+
* `f` through its own command table, where the key is listed in a toolbar
|
|
175
|
+
* tooltip and in the documentation panel, and fits every pane of a stack
|
|
176
|
+
* rather than the one chart the pointer is on.
|
|
177
|
+
* @default true
|
|
178
|
+
*/
|
|
179
|
+
keys?: boolean;
|
|
166
180
|
}
|
|
167
181
|
|
|
168
182
|
/** What the gestures come to when a viewer states none of them. */
|
|
169
183
|
export const DEFAULT_ZOOM_GESTURES: Required<ZoomGestures> = {
|
|
170
184
|
drag: 'xAxis',
|
|
171
185
|
wheel: true,
|
|
186
|
+
keys: true,
|
|
172
187
|
};
|
|
173
188
|
|
|
174
189
|
/**
|
|
@@ -31,8 +31,10 @@ export interface SelectionRectangle {
|
|
|
31
31
|
/**
|
|
32
32
|
* The rectangle to draw for a drag being made.
|
|
33
33
|
*
|
|
34
|
-
* A drag that takes the y axis with it is drawn at the height
|
|
35
|
-
*
|
|
34
|
+
* A drag that takes the y axis with it is drawn at the height `zoomSelection`
|
|
35
|
+
* worked out — the window the release will take, which is the drag's own height
|
|
36
|
+
* stretched to any baseline the viewer holds — and one that asks for the x axis
|
|
37
|
+
* alone spans the whole plot.
|
|
36
38
|
* That is the gesture announcing itself before the button is let go: the
|
|
37
39
|
* rectangle changing shape — as the pointer crosses the baseline, or as a
|
|
38
40
|
* `dual` drag leaves the level it started on — is the only warning a user gets
|