A customized STAC Browser for the Cal-Adapt STAC API, live at https://stac-browser.cal-adapt.org.
Based on radiantearth/stac-browser v5.1.0. See upstream's README and docs for everything not covered here.
Custom code lives in src/caladapt/ and is wired in through STAC Browser's config files, so upstream files stay unchanged where possible.
- Config (
config.js): Cal-Adapt API and title (also shown on the home page instead of the API's own title), the Cal-Adapt bear logo (public/bear.png, also the favicon inpublic/favicon.ico), hash routing so existing/#/links keep working, footer links, English and light mode only, no favorites or social sharing, andcollectionOrder, the collections listed first on the home page and in the All datasets sidebar. - Brand theme: Cal-Adapt colors, Poppins and Roboto fonts, navy text, and a pale blue header in
src/theme/variables.scss; small overrides insrc/theme/custom.scss, including a left-aligned header title, hover outlines on collection and item tiles, and hidden Search, API, Share and Additional filters buttons. - Home page filters: labelled rows of pill buttons under the search box: Topic (keywords), Data type (
caladapt:spatial_type) and Source (caladapt:source), each pill with its number of datasets. Selections are kept in the URL (e.g.?.topic=energy&.source=wrf), and Clear filters appears beside the Tiles/List buttons. The rows are insrc/caladapt/PillFilters.vue, configured insrc/caladapt/collectionFilters.js. Browse, relabelled "All datasets" (src/locales/en/custom.json), sits beside Source. - Widgets (
widgets.config.js): a Dataset Overview on collection pages with tables built fromcaladapt:*_labelsfields and queryable values (labels insrc/caladapt/collectionOverviewConfig.js). - Item filters (
src/caladapt/ItemFilters.vue): a "Filter items" panel above the items list on dataset pages, with one dropdown per queryable with more than one value in an equal-width grid (Variable first) and Clear filters in its heading once one is set, labelled from the collection'scaladapt:*_labelsfields andsrc/caladapt/collectionOverviewConfig.js(the same names as the Dataset Overview). They replace STAC Browser's Show Filters panel (dates, area, sorting), whichCatalog.vueno longer enables. - Asset actions (
assetActions.config.js): Preview for CSV files, and Download for publics3://files over HTTPS. - Python snippets: climakitae or xarray/pandas code on each asset (
src/caladapt/PythonSnippet.vue). - Hidden metadata (
fields.config.js): fields that the Dataset Overview already shows.
Edits to upstream files, to check when upgrading:
src/components/AssetAlternative.vue: renders the Python snippet.src/views/Catalog.vue: adds theview-catalog-intro-endwidget hook, renderssrc/caladapt/ItemFilters.vueabove the items, passing itfilterItems, and dropsallowFilterfrom the items list so upstream's Show Filters panel is hidden.src/StacBrowser.vue: adds the Browse button (labelled "All datasets" insrc/locales/en/custom.json) beside Source in the page title row.src/components/Catalogs.vue: renderssrc/caladapt/PillFilters.vueunder the search box, applies its selection in the collection filter, and shows Clear filters in the header. Also drops the ascending/descending sort buttons, and puts the collections in thecollectionOrderconfig option first (src/caladapt/collectionOrder.js). Upstream's keyword dropdown is left in place; it only shows when the API has no free-text collection search, so it stays hidden here.src/components/Tree.vue: puts thecollectionOrdercollections first in the All datasets sidebar too.
src/caladapt/ItemFilters.vue and CollectionOverview.vue also call upstream code that isn't a public API, so check them after upgrading: fetchSchemaProperties in src/search-schemas.js (moved there from src/store/utils.js in 5.2), the Queryable model in src/models/cql2/queryable.js (fallback filter names), Catalog.vue's filterItems(filters) method, and Utils.addFiltersToLink, which calls filters.serialize() to add the filter to the request.
src/theme/custom.scss also targets upstream class names and IDs in the header (.navigation and the order of its buttons, with Browse first, .title, #popover-share-btn, #popover-link-btn) and on the home page (.additional-filter-link). If an upgrade renames them, hidden buttons come back or the layout shifts, so check the header and home page after upgrading.
Requires Node 22 (see .nvmrc).
npm install
npm startBrowse to http://localhost:8080.
- Production: pushes to
maindeploy to GitHub Pages via.github/workflows/deploy-demo.yml. - Previews: each pull request is built and deployed to Netlify via
.github/workflows/preview.yml, which comments the preview link on the PR. Needs theNETLIFY_AUTH_TOKENandNETLIFY_SITE_IDrepository secrets.