@jlpereira/taxonpages-panel-specimen-records
v0.0.1
Published
A TaxonPages panel that displays specimen records for a given taxon
Readme
PanelSpecimenRecords
A TaxonPages panel that displays specimen records for a given OTU. It fetches Darwin Core records from the TaxonWorks inventory endpoint and splits them into two cards — Type specimens and Specimen records — each with locality, coordinates, depository, collector, and associated media, plus an integrated image viewer.
Panel ID: panel:specimen-records
Installation
Via npm
npm install @jlpereira/taxonpages-specimen-recordsManual
Copy the PanelSpecimenRecords/ folder into your project's panels/ directory:
panels/
PanelSpecimenRecords/Usage
Add the panel to your config/taxa_page.yml:
taxa_page:
overview:
panels:
- - - panel:specimen-recordsHow it works
Fetching records — Requests
/otus/{otuId}/inventory/dwc.jsonand keeps records wheredwc_occurrence_object_typeisCollectionObject.Splitting — Records with a
typeStatusare rendered in the Type specimens card; records without one are rendered in the Specimen records card. The type-specimens card is hidden entirely when there are no type specimens.Sorting — Records with
associatedMediaare moved to the top of the list, so specimens with images are shown first.Media resolution — For each record with
associatedMedia, the panel splits the pipe-separated URLs and fetches each image extended withattribution,depictions, andsourcedata in parallel.Label composition — Each specimen is summarized as a single line built from:
- Count and sex —
"{individualCount} {sex}"ifsexis present, otherwise"{individualCount} specimen(s)". - Depository —
institutionCode, rendered as a link toinstitutionIDwhen available. - Catalog number —
catalogNumberif present. - Locality —
country,stateProvince,county, andverbatimLocalityjoined with commas. - Coordinates —
verbatimCoordinatesshown in parentheses. - Collector —
"Col. {recordedBy}"when present.
Example:
1 male; MACN; 12345; Argentina, Misiones, Iguazú; (-25.6, -54.5); Col. J. Smith.- Count and sex —
Display — Each card renders the first
10records by default. When more exist, a... Show all ... (N)toggle reveals the rest. Each record shows itstypeStatus, the composed label, and a thumbnail gallery for its images.Image viewer — Clicking a thumbnail opens a full-screen viewer with next/previous navigation across all images of the selected specimen.
Project structure
PanelSpecimenRecords/
├── main.js # Panel entry point and registration
├── PanelSpecimenRecords.vue # Main panel component
└── components/
├── ListSpecimens.vue # Non-type specimen list with gallery
└── ListTypeSpecimens.vue # Type specimen list with gallery