Built to accompany the U.S. Climate Resilience Toolkit, the Climate Explorer offers graphs and maps of observed and projected temperature, precipitation, and related climate variables for every county in the contiguous United States.
The live version of this project can be found at crt-climate-explorer.nemac.org
Climate Explorer is a large web application and was (mostly) developed before modern web frameworks existed, which is to say much of its codebase uses outdated patterns and different areas of the project may use different naming conventions.
Here are a few rules to make the future of the application a little brighter:
window.my_var = my_var
./vendor/
or /node_modules/
.import get from '../node_modules/lodash/get.js
not import get from 'lodash/get'
.To set up your development environment use npm install
then run npm run build
to build and npm run start
to start the development server. Changes to html or js may require you to re-run npm run build
. Alternatively, run npm run start:dev
to symlink /dist/js/
to /js/
so you don't have to re-build for js file changes.
template-literal-cli
provides static templating. All files in the /pages/
directory are those templates. Running npm run build:html
will build the page templates using the config file config.yml
.npm run build:css
will build the stylesheets used in this project, or running npm run watch:css
will automatically build the stylesheets when the source '.scss' files have changed.v16.0.0
and npm 7.10.0
are required to build the project. This project is intended for deployment as a static site, but there are a handful of services aside from the code in this repo that are expected:
https://crt-climate-explorer.nemac.org/webtiles/*
./template/footer.js
. It can be removed, or the account it is attached to can be changed via "google_analytics_id" in config.yml
As of 2021, many data JSON files have been moved out of the Climate Explorer source repo to be hosted at https://crt-climate-explorer.nemac.org/data/
This project has a number of url-persisted state variables that are passed from page to page when applicable. Primarily these variables are managed by /js/main.js
as a form of global state management, but it depends on each page to give it variables and not all pages use this convention.
local-climate-charts
, local-climate-maps
to climate_graphs
and climate_maps
, respectively. All other pages now use underscores (_
) instead of dashes (-
)./js/main.js
(formerly ce.js
). All url updates should now happen in main.js
.area_id
instead of relying only on fips codes (see also: main.js
). Currently climate_maps
is not available for either, and high_tide_flooding
is not available for AK areas.climate_maps
page to support clicking a county to get more information in the map.Complete user interface revamp for improved responsiveness and added limited mobile device compatibility.