The scored components: one registry of keys and labels
Source:R/components.R
components_registry.RdThe scored components of a release (the seven species categories plus the
environmental primprod, and the legacy v1-v7 other bucket) are named in ONE
table, components.csv, read by this package, the app bundle and the docs, so a
key or a label is spelled in one place. Columns: key (the sp_cat /
extrisk_{key} / primprod spelling – never changes), label (the v11 display
name), short, order (display order), colour (the Atlas categorical palette,
--cat-* in its tokens.css; may be empty), icon (may be empty), kind
("species" or "environment") and label_v10 (the labels v1-v10 published).
Value
a tibble of the components, sorted by order. Errors on duplicate keys or
orders, a kind outside species/environment, an empty key, label,
short or label_v10, or a missing column.
Details
The source of truth is workflows/data/components.csv; the copy in
inst/extdata/components.csv must be identical (test-components.R compares the
two when the workflows checkout sits beside this package).
Examples
components_registry()
#> # A tibble: 9 × 8
#> key label short order colour icon kind label_v10
#> <chr> <chr> <chr> <int> <chr> <chr> <chr> <chr>
#> 1 bird Seabirds Seabirds 1 #7cc7… "" spec… Seabirds
#> 2 coral Corals Corals 2 #f08a… "" spec… Corals
#> 3 fish Fish Fish 3 #9f81… "" spec… Fish
#> 4 invertebrate Invertebrates Inverts 4 #e79e… "" spec… Inverteb…
#> 5 mammal Marine Mammals Mammals 5 #e6c7… "" spec… Marine M…
#> 6 primary_producer Flora Flora 6 #4cc9… "" spec… Primary …
#> 7 turtle Sea Turtles Turtles 7 #a1c7… "" spec… Sea Turt…
#> 8 primprod Productivity Productivi… 8 #4cc9… "" envi… Primary …
#> 9 other Other Species Other 9 #b6bf… "" spec… Other Sp…