col-browser 2.6.5 → 2.7.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 CHANGED
@@ -282,12 +282,13 @@ A [browsable taxonomic tree](https://www.catalogueoflife.org/data/browse). Compo
282
282
  1. `datasetKey` - the dataset key from the [Catalogue of Life ChecklistBank](https://www.checklistbank.org/).
283
283
  2. `expandedTaxonKey` - (Optional, controlled) which taxon the tree is expanded down to. Pair with `onExpandedTaxonKeyChange` to keep host state in sync.
284
284
  3. `onExpandedTaxonKeyChange` - (Optional) called with the new key when the user expands a different taxon.
285
- 4. `defaultTaxonKey` - (Optional, uncontrolled fallback) initial taxon to expand to when `expandedTaxonKey` is not provided. Nothing is expanded unless one of these is set — pass a root id to open it on load, e.g. `defaultTaxonKey="CS5HF"` opens Eukaryota in current Catalogue of Life releases.
285
+ 4. `defaultTaxonKey` - (Optional, uncontrolled fallback) initial taxon to expand to when `expandedTaxonKey` is not provided. Nothing is expanded unless one of these is set — pass a root id to open it on load, e.g. `defaultTaxonKey="CS5HF"` opens Eukaryota in current Catalogue of Life releases. The page scrolls to an `expandedTaxonKey` on load, but not to a `defaultTaxonKey`.
286
286
  5. `showTreeOptions` - (Optional) show toggles for extinct taxa and info (estimates, providers etc).
287
287
  6. `linkToSpeciesPage` - (Optional) when the searchbox finds a species or infraspecific taxon, jump directly to the taxon page rather than opening the tree.
288
288
  7. `citation` - (Optional) either `"top"` or `"bottom"`; include the necessary dataset citation above or below the tree component.
289
289
  8. `type` - (Optional) e.g. `type="project"` will show info about contributing sources on the tree nodes.
290
290
  9. `insertPlaceholder` - (Optional, defaults to `true`) when true, the API virtually groups children of lower ranks into a "Not assigned" placeholder node for a more compact browsing experience. Pass `false` to disable.
291
+ 10. `autoFocus` - (Optional, defaults to `true`) focus the search box when the tree loads. Pass `false` when the tree is not the main thing on the page, so it does not take the focus or scroll the page to itself.
291
292
 
292
293
  ```html
293
294
  <div id="tree"></div> <!-- Dom element for the tree to attach to -->
@@ -444,11 +445,11 @@ ColBrowser.ReactDOM.createRoot(document.querySelector('#taxon')).render(
444
445
 
445
446
  ### ColBrowser.TaxonBreakdown
446
447
 
447
- A Highcharts pie chart breaking the accepted children of a taxon down by rank, with click-to-drill into each child. Rendered inside the Taxon page but also exported standalone for use on dashboards or summary pages. Component-specific props:
448
+ A Highcharts pie chart breaking the accepted children of a taxon down by rank, with click-to-drill into each child. The API decides what the slices count (species, or genera where genera outnumber species more than twofold) and which ranks form the rings, and adds a "Not assigned" slice for what sits in no child. Rendered inside the Taxon page but also exported standalone for use on dashboards or summary pages. Component-specific props:
448
449
 
449
450
  1. `datasetKey` - the dataset key from the [Catalogue of Life ChecklistBank](https://www.checklistbank.org/).
450
- 2. `taxonId` - (controlled) the taxon to break down. The chart loads the taxon, its rank vocabulary, and the dataset citation itself, so no preloading is needed.
451
- 3. `level` - (Optional, `1` or `2`, default `1`) controls how deep the breakdown nests. `1` renders a single-ring donut (direct children of `taxonId`). `2` renders a two-ring donut adding grandchildren. The value is passed through as the `level` query parameter on the `/dataset/{key}/taxon/{id}/breakdown` API.
451
+ 2. `taxonId` - (controlled) the taxon to break down. The chart loads the taxon and the dataset citation itself, so no preloading is needed.
452
+ 3. `level` - (Optional, `1` or `2`, default `1`) the most rings to draw. `1` renders a single-ring donut (direct children of `taxonId`). `2` adds grandchildren as a second ring, unless the API decides that ring is not worth drawing (it would be the counted rank itself, or hold more than 1000 taxa). The value is passed through as the `level` query parameter on the `/dataset/{key}/taxon/{id}/breakdown` API, which returns a `TaxonBreakdown` object since ChecklistBank API 2026-11; older API versions are not supported.
452
453
  4. `showLevelSwitch` - (Optional, default `false`) when `true`, render an in-chart antd `Switch` that lets the user toggle between level 1 and 2 at runtime.
453
454
  5. `darkMode` - (Optional) when `true`, use the dark-mode outer-ring gap colour. Falls back to `prefers-color-scheme` when unset.
454
455