@ca-plant-list/ca-plant-list 0.4.17 → 0.4.19

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/taxa.csv CHANGED
@@ -227,10 +227,10 @@ Bolboschoenus maritimus subsp. paludosus,saltmarsh bulrush,N,49436,10796,79646,P
227
227
  Bolboschoenus robustus,seacoast bulrush,N,77450,10798,75840,Big Bulrush
228
228
  Bowlesia incana,,N,15999,1133,56822,Hoary Bowlesia
229
229
  Brachypodium distachyon,false-brome,X,16042,1137,57158
230
- Brassica juncea,India mustard,X,16072,1142,64241
231
- Brassica nigra,black mustard,X,16079,1144,1555489,,,yellow
232
- Brassica oleracea,cabbage,X,16080,9040,54516
233
- Brassica rapa,field mustard,X,16081,1145,53271,,,yellow
230
+ Brassica juncea,India mustard,X,16072,1142,64241,,"annual,perennial",yellow,5,9
231
+ Brassica nigra,black mustard,X,16079,1144,1555489,,annual,yellow,4,9
232
+ Brassica oleracea,cabbage,X,16080,9040,54516,,"biennial,perennial",yellow,5,8
233
+ Brassica rapa,field mustard,X,16081,1145,53271,,"annual,biennial",yellow,1,5
234
234
  Brickellia californica,California brickelbush,N,1794,1152,58803,Brickell Bush
235
235
  Briza maxima,quaking grass,X,16135,1165,57157
236
236
  Briza minor,little quaking grass,X,16137,1166,57162
@@ -1075,11 +1075,11 @@ Linanthus dichotomus subsp. meridianus,,N,51287,10625,80001
1075
1075
  Linanthus pungens subsp. pulchriflorus,granite prickly phlox,N,98684,14586,861790,,perennial,"white,pink",5,8
1076
1076
  Linum bienne,,X,31144,4906,55679
1077
1077
  Linum lewisii var. lewisii,blue flax,N,60912,4910,60495,Prairie Flax
1078
- Lithophragma affine,woodland star,N,31236,4922,50803,San Francisco Woodland Star,,white,3,4
1079
- Lithophragma bolanderi,,N,31238,4923,77787,Bolander's Woodland Star
1080
- Lithophragma cymbalaria,,N,31241,4925,58323,Mission Woodland Star
1081
- Lithophragma heterophyllum,hill starflower,N,31244,4927,53124,Hillside Woodland Star,,white
1082
- Lithophragma parviflorum var. parviflorum,,N,60952,4930,81027,Smallflower Woodland-star,,"white,pink",3,7
1078
+ Lithophragma affine,woodland star,N,31236,4922,50803,San Francisco Woodland Star,perennial,white,3,4
1079
+ Lithophragma bolanderi,,N,31238,4923,77787,Bolander's Woodland Star,perennial,white,2,7
1080
+ Lithophragma cymbalaria,,N,31241,4925,58323,Mission Woodland Star,perennial,white,3,5
1081
+ Lithophragma heterophyllum,hill starflower,N,31244,4927,53124,Hillside Woodland Star,perennial,white,2,6
1082
+ Lithophragma parviflorum var. parviflorum,,N,60952,4930,81027,Smallflower Woodland-star,perennial,"white,pink",3,7
1083
1083
  Lobularia maritima,sweet alyssum,X,31347,4939,56992
1084
1084
  Logfia filaginoides,herba impia,N,81847,10960,64254,California Cottonrose,annual,red,2,5
1085
1085
  Logfia gallica,,X,31363,9521,56949,,annual,"brown,yellow",3,7
@@ -1285,9 +1285,10 @@ Osmorhiza berteroi,wood cicely,N,35560,10164,53166,Sweet Cicely
1285
1285
  Osmorhiza brachypoda,California cicely,N,35564,6000,58793,California Sweetcicely
1286
1286
  Oxalis corniculata,creeping wood sorrel,X,35609,6010,53168,,,yellow,1,12
1287
1287
  Oxalis incarnata,crimson wood sorrel,X,35636,6012,61776,,,"white,pink",3,6
