Skip to content

Improve homepage dataset summary and searchable preview#33

Open
ANAMASGARD wants to merge 1 commit into
PecanProject:mainfrom
ANAMASGARD:fix/26-homepage-dataset-summary
Open

Improve homepage dataset summary and searchable preview#33
ANAMASGARD wants to merge 1 commit into
PecanProject:mainfrom
ANAMASGARD:fix/26-homepage-dataset-summary

Conversation

@ANAMASGARD

Copy link
Copy Markdown

Description

Improves the homepage so its summary reflects records represented in traitsview, rather than counting every row in the full species, sites, and citations tables.

This PR:

  • replaces the generic Metric/Value table with five observation-backed summary cards;
  • renames unclear metrics using human-friendly labels;
  • adds a searchable and paginated observation preview;
  • removes IDs, checked, result_type, notes, timestamps, and other internal fields from the preview;
  • replaces the bioenergy-only example with general summaries of the most frequently observed traits and species;
  • adds responsive styling for the new homepage cards;
  • adds focused tests for the homepage calculations and ranking logic;
  • adds DT to the suggested dependencies and Quarto publishing workflow.

The summary values are calculated directly from traitsview:

  • Observations: total observation rows
  • Measured variables: distinct non-blank traits
  • Represented species: distinct non-missing species_id values
  • Contributing sites: distinct non-missing site_id values
  • Data sources: distinct non-missing citation_id values

No species, site, citation, PFT, or junction tables are joined when calculating these metrics.

Related Issue(s)

Addresses #26

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Data update (changes to datasets)
  • Documentation update
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have run devtools::check() with no new errors or warnings
  • I have updated NEWS.md if applicable
  • I have updated documentation if applicable
  • I have added/updated tests if applicable

Validation

  • devtools::test()
    • 30 tests passed
  • quarto render --execute
    • full site rendered successfully
  • devtools::check(args = c("--no-manual", "--no-build-vignettes"))
    • completed without new errors or warnings
    • three pre-existing NOTES remain related to Quarto frozen assets and the license stub
  • git diff --check
    • passed
  • Manually verified:
    • all five summary values;
    • table search and filtering;
    • sorting and pagination;
    • desktop and narrow-width layouts;
    • absence of internal database fields;
    • top-trait and top-species summaries.

Screenshots

Observation-backed homepage summary

Screenshot From 2026-07-17 17-02-56

Searchable observation preview

The preview below is filtered using Panicum, showing that client-side search works across the observation table.

Screenshot From 2026-07-17 17-17-11

Dataset diversity summaries

Screenshot From 2026-07-17 17-18-20

Data Changes

No packaged datasets or files under data-raw/ were modified.

Additional Notes

Biome and PFT summaries are not included because the packaged observation data does not contain a direct biome classification and the species-to-PFT relationship is many-to-many.

A map or biome/PFT summary would require maintainer guidance on the authoritative classification and how species assigned to multiple PFTs should be counted. These can be handled as follow-up work if requested.

Signed-off-by: Gaurav Chaudhary <chaudharygaurav2004@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant