Interactive interface for browsing global, full-resolution satellite imagery
WV-3117 Charting Feature Styling Updates (#5281)
christof-wittreich7cb3cfb8759f
diff --git a/e2e/features/charting/charting-test.spec.js b/e2e/features/charting/charting-test.spec.jsindex 63a328f04..6448bbee1 100644--- a/e2e/features/charting/charting-test.spec.js+++ b/e2e/features/charting/charting-test.spec.js@@ -73,12 +73,10 @@ test('Select an Area of Interest works appropriately', async () => {const isChartingEnabled = await page.$('#chart-toggle-button')if (isChartingEnabled) {await page.locator('#chart-toggle-button').click()- const aoiIcon = page.locator('#wv-charting-mode-container > div.charting-aoi-container > h3')- await expect(aoiIcon).toHaveText('Select Area of Interest')- await page.locator('#wv-charting-mode-container > div.charting-aoi-container > svg').click()- await page.mouse.click(300, 300)- await page.mouse.click(400, 400)- await expect(aoiIcon).toHaveText('Area of Interest Selected')+ const aoiBtn = page.locator('#wv-charting-mode-container > div.charting-aoi-container > .edit-coordinates')+ await expect(aoiBtn).toHaveText('Entire Screen')+ await aoiBtn.click()+ await expect(aoiBtn).toHaveText('Area Selected')}})@@ -96,12 +94,12 @@ test('Confirm defaults for time span selection', async () => {}})-test('Calendar icon opens datepicker modal', async () => {+test('Date selector opens datepicker modal', async () => {await page.goto(multipleDataLayers)const isChartingEnabled = await page.$('#chart-toggle-button')if (isChartingEnabled) {await page.locator('#chart-toggle-button').click()- await page.locator('#charting-calendar-container > svg').click()+ await page.locator('#charting-date-button').click()const chartingDateModal = page.locator('#charting_date_modal > div > div > div.modal-header > h5')await expect(chartingDateModal).toHaveText('Charting Mode Date Selection')}@@ -116,7 +114,7 @@ test('Info modal opens on mode start & on icon click', async () => {await expect(infoModal).toHaveText('Charting Tool')await page.locator('#charting_info_modal > div > div > div.modal-header > button').click()await expect(infoModal).toHaveCount(0)- await page.locator('#charting-info-container > svg').click()+ await page.locator('#charting-info-container svg').click()await expect(infoModal).toHaveText('Charting Tool')}})diff --git a/package-lock.json b/package-lock.jsonindex f97862b0e..af0e278b0 100644--- a/package-lock.json+++ b/package-lock.json@@ -3838,7 +3838,9 @@"license": "MIT"},"node_modules/@types/estree": {- "version": "1.0.5",+ "version": "1.0.6",+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz",+ "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==","license": "MIT"},"node_modules/@types/express": {@@ -5262,6 +5264,8 @@},"node_modules/body-parser/node_modules/bytes": {"version": "3.1.2",+ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",+ "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==","dev": true,"license": "MIT","engines": {@@ -5270,6 +5274,8 @@},"node_modules/body-parser/node_modules/debug": {"version": "2.6.9",+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==","dev": true,"license": "MIT","dependencies": {@@ -5278,6 +5284,8 @@},"node_modules/body-parser/node_modules/ms": {"version": "2.0.0",+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",+ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==","dev": true,"license": "MIT"},@@ -6011,6 +6019,8 @@},"node_modules/content-type": {"version": "1.0.5",+ "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz",+ "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==","dev": true,"license": "MIT","engines": {@@ -6988,6 +6998,8 @@},"node_modules/depd": {"version": "2.0.0",+ "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",+ "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==","dev": true,"license": "MIT","engines": {@@ -7000,6 +7012,8 @@},"node_modules/destroy": {"version": "1.2.0",+ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz",+ "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==","dev": true,"license": "MIT","engines": {@@ -8397,6 +8411,8 @@},"node_modules/etag": {"version": "1.8.1",+ "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",+ "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==","dev": true,"license": "MIT","engines": {@@ -8735,6 +8751,8 @@},"node_modules/finalhandler/node_modules/debug": {"version": "2.6.9",+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==","dev": true,"license": "MIT","dependencies": {@@ -8743,6 +8761,8 @@},"node_modules/finalhandler/node_modules/ms": {"version": "2.0.0",+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",+ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==","dev": true,"license": "MIT"},@@ -8986,6 +9006,8 @@},"node_modules/fresh": {"version": "0.5.2",+ "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",+ "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==","dev": true,"license": "MIT","engines": {@@ -9511,6 +9533,8 @@},"node_modules/http-errors": {"version": "2.0.0",+ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz",+ "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==","dev": true,"license": "MIT","dependencies": {@@ -9633,6 +9657,8 @@},"node_modules/iconv-lite": {"version": "0.4.24",+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",+ "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==","dev": true,"license": "MIT","dependencies": {@@ -12513,6 +12539,8 @@},"node_modules/media-typer": {"version": "0.3.0",+ "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",+ "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==","dev": true,"license": "MIT","engines": {@@ -12617,6 +12645,8 @@},"node_modules/mime": {"version": "1.6.0",+ "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",+ "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==","dev": true,"license": "MIT","bin": {@@ -14801,6 +14831,8 @@},"node_modules/raw-body": {"version": "2.5.2",+ "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz",+ "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==","dev": true,"license": "MIT","dependencies": {@@ -14815,6 +14847,8 @@},"node_modules/raw-body/node_modules/bytes": {"version": "3.1.2",+ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",+ "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==","dev": true,"license": "MIT","engines": {@@ -16100,6 +16134,8 @@},"node_modules/send/node_modules/debug": {"version": "2.6.9",+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==","dev": true,"license": "MIT","dependencies": {@@ -16108,6 +16144,8 @@},"node_modules/send/node_modules/debug/node_modules/ms": {"version": "2.0.0",+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",+ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==","dev": true,"license": "MIT"},@@ -16121,6 +16159,8 @@},"node_modules/send/node_modules/ms": {"version": "2.1.3",+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==","dev": true,"license": "MIT"},@@ -16245,6 +16285,8 @@},"node_modules/setprototypeof": {"version": "1.2.0",+ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",+ "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==","dev": true,"license": "ISC"},@@ -16656,6 +16698,8 @@},"node_modules/statuses": {"version": "2.0.1",+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",+ "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==","dev": true,"license": "MIT","engines": {@@ -17465,6 +17509,8 @@},"node_modules/toidentifier": {"version": "1.0.1",+ "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",+ "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==","dev": true,"license": "MIT","engines": {@@ -17598,6 +17644,8 @@},"node_modules/type-is": {"version": "1.6.18",+ "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",+ "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==","dev": true,"license": "MIT","dependencies": {@@ -17779,6 +17827,8 @@},"node_modules/unpipe": {"version": "1.0.0",+ "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",+ "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==","dev": true,"license": "MIT","engines": {@@ -18729,7 +18779,9 @@}},"node_modules/ws": {- "version": "8.17.1",+ "version": "8.18.0",+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz",+ "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==","dev": true,"license": "MIT","engines": {diff --git a/web/js/components/charting/chart-component.js b/web/js/components/charting/chart-component.jsindex 41441408a..6c753749d 100644--- a/web/js/components/charting/chart-component.js+++ b/web/js/components/charting/chart-component.js@@ -12,7 +12,7 @@ function ChartComponent (props) {const { data } = liveData;// Arbitrary array of colors to use- const lineColors = ['#8884D8', '#82CA9D', 'orange', 'pink', 'green', 'red', 'yellow', 'aqua', 'maroon'];+ const lineColors = ['#A3905D', '#82CA9D', 'orange', 'pink', 'green', 'red', 'yellow', 'aqua', 'maroon'];function formatToThreeDigits(str) {return parseFloat(str).toFixed(3);@@ -143,10 +143,11 @@ function ChartComponent (props) {</div></div></div>- <div className="charting-discalimer">- <strong>NOTE:</strong>+ <div className="charting-disclaimer">+ <strong>Note:</strong>+ <br />{' '}- Numerical analyses performed on imagery should only be used for initial basic exploratory purposes+ Numerical analyses performed on imagery should only be used for initial basic exploratory purposes.</div></>);@@ -160,8 +161,8 @@ function ChartComponent (props) {{' '}<Legend />{getLineChart(data)}- <XAxis dataKey="name" />- <YAxis type="number" domain={yAxisValuesArr} />+ <XAxis dataKey="name" stroke="#a6a5a6" />+ <YAxis type="number" stroke="#a6a5a6" domain={yAxisValuesArr} /><Legend /></LineChart></div>diff --git a/web/js/components/charting/charting-date-selector.js b/web/js/components/charting/charting-date-selector.jsindex 7043149dc..ba4a48eee 100644--- a/web/js/components/charting/charting-date-selector.js+++ b/web/js/components/charting/charting-date-selector.js@@ -37,7 +37,7 @@ function ChartingDateSelector (props) {}return (- <div className="charting-date-container">+ <div className="charting-date-container wv-date-range-selector">{/* single date mode */}{timeSpanSelection === 'date'? (diff --git a/web/js/components/charting/charting-info.js b/web/js/components/charting/charting-info.jsindex 09d8a9d1e..413dbda0e 100644--- a/web/js/components/charting/charting-info.js+++ b/web/js/components/charting/charting-info.js@@ -4,19 +4,20 @@ function ChartingInfo(props) {return (<div className="charting-info-container"><div className="charting-info-text">- <p className="charting-info">- Click on the pencil icon to click and drag a bounding box on the map to define an Area of Interest (AOI).- </p>+ <p className="charting-info">The Charting Tool provides the option to create a line chart for a date range showing change over time, and statistics for a single date (minimum, maximum, mean, and standard deviation) for an area of interest.</p>- <p className="charting-info">In Date Range mode (the default mode), select the calendar icon near the bottom of the Layers panel and increment the values in the resulting window to change their dates. To use a single date instead of a range, choose One Date at the bottom of the Layers panel.</p>+ <p className="charting-info">Select the layer to be charted by clicking on the radio button to the left of the layer name.</p>- <p className="charting-info">Select the active layer via the toggle icon on its left. Click on Request Chart & you will see additional data as you hover over points on the enlarged chart.</p>+ <p className="charting-info">The default area of interest is the entire screen, click on the “Entire Screen” button to change to a bounding box area of interest selection. Click on any box at the edge or corner of the selection box to change the size and shape.</p>- <p className="charting-info">Exit the charting mode by selecting Exit Charting near the botom of the Layers Panel.</p>+ <p className="charting-info">The default date selection is a date range of the past 7 days. Click on the dates to change the date range in the Charting Mode Date Selection box. Click on the red “Generate Chart” button to generate a chart of change over time.</p>++ <p className="charting-info">To select a single date, select “One Date”. Click on the date to change the date in date selection box. Click on the red “Generate Statistics” button to generate a list of statistics including min, max, mean, and standard deviation.</p><h3>NOTE:</h3><p className="charting-disclaimer">Numerical analyses performed on imagery should only be used for initial basic exploratory purposes. Results from these analyses should not be used for formal scientific study since the imagery is generally of lower precision than the original data and has often had additional processing steps applied to it, e.g. projection into a different coordinate system.</p>+</div></div>);diff --git a/web/js/components/charting/simple-statistics.js b/web/js/components/charting/simple-statistics.jsindex abfba520b..683e743d8 100644--- a/web/js/components/charting/simple-statistics.js+++ b/web/js/components/charting/simple-statistics.js@@ -68,10 +68,11 @@ function SimpleStatistics(props) {</div></div></div>- <div className="charting-discalimer">- <strong>NOTE:</strong>+ <div className="charting-disclaimer">+ <strong>Note:</strong>+ <br />{' '}- Numerical analyses performed on imagery should only be used for initial basic exploratory purposes+ Numerical analyses performed on imagery should only be used for initial basic exploratory purposes.</div></>);diff --git a/web/js/components/sidebar/charting-mode-options.js b/web/js/components/sidebar/charting-mode-options.jsindex 2237ffb55..9a91fe490 100644--- a/web/js/components/sidebar/charting-mode-options.js+++ b/web/js/components/sidebar/charting-mode-options.js@@ -1,14 +1,13 @@-import React, { useEffect } from 'react';+import React, { useState, useEffect } from 'react';import PropTypes from 'prop-types';-import { Button, ButtonGroup } from 'reactstrap';+import * as olProj from 'ol/proj';+import { Button, ButtonGroup, UncontrolledTooltip } from 'reactstrap';import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';-import { faPencilAlt, faCalendarDay } from '@fortawesome/free-solid-svg-icons';import { connect } from 'react-redux';-import { Draw as OlInteractionDraw } from 'ol/interaction';-import { createBox } from 'ol/interaction/Draw';-import { Vector as OlVectorLayer } from 'ol/layer';-import { transform } from 'ol/proj';import { Vector as OlVectorSource } from 'ol/source';+import CustomButton from '../util/button';+import Crop from '../util/image-crop';+import util from '../../util/util';import {toggleChartingAOIOnOff,toggleAOISelected,@@ -19,14 +18,10 @@ import {} from '../../modules/charting/actions';import { openCustomContent } from '../../modules/modal/actions';import { CRS } from '../../modules/map/constants';-import { areCoordinatesWithinExtent } from '../../modules/location-search/util';import ChartingInfo from '../charting/charting-info';import SimpleStatistics from '../charting/simple-statistics';import ChartingDateSelector from '../charting/charting-date-selector';import ChartComponent from '../charting/chart-component';-import {- drawStyles, vectorStyles,-} from '../charting/charting-area-of-interest-style';const AOIFeatureObj = {};const vectorLayers = {};@@ -34,13 +29,12 @@ const sources = {};let init = false;let draw;-function ChartingModeOptions (props) {+function ChartingModeOptions(props) {const {activeLayer,activeLayers,aoiActive,aoiCoordinates,- aoiSelected,chartRequestInProgress,crs,displayChart,@@ -51,7 +45,6 @@ function ChartingModeOptions (props) {openChartingDateModal,openChartingInfoModal,olMap,- proj,projections,renderedPalettes,requestStatusMessage,@@ -67,6 +60,18 @@ function ChartingModeOptions (props) {updateRequestStatusMessage,} = props;+ const { screenHeight, screenWidth } = props;++ const [boundaries, setBoundaries] = useState({+ x: screenWidth / 2 - 100,+ y: screenHeight / 2 - 100,+ x2: screenWidth / 2 + 100,+ y2: screenHeight / 2 + 100,+ });+ const {+ x, y, y2, x2,+ } = boundaries;+function endDrawingAreaOfInterest () {if (draw) {olMap.removeInteraction(draw);@@ -115,49 +120,6 @@ function ChartingModeOptions (props) {return `${year} ${month} ${day}`;}- function getAreaOfInterestCoordinates(geometry) {- updateAOICoordinates(geometry.getExtent());- }-- const drawEndCallback = ({ feature }) => {- // Add the draw feature to the collection- AOIFeatureObj[crs][feature.ol_uid] = {- feature,- };- endDrawingAreaOfInterest();- toggleAreaOfInterestActive();- toggleAreaOfInterestSelected();- getAreaOfInterestCoordinates(feature.getGeometry());- };-- function beginDrawingAOI () {- resetAreaOfInterest();- draw = new OlInteractionDraw({- source: sources[crs], // Destination source for the drawn features (i.e. VectorSource)- type: 'Circle', // Geometry type of the geometries being drawn with this instance.- style: drawStyles, // Style used to indicate Area of Interest- // This is from measurement tool; validate area selected- condition(e) {- const pixel = [e.originalEvent.x, e.originalEvent.y];- const coord = olMap.getCoordinateFromPixel(pixel);- const tCoord = transform(coord, crs, CRS.GEOGRAPHIC);- return areCoordinatesWithinExtent(proj, tCoord);- },- geometryFunction: createBox(), // Function that is called when a geometry's coordinates are updated.-- });- olMap.addInteraction(draw);- draw.on('drawend', drawEndCallback);-- if (!vectorLayers[crs]) {- vectorLayers[crs] = new OlVectorLayer({- source: sources[crs],- style: vectorStyles,- map: olMap,- });- }- }-useEffect(() => {if (!init) {projections.forEach((key) => {@@ -178,16 +140,6 @@ function ChartingModeOptions (props) {const primaryDate = formatDateString(initialStartDate);const secondaryDate = formatDateString(initialEndDate);- const onAreaOfInterestButtonClick = (evt) => {- toggleAreaOfInterestActive();- if (!aoiActive) {- beginDrawingAOI();- } else {- endDrawingAreaOfInterest();- }- };--function getActiveChartingLayer() {const liveLayers = getLiveLayers();const filteredLayerList = liveLayers.filter((layer) => layer.id === activeLayer);@@ -255,7 +207,7 @@ function ChartingModeOptions (props) {areaOfInterestCoords,bins,} = uriParameters;- let requestURL = `https://d1igaxm6d8pbn2.cloudfront.net/get_stats?_type=${type}×tamp=${timestamp}&steps=${steps}&layer=${layer}&colormap=${colormap}&bbox=${areaOfInterestCoords}&bins=${bins}`;+ let requestURL = `https://worldview.sit.earthdata.nasa.gov/service/imagestat/get_stats?_type=${type}×tamp=${timestamp}&steps=${steps}&layer=${layer}&colormap=${colormap}&bbox=${areaOfInterestCoords}&bins=${bins}`;if (type !== 'date') {requestURL += `&end_timestamp=${endTimestamp}`;}@@ -343,7 +295,6 @@ function ChartingModeOptions (props) {const paletteName = layerInfo.palette.id;const paletteLegend = renderedPalettes[paletteName].maps[0].legend;const unitOfMeasure = Object.prototype.hasOwnProperty.call(paletteLegend, 'units') ? `(${paletteLegend.units})` : '';- console.log(unitOfMeasure);const dataToRender = {title: layerInfo.title,subtitle: layerInfo.subtitle,@@ -378,11 +329,72 @@ function ChartingModeOptions (props) {openChartingDateModal({ layerStartDate, layerEndDate }, timeSpanSelection);}- const aoiTextPrompt = aoiSelected ? 'Area of Interest Selected' : 'Select Area of Interest';+ /**+ * Convert pixel value to latitude longitude value+ * @param {Array} pixelX+ * @param {Array} pixelY+ *+ * @returns {Array}+ */+ function getLatLongFromPixelValue(pixelX, pixelY) {+ const { proj, olMap } = props;+ const coordinate = olMap.getCoordinateFromPixel([Math.floor(pixelX), Math.floor(pixelY)]);+ const { crs } = proj.selected;+ const [x, y] = olProj.transform(coordinate, crs, CRS.GEOGRAPHIC);++ return [Number(x.toFixed(4)), Number(y.toFixed(4))];+ }++ const [bottomLeftLatLong, setBottomLeftLatLong] = useState(getLatLongFromPixelValue(x, y2));+ const [topRightLatLong, setTopRightLatLong] = useState(getLatLongFromPixelValue(x2, y));++ /**+ * Update latitude longitude values on+ * crop change+ * @param {Object} boundaries+ *+ * @returns {null}+ */+ function onBoundaryUpdate(boundaries) {+ const {+ x, y, width, height,+ } = boundaries;+ const newBoundaries = {+ x,+ y,+ x2: x + width,+ y2: y + height,+ };+ setBoundaries(newBoundaries);+ const bottomLeft = getLatLongFromPixelValue(newBoundaries.x, newBoundaries.y2);+ const topRight = getLatLongFromPixelValue(newBoundaries.x2, newBoundaries.y);+ setBottomLeftLatLong(bottomLeft);+ setTopRightLatLong(topRight);+ updateAOICoordinates([...bottomLeft, ...topRight]);+ }++ const onAreaOfInterestButtonClick = (evt) => {+ if (aoiActive) {+ updateAOICoordinates(null);+ } else {+ const {+ x, y, x2, y2,+ } = boundaries;+ onBoundaryUpdate({+ x, y, width: x2 - x, height: y2 - y,+ });+ }+ toggleAreaOfInterestActive();+ };++ const layerInfo = getActiveChartingLayer();+ const aoiTextPrompt = 'Area of Interest:';const oneDateBtnStatus = timeSpanSelection === 'date' ? 'btn-active' : '';const dateRangeBtnStatus = timeSpanSelection === 'date' ? '' : 'btn-active';const dateRangeValue = timeSpanSelection === 'range' ? `${primaryDate} - ${secondaryDate}` : primaryDate;const chartRequestMessage = chartRequestInProgress ? 'In progress...' : '';+ const requestBtnText = timeSpanSelection === 'date' ? 'Generate Statistics' : 'Generate Chart';+ const aoiBtnText = aoiActive ? 'Area Selected' : 'Entire Screen';return (<div@@ -390,16 +402,48 @@ function ChartingModeOptions (props) {className="wv-charting-mode-container"style={{ display: isChartingActive && !isMobile ? 'block' : 'none' }}>+ <h1 className="charting-title">Charting Mode</h1>+ <div id="charting-info-container" className="charting-info-container">+ <span id="charting-info-icon">+ <FontAwesomeIcon+ icon="info-circle"+ onClick={openChartingInfoModal}+ />+ <UncontrolledTooltip+ id="center-align-tooltip"+ placement="bottom"+ target="charting-info-icon"+ >+ Charting Information+ </UncontrolledTooltip>+ </span>+ </div>+ <div className="charting-subtitle">+ <h3>Layer: </h3>+ <span id="charting-layer-name">+ {layerInfo && layerInfo.title}+ <UncontrolledTooltip+ id="center-align-tooltip"+ placement="right"+ target="charting-layer-name"+ >+ {layerInfo && layerInfo.title}+ </UncontrolledTooltip>+ </span>+ </div><div className="charting-aoi-container"><h3>{aoiTextPrompt}</h3>- <FontAwesomeIcon- icon={faPencilAlt}+ <CustomButton+ id="edit-coordinates"+ aria-label={aoiBtnText}+ className="edit-coordinates btn"onClick={onAreaOfInterestButtonClick}+ text={aoiBtnText}/></div><div className="charting-timespan-container">- <h3>Time Span:</h3>- <ButtonGroup size="sm">+ <h3>Time:</h3>+ <ButtonGroup><Buttonid="charting-date-single-button"className={`charting-button ${oneDateBtnStatus}`}@@ -418,52 +462,68 @@ function ChartingModeOptions (props) {</div><div className="charting-date-row"><div className="charting-date-container">- {dateRangeValue}- </div>- <div className="charting-icons">- <div id="charting-calendar-container" className="charting-calendar-container">- <FontAwesomeIcon- icon={faCalendarDay}- onClick={onDateIconClick}- />- </div>- <div id="charting-info-container" className="charting-info-container">- <FontAwesomeIcon- icon="info-circle"- onClick={openChartingInfoModal}- />- </div>+ <CustomButton+ id="charting-date-button"+ aria-label={dateRangeValue}+ className="charting-date-button btn"+ onClick={onDateIconClick}+ text={dateRangeValue}+ /></div></div><div className="charting-buttons">- <ButtonGroup size="sm">- <Button- id="charting-create-chart-button"- className="charting-button"- disabled={chartRequestInProgress}- onClick={() => onRequestChartClick()}- >- Request Chart- </Button>- </ButtonGroup>+ <CustomButton+ id="charting-create-button"+ aria-label={requestBtnText}+ className="charting-create-button btn wv-button red"+ onClick={() => onRequestChartClick()}+ text={requestBtnText}+ /></div><div className="charting-request-status">{chartRequestMessage}- </div>- <div className="charting-request-status">{requestStatusMessage}</div>+ <div className="charting-request-status" />+ {aoiActive && (+ <Crop+ x={x}+ y={y}+ width={x2 - x}+ height={y2 - y}+ maxHeight={screenHeight}+ maxWidth={screenWidth}+ onChange={onBoundaryUpdate}+ onClose={onAreaOfInterestButtonClick}+ bottomLeftStyle={{+ left: x,+ top: y2 + 5,+ width: x2 - x,+ }}+ topRightStyle={{+ left: x,+ top: y - 20,+ width: x2 - x,+ }}+ coordinates={{+ bottomLeft: util.formatCoordinate(bottomLeftLatLong),+ topRight: util.formatCoordinate(topRightLatLong),+ }}+ showCoordinates+ />+ )}</div>);}const mapStateToProps = (state) => {const {- charting, map, proj, config, layers, date, palettes,+ charting, map, proj, config, layers, date, palettes, screenSize,} = state;const renderedPalettes = palettes.rendered;const activeLayers = layers.active.layers;const { crs } = proj.selected;+ const { screenWidth, screenHeight } = screenSize;const {activeLayer, aoiActive, aoiCoordinates, aoiSelected, chartRequestInProgress, timeSpanSelection, timeSpanStartDate, timeSpanEndDate, requestStatusMessage,} = charting;@@ -488,6 +548,8 @@ const mapStateToProps = (state) => {timeSpanStartDate,timelineStartDate,timelineEndDate,+ screenWidth,+ screenHeight,};};diff --git a/web/js/components/sidebar/compare-mode-options.js b/web/js/components/sidebar/compare-mode-options.jsindex 4f9f0214c..23d4fccc8 100644--- a/web/js/components/sidebar/compare-mode-options.js+++ b/web/js/components/sidebar/compare-mode-options.js@@ -28,33 +28,46 @@ class CompareModeOptions extends React.Component {className="wv-ab-mode-selection-case"style={{ display: isActive && !isMobile ? 'block' : 'none' }}>- <h3>COMPARE MODE:</h3>- <ButtonGroup size="sm">- <Button- id="compare-swipe-button"- className="compare-button compare-swipe-button"- disabled={selected === 'swipe'}- onClick={() => onclick('swipe')}+ <h3+ className="compare-title"+ >+ Comparison Mode+ </h3>+ <div+ className="compare-button-row"+ >+ <h3+ className="compare-subtitle">- Swipe- </Button>- <Button- id="compare-opacity-button"- className="compare-button compare-opacity-button"- disabled={selected === 'opacity'}- onClick={() => onclick('opacity')}- >- Opacity- </Button>- <Button- id="compare-spy-button"- className="compare-button compare-spy-button"- disabled={selected === 'spy'}- onClick={() => onclick('spy')}- >- Spy- </Button>- </ButtonGroup>+ Type:+ </h3>+ <ButtonGroup size="sm">+ <Button+ id="compare-swipe-button"+ className="compare-button compare-swipe-button"+ disabled={selected === 'swipe'}+ onClick={() => onclick('swipe')}+ >+ Swipe+ </Button>+ <Button+ id="compare-opacity-button"+ className="compare-button compare-opacity-button"+ disabled={selected === 'opacity'}+ onClick={() => onclick('opacity')}+ >+ Opacity+ </Button>+ <Button+ id="compare-spy-button"+ className="compare-button compare-spy-button"+ disabled={selected === 'spy'}+ onClick={() => onclick('spy')}+ >+ Spy+ </Button>+ </ButtonGroup>+ </div></div>);}diff --git a/web/js/containers/sidebar/add-layers-content.js b/web/js/containers/sidebar/add-layers-content.jsnew file mode 100644index 000000000..a48a64d5b--- /dev/null+++ b/web/js/containers/sidebar/add-layers-content.js@@ -0,0 +1,124 @@+/* eslint-disable react/jsx-props-no-spreading */+import React from 'react';+import { connect } from 'react-redux';+import PropTypes from 'prop-types';+import { isMobileOnly, isTablet } from 'react-device-detect';+import googleTagManager from 'googleTagManager';+import { Plus } from '@edsc/earthdata-react-icons/horizon-design-system/hds/ui';+import Button from '../../components/util/button';+import {+ toggleOverlayGroups as toggleOverlayGroupsAction,+} from '../../modules/layers/actions';+import Checkbox from '../../components/util/checkbox';+import SearchUiProvider from '../../components/layer/product-picker/search-ui-provider';+import { openCustomContent } from '../../modules/modal/actions';+import { stop as stopAnimationAction } from '../../modules/animation/actions';++function AddLayersContent (props) {+ const {+ groupOverlays,+ isActive,+ isEmbedModeActive,+ isAnimating,+ isMobile,+ breakpoints,+ screenWidth,+ toggleOverlayGroups,+ addLayers,+ } = props;++ const onClickAddLayers = (e) => {+ e.stopPropagation();+ addLayers(isAnimating, isMobile, breakpoints, screenWidth);+ googleTagManager.pushEvent({ event: 'add_layers' });+ };++ return isActive && !isEmbedModeActive && (+ <>+ <div className="product-buttons">+ <Button+ id="layers-add"+ aria-label="Add layers"+ className="layers-add red"+ text={(+ <>+ <Plus class="add-plus" size="10px" />+ Add Layers+ </>+ )}+ onClick={onClickAddLayers}+ />+ <div className="layers-add-container">+ <Checkbox+ id="group-overlays-checkbox"+ checked={groupOverlays}+ onCheck={toggleOverlayGroups}+ label="Group Similar Layers"+ />+ </div>+ </div>+ <hr className="product-section-break" />+ </>+ );+}++const mapStateToProps = (state, ownProps) => {+ const { compareState } = ownProps;+ const {+ embed, layers, animation, screenSize,+ } = state;+ const { isEmbedModeActive } = embed;+ const isMobile = screenSize.isMobileDevice;+ const { groupOverlays } = layers[compareState];++ return {+ isAnimating: animation.isPlaying,+ isEmbedModeActive,+ isMobile,+ breakpoints: screenSize.breakpoints,+ screenWidth: screenSize.screenWidth,+ groupOverlays,+ };+};++const mapDispatchToProps = (dispatch) => ({+ toggleOverlayGroups: () => {+ setTimeout(() => {+ dispatch(toggleOverlayGroupsAction());+ });+ },+ addLayers: (isPlaying) => {+ const modalClassName = isMobileOnly || isTablet ? 'custom-layer-dialog-mobile custom-layer-dialog light' : 'custom-layer-dialog light';+ if (isPlaying) {+ dispatch(stopAnimationAction());+ }+ dispatch(+ openCustomContent('LAYER_PICKER_COMPONENT', {+ headerText: null,+ modalClassName,+ backdrop: true,+ CompletelyCustomModal: SearchUiProvider,+ wrapClassName: '',+ }),+ );+ },+});++export default connect(+ mapStateToProps,+ mapDispatchToProps,+)(AddLayersContent);++AddLayersContent.propTypes = {+ compareState: PropTypes.string,+ groupOverlays: PropTypes.bool,+ isActive: PropTypes.bool,+ isAnimating: PropTypes.bool,+ isEmbedModeActive: PropTypes.bool,+ isMobile: PropTypes.bool,+ toggleOverlayGroups: PropTypes.func,+ breakpoints: PropTypes.object,+ isPlaying: PropTypes.bool,+ screenWidth: PropTypes.number,+ addLayers: PropTypes.func,+};diff --git a/web/js/containers/sidebar/charting.js b/web/js/containers/sidebar/charting.jsindex 6b2418106..20340e4c2 100644--- a/web/js/containers/sidebar/charting.js+++ b/web/js/containers/sidebar/charting.js@@ -35,11 +35,10 @@ function ChartingLayerMenu (props) {minHeight,maxHeight,overflowY: 'auto',- paddingBottom: '4px',};useEffect(() => {- updateActiveChartingLayer(activeLayersWithPalettes[0].id);+ updateActiveChartingLayer(activeLayersWithPalettes.filter((layer) => !layer.shouldHide)[0].id);}, []);return isActive && (@@ -76,7 +75,7 @@ const mapStateToProps = (state, ownProps) => {overlays = overlays.filter((layer) => layer.visible && layer.layergroup !== 'Reference');overlayGroups = getFilteredOverlayGroups(overlayGroups, overlays);}- const activeLayersWithPalettes = overlays.filter((layer) => Object.prototype.hasOwnProperty.call(layer, 'palette'));+ const activeLayersWithPalettes = overlays.map((layer) => ({ ...layer, shouldHide: !(Object.prototype.hasOwnProperty.call(layer, 'palette') && state.palettes.rendered[layer.palette.id] && state.palettes.rendered[layer.palette.id].maps[0].type === 'continuous') }));return {isAnimating: animation.isPlaying,diff --git a/web/js/containers/sidebar/footer-content.js b/web/js/containers/sidebar/footer-content.jsindex fb951e52c..da1eab359 100644--- a/web/js/containers/sidebar/footer-content.js+++ b/web/js/containers/sidebar/footer-content.js@@ -8,7 +8,6 @@ import {import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';import { isMobileOnly, isTablet } from 'react-device-detect';import googleTagManager from 'googleTagManager';-import { Plus } from '@edsc/earthdata-react-icons/horizon-design-system/hds/ui';import ChartingInfo from '../../components/charting/charting-info';import Button from '../../components/util/button';import CompareModeOptions from '../../components/sidebar/compare-mode-options';@@ -41,10 +40,6 @@ const FooterContent = React.forwardRef((props, ref) => {openChartingInfoModal,toggleCharting,toggleCompare,- breakpoints,- screenWidth,- isPlaying,- addLayers,} = props;const compareBtnText = !isCompareActive@@ -69,12 +64,6 @@ const FooterContent = React.forwardRef((props, ref) => {googleTagManager.pushEvent({ event: 'charting_mode' });};- const onClickAddLayers = (e) => {- e.stopPropagation();- addLayers(isPlaying, isMobile, breakpoints, screenWidth);- googleTagManager.pushEvent({ event: 'add_layers' });- };-const renderLayersFooter = () => (<><div>@@ -92,21 +81,17 @@ const FooterContent = React.forwardRef((props, ref) => {)}</div><div className="product-buttons">- {!isChartingActive- && (- <Button- id="layers-add"- aria-label="Add layers"- className="layers-add red"- text={(- <>- <Plus class="add-plus" size="10px" />- Add Layers- </>+ {!isMobile && !isCompareActive && chartFeature+ && (+ <Button+ id="chart-toggle-button"+ aria-label={chartBtnText}+ className={!isCompareActive && chartingModeAccessible ? 'chart-toggle-button btn' : 'chart-toggle-button btn disabled'}+ style={!chartFeature ? { display: 'none' } : null}+ onClick={!isCompareActive && chartingModeAccessible ? onClickToggleCharting : null}+ text={chartBtnText}+ />)}- onClick={onClickAddLayers}- />- )}{!isChartingActive&& (<Button@@ -119,19 +104,6 @@ const FooterContent = React.forwardRef((props, ref) => {/>)}</div>- <div className="charting-button">- {!isMobile && !isCompareActive && chartFeature- && (- <Button- id="chart-toggle-button"- aria-label={chartBtnText}- className={!isCompareActive && chartingModeAccessible ? 'chart-toggle-button btn' : 'chart-toggle-button btn disabled'}- style={!chartFeature ? { display: 'none' } : null}- onClick={!isCompareActive && chartingModeAccessible ? onClickToggleCharting : null}- text={chartBtnText}- />- )}- </div></>);diff --git a/web/js/containers/sidebar/layer-row.js b/web/js/containers/sidebar/layer-row.jsindex c3793e1ba..8852189ea 100644--- a/web/js/containers/sidebar/layer-row.js+++ b/web/js/containers/sidebar/layer-row.js@@ -10,7 +10,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';import {UncontrolledTooltip, Dropdown, DropdownToggle, DropdownMenu, DropdownItem,} from 'reactstrap';-import { faToggleOn, faToggleOff } from '@fortawesome/free-solid-svg-icons';+import { faCircleDot, faCircle } from '@fortawesome/free-solid-svg-icons';import googleTagManager from 'googleTagManager';import PaletteLegend from '../../components/sidebar/paletteLegend';import util from '../../util/util';@@ -510,15 +510,14 @@ function LayerRow (props) {>Select layer for processing</UncontrolledTooltip>- {/* <FontAwesomeIcon icon="fa-solid fa-circle-dot" className="fa-circle-dot" /> */}{layer.id === activeChartingLayer ? (<FontAwesomeIcon- icon={faToggleOn}+ icon={faCircleDot}className="charting-indicator"/>) : (<FontAwesomeIcon- icon={faToggleOff}+ icon={faCircle}className="charting-indicator"/>)}@@ -588,36 +587,38 @@ function LayerRow (props) {</>);- return (- <Draggable- isDragDisabled={isEmbedModeActive || isAnimating}- draggableId={`${encodedLayerId}-${compareState}`}- index={index}- direction="vertical"- >- {(provided, snapshot) => (isInProjection ? (- <li- id={`${compareState}-${encodedLayerId}`}- className={getLayerItemClasses()}- style={getItemStyle(snapshot.isDragging, provided.draggableProps.style)}- ref={provided.innerRef}- onMouseOver={mouseOver}- onMouseLeave={mouseLeave}- {...provided.draggableProps}- {...provided.dragHandleProps}- >- {renderLayerRow()}- </li>- ) : (- <li- className="layer-list-placeholder"- ref={provided.innerRef}- {...provided.draggableProps}- {...provided.dragHandleProps}- />- ))}- </Draggable>- );+ if (!layer.shouldHide) {+ return (+ <Draggable+ isDragDisabled={isEmbedModeActive || isAnimating}+ draggableId={`${encodedLayerId}-${compareState}`}+ index={index}+ direction="vertical"+ >+ {(provided, snapshot) => (isInProjection ? (+ <li+ id={`${compareState}-${encodedLayerId}`}+ className={getLayerItemClasses()}+ style={getItemStyle(snapshot.isDragging, provided.draggableProps.style)}+ ref={provided.innerRef}+ onMouseOver={mouseOver}+ onMouseLeave={mouseLeave}+ {...provided.draggableProps}+ {...provided.dragHandleProps}+ >+ {renderLayerRow()}+ </li>+ ) : (+ <li+ className="layer-list-placeholder"+ ref={provided.innerRef}+ {...provided.draggableProps}+ {...provided.dragHandleProps}+ />+ ))}+ </Draggable>+ );+ }}const makeMapStateToProps = () => {diff --git a/web/js/containers/sidebar/layers-container.js b/web/js/containers/sidebar/layers-container.jsindex 329a55822..de27bc1e1 100644--- a/web/js/containers/sidebar/layers-container.js+++ b/web/js/containers/sidebar/layers-container.js@@ -13,10 +13,8 @@ import {} from '../../modules/layers/selectors';import {reorderOverlayGroups as reorderOverlayGroupsAction,- toggleOverlayGroups as toggleOverlayGroupsAction,toggleGroupCollapsed as toggleGroupCollapsedAction,} from '../../modules/layers/actions';-import Checkbox from '../../components/util/checkbox';import util from '../../util/util';import SearchUiProvider from '../../components/layer/product-picker/search-ui-provider';import { openCustomContent } from '../../modules/modal/actions';@@ -36,7 +34,6 @@ function LayersContainer (props) {overlays,reorderOverlayGroups,toggleCollapse,- toggleOverlayGroups,} = props;const [overlaysCollapsed, toggleOverlaysCollapsed] = useState(false);@@ -162,18 +159,6 @@ function LayersContainer (props) {)}</div></div>- { !isEmbedModeActive && (- <div className="product-buttons">- <div className="layers-add-container">- <Checkbox- id="group-overlays-checkbox"- checked={groupOverlays}- onCheck={toggleOverlayGroups}- label="Group Similar Layers"- />- </div>- </div>- )}</>);}@@ -181,10 +166,9 @@ function LayersContainer (props) {const mapStateToProps = (state, ownProps) => {const { compareState } = ownProps;const {- compare, charting, embed, layers, animation, screenSize,+ compare, embed, layers, animation, screenSize,} = state;const isCompareActive = compare.active;- const isChartingActive = charting.active;const { isEmbedModeActive } = embed;const isMobile = screenSize.isMobileDevice;const { groupOverlays } = layers[compareState];@@ -201,9 +185,10 @@ const mapStateToProps = (state, ownProps) => {return {isAnimating: animation.isPlaying,isCompareActive,- isChartingActive,isEmbedModeActive,isMobile,+ breakpoints: screenSize.breakpoints,+ screenWidth: screenSize.screenWidth,baselayers,overlays,overlayGroups,@@ -216,11 +201,6 @@ const mapDispatchToProps = (dispatch) => ({reorderOverlayGroups: (layers, groups) => {dispatch(reorderOverlayGroupsAction(layers, groups));},- toggleOverlayGroups: () => {- setTimeout(() => {- dispatch(toggleOverlayGroupsAction());- });- },toggleCollapse: (groupName, collapsed) => {dispatch(toggleGroupCollapsedAction(groupName, collapsed));},@@ -255,14 +235,12 @@ LayersContainer.propTypes = {isActive: PropTypes.bool,isAnimating: PropTypes.bool,isCompareActive: PropTypes.bool,- isChartingActive: PropTypes.bool,isEmbedModeActive: PropTypes.bool,isMobile: PropTypes.bool,overlayGroups: PropTypes.array,overlays: PropTypes.array,reorderOverlayGroups: PropTypes.func,toggleCollapse: PropTypes.func,- toggleOverlayGroups: PropTypes.func,breakpoints: PropTypes.object,isPlaying: PropTypes.bool,screenWidth: PropTypes.number,diff --git a/web/js/containers/sidebar/sidebar.js b/web/js/containers/sidebar/sidebar.jsindex 3861a9dec..2f46734cd 100644--- a/web/js/containers/sidebar/sidebar.js+++ b/web/js/containers/sidebar/sidebar.js@@ -13,6 +13,7 @@ import Events from './events';import SmartHandoff from './smart-handoff';import CompareCase from './compare';import FooterContent from './footer-content';+import AddLayersContent from './add-layers-content';import CollapsedButton from '../../components/sidebar/collapsed-button';import NavCase from '../../components/sidebar/nav/nav-case';import {@@ -105,6 +106,7 @@ class Sidebar extends React.Component {isMobile, screenHeight, isCompareMode,} = this.props;const footerHeight = lodashGet(this, 'footerElement.clientHeight') || 20;+ const addLayersHeight = lodashGet(this, 'addLayersElement.clientHeight') || 30;const tabHeight = isMobile ? isCompareMode ? 80 : 40 : 32;const groupCheckboxHeight = 35;let newHeight;@@ -113,10 +115,10 @@ class Sidebar extends React.Component {const topOffset = 10;const basePadding = 130;newHeight = screenHeight- - (iconHeight + topOffset + tabHeight + groupCheckboxHeight + basePadding + footerHeight)+ - (iconHeight + topOffset + tabHeight + groupCheckboxHeight + basePadding + footerHeight + addLayersHeight)- 10;} else {- newHeight = screenHeight - (tabHeight + groupCheckboxHeight + footerHeight);+ newHeight = screenHeight - (tabHeight + groupCheckboxHeight + footerHeight + addLayersHeight);}// Issue #1415: This was checking for subComponentHeight !== newHeight.// Sometimes it would get stuck in a loop in which the newHeight@@ -303,6 +305,7 @@ class Sidebar extends React.Component {screenHeight,tabTypes,chartingModeAccessible,+ activeString,} = this.props;if ((isMobile || isEmbedModeActive) && activeTab === 'download') changeTab('layers');@@ -371,25 +374,30 @@ class Sidebar extends React.Component {<TabContent activeTab={activeTab}><TabPane tabId="layers">{this.getProductsToRender(activeTab, isCompareMode, isChartMode)}- </TabPane>- {naturalEvents && activeTab === 'events' && (- <TabPane tabId="events">- <Events- height={subComponentHeight}- isLoading={isLoadingEvents}- hasRequestError={hasEventRequestError}- eventsData={eventsData}- sources={eventsSources}+ <AddLayersContent+ ref={(el) => { this.addLayersElement = el; }}+ isActive={activeTab === 'layers'}+ compareState={activeString}/></TabPane>+ {naturalEvents && activeTab === 'events' && (+ <TabPane tabId="events">+ <Events+ height={subComponentHeight}+ isLoading={isLoadingEvents}+ hasRequestError={hasEventRequestError}+ eventsData={eventsData}+ sources={eventsSources}+ />+ </TabPane>)}{smartHandoffs && activeTab === 'download' && (- <TabPane tabId="download">- <SmartHandoff- isActive={activeTab === 'download'}- tabTypes={tabTypes}- />- </TabPane>+ <TabPane tabId="download">+ <SmartHandoff+ isActive={activeTab === 'download'}+ tabTypes={tabTypes}+ />+ </TabPane>)}{!isKioskModeActive && (@@ -430,7 +438,7 @@ const mapStateToProps = (state) => {ui,} = state;- const chartingModeAccessible = layers.active.layers.filter((layer) => Object.prototype.hasOwnProperty.call(layer, 'palette')).length > 0;+ const chartingModeAccessible = layers.active.layers.filter((layer) => Object.prototype.hasOwnProperty.call(layer, 'palette') && state.palettes.rendered[layer.palette.id] && state.palettes.rendered[layer.palette.id].maps[0].type === 'continuous').length > 0;const isLoadingEvents = requestedEvents.isLoading|| requestedEventSources.isLoading;const hasEventRequestError = !!(requestedEvents.errordiff --git a/web/scss/components/button.scss b/web/scss/components/button.scssindex 9e88d1c33..d9b9c6df1 100644--- a/web/scss/components/button.scss+++ b/web/scss/components/button.scss@@ -27,6 +27,11 @@padding: 3px 13px 4px;}+#chart-toggle-button.disabled {+ color: #fff;+ pointer-events: auto;+}+.wv-button.red {background: #f64137;border-color: #f64137;@@ -36,7 +41,7 @@background: #212121;}-.wv-button:hover,+.wv-button:not(.disabled):hover,#compare-toggle-button:hover {border-color: #eee;background-color: #eee;diff --git a/web/scss/features/sidebar.scss b/web/scss/features/sidebar.scssindex f642a9a44..cb0226ee3 100644--- a/web/scss/features/sidebar.scss+++ b/web/scss/features/sidebar.scss@@ -170,18 +170,28 @@#products-holder footer {width: initial;- margin-bottom: 10px;+ margin-bottom: 5px;+ margin-top: 12px;+}++footer #layers-add {+ margin: 5px 10px 10px;+}++.product-section-break {+ color: #ccc;+ opacity: 1;+ margin: 0 10px;}footer .product-buttons {- height: 47px;+ height: 31px;width: auto;- padding: 10px;+}- #layers-add .add-plus {- margin-right: 5px;- margin-top: -2px;- }+#layers-add .add-plus {+ margin-right: 5px;+ margin-top: -2px;}.wv-button {@@ -213,6 +223,19 @@ footer .product-buttons {font-size: 1em;font-weight: 700;padding: 0;+ width: 138px;+}++footer .chart-toggle-button {+ background: #77777a;+ border: 1px solid #77777a;+ position: absolute;+ left: 10px;+ width: 113px !important;++ .button-text {+ padding: 3px 0 4px !important;+ }}footer .compare-toggle-button {@@ -399,6 +422,20 @@ div#group-overlays-checkbox-case {}}+.tab-pane > .product-buttons {+ display: flex;+ margin: 10px;++ #group-overlays-checkbox-case {+ margin: 2px;+ display: flex;+ align-items: center;+ font-size: 12px;+ position: absolute;+ right: 10px;+ }+}+.group-overlays-checkbox {margin: 4px 0 0 4px;}@@ -411,8 +448,42 @@ div#group-overlays-checkbox-case {.wv-ab-mode-selection-case,.wv-charting-mode-container {- margin: 5px;+ margin: 10px;color: #fff;+ position: relative;+}++.charting-title {+ font-size: 16px;+ font-weight: bold;+}++#charting-info-container {+ position: absolute;+ top: 0;+ right: 0;++ #charting-info-icon svg {+ height: 16px;+ cursor: pointer;+ }+}++.charting-subtitle {+ display: flex;+ margin-top: 15px;+}++.charting-subtitle h3 {+ font-size: 13px;+ font-weight: bold;+}++.charting-subtitle span {+ margin-left: 20px;+ white-space: nowrap;+ text-overflow: ellipsis;+ overflow: hidden;}.wv-ab-mode-selection-case .compare-button {@@ -424,52 +495,79 @@ div#group-overlays-checkbox-case {opacity: 1;}-.wv-ab-mode-selection-case > div {- margin-left: 10px;+.compare-title {+ font-size: 15px;+ font-weight: bold;+ margin: 10px 0;}-.wv-ab-mode-selection-case > div,-.wv-ab-mode-selection-case h3 {- display: inline-block;+.compare-button-row {+ margin-bottom: 25px;+ display: flex;+ align-items: center;+ margin-top: 20px;+ position: relative;++ .btn-group {+ position: absolute;+ right: 0;++ .compare-button {+ padding: 3px 18px;+ }+ }++ .compare-subtitle {+ display: inline-block;+ }}.charting-aoi-container {display: flex;justify-content: space-between;- width: 80%;- margin: 10px;+ margin-top: 10px;- svg {- font-size: 1.4em;+ h3 {+ font-size: 13px;+ font-weight: bold;+ display: flex;+ align-items: center;}- h3 {- line-height: 1.4em;+ .edit-coordinates span {+ padding: 3px 9px;}}-.charting-date-row {+.charting-timespan-container {+ align-items: center;+ margin-top: 10px;display: flex;- justify-content: space-around;-}+ justify-content: space-between;-.charting-timespan-container,-.charting-date-container {- display: flex;- justify-content: space-around;-}+ h3 {+ font-size: 13px;+ font-weight: bold;+ }-.charting-timespan-container {- align-items: center;- margin: 10px;+ button {+ padding: 4px 11px;+ background: #222;+ border-color: #5c6369;+ }div > .btn-active {- background: #d54e21;- border-color: #d54e21;+ background: #01457b;}+}- svg {- font-size: 1.4em;+.charting-date-row {+ text-align: right;+ margin-top: 6px;++ .charting-date-button span {+ padding: 3px 9px;+ font-weight: normal;}}@@ -484,6 +582,10 @@ div#group-overlays-checkbox-case {display: flex;}+.modal-dialog.chart-dialog {+ top: 80px;+}+.charting-statistics-label {font-weight: bolder;min-width: 40%;@@ -495,19 +597,40 @@ div#group-overlays-checkbox-case {padding: 0.25em;}+.recharts-legend-item {+ font-weight: bold;+}++.charting-disclaimer {+ line-height: 1.3em;+}+.charting-buttons {- font-size: 1.5em;- margin-top: 1em;- display: flex;- justify-content: space-around;+ position: absolute;+ right: -10px;+ bottom: -37.5px;+ width: calc(100% + 20px);++ #charting-create-button {+ float: right;+ margin-right: 10px;+ width: 138px;++ .button-text {+ display: block;+ font-size: 13px;+ padding: 3px 0;+ }+ }}.charting-indicator {- font-size: 1.5em;+ font-size: 1.25em;margin: 0;position: absolute;top: 50%;- transform: translateY(-50%);+ left: 50%;+ transform: translate(-50%, -50%);}#charting-chart {@@ -838,3 +961,7 @@ p.recharts-tooltip-label {}}}++.ReactCrop {+ z-index: 0 !important;+}\ No newline at end of file