1288
- Oxalis oregana,redwood sorrel,N,35641,6015,47757,Redwood Sorrel,,"white,pink",2,8
1288
+ Oxalis oregana,Oregon wood sorrel,N,35641,6015,47757,Redwood Sorrel,perennial,white,2,10
1289
1289
  Oxalis pes-caprae,Bermuda-buttercup,X,35642,6016,53169,,,yellow,1,5
1290
1290
  Oxalis pilosa,hairy wood sorrel,N,35601,11895,78300,Radishroot Woodsorrel,,yellow,2,9
1291
+ Oxalis smalliana,redwood sorrel,N,8615,14752,1464017,,perennial,"white,pink,blue",1,8
1291
1292
  Packera breweri,Brewer groundsel,N,77383,9613,56983,Groundsel
1292
1293
  Panicum acuminatum,Pacific panic grass,N,35923,6044,128949,Western Panicgrass
1293
1294
  Panicum capillare,witchgrass,N,36094,6048,78337,Witch Grass
@@ -1563,17 +1564,17 @@ Rubus pensilvanicus,,X,42114,7202,78894
1563
1564
  Rubus spectabilis,,N,42231,7203,47543,Salmon Berry
1564
1565
  Rubus ulmifolius var. anoplothyrsus,,X,91783,11997,81352
1565
1566
  Rubus ursinus,California blackberry,N,42267,7206,53445,California Blackberry
1566
- Rumex acetosella,sheep sorrel,X,42362,7213,53195
1567
- Rumex californicus,,N,42423,11058,78901,California Dock
1568
- Rumex conglomeratus,green dock,X,42385,7214,57215
1569
- Rumex crassus,,N,42422,11059,61087,Willow Dock
1570
- Rumex crispus,curly dock,X,42386,7215,53197
1571
- Rumex fueginus,golden dock,N,42405,10679,78903,Golden Dock
1572
- Rumex obtusifolius,bitter dock,X,42409,7220,63371
1573
- Rumex occidentalis,western dock,N,42376,7221,61086,Western Dock
1574
- Rumex pulcher,fiddle dock,X,42419,7224,60232
1575
- Rumex salicifolius,willow dock,N,42421,7225,60233,Willow Dock
1576
- Rumex transitorius,,N,42429,11999,78910
1567
+ Rumex acetosella,sheep sorrel,X,42362,7213,53195,,perennial,,4,7
1568
+ Rumex californicus,,N,42423,11058,78901,California Dock,perennial,,5,9
1569
+ Rumex conglomeratus,green dock,X,42385,7214,57215,,perennial,,5,8
1570
+ Rumex crassus,,N,42422,11059,61087,Willow Dock,perennial,,2,7
1571
+ Rumex crispus,curly dock,X,42386,7215,53197,,perennial,,1,12
1572
+ Rumex fueginus,golden dock,N,42405,10679,78903,Golden Dock,annual,,5,8
1573
+ Rumex obtusifolius,bitter dock,X,42409,7220,63371,,perennial,,5,9
1574
+ Rumex occidentalis,western dock,N,42376,7221,61086,Western Dock,perennial,,5,8
1575
+ Rumex pulcher,fiddle dock,X,42419,7224,60232,,perennial,,5,9
1576
+ Rumex salicifolius,willow dock,N,42421,7225,60233,Willow Dock,perennial,,5,7
1577
+ Rumex transitorius,,N,42429,11999,78910,,perennial,,4,6
1577
1578
  Rupertia physodes,California tea,N,42446,7236,53198,Common Rupertia
1578
1579
  Ruppia cirrhosa,ditch-grass,N,42449,7238,61089,Spiral Ditchgrass
1579
1580
  Ruppia maritima,ditch-grass,N,42451,7239,61090,Beaked Tasselweed
