Interactive interface for browsing global, full-resolution satellite imagery
Linting for filler words and formatting
Jo Spraguee3e3375f767b
diff --git a/README.md b/README.mdindex 7478dd588..30b60fc2a 100644--- a/README.md+++ b/README.md@@ -59,13 +59,13 @@ npm run buildnpm start```-Navigate to [`http://localhost:3000`](http://localhost:3000) in a browser. To stop Worldview, press Control+C in your terminal.+Navigate to [`http://localhost:3000`](http://localhost:3000) in a browser. To stop Worldview, press Control+C in the terminal.See [Developing](doc/developing.md) for more usage details.## Updates-To update Worldview, you can pull down any branch or tag from GitHub. If you're on the `master` branch (default), and you want to update to the latest stable version of Worldview, run `git pull`.+To update Worldview, pull down any branch or tag from GitHub. From the `master` branch (default), to update to the latest stable version of Worldview, run `git pull`.**Note:** This project uses [Semantic Versioning](https://semver.org/). Updates to the major version number in [package.json](package.json) indicate a breaking change; _update with caution_.diff --git a/doc/apache_setup.md b/doc/apache_setup.mdindex 3fc6ebb61..f2b0c1a11 100644--- a/doc/apache_setup.md+++ b/doc/apache_setup.md@@ -1,6 +1,6 @@# How to Setup Worldview Using Apache-> Note: Using Worldview with Apache is deprecated and will not be supported in the future. Is is recommended that you use Worldview with Node/[Express](https://expressjs.com/) instead. If you choose to proceed with Apache, choose one of the setup methods below.+> Note: Using Worldview with Apache is deprecated and will not be supported in the future. We recommended using Worldview with Node/[Express](https://expressjs.com/) instead. To use Apache, choose one of the setup methods below.## Manual Setupdiff --git a/doc/branding.md b/doc/branding.mdindex 6d19796b5..d09fbe532 100644--- a/doc/branding.md+++ b/doc/branding.md@@ -1,10 +1,11 @@# Branding-To add custom branding to Worldview you can [create a custom configuration](configuration.md) and modify it;+To add custom branding to Worldview,+[create a custom configuration](configuration.md) and modify it;## Customizing-Update the following fields in `options/common/brand.json` with your custom branding;+Update the following fields in `options/common/brand.json` with custom branding;* `packageName`: Application name used to create builds, (i.e. `worldview`).* `name`: Application name shown to end users (i.e. `EOSDIS Worldview`).@@ -19,10 +20,10 @@ the following instead:To add a logo, replace `options/common/brand/images/wv-logo.png` with an imagethat is 247x45 pixels.-To create an "About" page, edit `options/common/brand/pages/about.md`. You can-also create other pages by creating other Markdown files in this directory.+To create an "About" page, edit `options/common/brand/pages/about.md`. Add other+Markdown files in this directory to add more pages.## Rebuilding-After making changes to a custom configuration, you'll need to run-`npm run build` again to rebuild the app.+After making changes to a custom configuration, run `npm run build` again to+rebuild the app.diff --git a/doc/configuration.md b/doc/configuration.mdindex 909a60f7f..f1fbefa4e 100644--- a/doc/configuration.md+++ b/doc/configuration.md@@ -1,6 +1,9 @@# Configuration-By default, Worldview uses [the official EOSDIS configuration](https://github.com/nasa-gibs/worldview-options-eosdis). To create a custom configuration, you can clone the default configuration repo or [the configuration template repo](https://github.com/nasa-gibs/worldview-options-template.git) into the `options/` directory and modify it;+By default, Worldview uses [the official EOSDIS configuration](https://github.com/nasa-gibs/worldview-options-eosdis).+To create a custom configuration, clone the default configuration repo or+[the configuration template repo](https://github.com/nasa-gibs/worldview-options-template.git)+into the `options/` directory and modify it;```bashgit clone https://github.com/nasa-gibs/worldview-options-template.git options@@ -8,22 +11,27 @@ git clone https://github.com/nasa-gibs/worldview-options-template.git options## Updating the Configuration-After making any changes to a custom configuration, you need to rebuild the app-with the changes. Instead of running the entire build process you can run-`npm run getcapabilities` to make a request to [the GIBS `GetCapabilities` API](https://wiki.earthdata.nasa.gov/display/GIBS/GIBS+API+for+Developers)+After making any changes to a custom configuration, rebuild the app for the+changes to take effect. Instead of running the entire build process, use the+`npm run getcapabilities` command to make a request to [the GIBS `GetCapabilities` API](https://wiki.earthdata.nasa.gov/display/GIBS/GIBS+API+for+Developers)and update layer configurations, and then `npm run build:config` to rebuild the-configuration for use by the application. You can run these commands separately-as needed or use `npm run updateconfig` as a shortcut to run them both.+configuration for use by the application. Run these commands separately+as needed or use `npm run updateconfig` as a shortcut to run both.### Subdirectories-If you have a custom configuration in a subdirectory of `options/` other than `options/release/`, you can pass in the name of the subdirectory you would like to use with `npm run build:config -- subdirectory_name`. If you would like to build an incomplete configuration, you should prefix the command like this; `IGNORE_ERRORS=true npm run build:config`.+If you have a custom configuration in a subdirectory of `options/` other than+`options/release/`, pass in the name of the subdirectory to use with+`npm run build:config -- subdirectory_name`. To build an incomplete configuration,+prefix the command like this; `IGNORE_ERRORS=true npm run build:config`.## New Layers-Create a new JSON document in `config/wv.json/layers` named `X.json` where `X` is the layer identifier used in the WMTS or WMS API call. This file can be placed in any subdirectory as needed for organizational purposes.+Create a new JSON document in `config/wv.json/layers` named `X.json` where `X`+is the layer identifier used in the WMTS or WMS API call. This file can be+placed in any subdirectory as needed for organizational purposes.-The following is the minimum configuration needed for the Aerosol Optical Depth layer:+Here's an example of a minimum configuration for the Aerosol Optical Depth layer:```json{@@ -38,7 +46,8 @@ The following is the minimum configuration needed for the Aerosol Optical Depth}```-All properties should be in an object keyed by the layer identifier used in the WMTS of WMS API call.+All properties should be in an object keyed by the layer identifier used in the+WMTS of WMS API call.### Required Properties@@ -47,7 +56,7 @@ The minimum set of required properties are as follows:- **id**: The layer identifier used in the WMTS or WMS call- **title**: Title of the layer displayed to the end user. This is the first line displayed in the active layers list.- **subtitle**: Subtitle of the layer displayed to the end user. This is the second line displayed in the active layers list and usually includes platform, sensor, and/or attribution information.-- **group**: The group this layer should be found in, either *baselayers* or *overlays*+- **group**: The group this layer is found in, either *baselayers* or *overlays*The following properties are required if this information is not available via the GIBS WMTS GetCapabilities document:@@ -152,16 +161,21 @@ First, layers must be added to `config/wv.json/layers` and `config/wv.json/layer## New Map Sources-Modify the JSON document, `config/wv.json/sources.json`. There is a *sources* object that contains an object for each map source keyed by the source identifier. For layers that can be configured via a GIBS WMTS GetCapabilities document or for WMS layers, the only property required is:+Modify the JSON document, `config/wv.json/sources.json`. There is a *sources*+object that contains an object for each map source keyed by the source identifier.+For layers that can be configured via a GIBS WMTS GetCapabilities document or+for WMS layers, the only property required is:- **url**: Either a string or array of strings where the map service is found.-For WMTS layers that cannot be configured with a GetCapabilities document, a *matrixSets* object must exist that contains an object for each matrix set, keyed by the matrix set identifier.+For WMTS layers that cannot be configured with a GetCapabilities document, a+*matrixSets* object must exist that contains an object for each matrix set,+keyed by the matrix set identifier.- **id**: The identifier for this matrix set.- **maxResolution**: The maximum resolution of this of this matrix tile set as defined in the [OpenLayers 2 documentation](http://dev.openlayers.org/docs/files/OpenLayers/Layer-js.html#OpenLayers.Layer.maxResolution). This property might be deprecated in the future as it can be obtained from the *resolutions* property.- **resolutions**: Array of resolutions for each zoom level as defined in the [OpenLayers 2 documentation](http://dev.openlayers.org/docs/files/OpenLayers/Layer-js.html#OpenLayers.Layer.maxResolution).-- **tileSize**: Array of pixel dimensions for each tile. Example *[512, 512]*+- **tileSize**: Array of pixel dimensions for each tile. Example; `[512, 512]`### Full Example@@ -189,15 +203,17 @@ For WMTS layers that cannot be configured with a GetCapabilities document, a *ma### GetCapabilities-To automatically fetch configuration information from the GetCapabilities document, modify the `config.json` file and add an object to the *wv-options-fetch* object with the following properties:+To automatically fetch configuration information from the GetCapabilities+document, modify the `config.json` file and add an object to the+`wv-options-fetch` object with the following properties:- **from**: The URL to fetch the GetCapabilities document- **to**: Name of the temporary file used to store the GetCapabilities document.-Now add an object to the *wv-options-wmts* object with the following properties:+Now add an object to the `wv-options-wmts` object with the following properties:- **source**: The identifier of the source that corresponds to this endpoint.-- **from**: The name of the temporary file used int he *wv-options-fetch* object.+- **from**: The name of the temporary file used int he `wv-options-fetch` object.- **to**: The name of the temporary output JSON file.- **projection**: The identifier of the projection used in this endpoint (see `config/wv.json/projections`)- **maxResolution**: The resolution of first tile matrix entry.diff --git a/doc/data_download.md b/doc/data_download.mdindex 85d181de0..2b1ef1343 100644--- a/doc/data_download.md+++ b/doc/data_download.md@@ -1,12 +1,13 @@# Data Download-*Note*: This feature exclusively uses the Common Metadata Repository (CMR) and is-of no use for datasets stored elsewhere.+**Note**: This feature uses the Common Metadata Repository (CMR) and does not+work for data sets stored elsewhere.-Each layer in Worldview can be mapped to a data product found in the CMR. In the layer configuration, use the *product* attribute and provide the identifier that will be used for the downloadable product.+Each layer in Worldview can be mapped to a data product in the CMR. In the layer+configuration, use the *product* attribute and provide the identifier for the+downloadable product.-Each *product* is defined in the *products* section, keyed by identifier. An-example follows below:+Each *product* is defined in the *products* section, keyed by identifier:```json{@@ -43,12 +44,12 @@ yesterday, and tomorrow appear together on the same map.list. Use this for collections that do not have granules and only havea collection level entry.* `CollectionMix`: Handles layers which only have collection-level metadata-and have different collections based on the currently-selected date. Uses+and have different collections based on the selected date. Uses"science" and "nrt" query flags to distinguish between "old" and "new"collections, respectively.* `DailyAMSRE`: Displays a single entry for a daily AMSR-E product. Since the-metadata is too exact, this omits granules that happen to contain on a very-small fraction of the day.+metadata is too exact, this omits granules that happen to contain a small+fraction of the day.* `DailyGranuleList`: Similar to `List` but also obtains granules three hoursfrom yesterday and tomorrow. This handler is only used for MODIS CombinedValue Added AOD and granules appear to be in six hour chunks. It isn't apparent@@ -103,7 +104,7 @@ using the `MODISMix` handler, the query is specified in the following manner:## Result Processing and Filtering-Each handler has a series of processors that may change or filter each result.+Each handler has a series of processors that change or filter each result.The result processors and configurations are as follows:### AntiMeridianMulti@@ -111,7 +112,7 @@ The result processors and configurations are as follows:If a granule splits the anti-meridian, this processor creates two polygons,one on each side of the map. The constructor takes a `maxDistance` argumentthat specifies a distance, in degrees. If a line segment in the polygon is-greater than `maxDistance`, it is assumed to be crossing the anti-meridian.+greater than `maxDistance`, it's assumed to be crossing the anti-meridian.### CollectPreferred@@ -172,7 +173,7 @@ Filter by ascending or descending orbit. Configure with `orbit` with thefollowing parameters:* `type`: Always `regex_group`-* `field`: The field to inspect to determine the orbit+* `field`: The field to inspect to find the orbit* `regex`: The regular expression to match against, should have one group.* `match`: Keep the granule if it matches this value.@@ -209,8 +210,8 @@ parameters:* `field`: The field value to check against* `value`: Field value must equal this exactly.* `regex`: Field value must match this regular expression.-* `handler`: If the handler for this product is `MODISMix` or `CollectionMix`, the-handler that should be used for the NRT query, for example, `TerraSwathMultiDay`.+* `handler`: If the handler for this product is `MODISMix` or `CollectionMix`,+the handler to use for the NRT query, for example, `TerraSwathMultiDay`.Example:@@ -232,8 +233,6 @@ Add a field to the granule result with the name of the product.Mark granules as requiring URS access depending on the following `urs`configuration parameters.-*FIXME*: Code an almost copy-and-paste from TagNRT, maybe consolidate this?-* `by`: Determine if this requires URS by `value`, `regex`, or `constant`* `field`: The field value to check against* `value`: Field value must equal this exactly or the constant to set as.diff --git a/doc/deployment.md b/doc/deployment.mdindex b1d248afd..09f18a0e1 100644--- a/doc/deployment.md+++ b/doc/deployment.md@@ -1,3 +1,6 @@# Deployment-To build the app for deployment, run the included `tasks/buildAll.sh`. This will build the app and generate `.tar.bz2` files and an `.rpm` file which can be used to deploy the app to an Apache environment.+To build the app for deployment, run the included `tasks/buildAll.sh`. This+script installs dependencies. builds the app in the `build/` directory and+creates `.tar.bz2` files and an `.rpm` file which can be used to deploy the+app to an Apache environment.diff --git a/doc/developing.md b/doc/developing.mdindex 765c2951a..42b485c5e 100644--- a/doc/developing.md+++ b/doc/developing.md@@ -2,14 +2,14 @@## Building-This project uses `npm` as an interface to run build scripts and other tasks.-The scripts themselves are a combination of JavaScript, Bash and Python scripts.+This project uses `npm` to run build scripts and other tasks. The scripts are a+combination of JavaScript, Bash and Python scripts.-**`npm run build`**: Runs all of the `build:x` scripts below and generates a build+**`npm run build`**: Runs all the `build:x` scripts below and generates a buildin `build/` and `dist/site-worldview.tar.bz2`. If you have a custom configuration-subdirectory, you can pass that in with `npm run build -- subdirectory_name`. If-you would like to build the app with an incomplete configuration, you should-prefix the command like this; `IGNORE_ERRORS=true npm run build`.+subdirectory, pass it to the command with `npm run build -- subdirectory_name`.+To build the app with an incomplete configuration, prefix the command like this;+`IGNORE_ERRORS=true npm run build`.**`npm run build:js`**: Builds the JavaScript bundle for the app and writes itto `web/build/wv.js`.@@ -23,16 +23,16 @@ to `web/build/wv.js`.**`npm run build:tests`**: Builds a JavaScript bundle in `web/build/wv-test-bundle.js`for running tests.-**`npm watch`**: Runs all of the build tasks necessary for local development in watch-mode so the JS and CSS bundles are updated automatically when source files change.-This does not generate any assets in `build/`, and is only for local development.+**`npm watch`**: Runs all the build scripts necessary for local development in watch+mode. JS and CSS bundles are updated automatically when source files change.+This does not create any assets in `build/`, and is only for local development.You must run `npm run build` or `npm run build:config` first to make a requestto [the GIBS `GetCapabilities` API](https://wiki.earthdata.nasa.gov/display/GIBS/GIBS+API+for+Developers) andbuild the configuration files.### Grunt tasks-Grunt tasks are deprecated, but the following are still used by the build scripts+Grunt tasks are deprecated, but the following are used by the build scriptsunder the hood and available to use if you know what you're doing;**`grunt`**: This is a shortcut for `grunt build config site`.@@ -40,16 +40,16 @@ under the hood and available to use if you know what you're doing;**`grunt config`**: Compiles branding and configuration options and puts the resultsin `build/`, `dist/`, and `web/`.-**`grunt build`**: Copies assets to build directories and generate intermediate `tar` files.+**`grunt build`**: Copies assets to build directories and create intermediate `tar` files.**`grunt site`**: Combines the results of `grunt config` and `grunt build` into final-`build/` and `dist/` directories and generates `tar` files of the final build.+`build/` and `dist/` directories and creates `tar` files of the final build.**`grunt rpm-placeholders`**: Replaces placeholder strings in rpm source files.## Starting-**`npm start`**: Starts the app for local development. More specifically, starts a-web server that serves the contents of the `web/` directory. For advanced usage,-you can edit `tasks/start.js` to serve the `build/site-worldview/` directory-instead, which will include string placeholder replacements.+**`npm start`**: Starts the app for local development. Express serves the+contents of the `web/` directory. For advanced usage, edit `tasks/start.js` to+serve the `build/site-worldview/` directory instead, which includes string+placeholder replacements.diff --git a/doc/features.md b/doc/features.mdindex 8ba9a46c9..024b3c322 100644--- a/doc/features.md+++ b/doc/features.md@@ -2,12 +2,12 @@These features require CGI scripts to execute on your server. In order for themto function, make sure your server is configured to allow the execution of-CGI files. You can then enable these features in your configuration file;+CGI files. Next, enable these features in your configuration file.## Data DownloadThis feature uses CGI scripts to query the CMR API on the server. To enable,-open `options/common/features.json` and set `"dataDownload": true`.+edit `options/common/features.json` and set `"dataDownload": true`.## URL Shortening@@ -15,7 +15,7 @@ This feature uses[bit.ly](http://bit.ly) to shorten links. Follow these steps to enable it;* Edit `options/common/features.json` and set `"urlShortening": true`.-* Obtain a login and API key from [bit.ly](http://bit.ly).+* Get a login and API key from [bit.ly](http://bit.ly).* Create `build/options/bitly.json` with the following contents (replacing `your_login` and `your_key` with the appropriate values);```json@@ -25,4 +25,4 @@ This feature uses}```-> Caution: Do not commit this file to a public repo, and make sure that the `build/options` directory is not publicly accessible on your web server since your API key should remain secret.+> Caution: Do not commit this file to a public repo, and make sure the `build/options` directory is not publicly accessible on your web server to protect the privacy of your API key.diff --git a/doc/testing.md b/doc/testing.mdindex e1fca562c..211318210 100644--- a/doc/testing.md+++ b/doc/testing.md@@ -15,9 +15,8 @@ build a testable version of Worldview.## End-to-end Tests-You can run the included end-to-end tests to test the app in Chrome and Firefox.-The tests run the Cucumber features in `./e2e/features` using Nightwatch-and Selenium.+Run the included end-to-end tests to test the app in Chrome and Firefox. The+tests run the Cucumber features in `./e2e/features` using Nightwatch and Selenium.To run tests on your machine in Chrome; `npm run e2e:chrome`.@@ -26,11 +25,11 @@ To run tests on your machine in Firefox;1) [Create a new Firefox profile](https://developer.mozilla.org/en-US/Firefox/Multiple_profiles) called 'nightwatch'.2) Run `npm run e2e:firefox`.-You can run tests for both browsers in sequence by running `npm run e2e`.+To run tests for both browsers in sequence; `npm run e2e`.-To run tests in Browserstack;+To run tests in BrowserStack;-1) Log into [Browserstack](https://www.browserstack.com/automate) and get your username and access key from the upper left.+1) Log into [BrowserStack](https://www.browserstack.com/automate) and get your username and access key from the upper left.2) Add the following to your shell configuration (`.bashrc` or `.profile`);```bash@@ -38,22 +37,22 @@ export BROWSERSTACK_ACCESS_KEY=yourkeyhereexport BROWSERSTACK_USER=yourusernamehere```-3) Configure `./e2e/environments.json` with the browsers you want to test.+3) Configure `./e2e/environments.json` with the browsers to test.4) Run `npm run browserstack`.### ReportsAfter running end-to-end tests, reports are generated and saved in-`./e2e/reports`. You can convert these to HTML by running-`npm run report <environment>` where `<environment>` is either the lowercase-name of the browser for local tests (`chrome` or `firefox`) or the name of the-Browserstack environment, such as `Chrome_61-0_OS_X_El_Capitan-1` (you can get-this name from the JSON files in `./e2e/reports`).+`./e2e/reports`. To convert these to HTML, use `npm run report <environment>`+where `<environment>` is either the lowercase name of the browser for local+tests (`chrome` or `firefox`) or the name of the BrowserStack environment, such+as `Chrome_61-0_OS_X_El_Capitan-1` (get the name from the JSON files in+`./e2e/reports`).The end-to-end tests are a little bit flaky, so they aren't required to pass-before a submission will be accepted, but you should run them and read through-the results to make sure that you haven't broken any functionality. Please also-consider adding end-to-end tests to cover any functionality you add.+before a submission will be accepted. But, please run them and check the results+to make sure you haven't broken any functionality. And add end-to-end tests to+cover any new functionality you add.## Mocking Data