This application is build from WebGeoDa.
The below are required environmnent variables. These should be available in .env
or .env.local
in your repo root. Don't commit them to Github. You can copy .env.example
to .env
and fill in the blank values.
# mapbox token for map
REACT_APP_MAPBOX_TOKEN=pk...
# air quality endpoint
REACT_APP_AQ_ENDPOINT=https:...
# submission url for google form
REACT_APP_EMAIL_FORM_URL=
yarn install
yarn build:data
yarn start
Fetch and build relevant data. You must run this prior to development.
This builds 4 main things:
- Main data for the application
- Map variable specification
- Documentation for the docs / about page
- Resource page entries and contributor logs for home page
This process is shown in context in the following diagram.
Dev note: use d2 docs/chives-build-data.d2 docs/chives-build-data.png --pad 20
to regenerate this diagram. learn more about D2
Data is pulled from the data management document described in the Content Management System section below.
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
Note: this is a one-way operation. Once you eject
, you can’t go back!
If you aren’t satisfied with the build tool and configuration choices, you can eject
at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject
will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
You don’t have to ever use eject
. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
The CMS for ChiVes is managed in Google Drive, and configured entirely through a Google Sheets file called Data Dictionary and Variables.xlsx. This file has multiple sheets, all of which are downloaded and parsed during the yarn build:data
step described above. Commonly, cells in these sheets link out to other data sheets and metadata documents that are stored in different Google Drive folders.
A full summary of all sheets and fields in this file follows.
This sheet links out to all of the contributed data sheets that hold the various variables described in other sheets. These data sheets are all merged into a single GeoJSON file, which forms the basis of the map display and downloadable data.
Name
- name of dataManager
- Owner of dataData Sheet Link
- CORS accessible CSV endpoint or file URLMeta Data Link
- Link to the metadata document for this sheet. This may not be used, in fact, as metadata documents are better linked directly to individual variables, not entire data sheets...
This is a full list of all columns in all sheets. It is used to drive the Data Dictionary that is presented on the ChiVes Data page. It is also where you determine whether a given field will be included in the full public download file.
Column
- column name in dataDescription
- Text description of dataDownloadable
- Yes/No, whether this column should be distributed in the download
A list of categories (i.e. "display groups") that are used to sort the presentation of variables in the map and index builder variable dropdown lists. These categories determine the available listGroup
options for variables.
Category Name
- display nameSort Order
- sort order for listing
This sheet holds the most detailed set of information for all of the variables that are shown on the map and index builder.
Variable Name
- Display name of the variableColumn
- Name of data column in the Columns sheet and in the source data sheets.- Controlled vocabulary →
Columns:Column
- Controlled vocabulary →
units
- suffix, eg%
Description
- HTML description for in-map description of variableData Year
- data yearData Source(s)
- data sourcesOriginal Scale
- origin geospatial unitMetadata Doc
- link to full metadataBins
- If specifying bin scale, otherwise quantilecolorScale
- rgb[] | rgba[] repeated binsAdded By
- data attributionlistGroup
- grouping on the variable drop down- Controlled vocabulary →
Categories:Category Name
- Controlled vocabulary →
custom
- if custom layer, indicated an ID here and integrate that on the frontendactive
- Set to FALSE to hide the variable from the UI in all views: Map, Data, Index Builder, etc.- Controlled vocabulary →
TRUE
|FALSE
- Controlled vocabulary →
ibDefaultDirectionality
- Determines whether a variable's value affects the overall index positively or negativelyibEnabled
- Determines whether or not a variable will be available in the custom Index Builder- Controlled vocabulary →
TRUE
|FALSE
- Controlled vocabulary →
ibIgnoreZero
- Determines whether values of 0 in this variable should be ignored in the index creation- Controlled vocabulary →
TRUE
|FALSE
- Controlled vocabulary →
ibExplanation
(for consideration): Short text description that explains the rationale for a given variable'sibDefaultDirectionality
value
A few custom layers are incorporated within the basemap for the main map view. This data is typically incorporated directly into the basemap style, so no data sheets are stored in Google Drive for this content.
Variable Name
- name of variableData Year
- data yearData Source(s)
- data sourcesOriginal Scale
- origin geospatial unitMetadata Doc
- link to full metadataAdded By
- data attribution
This is the list of resources displayed in the /resources page.
title
- title of resourcelink
- link to resourcetext
- text description of resourcelogo
- logo of resource - path relative to chives repo > public folderimage
- image of resource - path relative to chives repo > public folderlogoAltText
- alt text for logoimageAltText
- alt text for imagedateAdded
- date added to resource guideverified
- if verified by chives team
This is the list of contributor logos displayed on the home page.
Contributor
- name of contributorLink
- link to contributor's websiteImagePath
- path to contributor's logo - path relative to chives repo > public folderAltText
- alt text for logo