@@ -0,0 +1 @@
1
+ Upper leaves not clasping stem. Usually hairy.
@@ -0,0 +1 @@
1
+ Upper leaves clasping stem. Usually not hairy.
@@ -0,0 +1,3 @@
1
+ ## Resources
2
+
3
+ - Brinegar, Chris. (2023). [THE TRUE REDWOOD SORREL: REINSTATEMENT OF OXALIS SMALLIANA (OXALIDACEAE) AS A SPECIES SEPARATE FROM OXALIS OREGANA](https://www.researchgate.net/publication/369602947_THE_TRUE_REDWOOD_SORREL_REINSTATEMENT_OF_OXALIS_SMALLIANA_OXALIDACEAE_AS_A_SPECIES_SEPARATE_FROM_OXALIS_OREGANA). Madroño. 69. 10.3120/0024-9637-69.4.304.
@@ -0,0 +1,3 @@
1
+ ## Resources
2
+
3
+ - Brinegar, Chris. (2023). [THE TRUE REDWOOD SORREL: REINSTATEMENT OF OXALIS SMALLIANA (OXALIDACEAE) AS A SPECIES SEPARATE FROM OXALIS OREGANA](https://www.researchgate.net/publication/369602947_THE_TRUE_REDWOOD_SORREL_REINSTATEMENT_OF_OXALIS_SMALLIANA_OXALIDACEAE_AS_A_SPECIES_SEPARATE_FROM_OXALIS_OREGANA). Madroño. 69. 10.3120/0024-9637-69.4.304.
@@ -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
+ Leaves with lobes at base. Plants unisexual.
@@ -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 {TaxaCol[]} [familyCols]
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 = [];
package/lib/csv.js CHANGED
@@ -85,9 +85,10 @@ class CSV {
85
85
  }
86
86
 
87
87
  /**
88
+ * @template T
88
89
  * @param {string} fileName
89
90
  * @param {string} [delimiter]
90
- * @returns {{headers:string[],data:Object<string,any>[]}}
91
+ * @returns {{headers:string[],data:T[]}}
91
92
  */
92
93
  static readFileAndHeaders(fileName, delimiter) {
93
94
  let headers;
@@ -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
@@ -8,7 +8,7 @@ class PageListSpecies extends EBookPage {
8
8
  /**
9
9
  *
10
10
  * @param {string} outputDir
11
- * @param {Taxon[]} taxa
11
+ * @param {import("../../taxon.js").Taxon[]} taxa
12
12
  * @param {string} filename
13
13
  * @param {string} title
14
14
  */
@@ -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 = `${photo.rights === "CC0" ? "By" : "(c)"} ${photo.rightsHolder} ${photo.rights && `(${photo.rights})`}`;
72
+ const caption = photo.getAttribution();
73
73
  if (caption) {
74
74
  img += XHTML.textElement("figcaption", caption);
75
75
  }
@@ -18,7 +18,7 @@ class PlantBook extends EBook {
18
18
  /**
19
19
  * @param {string} outputDir
20
20
  * @param {Config} config
21
- * @param {Taxa} taxa
21
+ * @param {import("../taxa.js").Taxa} taxa
22
22
  */
23
23
  constructor(outputDir, config, taxa) {
24
24
  super(
package/lib/exceptions.js CHANGED
@@ -30,6 +30,9 @@ class Exceptions {
30
30
  }
31
31
  }
32
32
 
33
+ /**
34
+ * @returns {[string,Object<string,Object<string,string>>][]}
35
+ */
33
36
  getExceptions() {
34
37
  return Object.entries(this.#exceptions);
35
38
  }
package/lib/families.js CHANGED
@@ -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 {TaxaCol[]} taxaColumns
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 {TaxaCol[]} taxaColumns
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 {TaxaCol[]} columns
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 {TaxaCol[]} [columns]
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/genera.js CHANGED
@@ -15,7 +15,7 @@ class Genera {
15
15
  }
16
16
 
17
17
  /**
18
- * @param {Taxon} taxon
18
+ * @param {import("./taxon.js").Taxon} taxon
19
19
  */
20
20
  addTaxon(taxon) {
21
21
  const genusName = taxon.getGenusName();
package/lib/htmltaxon.js CHANGED
@@ -6,7 +6,15 @@ import { RarePlants } from "./rareplants.js";
6
6
  import { TextUtils } from "./textutils.js";
7
7
 
8
8
  /**
9
- * @type {Record<string,{title:string,data:function (Taxon):string}>}
9
+ * @typedef {{
10
+ class?: string;
11
+ data: (taxon: import("./taxon.js").Taxon) => string;
12
+ title: string;
13
+ }} TaxaColDef
14
+ */
15
+
16
+ /**
17
+ * @type {Record<string,TaxaColDef>}
10
18
  */
11
19
  const TAXA_LIST_COLS = {
12
20
  CESA: {
@@ -39,6 +47,7 @@ const TAXA_LIST_COLS = {
39
47
  },
40
48
  };
41
49
 
50
+ /** @type {TaxaColDef[]} */
42
51
  const DEFAULT_TAXA_COLUMNS = [
43
52
  TAXA_LIST_COLS.SPECIES,
44
53
  TAXA_LIST_COLS.COMMON_NAME,
@@ -46,7 +55,7 @@ const DEFAULT_TAXA_COLUMNS = [
46
55
 
47
56
  class HTMLTaxon {
48
57
  /**
49
- * @param {Taxon} taxon
58
+ * @param {import("./taxon.js").Taxon} taxon
50
59
  * @returns {string|undefined}
51
60
  */
52
61
  static getCalscapeLink(taxon) {
@@ -88,7 +97,7 @@ class HTMLTaxon {
88
97
  }
89
98
 
90
99
  /**
91
- * @param {Taxon} taxon
100
+ * @param {import("./taxon.js").Taxon} taxon
92
101
  * @param {string} classNames
93
102
  * @param {boolean} [includeColorLink=true]
94
103
  */
@@ -129,7 +138,7 @@ class HTMLTaxon {
129
138
  }
130
139
 
131
140
  /**
132
- * @param {Taxon} taxon
141
+ * @param {import("./taxon.js").Taxon} taxon
133
142
  * @returns {string}
134
143
  */
135
144
  static getFooterHTML(taxon) {
@@ -142,7 +151,7 @@ class HTMLTaxon {
142
151
  }
143
152
 
144
153
  /**
145
- * @param {Taxon} taxon
154
+ * @param {import("./taxon.js").Taxon} taxon
146
155
  */
147
156
  static getLink(taxon) {
148
157
  return (
@@ -182,8 +191,8 @@ class HTMLTaxon {
182
191
  }
183
192
 
184
193
  /**
185
- * @param {Taxon[]} taxa
186
- * @param {TaxaCol[]} [columns]
194
+ * @param {import("./taxon.js").Taxon[]} taxa
195
+ * @param {TaxaColDef[]} [columns]
187
196
  */
188
197
  static getTaxaTable(taxa, columns = DEFAULT_TAXA_COLUMNS) {
189
198
  let html = "<table><thead>";
package/lib/index.d.ts CHANGED
@@ -24,6 +24,13 @@ export class ErrorLog {
24
24
 
25
25
  export class Exceptions {
26
26
  constructor(dataDir: string);
27
+ getExceptions(): [string, Record<string, Record<string, string>>][];
28
+ getValue(
29
+ name: string,
30
+ cat: string,
31
+ subcat: string,
32
+ defaultValue?: string | undefined,
33
+ ): string | undefined;
27
34
  hasException(name: string, cat: string, subcat: string): boolean;
28
35
  }
29
36
 
@@ -72,6 +79,16 @@ export class Jekyll {
72
79
  static include(fileName: string): string;
73
80
  }
74
81
 
82
+ type PhotoRights = "CC0" | "CC BY" | "CC BY-NC" | "C" | null;
83
+
84
+ export class Photo {
85
+ getAttribution(): string;
86
+ getExt(): string;
87
+ getId(): number;
88
+ getSourceUrl(): string;
89
+ getUrl(): string;
90
+ }
91
+
75
92
  export class Program {
76
93
  static getIncludeList(dataDir: string): string[];
77
94
  static getProgram(): Command;
@@ -94,13 +111,20 @@ export class Taxon {
94
111
  getBaseFileName(): string;
95
112
  getCalfloraID(): string;
96
113
  getCalfloraTaxonLink(): string;
114
+ getCESA(): string | undefined;
115
+ getCNDDBRank(): string | undefined;
97
116
  getCommonNames(): string[];
98
117
  getFamily(): Family;
118
+ getFESA(): string | undefined;
99
119
  getGenus(): Genus;
100
120
  getGenusName(): string;
121
+ getGlobalRank(): string | undefined;
101
122
  getINatID(): string;
102
123
  getINatTaxonLink(): string;
124
+ getJepsonID(): string;
103
125
  getName(): string;
126
+ getPhotos(): Photo[];
127
+ getRPIRankAndThreat(): string;
104
128
  getRPITaxonLink(): string;
105
129
  getSynonyms(): string[];
106
130
  }