@ca-plant-list/ca-plant-list 0.4.18 → 0.4.20
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/data/genera.json +36 -32
- package/data/inattaxonphotos.csv +4 -0
- package/data/synonyms.csv +2 -0
- package/data/taxa.csv +6 -5
- package/data/text/Polypodium-calirhiza.md +1 -0
- package/data/text/Polypodium-scouleri.md +1 -0
- package/data/text/Rumex-conglomeratus.md +1 -0
- package/data/text/Rumex-obtusifolius.md +1 -0
- package/data/text/Rumex-pulcher.md +1 -0
- package/data/text/Rumex-salicifolius.md +1 -0
- package/lib/basepagerenderer.js +3 -3
- package/lib/ebook/glossarypages.js +3 -3
- package/lib/ebook/images.js +7 -7
- package/lib/ebook/pages/page_list_families.js +1 -1
- package/lib/ebook/pages/page_list_flower_color.js +2 -2
- package/lib/ebook/pages/page_list_flowers.js +8 -8
- package/lib/ebook/pages/page_list_species.js +1 -1
- package/lib/ebook/pages/taxonpage.js +2 -2
- package/lib/ebook/pages/tocpage.js +2 -2
- package/lib/ebook/plantbook.js +3 -3
- package/lib/externalsites.js +20 -15
- package/lib/families.js +14 -14
- package/lib/flowercolor.js +2 -2
- package/lib/genera.js +3 -3
- package/lib/htmltaxon.js +16 -7
- package/lib/index.d.ts +46 -1
- package/lib/pagerenderer.js +223 -220
- package/lib/photo.js +52 -31
- package/lib/plants/glossary.js +2 -4
- package/lib/program.js +10 -2
- package/lib/sitegenerator.js +13 -3
- package/lib/taxa.js +16 -12
- package/lib/taxon.js +12 -6
- package/lib/tools/calflora.js +41 -8
- package/lib/tools/calscape.js +4 -4
- package/lib/tools/inat.js +7 -7
- package/lib/tools/jepsoneflora.js +28 -4
- package/lib/tools/jepsonfamilies.js +102 -0
- package/lib/tools/rpi.js +8 -9
- package/lib/tools/supplementaltext.js +43 -0
- package/lib/tools/taxacsv.js +2 -2
- package/lib/utils/inat-tools.js +39 -2
- package/lib/web/glossarypages.js +6 -6
- package/lib/web/pagetaxon.js +4 -6
- package/package.json +10 -8
- package/scripts/cpl-photos.js +2 -2
- package/scripts/cpl-tools.js +11 -3
- package/scripts/inatobsphotos.js +10 -1
- package/scripts/inattaxonphotos.js +45 -43
- package/lib/inat_photo.js +0 -43
- package/types/classes.d.ts +0 -232
package/data/genera.json
CHANGED
@@ -607,6 +607,10 @@
|
|
607
607
|
"family": "Asteraceae",
|
608
608
|
"id": "302"
|
609
609
|
},
|
610
|
+
"Aldama": {
|
611
|
+
"family": "Asteraceae",
|
612
|
+
"id": "95525"
|
613
|
+
},
|
610
614
|
"Almutaster": {
|
611
615
|
"family": "Asteraceae",
|
612
616
|
"id": "67986"
|
@@ -1107,6 +1111,10 @@
|
|
1107
1111
|
"family": "Asteraceae",
|
1108
1112
|
"id": "497"
|
1109
1113
|
},
|
1114
|
+
"Laphamia": {
|
1115
|
+
"family": "Asteraceae",
|
1116
|
+
"id": "68724"
|
1117
|
+
},
|
1110
1118
|
"Lapsana": {
|
1111
1119
|
"family": "Asteraceae",
|
1112
1120
|
"id": "498"
|
@@ -1199,6 +1207,10 @@
|
|
1199
1207
|
"family": "Asteraceae",
|
1200
1208
|
"id": "68898"
|
1201
1209
|
},
|
1210
|
+
"Mycelis": {
|
1211
|
+
"family": "Asteraceae",
|
1212
|
+
"id": "532"
|
1213
|
+
},
|
1202
1214
|
"Nestotus": {
|
1203
1215
|
"family": "Asteraceae",
|
1204
1216
|
"id": "82475"
|
@@ -1515,10 +1527,6 @@
|
|
1515
1527
|
"family": "Asteraceae",
|
1516
1528
|
"id": "653"
|
1517
1529
|
},
|
1518
|
-
"Viguiera": {
|
1519
|
-
"family": "Asteraceae",
|
1520
|
-
"id": "655"
|
1521
|
-
},
|
1522
1530
|
"Volutaria": {
|
1523
1531
|
"family": "Asteraceae",
|
1524
1532
|
"id": "82515"
|
@@ -1983,10 +1991,6 @@
|
|
1983
1991
|
"family": "Cactaceae",
|
1984
1992
|
"id": "9216"
|
1985
1993
|
},
|
1986
|
-
"Coryphantha": {
|
1987
|
-
"family": "Cactaceae",
|
1988
|
-
"id": "9218"
|
1989
|
-
},
|
1990
1994
|
"Cylindropuntia": {
|
1991
1995
|
"family": "Cactaceae",
|
1992
1996
|
"id": "68351"
|
@@ -1999,6 +2003,10 @@
|
|
1999
2003
|
"family": "Cactaceae",
|
2000
2004
|
"id": "9220"
|
2001
2005
|
},
|
2006
|
+
"Escobaria": {
|
2007
|
+
"family": "Cactaceae",
|
2008
|
+
"id": "10632"
|
2009
|
+
},
|
2002
2010
|
"Ferocactus": {
|
2003
2011
|
"family": "Cactaceae",
|
2004
2012
|
"id": "10633"
|
@@ -2115,6 +2123,10 @@
|
|
2115
2123
|
"family": "Caryophyllaceae",
|
2116
2124
|
"id": "10431"
|
2117
2125
|
},
|
2126
|
+
"Engellaria": {
|
2127
|
+
"family": "Caryophyllaceae",
|
2128
|
+
"id": "85147"
|
2129
|
+
},
|
2118
2130
|
"Eremogone": {
|
2119
2131
|
"family": "Caryophyllaceae",
|
2120
2132
|
"id": "68468"
|
@@ -2175,10 +2187,6 @@
|
|
2175
2187
|
"family": "Caryophyllaceae",
|
2176
2188
|
"id": "10855"
|
2177
2189
|
},
|
2178
|
-
"Schizotechium": {
|
2179
|
-
"family": "Caryophyllaceae",
|
2180
|
-
"id": "85148"
|
2181
|
-
},
|
2182
2190
|
"Scleranthus": {
|
2183
2191
|
"family": "Caryophyllaceae",
|
2184
2192
|
"id": "10857"
|
@@ -2203,6 +2211,10 @@
|
|
2203
2211
|
"family": "Caryophyllaceae",
|
2204
2212
|
"id": "10852"
|
2205
2213
|
},
|
2214
|
+
"Torreyostellaria": {
|
2215
|
+
"family": "Caryophyllaceae",
|
2216
|
+
"id": "8632"
|
2217
|
+
},
|
2206
2218
|
"Euonymus": {
|
2207
2219
|
"family": "Celastraceae",
|
2208
2220
|
"id": "9802"
|
@@ -2315,30 +2327,14 @@
|
|
2315
2327
|
"family": "Cistaceae",
|
2316
2328
|
"id": "10869"
|
2317
2329
|
},
|
2318
|
-
"Carsonia": {
|
2319
|
-
"family": "Cleomaceae",
|
2320
|
-
"id": "91883"
|
2321
|
-
},
|
2322
2330
|
"Cleomella": {
|
2323
2331
|
"family": "Cleomaceae",
|
2324
2332
|
"id": "10309"
|
2325
2333
|
},
|
2326
|
-
"Oxystylis": {
|
2327
|
-
"family": "Cleomaceae",
|
2328
|
-
"id": "10312"
|
2329
|
-
},
|
2330
|
-
"Peritoma": {
|
2331
|
-
"family": "Cleomaceae",
|
2332
|
-
"id": "91884"
|
2333
|
-
},
|
2334
2334
|
"Polanisia": {
|
2335
2335
|
"family": "Cleomaceae",
|
2336
2336
|
"id": "10313"
|
2337
2337
|
},
|
2338
|
-
"Wislizenia": {
|
2339
|
-
"family": "Cleomaceae",
|
2340
|
-
"id": "10314"
|
2341
|
-
},
|
2342
2338
|
"Comandra": {
|
2343
2339
|
"family": "Comandraceae",
|
2344
2340
|
"id": "10714"
|
@@ -2735,6 +2731,10 @@
|
|
2735
2731
|
"family": "Fabaceae",
|
2736
2732
|
"id": "9376"
|
2737
2733
|
},
|
2734
|
+
"Neltuma": {
|
2735
|
+
"family": "Fabaceae",
|
2736
|
+
"id": "68919"
|
2737
|
+
},
|
2738
2738
|
"Olneya": {
|
2739
2739
|
"family": "Fabaceae",
|
2740
2740
|
"id": "9384"
|
@@ -2751,6 +2751,10 @@
|
|
2751
2751
|
"family": "Fabaceae",
|
2752
2752
|
"id": "9391"
|
2753
2753
|
},
|
2754
|
+
"Paraserianthes": {
|
2755
|
+
"family": "Fabaceae",
|
2756
|
+
"id": "9393"
|
2757
|
+
},
|
2754
2758
|
"Parkinsonia": {
|
2755
2759
|
"family": "Fabaceae",
|
2756
2760
|
"id": "9394"
|
@@ -2775,10 +2779,6 @@
|
|
2775
2779
|
"family": "Fabaceae",
|
2776
2780
|
"id": "9404"
|
2777
2781
|
},
|
2778
|
-
"Prosopis": {
|
2779
|
-
"family": "Fabaceae",
|
2780
|
-
"id": "9406"
|
2781
|
-
},
|
2782
2782
|
"Psorothamnus": {
|
2783
2783
|
"family": "Fabaceae",
|
2784
2784
|
"id": "9408"
|
@@ -2811,6 +2811,10 @@
|
|
2811
2811
|
"family": "Fabaceae",
|
2812
2812
|
"id": "9420"
|
2813
2813
|
},
|
2814
|
+
"Strombocarpa": {
|
2815
|
+
"family": "Fabaceae",
|
2816
|
+
"id": "8678"
|
2817
|
+
},
|
2814
2818
|
"Thermopsis": {
|
2815
2819
|
"family": "Fabaceae",
|
2816
2820
|
"id": "10382"
|
package/data/inattaxonphotos.csv
CHANGED
@@ -4044,6 +4044,10 @@ Oxalis pes-caprae,6503168,jpeg,cc-by-nc,James Bailey
|
|
4044
4044
|
Oxalis pilosa,8865145,jpg,cc-by-nc,Carol Blaney
|
4045
4045
|
Oxalis pilosa,8865151,jpg,cc-by-nc,Carol Blaney
|
4046
4046
|
Oxalis pilosa,8865149,jpg,cc-by-nc,Carol Blaney
|
4047
|
+
Oxalis smalliana,218331103,jpeg,cc-by-nc,Sadie Hickey
|
4048
|
+
Oxalis smalliana,353081201,jpg,cc-by-nc,ardouglas
|
4049
|
+
Oxalis smalliana,218331090,jpeg,cc-by-nc,Sadie Hickey
|
4050
|
+
Oxalis smalliana,294594629,jpeg,cc-by,Ed Alverson
|
4047
4051
|
Packera breweri,37358638,jpg,cc-by-nc,Stacie Wolny
|
4048
4052
|
Packera breweri,16970444,jpg,cc-by-nc,Stacie Wolny
|
4049
4053
|
Packera breweri,37358664,jpg,cc-by-nc,Stacie Wolny
|
package/data/synonyms.csv
CHANGED
@@ -597,10 +597,12 @@ Dodecatheon jeffreyi subsp. jeffreyi,Primula jeffreyi
|
|
597
597
|
Dodecatheon jeffreyi subsp. pygmaeum,Primula jeffreyi
|
598
598
|
Dodecatheon jeffreyi var. alpinum,Primula tetrandra
|
599
599
|
Dodecatheon tetrandrum,Primula tetrandra
|
600
|
+
Downingia concolor var. tricolor,Downingia concolor var. concolor
|
600
601
|
Downingia immaculata,Downingia cuspidata
|
601
602
|
Downingia mirabilis,Downingia ornatissima var. mirabilis
|
602
603
|
Downingia mirabilis var. eximia,Downingia ornatissima var. mirabilis
|
603
604
|
Downingia ornatissima var. eximia,Downingia ornatissima var. mirabilis
|
605
|
+
Downingia tricolor,Downingia concolor var. concolor
|
604
606
|
Draba cuneifolia var. cuneifolia,Draba cuneifolia
|
605
607
|
Draba cuneifolia var. integrifolia,Draba cuneifolia
|
606
608
|
Draba cuneifolia var. sonorae,Draba cuneifolia
|
package/data/taxa.csv
CHANGED
@@ -592,11 +592,12 @@ Dipterostemon capitatus,blue dicks,N,108599,13632,1196784,Blue Dicks
|
|
592
592
|
Dirca occidentalis,western leatherwood,N,23143,2739,50315,Western Leatherwood,,,,,567,1B.2,,,S2,G2
|
593
593
|
Distichlis spicata,saltgrass,N,23161,2743,58372,Saltgrass
|
594
594
|
Dittrichia graveolens,stinkwort,X,2454,8482,58822
|
595
|
-
Downingia bella,,N,23273,2766,60160,Hoover's Downingia
|
596
|
-
Downingia
|
597
|
-
Downingia
|
598
|
-
Downingia
|
599
|
-
Downingia
|
595
|
+
Downingia bella,,N,23273,2766,60160,Hoover's Downingia,annual,blue,3,5
|
596
|
+
Downingia concolor var. concolor,maroonspot calicoflower,N,57811,2772,80674,Maroonspot Calicoflower,annual,blue,4,7
|
597
|
+
Downingia cuspidata,,N,101864,2773,60163,Toothed Calicoflower,annual,blue,3,6
|
598
|
+
Downingia insignis,,N,23278,2776,60164,Harlequin Calicoflower,annual,blue,3,5
|
599
|
+
Downingia ornatissima var. mirabilis,,N,84766,14563,,,annual,blue,4,5
|
600
|
+
Downingia pulchella,,N,23282,2782,60167,Flatface Calicoflower,annual,blue,4,6
|
600
601
|
Draba cuneifolia,,N,23332,2798,1138678,Wedgeleaf Draba
|
601
602
|
Draba verna,spring whitlow-grass,X,23442,2816,55823,,,white,2,5
|
602
603
|
Drymocallis glandulosa var. glandulosa,sticky cinquefoil,N,82059,11609,80678,Sticky Cinquefoil,perennial,"yellow,white",5,7
|
@@ -0,0 +1 @@
|
|
1
|
+
Frond narrows at base (not triangle shaped). Sori not sunken.
|
@@ -0,0 +1 @@
|
|
1
|
+
Frond not hairy on center rib. Frond brittle.
|
@@ -0,0 +1 @@
|
|
1
|
+
[Perianth](./g/perianth.html) without teeth.
|
@@ -0,0 +1 @@
|
|
1
|
+
[Perianth](./g/perianth.html) with teeth.
|
@@ -0,0 +1 @@
|
|
1
|
+
[Perianth](./g/perianth.html) with teeth.
|
@@ -0,0 +1 @@
|
|
1
|
+
Leaves only on stem (no basal leaves).
|
package/lib/basepagerenderer.js
CHANGED
@@ -6,8 +6,8 @@ import { GlossaryPages } from "./web/glossarypages.js";
|
|
6
6
|
class BasePageRenderer {
|
7
7
|
/**
|
8
8
|
* @param {string} outputDir
|
9
|
-
* @param {Taxa} taxa
|
10
|
-
* @param {
|
9
|
+
* @param {import("./taxa.js").Taxa} taxa
|
10
|
+
* @param {import("./htmltaxon.js").TaxaColDef[]} [familyCols]
|
11
11
|
*/
|
12
12
|
static renderBasePages(outputDir, taxa, familyCols) {
|
13
13
|
const siteGenerator = new Jekyll(outputDir);
|
@@ -30,7 +30,7 @@ class BasePageRenderer {
|
|
30
30
|
|
31
31
|
/**
|
32
32
|
* @param {string} outputDir
|
33
|
-
* @param {Taxa} taxa
|
33
|
+
* @param {import("./taxa.js").Taxa} taxa
|
34
34
|
*/
|
35
35
|
static renderTools(outputDir, taxa) {
|
36
36
|
const names = [];
|
@@ -3,7 +3,7 @@ import { EBook } from "./ebook.js";
|
|
3
3
|
|
4
4
|
class GlossaryPages extends BaseGlossaryPages {
|
5
5
|
/**
|
6
|
-
* @param {SiteGenerator} siteGenerator
|
6
|
+
* @param {import("../sitegenerator.js").SiteGenerator} siteGenerator
|
7
7
|
*/
|
8
8
|
constructor(siteGenerator) {
|
9
9
|
super(siteGenerator);
|
@@ -19,8 +19,8 @@ class GlossaryPages extends BaseGlossaryPages {
|
|
19
19
|
manifestEntries.push(
|
20
20
|
EBook.getManifestEntry(
|
21
21
|
"g" + index,
|
22
|
-
"g/" + entry.getHTMLFileName()
|
23
|
-
)
|
22
|
+
"g/" + entry.getHTMLFileName(),
|
23
|
+
),
|
24
24
|
);
|
25
25
|
}
|
26
26
|
|
package/lib/ebook/images.js
CHANGED
@@ -12,9 +12,9 @@ class Images {
|
|
12
12
|
#taxa;
|
13
13
|
|
14
14
|
/**
|
15
|
-
* @param {SiteGenerator} siteGenerator
|
15
|
+
* @param {import("../sitegenerator.js").SiteGenerator} siteGenerator
|
16
16
|
* @param {string} contentDir
|
17
|
-
* @param {Taxa} taxa
|
17
|
+
* @param {import("../taxa.js").Taxa} taxa
|
18
18
|
*/
|
19
19
|
constructor(siteGenerator, contentDir, taxa) {
|
20
20
|
this.#siteGenerator = siteGenerator;
|
@@ -23,7 +23,7 @@ class Images {
|
|
23
23
|
}
|
24
24
|
|
25
25
|
/**
|
26
|
-
* @param {Taxon[]} taxa
|
26
|
+
* @param {import("../taxon.js").Taxon[]} taxa
|
27
27
|
*/
|
28
28
|
async createImages(taxa) {
|
29
29
|
const meter = new ProgressMeter("processing photos", taxa.length);
|
@@ -102,7 +102,7 @@ class Images {
|
|
102
102
|
}
|
103
103
|
|
104
104
|
/**
|
105
|
-
* @param {Photo} photo
|
105
|
+
* @param {import("../photo.js").Photo} photo
|
106
106
|
* @returns {string}
|
107
107
|
*/
|
108
108
|
getCompressedFilePath(photo) {
|
@@ -110,7 +110,7 @@ class Images {
|
|
110
110
|
}
|
111
111
|
|
112
112
|
/**
|
113
|
-
* @param {Photo} photo
|
113
|
+
* @param {import("../photo.js").Photo} photo
|
114
114
|
* @returns {string}
|
115
115
|
*/
|
116
116
|
getCompressedImageName(photo) {
|
@@ -118,8 +118,8 @@ class Images {
|
|
118
118
|
}
|
119
119
|
|
120
120
|
/**
|
121
|
-
* @param {Taxon} taxon
|
122
|
-
* @returns {Photo[]}
|
121
|
+
* @param {import("../taxon.js").Taxon} taxon
|
122
|
+
* @returns {import("../photo.js").Photo[]}
|
123
123
|
*/
|
124
124
|
static getTaxonPhotos(taxon) {
|
125
125
|
const photos = taxon
|
@@ -6,7 +6,7 @@ class PageListFamilies extends EBookPage {
|
|
6
6
|
|
7
7
|
/**
|
8
8
|
* @param {string} outputDir
|
9
|
-
* @param {Families} families
|
9
|
+
* @param {import("../../families.js").Families} families
|
10
10
|
*/
|
11
11
|
constructor(outputDir, families) {
|
12
12
|
super(outputDir + "/list_families.html", "All Families");
|
@@ -6,12 +6,12 @@ class PageListFlowerColor extends EBookPage {
|
|
6
6
|
|
7
7
|
/**
|
8
8
|
* @param {string} outputDir
|
9
|
-
* @param {FlowerColor} color
|
9
|
+
* @param {import("../../flowercolor.js").FlowerColor} color
|
10
10
|
*/
|
11
11
|
constructor(outputDir, color) {
|
12
12
|
super(
|
13
13
|
outputDir + "/" + color.getFileName(),
|
14
|
-
color.getColorName(true) + " Flowers"
|
14
|
+
color.getColorName(true) + " Flowers",
|
15
15
|
);
|
16
16
|
this.#color = color;
|
17
17
|
}
|
@@ -8,7 +8,7 @@ const FN_FLOWER_TIME_INDEX = "fm.html";
|
|
8
8
|
class PageListFlowers {
|
9
9
|
/**
|
10
10
|
* @param {string} contentDir
|
11
|
-
* @param {Taxa} taxa
|
11
|
+
* @param {import("../../taxa.js").Taxa} taxa
|
12
12
|
*/
|
13
13
|
static createPages(contentDir, taxa) {
|
14
14
|
new PageListFlowerTimeIndex(contentDir).create();
|
@@ -21,14 +21,14 @@ class PageListFlowers {
|
|
21
21
|
const manifestEntries = [];
|
22
22
|
|
23
23
|
manifestEntries.push(
|
24
|
-
EBook.getManifestEntry("fm0", FN_FLOWER_TIME_INDEX)
|
24
|
+
EBook.getManifestEntry("fm0", FN_FLOWER_TIME_INDEX),
|
25
25
|
);
|
26
26
|
for (let m1 = 1; m1 < 13; m1++) {
|
27
27
|
manifestEntries.push(
|
28
28
|
EBook.getManifestEntry(
|
29
29
|
"fm" + m1,
|
30
|
-
PageListFlowerTime.getFileNameBloomTime(m1)
|
31
|
-
)
|
30
|
+
PageListFlowerTime.getFileNameBloomTime(m1),
|
31
|
+
),
|
32
32
|
);
|
33
33
|
}
|
34
34
|
|
@@ -54,8 +54,8 @@ class PageListFlowers {
|
|
54
54
|
PageListFlowerTime.getFileNameBloomTime(m1),
|
55
55
|
DateUtils.getMonthName(m1) +
|
56
56
|
" - " +
|
57
|
-
DateUtils.getMonthName((m1 % 12) + 1)
|
58
|
-
)
|
57
|
+
DateUtils.getMonthName((m1 % 12) + 1),
|
58
|
+
),
|
59
59
|
);
|
60
60
|
}
|
61
61
|
return XHTML.wrap("ol", XHTML.arrayToLI(links));
|
@@ -83,7 +83,7 @@ class PageListFlowerTime extends EBookPage {
|
|
83
83
|
|
84
84
|
/**
|
85
85
|
* @param {string} outputDir
|
86
|
-
* @param {Taxa} taxa
|
86
|
+
* @param {import("../../taxa.js").Taxa} taxa
|
87
87
|
* @param {number} month
|
88
88
|
*/
|
89
89
|
constructor(outputDir, taxa, month) {
|
@@ -92,7 +92,7 @@ class PageListFlowerTime extends EBookPage {
|
|
92
92
|
"Flowering in " +
|
93
93
|
DateUtils.getMonthName(month) +
|
94
94
|
" - " +
|
95
|
-
DateUtils.getMonthName((month % 12) + 1)
|
95
|
+
DateUtils.getMonthName((month % 12) + 1),
|
96
96
|
);
|
97
97
|
this.#taxa = taxa;
|
98
98
|
this.#m1 = month;
|
@@ -13,7 +13,7 @@ class TaxonPage extends EBookPage {
|
|
13
13
|
|
14
14
|
/**
|
15
15
|
* @param {string} outputDir
|
16
|
-
* @param {Taxon} taxon
|
16
|
+
* @param {import("../../taxon.js").Taxon} taxon
|
17
17
|
* @param {Images} images
|
18
18
|
*/
|
19
19
|
constructor(outputDir, taxon, images) {
|
@@ -69,7 +69,7 @@ class TaxonPage extends EBookPage {
|
|
69
69
|
src: `i/${this.#images.getCompressedImageName(photo)}`,
|
70
70
|
style: "max-width:" + dimensions.width + "px",
|
71
71
|
});
|
72
|
-
const caption =
|
72
|
+
const caption = photo.getAttribution();
|
73
73
|
if (caption) {
|
74
74
|
img += XHTML.textElement("figcaption", caption);
|
75
75
|
}
|
@@ -7,7 +7,7 @@ class TOCPage extends EBookPage {
|
|
7
7
|
|
8
8
|
/**
|
9
9
|
* @param {string} outputDir
|
10
|
-
* @param {Taxa} taxa
|
10
|
+
* @param {import("../../taxa.js").Taxa} taxa
|
11
11
|
*/
|
12
12
|
constructor(outputDir, taxa) {
|
13
13
|
super(outputDir + "/toc.xhtml", "Table of Contents");
|
@@ -37,7 +37,7 @@ class TOCPage extends EBookPage {
|
|
37
37
|
for (const color of this.#taxa.getFlowerColors()) {
|
38
38
|
const colorName = color.getColorName();
|
39
39
|
links.push(
|
40
|
-
XHTML.getLink("list_fc_" + colorName + ".html", colorName)
|
40
|
+
XHTML.getLink("list_fc_" + colorName + ".html", colorName),
|
41
41
|
);
|
42
42
|
}
|
43
43
|
return html + XHTML.wrap("ol", XHTML.arrayToLI(links));
|
package/lib/ebook/plantbook.js
CHANGED
@@ -17,8 +17,8 @@ class PlantBook extends EBook {
|
|
17
17
|
|
18
18
|
/**
|
19
19
|
* @param {string} outputDir
|
20
|
-
* @param {Config} config
|
21
|
-
* @param {Taxa} taxa
|
20
|
+
* @param {import("../config.js").Config} config
|
21
|
+
* @param {import("../taxa.js").Taxa} taxa
|
22
22
|
*/
|
23
23
|
constructor(outputDir, config, taxa) {
|
24
24
|
super(
|
@@ -168,7 +168,7 @@ class PlantBook extends EBook {
|
|
168
168
|
}
|
169
169
|
|
170
170
|
/**
|
171
|
-
* @param {Config} config
|
171
|
+
* @param {import("../config.js").Config} config
|
172
172
|
* @param {string} name
|
173
173
|
* @returns {string}
|
174
174
|
*/
|
package/lib/externalsites.js
CHANGED
@@ -1,27 +1,32 @@
|
|
1
|
+
/** @typedef {{
|
2
|
+
coords?: [number, number];
|
3
|
+
project_id?: string;
|
4
|
+
subview?: "grid" | "list" | "map";
|
5
|
+
taxon_id?: string;
|
6
|
+
}} InatObsOptions */
|
7
|
+
|
1
8
|
class ExternalSites {
|
2
9
|
/**
|
3
10
|
* @param {InatObsOptions} options
|
4
11
|
*/
|
5
12
|
static getInatObsLink(options) {
|
6
13
|
const url = new URL(
|
7
|
-
"https://www.inaturalist.org/observations?subview=map"
|
14
|
+
"https://www.inaturalist.org/observations?subview=map",
|
8
15
|
);
|
9
16
|
|
17
|
+
if (options.coords) {
|
18
|
+
const delta = 0.1;
|
19
|
+
const params = url.searchParams;
|
20
|
+
const lat = options.coords[1];
|
21
|
+
const lng = options.coords[0];
|
22
|
+
params.set("nelat", (lat + delta).toString());
|
23
|
+
params.set("swlat", (lat - delta).toString());
|
24
|
+
params.set("nelng", (lng + delta).toString());
|
25
|
+
params.set("swlng", (lng - delta).toString());
|
26
|
+
}
|
27
|
+
|
10
28
|
for (const [k, v] of Object.entries(options)) {
|
11
29
|
switch (k) {
|
12
|
-
case "coords": {
|
13
|
-
const delta = 0.1;
|
14
|
-
const params = url.searchParams;
|
15
|
-
/** @type {number} */
|
16
|
-
const lat = v[1];
|
17
|
-
/** @type {number} */
|
18
|
-
const lng = v[0];
|
19
|
-
params.set("nelat", (lat + delta).toString());
|
20
|
-
params.set("swlat", (lat - delta).toString());
|
21
|
-
params.set("nelng", (lng + delta).toString());
|
22
|
-
params.set("swlng", (lng - delta).toString());
|
23
|
-
break;
|
24
|
-
}
|
25
30
|
case "created_d1":
|
26
31
|
case "list_id":
|
27
32
|
case "place_id":
|
@@ -29,7 +34,7 @@ class ExternalSites {
|
|
29
34
|
case "subview":
|
30
35
|
case "taxon_id":
|
31
36
|
case "taxon_name":
|
32
|
-
if (v) {
|
37
|
+
if (typeof v === "string") {
|
33
38
|
url.searchParams.set(k, v);
|
34
39
|
}
|
35
40
|
break;
|
package/lib/families.js
CHANGED
@@ -5,7 +5,7 @@ import { Files } from "./files.js";
|
|
5
5
|
import { Config } from "./config.js";
|
6
6
|
import { HTMLTaxon } from "./htmltaxon.js";
|
7
7
|
|
8
|
-
class Family {
|
8
|
+
export class Family {
|
9
9
|
#name;
|
10
10
|
#data;
|
11
11
|
|
@@ -19,7 +19,7 @@ class Family {
|
|
19
19
|
}
|
20
20
|
|
21
21
|
/**
|
22
|
-
* @param {Taxon} taxon
|
22
|
+
* @param {import("./taxon.js").Taxon} taxon
|
23
23
|
*/
|
24
24
|
addTaxon(taxon) {
|
25
25
|
if (!this.#data.taxa) {
|
@@ -68,7 +68,7 @@ class Families {
|
|
68
68
|
|
69
69
|
getFamilies() {
|
70
70
|
return Object.values(this.#families).sort((a, b) =>
|
71
|
-
a.getName().localeCompare(b.getName())
|
71
|
+
a.getName().localeCompare(b.getName()),
|
72
72
|
);
|
73
73
|
}
|
74
74
|
|
@@ -81,7 +81,7 @@ class Families {
|
|
81
81
|
|
82
82
|
/**
|
83
83
|
* @param {string} outputDir
|
84
|
-
* @param {
|
84
|
+
* @param {import("./htmltaxon.js").TaxaColDef[]} [taxaColumns]
|
85
85
|
*/
|
86
86
|
renderPages(outputDir, taxaColumns) {
|
87
87
|
new PageFamilyList(outputDir, this.#families).render(taxaColumns);
|
@@ -109,7 +109,7 @@ class PageFamilyList extends GenericPage {
|
|
109
109
|
}
|
110
110
|
|
111
111
|
/**
|
112
|
-
* @param {
|
112
|
+
* @param {import("./htmltaxon.js").TaxaColDef[]} [taxaColumns]
|
113
113
|
*/
|
114
114
|
render(taxaColumns) {
|
115
115
|
let html = this.getDefaultIntro();
|
@@ -121,13 +121,13 @@ class PageFamilyList extends GenericPage {
|
|
121
121
|
|
122
122
|
// Render the section page.
|
123
123
|
new PageSection(this.getOutputDir(), name, taxa).render(
|
124
|
-
taxaColumns
|
124
|
+
taxaColumns,
|
125
125
|
);
|
126
126
|
|
127
127
|
// Render the link.
|
128
128
|
const href = "./" + name + ".html";
|
129
129
|
sectionLinks.push(
|
130
|
-
HTML.getLink(href, name) + " (" + taxa.length + ")"
|
130
|
+
HTML.getLink(href, name) + " (" + taxa.length + ")",
|
131
131
|
);
|
132
132
|
}
|
133
133
|
html += HTML.wrap("ul", HTML.arrayToLI(sectionLinks), {
|
@@ -150,7 +150,7 @@ class PageFamilyList extends GenericPage {
|
|
150
150
|
}
|
151
151
|
let cols = HTML.wrap(
|
152
152
|
"td",
|
153
|
-
HTML.getLink("./" + family.getFileName(), family.getName())
|
153
|
+
HTML.getLink("./" + family.getFileName(), family.getName()),
|
154
154
|
);
|
155
155
|
cols += HTML.wrap("td", taxa.length, { class: "right" });
|
156
156
|
html += HTML.wrap("tr", cols);
|
@@ -176,7 +176,7 @@ class PageFamily extends GenericPage {
|
|
176
176
|
}
|
177
177
|
|
178
178
|
/**
|
179
|
-
* @param {
|
179
|
+
* @param {import("./htmltaxon.js").TaxaColDef[]} [columns]
|
180
180
|
*/
|
181
181
|
render(columns) {
|
182
182
|
let html = this.getDefaultIntro();
|
@@ -184,7 +184,7 @@ class PageFamily extends GenericPage {
|
|
184
184
|
html += HTML.wrap(
|
185
185
|
"div",
|
186
186
|
Jepson.getEFloraLink(this.#family.getJepsonID()),
|
187
|
-
{ class: "section" }
|
187
|
+
{ class: "section" },
|
188
188
|
);
|
189
189
|
|
190
190
|
html += HTMLTaxon.getTaxaTable(this.#family.getTaxa(), columns);
|
@@ -199,7 +199,7 @@ class PageSection extends GenericPage {
|
|
199
199
|
/**
|
200
200
|
* @param {string} outputDir
|
201
201
|
* @param {string} name
|
202
|
-
* @param {Taxon[]} taxa
|
202
|
+
* @param {import("./taxon.js").Taxon[]} taxa
|
203
203
|
*/
|
204
204
|
constructor(outputDir, name, taxa) {
|
205
205
|
super(outputDir, name, name);
|
@@ -207,7 +207,7 @@ class PageSection extends GenericPage {
|
|
207
207
|
}
|
208
208
|
|
209
209
|
/**
|
210
|
-
* @param {
|
210
|
+
* @param {import("./htmltaxon.js").TaxaColDef[]} [columns]
|
211
211
|
*/
|
212
212
|
render(columns) {
|
213
213
|
let html = this.getDefaultIntro();
|
@@ -219,12 +219,12 @@ class PageSection extends GenericPage {
|
|
219
219
|
}
|
220
220
|
|
221
221
|
class Sections {
|
222
|
-
/** @type {Object<string,Taxon[]>} */
|
222
|
+
/** @type {Object<string,import("./taxon.js").Taxon[]>} */
|
223
223
|
static #sections = {};
|
224
224
|
|
225
225
|
/**
|
226
226
|
* @param {string} name
|
227
|
-
* @param {Taxon} taxon
|
227
|
+
* @param {import("./taxon.js").Taxon} taxon
|
228
228
|
*/
|
229
229
|
static addTaxon(name, taxon) {
|
230
230
|
let section = this.#sections[name];
|
package/lib/flowercolor.js
CHANGED
@@ -3,7 +3,7 @@ import { TextUtils } from "./textutils.js";
|
|
3
3
|
class FlowerColor {
|
4
4
|
#colorName;
|
5
5
|
#colorCode;
|
6
|
-
/** @type {Taxon[]} */
|
6
|
+
/** @type {import("./taxon.js").Taxon[]} */
|
7
7
|
#taxa = [];
|
8
8
|
|
9
9
|
/**
|
@@ -16,7 +16,7 @@ class FlowerColor {
|
|
16
16
|
}
|
17
17
|
|
18
18
|
/**
|
19
|
-
* @param {Taxon} taxon
|
19
|
+
* @param {import("./taxon.js").Taxon} taxon
|
20
20
|
*/
|
21
21
|
addTaxon(taxon) {
|
22
22
|
this.#taxa.push(taxon);
|