Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

WV-2812: ESLint Cleanup: Line length (#6248)

Jason Hurley2524b6d2b42e
diff --git a/package.json b/package.json
index 2bffb0771..52b085b15 100644
--- a/package.json
+++ b/package.json
@@ -60,7 +60,7 @@
"linkcheck": "node ./tasks/link-check",
"lint": "run-s lint:js lint:scss",
"lint:scss": "npx stylelint ./web/scss/**/*.scss",
- "lint:js": "npx eslint . --quiet",
+ "lint:js": "npx eslint .",
"preinstall": "node tasks/util/checkNodeVersion.js",
"postinstall": "patch-package && husky",
"start": "node ./tasks/util/start.js",
diff --git a/web/.eslintrc b/web/.eslintrc
index 2b60e1152..373f6b819 100644
--- a/web/.eslintrc
+++ b/web/.eslintrc
@@ -87,7 +87,7 @@
// Base rule overrides
"no-nested-ternary": "off", // 164 errors across 40 files
"no-shadow": "warn", // 110 errors across 40 files
- "max-len": "off", // 315 errors across 109 files
+ "max-len": "error", // 315 errors across 109 files
"consistent-return": "off", // 95 errors across 58 files
"no-underscore-dangle": "off", // 40 errors across 7 files
"no-param-reassign": [ // 198 errors across 46 files
diff --git a/web/js/app.js b/web/js/app.js
index c05d1463f..e52e4fe10 100644
--- a/web/js/app.js
+++ b/web/js/app.js
@@ -71,7 +71,8 @@ class App extends React.Component {
kioskModeEnabled, notifications, numberOutagesUnseen, e2eModeEnabled, hideNotificationsPopup,
} = this.props;
if (numberOutagesUnseen !== prevProps.numberOutagesUnseen) {
- if (numberOutagesUnseen > 0 && !kioskModeEnabled && !e2eModeEnabled && !hideNotificationsPopup) {
+ if (numberOutagesUnseen > 0 && !kioskModeEnabled
+ && !e2eModeEnabled && !hideNotificationsPopup) {
this.openNotification(notifications, numberOutagesUnseen);
}
}
@@ -165,7 +166,8 @@ class App extends React.Component {
<MapInteractions />
<AlertDropdown isTourActive={isTourActive} />
<div>
- {isTourActive && (numberOutagesUnseen === 0 || hideNotificationsPopup) && (!isMobile || isEmbedModeActive) ? <Tour /> : null}
+ {isTourActive && (numberOutagesUnseen === 0
+ || hideNotificationsPopup) && (!isMobile || isEmbedModeActive) ? <Tour /> : null}
</div>
<Sidebar />
<div id="layer-modal" className="layer-modal" />
diff --git a/web/js/components/animation-widget/gif-button.js b/web/js/components/animation-widget/gif-button.js
index 416fd29b8..78f0bf075 100644
--- a/web/js/components/animation-widget/gif-button.js
+++ b/web/js/components/animation-widget/gif-button.js
@@ -74,7 +74,8 @@ function GifButton(props) {
if (gifDisabled) {
return;
}
- const nonDownloadableLayers = hasNonDownloadableLayer ? getNonDownloadableLayers(visibleLayersForProj) : null;
+ const nonDownloadableLayers = hasNonDownloadableLayer
+ ? getNonDownloadableLayers(visibleLayersForProj) : null;
const paletteStore = lodashCloneDeep(activePalettes);
await getPromise(hasCustomPalettes, 'palette', clearCustoms, 'Notice');
await getPromise(isRotated, 'rotate', clearRotate, 'Reset rotation');
@@ -85,7 +86,8 @@ function GifButton(props) {
});
onCloseGif = () => {
- refreshStateAfterGif(hasCustomPalettes ? paletteStore : undefined, rotation, nonDownloadableLayers);
+ refreshStateAfterGif(hasCustomPalettes
+ ? paletteStore : undefined, rotation, nonDownloadableLayers);
toggleGif();
};
toggleGif();
diff --git a/web/js/components/animation-widget/play-queue.js b/web/js/components/animation-widget/play-queue.js
index e80fbf20e..3121fc67d 100644
--- a/web/js/components/animation-widget/play-queue.js
+++ b/web/js/components/animation-widget/play-queue.js
@@ -32,13 +32,13 @@ const getInitialBufferSize = (numberOfFrames, speed) => {
*
* The buffering logic is as follows:
* - n = 10 + speed (frames per sec)
- * - Make at least n requests (assuming there are >= n frames) to determine the avg fetch time for a frame
+ * - Make at least n requests (assuming there are >= n frames) to determine
+ * the avg fetch time for a frame
* - While making initial requests, if any return too quickly (e.g. they were cached), keep making
- * requests until at least n "real" requests can be made to determine average fetch time
+ * requests until at least n "real" requests can be made to determine average fetch time
* - Based on how long it took to load the first n, calculate how many additional frames
- * need to be pre-loaded, based on avg fetch time and playback speed, in order for playback to begin
- * without having to stop to buffer.
- *
+ * need to be pre-loaded, based on avg fetch time and playback speed,
+ * in order for playback to begin without having to stop to buffer.
*/
class PlayQueue extends React.Component {
constructor(props) {
diff --git a/web/js/components/charting/chart-component.js b/web/js/components/charting/chart-component.js
index 6b7cd4fc0..4a182b086 100644
--- a/web/js/components/charting/chart-component.js
+++ b/web/js/components/charting/chart-component.js
@@ -234,7 +234,8 @@ function ChartComponent (props) {
const yAxisValuesArr = getYAxisValues(data);
/**
- * Extracts each key from the provided object & returns the list, removing 'name' from the collection
+ * Extracts each key from the provided object &
+ * returns the list,removing 'name' from the collection
* @param {Object} chartData
*/
function getLineNames(obj) {
@@ -475,7 +476,10 @@ function ChartComponent (props) {
</div>
<div className="charting-disclaimer">
<strong className="charting-disclaimer-pre">Note: </strong>
- <span>Numerical analyses performed on imagery should only be used for initial basic exploratory purposes.</span>
+ <span>
+ Numerical analyses performed on imagery should only
+ be used for initial basic exploratory purposes.
+ </span>
{isTruncated
&& (
<div className="charting-disclaimer-upper">
diff --git a/web/js/components/charting/charting-date-selector.js b/web/js/components/charting/charting-date-selector.js
index ba4a48eee..00bfe0214 100644
--- a/web/js/components/charting/charting-date-selector.js
+++ b/web/js/components/charting/charting-date-selector.js
@@ -10,7 +10,10 @@ import {
function ChartingDateSelector (props) {
const {
- onUpdateStartDate, onUpdateEndDate, timeSpanStartDate, timeSpanEndDate, timeSpanSelection, date, layerStartDate, layerEndDate,
+ onUpdateStartDate, onUpdateEndDate,
+ timeSpanStartDate, timeSpanEndDate,
+ timeSpanSelection, date,
+ layerStartDate, layerEndDate,
} = props;
const { selected, selectedB } = date;
const startdate = timeSpanStartDate == null ? selected : timeSpanStartDate;
diff --git a/web/js/components/charting/charting-info.js b/web/js/components/charting/charting-info.js
index 23a0992d9..39864fb8d 100644
--- a/web/js/components/charting/charting-info.js
+++ b/web/js/components/charting/charting-info.js
@@ -15,7 +15,7 @@ function ChartingInfo(props) {
<div className="charting-info-text">
<p className="charting-info">
The charting feature is available for beta testing and evaluation.&nbsp;
- <span class="charting-feedback" onClick={() => sendFeedback(feedbackIsInitiated, isMobile)}>Please send comments and feedback to us.</span>
+ <span className="charting-feedback" onClick={() => sendFeedback(feedbackIsInitiated, isMobile)}>Please send comments and feedback to us.</span>
</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 (median, mean, minimum, maximum, and standard deviation) for an area of interest.</p>
diff --git a/web/js/components/charting/simple-statistics.js b/web/js/components/charting/simple-statistics.js
index 8df93a142..c845e9ccf 100644
--- a/web/js/components/charting/simple-statistics.js
+++ b/web/js/components/charting/simple-statistics.js
@@ -77,7 +77,8 @@ function SimpleStatistics(props) {
<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/context-menu/context-menu.js b/web/js/components/context-menu/context-menu.js
index a9a7c1dc3..741302eed 100644
--- a/web/js/components/context-menu/context-menu.js
+++ b/web/js/components/context-menu/context-menu.js
@@ -23,7 +23,8 @@ function RightClickMenu(props) {
const [toolTipToggleTime, setToolTipToggleTime] = useState(0);
const [formattedCoordinates, setFormattedCoordinates] = useState();
const {
- map, proj, unitOfMeasure, onToggleUnits, isCoordinateSearchActive, allMeasurements, measurementIsActive, isMobile,
+ map, proj, unitOfMeasure, onToggleUnits, isCoordinateSearchActive,
+ allMeasurements, measurementIsActive, isMobile,
} = props;
const { crs } = proj.selected;
const measurementsInProj = !!(Object.keys(allMeasurements[crs]) || []).length;
diff --git a/web/js/components/dateline/datelines.js b/web/js/components/dateline/datelines.js
index 0f145bef4..62252d051 100644
--- a/web/js/components/dateline/datelines.js
+++ b/web/js/components/dateline/datelines.js
@@ -9,7 +9,8 @@ import { CRS } from '../../modules/map/constants';
function DateLines(props) {
const {
- map, proj, date, isCompareActive, mapIsRendered, alwaysShow, hideText, isMobilePhone, isMobileTablet,
+ map, proj, date, isCompareActive, mapIsRendered,
+ alwaysShow, hideText, isMobilePhone, isMobileTablet,
} = props;
const [height, setHeight] = useState(0);
diff --git a/web/js/components/feature-alert/granuleAlertModal.js b/web/js/components/feature-alert/granuleAlertModal.js
index 3a74519d7..67cf405ec 100644
--- a/web/js/components/feature-alert/granuleAlertModal.js
+++ b/web/js/components/feature-alert/granuleAlertModal.js
@@ -15,7 +15,11 @@ function GranuleAlertModalBody() {
<Row className="p-3">
<Col>
<p>
- Certain imagery visualization layers have narrower and smaller footprints so there isn&apos;t imagery to view at every location across the globe. Some imagery layers also have lower temporal revisit periods meaning there won&apos;t be daily imagery for a specific location on earth. Click on “View Options” in the layer list to access a date picker to locate imagery for your desired location.
+ Certain imagery visualization layers have narrower and
+ smaller footprints so there isn&apos;t imagery to view at every location across the
+ globe. Some imagery layers also have lower temporal revisit periods meaning there
+ won&apos;t be daily imagery for a specific location on earth. Click on “View Options”
+ in the layer list to access a date picker to locate imagery for your desired location.
</p>
</Col>
</Row>
diff --git a/web/js/components/feature-alert/vector-alert-modal.js b/web/js/components/feature-alert/vector-alert-modal.js
index ed005146a..f9328e1d8 100644
--- a/web/js/components/feature-alert/vector-alert-modal.js
+++ b/web/js/components/feature-alert/vector-alert-modal.js
@@ -17,7 +17,12 @@ function VectorAlertModalBody() {
<Col>
<p>
- Vector layers identify locations on earth using points, line segments or polygons while raster layers represent locations on earth through a grid of cells or pixels that have associated color values. The vector layers have attribute information that can be examined when a vector feature is clicked. For example, when a point is clicked on in the Dams layer, a table of attributes will appear including the dam name, river, main use, representative capacity, etc.
+ Vector layers identify locations on earth using points, line segments or polygons while
+ raster layers represent locations on earth through a grid of cells or pixels that have
+ associated color values. The vector layers have attribute information that can be
+ examined when a vector feature is clicked. For example, when a point is clicked on in
+ the Dams layer, a table of attributes will appear including the dam name, river, main
+ use, representative capacity, etc.
</p>
</Col>
</Row>
@@ -32,7 +37,9 @@ function VectorAlertModalBody() {
<Col>
<p>
- To speed up map interactions, vector layers that have a vast number of features are rendered as raster images in outer zoom levels. Zoom in to be able to query the vector layer.
+ To speed up map interactions, vector layers that have a vast number of features are
+ rendered as raster images in outer zoom levels. Zoom in to be able to query the vector
+ layer.
</p>
</Col>
</Row>
@@ -46,7 +53,11 @@ function VectorAlertModalBody() {
<Row className="p-3">
<Col>
<p>
- If you see the blue pointer icon next to the layer in the sidebar Layer List, you should be able to click on that layer’s features in order to access attribute information associated with that vector feature. If you see the blue pointer with a red X over it, you are zoomed out too far and the layer is being rendered as a raster, zoom in to be able to examine the attribute information of the vector layer.
+ If you see the blue pointer icon next to the layer in the sidebar Layer List, you
+ should be able to click on that layer’s features in order to access attribute
+ information associated with that vector feature. If you see the blue pointer with a
+ red X over it, you are zoomed out too far and the layer is being rendered as a raster,
+ zoom in to be able to examine the attribute information of the vector layer.
</p>
</Col>
<Col>
diff --git a/web/js/components/feature-alert/zoomAlertModal.js b/web/js/components/feature-alert/zoomAlertModal.js
index 744d17aff..83637c28b 100644
--- a/web/js/components/feature-alert/zoomAlertModal.js
+++ b/web/js/components/feature-alert/zoomAlertModal.js
@@ -15,7 +15,8 @@ function ZoomAlertModalBody() {
<Row className="p-3">
<Col>
<p>
- Imagery for certain layers is dynamically generated and only available when zoomed in. Please zoom in to view this product.
+ Imagery for certain layers is dynamically generated and only available when zoomed in.
+ Please zoom in to view this product.
</p>
</Col>
</Row>
diff --git a/web/js/components/image-download/global-select.js b/web/js/components/image-download/global-select.js
index e36972ae7..2f25c9e2a 100644
--- a/web/js/components/image-download/global-select.js
+++ b/web/js/components/image-download/global-select.js
@@ -12,7 +12,8 @@ function GlobalSelectCheckbox(props) {
const boundingBoxArray = [...geoLatLong[0], ...geoLatLong[1]];
const globalSelected = isEqual(boundingBoxArray, GLOBAL_LAT_LONG_EXTENT);
- const [prevExtent, setPrevExtent] = useState(globalSelected ? [-40, -40, 40, 40] : boundingBoxArray);
+ const [prevExtent, setPrevExtent] = useState(globalSelected ? [-40, -40, 40, 40]
+ : boundingBoxArray);
const onCheck = () => {
const useExtent = globalSelected ? prevExtent : GLOBAL_LAT_LONG_EXTENT;
setPrevExtent(boundingBoxArray);
@@ -23,7 +24,8 @@ function GlobalSelectCheckbox(props) {
}, 50);
};
- const globalIsNotSelected = GLOBAL_LAT_LONG_EXTENT.some((latLongValue, index) => latLongValue !== boundingBoxArray[index]);
+ const globalIsNotSelected = GLOBAL_LAT_LONG_EXTENT.some((latLongValue, index) => latLongValue
+ !== boundingBoxArray[index]);
if (proj !== 'geographic') return null;
return (
diff --git a/web/js/components/image-download/image-download-panel.js b/web/js/components/image-download/image-download-panel.js
index 75b0f29a9..5f9cd03c1 100644
--- a/web/js/components/image-download/image-download-panel.js
+++ b/web/js/components/image-download/image-download-panel.js
@@ -59,12 +59,20 @@ function ImageDownloadPanel(props) {
const [currResolution, setResolution] = useState(resolution);
const [debugUrl, setDebugUrl] = useState('');
const [showGranuleWarning, setShowGranuleWarning] = useState(false);
- const activePalettes = useSelector((state) => getActivePalettes(state, state.compare.activeString));
+ const activePalettes = useSelector((state) => getActivePalettes(
+ state,
+ state.compare.activeString,
+ ));
useEffect(() => {
const layerList = getLayers();
- const granuleDatesMap = new Map(map.getLayers().getArray().map((layer) => [layer.wv.id, layer.wv.granuleDates]));
- const layerDefs = layerList.map((def) => ({ ...def, granuleDates: granuleDatesMap.get(def.id) }));
+ const granuleDatesMap = new Map(map.getLayers().getArray().map((layer) => [
+ layer.wv.id,
+ layer.wv.granuleDates,
+ ]));
+ const layerDefs = layerList.map((def) => ({
+ ...def, granuleDates: granuleDatesMap.get(def.id),
+ }));
const isTruncated = getTruncatedGranuleDates(layerDefs, date).truncated;
setShowGranuleWarning(isTruncated);
@@ -74,8 +82,12 @@ function ImageDownloadPanel(props) {
const time = new Date(date.getTime());
const layerList = getLayers();
- const granuleDatesMap = new Map(map.getLayers().getArray().map((layer) => [layer.wv.id, layer.wv.granuleDates]));
- const layerDefs = layerList.map((def) => ({ ...def, granuleDates: granuleDatesMap.get(def.id) }));
+ const granuleDatesMap = new Map(map.getLayers().getArray().map((layer) => [
+ layer.wv.id, layer.wv.granuleDates,
+ ]));
+ const layerDefs = layerList.map((def) => ({
+ ...def, granuleDates: granuleDatesMap.get(def.id),
+ }));
const dlURL = getDownloadUrl(
url,
projection,
@@ -212,7 +224,13 @@ function ImageDownloadPanel(props) {
map={map}
/>
{showGranuleWarning && (
- <p>Warning: A snapshot will capture a max. of {GRANULE_LIMIT} granules, additional granules are omitted.</p> // eslint-disable-line react/jsx-one-expression-per-line
+ <p>
+ Warning: A snapshot will capture a max. of
+ {GRANULE_LIMIT}
+ {' '}
+ granules, additional
+ granules are omitted.
+ </p> // eslint-disable-line react/jsx-one-expression-per-line
)}
<ResTable
width={width}
diff --git a/web/js/components/image-download/lat-long-inputs.js b/web/js/components/image-download/lat-long-inputs.js
index fd1a85bef..13071a2e6 100644
--- a/web/js/components/image-download/lat-long-inputs.js
+++ b/web/js/components/image-download/lat-long-inputs.js
@@ -94,7 +94,9 @@ function LatLongSelect(props) {
const boundingBoxArray = [geoLatLong[0][0], geoLatLong[0][1], geoLatLong[1][0], geoLatLong[1][1]];
const [showCoordinates, setShowCoordinates] = useState(false);
const coordText = showCoordinates ? 'Hide Coordinates' : 'Edit Coordinates';
- const [minLon, minLat, maxLon, maxLat] = boundingBoxArray.map((coord) => coord.toFixed(4).toString());
+ const [minLon, minLat, maxLon, maxLat] = boundingBoxArray.map(
+ (coord) => coord.toFixed(4).toString(),
+ );
return (
<div className="wv-image-input-case">
diff --git a/web/js/components/kiosk/animation-tile-check/animation-tile-check.js b/web/js/components/kiosk/animation-tile-check/animation-tile-check.js
index 1d1a34d31..c2d4934a5 100644
--- a/web/js/components/kiosk/animation-tile-check/animation-tile-check.js
+++ b/web/js/components/kiosk/animation-tile-check/animation-tile-check.js
@@ -17,7 +17,10 @@ function AnimationTileCheck(props) {
const config = useSelector((state) => state.config, shallowEqual);
const proj = useSelector((state) => state.proj.selected, shallowEqual);
const zoom = useSelector((state) => Math.floor(state.map.ui.selected.getView().getZoom()));
- const activeLayers = useSelector((state) => getActiveLayers(state, state.compare.activeString), shallowEqual);
+ const activeLayers = useSelector(
+ (state) => getActiveLayers(state, state.compare.activeString),
+ shallowEqual,
+ );
const [frameDates, setFrameDates] = useState([]);
@@ -48,7 +51,13 @@ function AnimationTileCheck(props) {
}, [isPlaying]);
return (
- <DateRangeTileCheck frameDates={frameDates} activeLayers={activeLayers} config={config} proj={proj} zoom={zoom} />
+ <DateRangeTileCheck
+ frameDates={frameDates}
+ activeLayers={activeLayers}
+ config={config}
+ proj={proj}
+ zoom={zoom}
+ />
);
}
diff --git a/web/js/components/kiosk/animation-tile-check/date-range-tile-check.js b/web/js/components/kiosk/animation-tile-check/date-range-tile-check.js
index c72c0079c..0cf3afeb3 100644
--- a/web/js/components/kiosk/animation-tile-check/date-range-tile-check.js
+++ b/web/js/components/kiosk/animation-tile-check/date-range-tile-check.js
@@ -10,7 +10,8 @@ import {
LEFT_WING_EXTENT, RIGHT_WING_EXTENT, LEFT_WING_ORIGIN, RIGHT_WING_ORIGIN,
} from '../../../modules/map/constants';
-// Layers to be checked for tile availability need to have manually determined content-length thresholds.
+// Layers to be checked for tile availability need
+// to have manually determined content-length thresholds.
// Any active layers that are not listed in this object will NOT be checked for tile availability.
// This represents a TOTAL content-length for all tiles for a single date for a single layer
// To find a good value for the total content-length:
@@ -37,7 +38,11 @@ function DateRangeTileCheck(props) {
} = props;
const dispatch = useDispatch();
- const toggleCheckedAnimationAvailability = (available) => { dispatch(toggleCheckedAnimationAvailabilityAction(available)); };
+ const toggleCheckedAnimationAvailability = (available) => {
+ dispatch(
+ toggleCheckedAnimationAvailabilityAction(available),
+ );
+ };
const calcExtentsFromLimits = (matrixSet, matrixSetLimits, day) => {
let extent;
@@ -103,7 +108,8 @@ function DateRangeTileCheck(props) {
const { tileMatrices, resolutions, tileSize } = configMatrixSet;
const { origin, extent } = calcExtentsFromLimits(configMatrixSet, matrixSetLimits, null);
- const sizes = !tileMatrices ? [] : tileMatrices.map(({ matrixWidth, matrixHeight }) => [matrixWidth, matrixHeight]);
+ const sizes = !tileMatrices ? [] : tileMatrices.map(({ matrixWidth, matrixHeight }) => [
+ matrixWidth, matrixHeight]);
const tileGridOptions = {
origin,
@@ -211,8 +217,10 @@ function DateRangeTileCheck(props) {
layer.dates.forEach((date) => {
if (date.contentLengthSum < threshold) {
- const dateStr = date.date.toISOString(); // Convert date to string for use as an object key
- uniqueDatesBelowThreshold.add(dateStr); // Add the date to the set. If it's already there, it won't be added again.
+ // Convert date to string for use as an object key
+ const dateStr = date.date.toISOString();
+ // Add the date to the set. If it's already there, it won't be added again.
+ uniqueDatesBelowThreshold.add(dateStr);
}
});
});
@@ -222,9 +230,11 @@ function DateRangeTileCheck(props) {
// Calculate how many frames are missing tiles as a percentage
const percentMissing = (framesWithMissingTiles / frameDates.length) * 100;
- // If there are less than 40% of frames with missing tiles we dispatch action to allow animation to play
+ // If there are less than 40% of frames with missing
+ // tiles we dispatch action to allow animation to play
// Else we do not do anything which means we display static imagery of the first frame
- // The imagery at this date should already be satisfactory because the errorTile process has already been completed
+ // The imagery at this date should already be
+ // satisfactory because the errorTile process has already been completed
// The percentMissing conditional value is completely arbitrary and can be changed
if (percentMissing < 40) {
console.log('Good Check:', percentMissing, '% ', 'of dates with missing frames');
diff --git a/web/js/components/layer/info/date-ranges.js b/web/js/components/layer/info/date-ranges.js
index d3157c7e4..24808d218 100644
--- a/web/js/components/layer/info/date-ranges.js
+++ b/web/js/components/layer/info/date-ranges.js
@@ -3,7 +3,10 @@ import { ListGroup, ListGroupItem, Spinner } from 'reactstrap';
import Scrollbar from '../../util/scrollbar';
import { coverageDateFormatter } from '../../../modules/date/util';
-const formatDateRanges = (dateRanges = []) => dateRanges.map(({ startDate, endDate }) => [startDate, endDate]);
+const formatDateRanges = (dateRanges = []) => dateRanges.map(({
+ startDate,
+ endDate,
+}) => [startDate, endDate]);
export default function DateRanges ({ layer }) {
const [showRanges, setShowRanges] = useState(false);
@@ -17,10 +20,13 @@ export default function DateRanges ({ layer }) {
worker.onmessage = (event) => {
if (Array.isArray(event.data)) { // our final format is an array
worker.terminate(); // terminate the worker
- const data = event.data.length ? event.data : formatDateRanges(layer.dateRanges); // fallback to layer.dateRanges if no DescribeDomains data
+ // fallback to layer.dateRanges if no DescribeDomains data
+ const data = event.data.length
+ ? event.data : formatDateRanges(layer.dateRanges);
return setDateRanges(data);
}
- // DOMParser is not available in workers so we parse the xml on the main thread before sending it back to the worker
+ // DOMParser is not available in workers so we parse the xml on the main thread before sending
+ // it back to the worker
const parser = new DOMParser();
const xmlDoc = parser.parseFromString(event.data, 'text/xml');
const domains = xmlDoc.querySelector('Domain')?.textContent || '';
@@ -28,10 +34,13 @@ export default function DateRanges ({ layer }) {
};
worker.onerror = () => {
worker.terminate();
- setDateRanges(formatDateRanges(layer.dateRanges)); // fallback to layer.dateRanges if worker fails
+ // fallback to layer.dateRanges if worker fails
+ setDateRanges(formatDateRanges(layer.dateRanges));
};
const { startDate } = layer;
- const endDate = layer.endDate ? new Date(layer.endDate).toISOString() : new Date().toISOString(); // default to today if no end date
+ const endDate = layer.endDate
+ ? new Date(layer.endDate).toISOString()
+ : new Date().toISOString(); // default to today if no end date
const params = {
startDate,
endDate,
diff --git a/web/js/components/layer/product-picker/browse/category-layer-row.js b/web/js/components/layer/product-picker/browse/category-layer-row.js
index a4e3a1e66..6511f3ad0 100644
--- a/web/js/components/layer/product-picker/browse/category-layer-row.js
+++ b/web/js/components/layer/product-picker/browse/category-layer-row.js
@@ -167,7 +167,8 @@ class CategoryLayerRow extends React.Component {
if (minValidIndex < 0) {
minValidIndex = index;
}
- // if activeSourceIndex is less than first valid index, make minValidIndex active tab
+ // if activeSourceIndex is less than first valid index,
+ // make minValidIndex active tab
validActiveIndex = minValidIndex > selectedMeasurementSourceIndex
? minValidIndex
: selectedMeasurementSourceIndex;
@@ -265,7 +266,12 @@ const mapStateToProps = (state) => {
sources: getSourcesForProjection(state),
selectedMeasurement,
selectedMeasurementSourceIndex,
- hasMeasurementSetting: (current, source) => hasSettingSelector(current, source, config, proj.id),
+ hasMeasurementSetting: (current, source) => hasSettingSelector(
+ current,
+ source,
+ config,
+ proj.id,
+ ),
};
};
diff --git a/web/js/components/layer/settings/band-selection/band-selection-menu.js b/web/js/components/layer/settings/band-selection/band-selection-menu.js
index f73be9571..bbe570504 100644
--- a/web/js/components/layer/settings/band-selection/band-selection-menu.js
+++ b/web/js/components/layer/settings/band-selection/band-selection-menu.js
@@ -18,7 +18,9 @@ export default function BandSelection({ layer }) {
activeLayers: getActiveLayers(state, state.compare.activeString).map((layer) => layer),
}));
const layerIndex = activeLayers.findIndex((activeLayer) => activeLayer.id === layer.id);
- const currentSelectedPreset = useSelector((state) => state.layers.active.layers[layerIndex].selectedPreset);
+ const currentSelectedPreset = useSelector(
+ (state) => state.layers.active.layers[layerIndex].selectedPreset,
+ );
const [selectedPreset, setSelectedPreset] = useState(currentSelectedPreset);
const updateBandCombination = (id, bandCombo) => {
dispatch(updateBandCombinationAction(id, bandCombo, layerIndex, selectedPreset));
diff --git a/web/js/components/layer/settings/imagery-search.js b/web/js/components/layer/settings/imagery-search.js
index 628570379..88a37230d 100644
--- a/web/js/components/layer/settings/imagery-search.js
+++ b/web/js/components/layer/settings/imagery-search.js
@@ -90,7 +90,10 @@ export default function ImagerySearch({ layer }) {
const loadNewerDates = async (layer, pageNum = 1) => {
setGranulesStartStatus('loading');
const newerDates = await getNewerGranules(layer, newerGranuleDates[0], pageNum);
- const dates = [...newerGranuleDates, ...newerDates].sort((a, b) => Date.parse(b) - Date.parse(a));
+ const dates = [
+ ...newerGranuleDates,
+ ...newerDates,
+ ].sort((a, b) => Date.parse(b) - Date.parse(a));
setNewerGranuleDates(dates);
setGranulesStartStatus('loaded');
};
@@ -98,7 +101,10 @@ export default function ImagerySearch({ layer }) {
const loadOlderDates = async (layer, pageNum = 1) => {
setGranulesEndStatus('loading');
const olderDates = await getOlderGranules(layer, olderGranuleDates.at(-1), pageNum);
- const dates = [...olderGranuleDates, ...olderDates].sort((a, b) => Date.parse(b) - Date.parse(a));
+ const dates = [
+ ...olderGranuleDates,
+ ...olderDates,
+ ].sort((a, b) => Date.parse(b) - Date.parse(a));
setOlderGranuleDates(dates);
setGranulesEndStatus('loaded');
};
@@ -120,8 +126,13 @@ export default function ImagerySearch({ layer }) {
}, [page]);
const renderDates = () => {
- const granuleDates = [...olderGranuleDates, ...newerGranuleDates].sort((a, b) => Date.parse(b) - Date.parse(a));
- const renderedDates = [...new Set(granuleDates.map((date) => date.toLocaleDateString('en-US', dateOptions)))].map((date, i) => (
+ const granuleDates = [
+ ...olderGranuleDates,
+ ...newerGranuleDates,
+ ].sort((a, b) => Date.parse(b) - Date.parse(a));
+ const renderedDates = [
+ ...new Set(granuleDates.map((date) => date.toLocaleDateString('en-US', dateOptions))),
+ ].map((date, i) => (
<li className="lazyload-list-item" key={date} onClick={() => handleSelection(date)}>
{date}
</li>
diff --git a/web/js/components/layer/settings/layer-settings.js b/web/js/components/layer/settings/layer-settings.js
index 724573b07..5ec45c5fc 100644
--- a/web/js/components/layer/settings/layer-settings.js
+++ b/web/js/components/layer/settings/layer-settings.js
@@ -125,7 +125,9 @@ class LayerSettings extends React.Component {
palette={palette}
toggle={(classIndex) => toggleClassification(layer.id, classIndex, i, groupName)}
legend={legend}
- toggleAll={(disabledArray) => { toggleAllClassifications(layer.id, disabledArray, i, groupName); }}
+ toggleAll={(disabledArray) => {
+ toggleAllClassifications(layer.id, disabledArray, i, groupName);
+ }}
/>
</TabPane>
);
@@ -227,7 +229,9 @@ class LayerSettings extends React.Component {
palette={palette}
toggle={(classIndex) => toggleClassification(layer.id, classIndex, 0, groupName)}
legend={legend}
- toggleAll={(disabledArray) => { toggleAllClassifications(layer.id, disabledArray, 0, groupName); }}
+ toggleAll={(disabledArray) => {
+ toggleAllClassifications(layer.id, disabledArray, 0, groupName);
+ }}
/>
);
}
diff --git a/web/js/components/layer/settings/palette-threshold.js b/web/js/components/layer/settings/palette-threshold.js
index 4ed2899fe..e8e2aa9c0 100644
--- a/web/js/components/layer/settings/palette-threshold.js
+++ b/web/js/components/layer/settings/palette-threshold.js
@@ -123,7 +123,10 @@ class PaletteThreshold extends React.Component {
} = this.props;
const units = legend.units || '';
- const { needsConversion, legendTempUnit } = checkTemperatureUnitConversion(units, globalTemperatureUnit);
+ const {
+ needsConversion,
+ legendTempUnit,
+ } = checkTemperatureUnitConversion(units, globalTemperatureUnit);
let startLabel = start === 0 && legend.minLabel
? legend.minLabel
: legend.tooltips[start];
diff --git a/web/js/components/layer/settings/palette.js b/web/js/components/layer/settings/palette.js
index eb6e96fe0..c70d0bb22 100644
--- a/web/js/components/layer/settings/palette.js
+++ b/web/js/components/layer/settings/palette.js
@@ -60,7 +60,7 @@ function PaletteSelect (props) {
onClick={() => onChangePalette(id)}
/>
{isSelected && (
- <span class="dot" />
+ <span className="dot" />
)}
<label htmlFor={`wv-palette-radio-${id}-${index}`}>
<span
@@ -103,7 +103,7 @@ function PaletteSelect (props) {
onClick={() => onChangePalette(id)}
/>
{isSelected && (
- <span class="dot" />
+ <span className="dot" />
)}
<label htmlFor={`wv-palette-radio-${id}-${index}`}>
<img src={dataURL} />
diff --git a/web/js/components/layer/settings/vector-style.js b/web/js/components/layer/settings/vector-style.js
index 008e32f10..2fd5a0115 100644
--- a/web/js/components/layer/settings/vector-style.js
+++ b/web/js/components/layer/settings/vector-style.js
@@ -124,7 +124,7 @@ class VectorStyleSelect extends React.Component {
onClick={() => this.onChangeVectorStyle(vectorStyleId)}
/>
{isSelected && (
- <span class="dot" />
+ <span className="dot" />
)}
<label htmlFor={`wv-palette-radio-${vectorStyleId}`}>
<span
diff --git a/web/js/components/location-search/coordinates-dialog.js b/web/js/components/location-search/coordinates-dialog.js
index e40e806ad..fdc41c5d6 100644
--- a/web/js/components/location-search/coordinates-dialog.js
+++ b/web/js/components/location-search/coordinates-dialog.js
@@ -149,7 +149,9 @@ class CoordinatesDialog extends Component {
const buttonId = 'copy-coordinates-to-clipboard-button';
const labelText = 'Copy coordinates to clipboard';
- const tooltipVisibilityCondition = !isMobile && !isCopyToClipboardTooltipVisible && showTooltips;
+ const tooltipVisibilityCondition = !isMobile
+ && !isCopyToClipboardTooltipVisible
+ && showTooltips;
return (
<div
diff --git a/web/js/components/location-search/location-search-modal.js b/web/js/components/location-search/location-search-modal.js
index fae07622c..4dd51b243 100644
--- a/web/js/components/location-search/location-search-modal.js
+++ b/web/js/components/location-search/location-search-modal.js
@@ -40,7 +40,14 @@ class LocationSearchModal extends Component {
showReverseGeocodeAlert: false,
showNoSuggestionsAlert: false,
};
- this.debounceGetSuggestions = lodashDebounce(this.getSuggestions, 400, { leading: true, trailing: true });
+ this.debounceGetSuggestions = lodashDebounce(
+ this.getSuggestions,
+ 400,
+ {
+ leading: true,
+ trailing: true,
+ },
+ );
}
componentDidUpdate(prevProps) {
@@ -66,14 +73,17 @@ class LocationSearchModal extends Component {
if (inputValue && suggestions.length === 0 && prevProps.suggestions.length > 0) {
const prevInputValue = prevProps.inputValue;
const prevSuggestedPlace = prevProps.suggestedPlace;
- const newSuggestedPlaceSelected = prevInputValue && prevSuggestedPlace.length > 0 && prevSuggestedPlace[0].text === prevInputValue;
+ const newSuggestedPlaceSelected = prevInputValue
+ && prevSuggestedPlace.length > 0 && prevSuggestedPlace[0].text === prevInputValue;
const isCoordinates = isValidCoordinates(inputValue);
// prevent flag error on new place/coordinates being copy pasted
if (!newSuggestedPlaceSelected && !isCoordinates) {
this.setNoSuggestionsAlert(true);
this.setInputAlertIcon(true);
}
- } else if ((showNoSuggestionsAlert || showInputAlert) && (!inputValue || suggestions.length > 0)) {
+ } else if (
+ (showNoSuggestionsAlert || showInputAlert)
+ && (!inputValue || suggestions.length > 0)) {
this.setNoSuggestionsAlert(false);
this.setInputAlertIcon(false);
}
@@ -414,7 +424,10 @@ const mapStateToProps = (state) => {
preventInputFocus,
coordinates,
locationSearchMobileModalOpen,
- isCoordinatePairWithinExtent: (targetCoordinates) => areCoordinatesWithinExtent(proj, targetCoordinates),
+ isCoordinatePairWithinExtent: (targetCoordinates) => areCoordinatesWithinExtent(
+ proj,
+ targetCoordinates,
+ ),
isCoordinateSearchActive,
isMobile,
processMagicKey: (magicKey) => processMagicKey(magicKey, config),
diff --git a/web/js/components/location-search/location-search.js b/web/js/components/location-search/location-search.js
index 12d975ff8..d8b9ce40b 100644
--- a/web/js/components/location-search/location-search.js
+++ b/web/js/components/location-search/location-search.js
@@ -84,7 +84,10 @@ const mapStateToProps = (state) => {
const isMobile = screenSize.isMobileDevice;
const snapshotModalOpen = modal.isOpen && modal.id === 'TOOLBAR_SNAPSHOT';
// Collapse when image download, GIF, measure tool, or distraction free mode is active
- const shouldCollapseFromOtherUI = snapshotModalOpen || measure.isActive || gifActive || isDistractionFreeModeActive;
+ const shouldCollapseFromOtherUI = snapshotModalOpen
+ || measure.isActive
+ || gifActive
+ || isDistractionFreeModeActive;
return {
isExpanded,
diff --git a/web/js/components/location-search/util.js b/web/js/components/location-search/util.js
index b714cf1bb..5c0c165cc 100644
--- a/web/js/components/location-search/util.js
+++ b/web/js/components/location-search/util.js
@@ -26,7 +26,10 @@ export function getNormalizedCoordinate([lon, lat]) {
}
const isNegative = lon < 0;
const remainder = lon % 360;
- const longitude = isNegative && remainder < -180 ? remainder + 360 : !isNegative && remainder > 180 ? remainder - 360 : remainder;
+ const longitude = isNegative
+ && remainder < -180
+ ? remainder + 360
+ : !isNegative && remainder > 180 ? remainder - 360 : remainder;
return [longitude, lat];
}
diff --git a/web/js/components/map/ol-measure-tool.js b/web/js/components/map/ol-measure-tool.js
index d905d7945..335faec93 100644
--- a/web/js/components/map/ol-measure-tool.js
+++ b/web/js/components/map/ol-measure-tool.js
@@ -277,7 +277,8 @@ function OlMeasureTool (props) {
}
}
- // Monitor for projection change & terminate any incomplete measurement from the previous projection
+ // Monitor for projection change &
+ // terminate any incomplete measurement from the previous projection
useEffect(() => {
if (olMap != null) {
const regionFromCrs = {
diff --git a/web/js/components/measure-tool/measure-menu.js b/web/js/components/measure-tool/measure-menu.js
index d936d891b..1e2c7004d 100644
--- a/web/js/components/measure-tool/measure-menu.js
+++ b/web/js/components/measure-tool/measure-menu.js
@@ -52,7 +52,9 @@ const MeasureMenu = function () {
const isMobile = useSelector((state) => state.screenSize.isMobileDevice);
const isTouchDevice = useSelector((state) => state.modal.customProps.touchDevice);
const unitOfMeasure = useSelector((state) => state.measure.unitOfMeasure);
- const measurementsInProj = useSelector((state) => !!Object.keys(state.measure.allMeasurements[state.proj.selected.crs]).length);
+ const measurementsInProj = useSelector((state) => !!Object.keys(
+ state.measure.allMeasurements[state.proj.selected.crs],
+ ).length);
const listSize = isTouchDevice ? 'large' : 'small';
DOWNLOAD_GEOJSON.hidden = !measurementsInProj || isMobile;
diff --git a/web/js/components/measure-tool/measure-tooltip.js b/web/js/components/measure-tool/measure-tooltip.js
index 08b36b5e8..c2ccdd099 100644
--- a/web/js/components/measure-tool/measure-tooltip.js
+++ b/web/js/components/measure-tool/measure-tooltip.js
@@ -110,15 +110,19 @@ export default function MeasureTooltip(props) {
const checkPolarCoordValidity = () => {
const coordinates = geometry.flatCoordinates;
- // Distance & Area measurement coordinates are stored differently, so identify based on geometry type
- const yCoord = geometry instanceof OlGeomPolygon ? coordinates[coordinates.length - 4] : coordinates[coordinates.length - 2];
- const xCoord = geometry instanceof OlGeomPolygon ? coordinates[coordinates.length - 3] : coordinates[coordinates.length - 1];
+ // Distance & Area measurement coordinates are stored differently,
+ // so identify based on geometry type
+ const yCoord = geometry instanceof OlGeomPolygon
+ ? coordinates[coordinates.length - 4] : coordinates[coordinates.length - 2];
+ const xCoord = geometry instanceof OlGeomPolygon
+ ? coordinates[coordinates.length - 3] : coordinates[coordinates.length - 1];
const tCoord = transform([xCoord, yCoord], crs, CRS.GEOGRAPHIC);
return areCoordinatesWithinExtent(proj, tCoord);
};
const tooltipValue = getMeasurementValue();
- const coordinatesAreValid = crs === CRS.GEOGRAPHIC ? checkGeographicCoordValidity(tooltipValue) : checkPolarCoordValidity();
+ const coordinatesAreValid = crs === CRS.GEOGRAPHIC
+ ? checkGeographicCoordValidity(tooltipValue) : checkPolarCoordValidity();
if (coordinatesAreValid) {
return (
diff --git a/web/js/components/measure-tool/util.js b/web/js/components/measure-tool/util.js
index a6bfef3c1..2af79acc5 100644
--- a/web/js/components/measure-tool/util.js
+++ b/web/js/components/measure-tool/util.js
@@ -52,7 +52,8 @@ function checkForXFlip(geom, projection) {
export function transformLineStringArc(geom, projection) {
const coords = [];
const distance = 50000; // meters between segments
- const transformedGeom = checkForXFlip(geom, projection).clone().transform(projection, CRS.GEOGRAPHIC);
+ const transformedGeom = checkForXFlip(geom, projection)
+ .clone().transform(projection, CRS.GEOGRAPHIC);
transformedGeom.forEachSegment((segStart, segEnd) => {
const line = geod.InverseLine(segStart[1], segStart[0], segEnd[1], segEnd[0]);
const n = Math.ceil(line.s13 / distance);
diff --git a/web/js/components/measure-tool/util.test.js b/web/js/components/measure-tool/util.test.js
index 337fea079..ad2a31fa1 100644
--- a/web/js/components/measure-tool/util.test.js
+++ b/web/js/components/measure-tool/util.test.js
@@ -26,7 +26,8 @@ test('two different triangles of the same size return the same measurement', ()
});
/**
- * Should be able to handle area calculation made crossing the anti-meridian in geographic projection
+ * Should be able to handle area calculation made
+ * crossing the anti-meridian in geographic projection
* where coordinates DO extend beyond +/- 180, +/- 90 due to map repeating
*/
test('area measurement that includes coordinates outisde of "normal" extents return correct result', () => {
diff --git a/web/js/components/range-selection/dragger-range.js b/web/js/components/range-selection/dragger-range.js
index e637ebcd7..fb9a5c27c 100644
--- a/web/js/components/range-selection/dragger-range.js
+++ b/web/js/components/range-selection/dragger-range.js
@@ -114,7 +114,8 @@ class TimelineDraggerRange extends PureComponent {
}
}
- // +/- {number} - change in x - set to 0 to 'stop' dragger movement - min/max of -55/55 to prevent overdrag
+ // +/- {number} - change in x - set to 0 to 'stop' dragger movement
+ // - min/max of -55/55 to prevent overdrag
let deltaX = d.deltaX < -55 ? -55 : d.deltaX > 55 ? 55 : d.deltaX;
// +/- {number} - start position
const deltaStart = d.x;
diff --git a/web/js/components/range-selection/range-selection.js b/web/js/components/range-selection/range-selection.js
index fa8556963..2daf1ff8d 100644
--- a/web/js/components/range-selection/range-selection.js
+++ b/web/js/components/range-selection/range-selection.js
@@ -126,7 +126,12 @@ class TimelineRangeSelector extends React.Component {
};
// update animation dragger helper function
- getAnimationLocateDateUpdate = (animLocationDate, animDraggerLocation, deltaX, { diffZeroValues, diffFactor }) => {
+ getAnimationLocateDateUpdate = (
+ animLocationDate,
+ animDraggerLocation,
+ deltaX,
+ { diffZeroValues, diffFactor },
+ ) => {
if (!diffZeroValues) { // month or year
const {
timeScale,
@@ -138,7 +143,8 @@ class TimelineRangeSelector extends React.Component {
const options = timeScaleOptions[timeScale].timeAxis;
const { gridWidth } = options;
- const startDraggerPositionRelativeToFrontDate = animDraggerLocation - position - transformX + deltaX;
+ const startDraggerPositionRelativeToFrontDate = animDraggerLocation
+ - position - transformX + deltaX;
const gridWidthCoef = startDraggerPositionRelativeToFrontDate / gridWidth;
const draggerDateAdded = moment.utc(frontDate).add(Math.floor(gridWidthCoef), timeScale);
const draggerDateAddedValue = draggerDateAdded.valueOf();
@@ -187,7 +193,8 @@ class TimelineRangeSelector extends React.Component {
const diffZeroValues = options.scaleMs;
// get startDate for diff calculation
let diffFactor;
- if (diffZeroValues) { // month or year diffFactor is not static, so require calculation based on front date
+ if (diffZeroValues) {
+ // month or year diffFactor is not static, so require calculation based on front date
diffFactor = diffZeroValues / options.gridWidth; // else known diffFactor used
}
diff --git a/web/js/components/sidebar/charting-mode-options.js b/web/js/components/sidebar/charting-mode-options.js
index f42afadf6..c2c4c93c7 100644
--- a/web/js/components/sidebar/charting-mode-options.js
+++ b/web/js/components/sidebar/charting-mode-options.js
@@ -238,7 +238,8 @@ function ChartingModeOptions(props) {
}, [isModalOpen, modalId]);
/**
- * Provides a default AOI of the entire map if unspecified, and modifies the Openlayers coordinates for use with imageStat API
+ * Provides a default AOI of the entire map if unspecified,
+ * and modifies the Openlayers coordinates for use with imageStat API
* @param {Object} aoi (Area Of Interest)
*/
function convertOLcoordsForImageStat(aoi) {
@@ -252,7 +253,8 @@ function ChartingModeOptions(props) {
/**
* Returns the ImageStat request parameters based on the provided layer
* @param {Object} layerInfo
- * @param {String} timeSpanSelection | 'Date' for single date, 'Range' for date range, 'series' for time series charting
+ * @param {String} timeSpanSelection | 'Date' for single date, 'Range' for date range, 'series'
+ * for time series charting
*/
function getImageStatRequestParameters(layerInfo, timeSpan, startDate, endDate) {
const startDateForImageStat = formatDateForImageStat(startDate);
@@ -262,9 +264,12 @@ function ChartingModeOptions(props) {
timestamp: startDateForImageStat, // start date
endTimestamp: endDateForImageStat, // end date
type: timeSpan === 'range' ? 'series' : 'date',
- steps: STEP_NUM, // the number of days selected within a given range/series. Use '1' for just the start and end date, '2' for start date, end date and middle date, etc.
- layer: layerInfo.id, // Layer to be pulled from gibs api. e.g. 'GHRSST_L4_MUR_Sea_Surface_Temperature'
- colormap: `${layerInfo.palette.id}.xml`, // Colormap to use to decipher layer. e.g. 'GHRSST_Sea_Surface_Temperature.xml'
+ steps: STEP_NUM, // the number of days selected within a given range/series. Use '1' for just
+ // the start and end date, '2' for start date, end date and middle date, etc.
+ layer: layerInfo.id, // Layer to be pulled from gibs api.
+ // e.g. 'GHRSST_L4_MUR_Sea_Surface_Temperature'
+ colormap: `${layerInfo.palette.id}.xml`, // Colormap to use to decipher layer.
+ // e.g. 'GHRSST_Sea_Surface_Temperature.xml'
areaOfInterestCoords: AOIForImageStat, // Bounding box of latitude and longitude.
bins: 10, // Number of bins to used in returned histogram. e.g. 10
scale: 1, // unused
@@ -345,7 +350,8 @@ function ChartingModeOptions(props) {
/**
* Process the ImageStat (GIBS) data for use in the Recharts library
- * @param {Object} data | This contains the name (dates) & min, max, stddev, etc. for each step requested
+ * @param {Object} data | This contains the name (dates)
+ * & min, max, stddev, etc. for each step requested
*/
function formatGIBSDataForRecharts(data) {
const xAxisNames = getKeysFromObj(data.min);
@@ -431,7 +437,9 @@ function ChartingModeOptions(props) {
});
const requestedLayerSource = layerInfo.projections.geographic.source;
if (requestedLayerSource === 'GIBS:geographic') {
- const numDaysRequested = Math.floor((initialEndDate - initialStartDate) / (1000 * 60 * 60 * 24)) + 1;
+ const numDaysRequested = Math.floor(
+ (initialEndDate - initialStartDate) / (1000 * 60 * 60 * 24),
+ ) + 1;
const requestsNeeded = Math.ceil(Math.min(MAX_DAYS, numDaysRequested) / STEP_NUM);
const requestsSize = Math.ceil(numDaysRequested / requestsNeeded);
const promises = [];
@@ -443,7 +451,12 @@ function ChartingModeOptions(props) {
if (requestEndDate > initialEndDate) {
requestEndDate = new Date(initialEndDate.getTime());
}
- const uriParameters = getImageStatRequestParameters(layerInfo, timeSpanSelection, requestStartDate, requestEndDate);
+ const uriParameters = getImageStatRequestParameters(
+ layerInfo,
+ timeSpanSelection,
+ requestStartDate,
+ requestEndDate,
+ );
const requestURI = getImageStatStatsRequestURL(uriParameters);
promises.push(getImageStatData(requestURI));
}
@@ -474,10 +487,14 @@ function ChartingModeOptions(props) {
if (timeSpanSelection === 'range') {
const rechartsData = formatGIBSDataForRecharts(dataToRender);
- const numRangeDays = Math.floor((Date.parse(initialEndDate) - Date.parse(initialStartDate)) / 86400000);
+ const numRangeDays = Math.floor(
+ (Date.parse(initialEndDate) - Date.parse(initialStartDate)) / 86400000,
+ );
const startDateFormatted = `${initialStartDate.getFullYear()}-${`0${initialStartDate.getMonth() + 1}`.slice(-2)}-${`0${initialStartDate.getDate()}`.slice(-2)}`;
const endDateFormatted = `${initialEndDate.getFullYear()}-${`0${initialEndDate.getMonth() + 1}`.slice(-2)}-${`0${initialEndDate.getDate()}`.slice(-2)}`;
- const numPoints = STEP_NUM - (data?.body?.errors?.error_count > 0 ? data.body.errors.error_count : 0);
+ const numPoints = STEP_NUM - (
+ data?.body?.errors?.error_count > 0 ? data.body.errors.error_count : 0
+ );
displayChart({
title: dataToRender.title,
subtitle: dataToRender.subtitle,
@@ -810,7 +827,12 @@ const mapStateToProps = (state) => {
const { crs, maxExtent } = proj.selected;
const { screenWidth, screenHeight } = screenSize;
const {
- activeLayer, aoiActive, aoiCoordinates, aoiSelected, chartRequestInProgress, timeSpanSelection, timeSpanStartDate, timeSpanEndDate, fromButton, isChartOpen,
+ activeLayer,
+ aoiActive,
+ aoiCoordinates,
+ aoiSelected,
+ chartRequestInProgress,
+ timeSpanSelection, timeSpanStartDate, timeSpanEndDate, fromButton, isChartOpen,
} = charting;
const {
isOpen, id,
diff --git a/web/js/components/sidebar/events-filter.js b/web/js/components/sidebar/events-filter.js
index 2c709bc3a..76a47f925 100644
--- a/web/js/components/sidebar/events-filter.js
+++ b/web/js/components/sidebar/events-filter.js
@@ -170,7 +170,8 @@ function EventFilterModalBody (props) {
placement="right"
target="bbox-show-all-tracks"
>
- If checked, shows tracks for all of the events listed in the sidebar. If unchecked, tracks will only
+ If checked, shows tracks for all of the events listed in the sidebar.
+ If unchecked, tracks will only
show for a selected event.
</UncontrolledTooltip>
diff --git a/web/js/components/sidebar/paletteLegend.js b/web/js/components/sidebar/paletteLegend.js
index d3ebbf217..9b2cb4dbb 100644
--- a/web/js/components/sidebar/paletteLegend.js
+++ b/web/js/components/sidebar/paletteLegend.js
@@ -86,11 +86,13 @@ class PaletteLegend extends React.Component {
width,
paletteLegends,
} = this.props;
- // Updates when layer options/settings changed, if ZOT changes the width of the palette, or distraction free mode exit
+ // Updates when layer options/settings changed, if ZOT changes the width of the palette,
+ // or distraction free mode exit
const layerChange = !lodashIsEqual(layer, prevProps.layer);
const paletteLegendsChange = !lodashIsEqual(paletteLegends, prevProps.paletteLegends);
const widthChange = prevProps.width !== width;
- const distractionFreeChange = prevProps.isDistractionFreeModeActive && !isDistractionFreeModeActive;
+ const distractionFreeChange = prevProps.isDistractionFreeModeActive
+ && !isDistractionFreeModeActive;
if (layerChange || widthChange || distractionFreeChange || paletteLegendsChange) {
this.updateCanvas();
}
@@ -202,7 +204,10 @@ class PaletteLegend extends React.Component {
const { globalTemperatureUnit } = this.props;
const units = legend.units || '';
- const { needsConversion, legendTempUnit } = checkTemperatureUnitConversion(units, globalTemperatureUnit);
+ const { needsConversion, legendTempUnit } = checkTemperatureUnitConversion(
+ units,
+ globalTemperatureUnit,
+ );
for (let i = 0, len = legend.colors.length; i < len; i += 1) {
if (util.hexColorDelta(legend.colors[i], hex) < acceptableDifference) {
const tooltipRange = legend.tooltips[i];
@@ -258,11 +263,16 @@ class PaletteLegend extends React.Component {
}
const units = legend.units || '';
- const { needsConversion, legendTempUnit } = checkTemperatureUnitConversion(units, globalTemperatureUnit);
+ const {
+ needsConversion,
+ legendTempUnit,
+ } = checkTemperatureUnitConversion(units, globalTemperatureUnit);
let min = legend.minLabel || legend.tooltips[0];
let max = legend.maxLabel || legend.tooltips[toolTipLength];
- min = palette.min ? legend.tooltips[legend.refs.indexOf(palette.entries.refs[palette.min])] : min;
- max = palette.max ? legend.tooltips[legend.refs.indexOf(palette.entries.refs[palette.max])] : max;
+ min = palette.min
+ ? legend.tooltips[legend.refs.indexOf(palette.entries.refs[palette.min])] : min;
+ max = palette.max
+ ? legend.tooltips[legend.refs.indexOf(palette.entries.refs[palette.max])] : max;
if (needsConversion) {
min = `${convertPaletteValue(min, legendTempUnit, globalTemperatureUnit)}`;
diff --git a/web/js/components/smart-handoffs/smart-handoff-granule-alert.js b/web/js/components/smart-handoffs/smart-handoff-granule-alert.js
index 533dcd6c0..8df31dc06 100644
--- a/web/js/components/smart-handoffs/smart-handoff-granule-alert.js
+++ b/web/js/components/smart-handoffs/smart-handoff-granule-alert.js
@@ -13,15 +13,17 @@ function GranuleAlertModalBody() {
{' '}
<a href="https://www.earthdata.nasa.gov/learn/earth-observation-data-basics/near-real-time-versus-standard-products" target="_blank" rel="noopener noreferrer">Near Real-Time (NRT)</a>
{' '}
- and then &quot;backfilled&quot; by the corresponding Standard (STD) product when it is available. @NAME@ displays them on a
+ and then &quot;backfilled&quot; by the corresponding Standard (STD)
+ product when it is available. @NAME@ displays them on a
<a href="https://nasa-gibs.github.io/gibs-api-docs/access-advanced-topics/#best-available-layers" target="_blank" rel="noopener noreferrer"> &quot;Best Available&quot; </a>
basis, showing Standard-quality imagery if it is available, NRT otherwise.
</p>
<p>
- Often layers will have both NRT and STD collections available for download in Earthdata Search. If you are looking
- for data within the last ~7 days you will likely want to use the NRT collection. If you have the NRT collection
- selected and the granule count shows &quot;NONE&quot;, this may be an indication that your selected date is too far in the past and you
- may have better luck with the STD collection.
+ Often layers will have both NRT and STD collections available for download in Earthdata
+ Search. If you are looking for data within the last ~7 days you will likely want to use the
+ NRT collection. If you have the NRT collection selected and the granule count shows
+ &quot;NONE&quot;, this may be an indication that your selected date is too far in the past
+ and you may have better luck with the STD collection.
</p>
<p>You may also see NONE or “0 out of n” granules when:</p>
<ol>
@@ -29,8 +31,9 @@ function GranuleAlertModalBody() {
The area of interest does not encompass any of the imagery displayed on the map.
</li>
<li>
- The area of interest is encompassing imagery but the collection&apos;s metadata record does not contain the appropriate spatial
- information for this feature to work. Unchecking the &quot;Set Area of Interest&quot; box should address this.
+ The area of interest is encompassing imagery but the collection&apos;s metadata record
+ does not contain the appropriate spatial information for this feature to work. Unchecking
+ the &quot;Set Area of Interest&quot; box should address this.
</li>
</ol>
diff --git a/web/js/components/smart-handoffs/smart-handoff-modal.js b/web/js/components/smart-handoffs/smart-handoff-modal.js
index a21a9c75c..7247451a0 100644
--- a/web/js/components/smart-handoffs/smart-handoff-modal.js
+++ b/web/js/components/smart-handoffs/smart-handoff-modal.js
@@ -53,8 +53,8 @@ function SmartHandoffModal({
</div>
<div className="smart-handoff-message">
- You are about to be transferred to the NASA Earthdata Search tool. This tool is used to download
- data granules using the selected layer, area of interest, and current date.
+ You are about to be transferred to the NASA Earthdata Search tool. This tool is used to
+ download data granules using the selected layer, area of interest, and current date.
</div>
{ showMoreInfo
@@ -64,32 +64,36 @@ function SmartHandoffModal({
<h1 className="about-heading">About Earthdata Search</h1>
<div className="about-section">
<p>
- Earthdata Search provides the only means for data discovery, filtering, visualization, and
- access across all of NASA Earth science data holdings. The current selected layer and the designated
- viewport region in @NAME@ will be used to derive data granules within Earthdata Search.
+ Earthdata Search provides the only means for data discovery, filtering, visualization,
+ and access across all of NASA Earth science data holdings. The current selected layer
+ and the designated viewport region in @NAME@ will be used to derive data granules
+ within Earthdata Search.
</p>
<img className="earth-data-gif" src="images/earth-data-search-preview.gif" />
<p className="earth-data-caption">
- Granules that are available to download will be listed in the white pull out menu. Each granule listed can be
- downloaded individually or the entire set contained within the bounding box can be downloaded as a zip file.
+ Granules that are available to download will be listed in the white pull out menu. Each
+ granule listed can be downloaded individually or the entire set contained within the
+ bounding box can be downloaded as a zip file.
</p>
<p>
To leverage the use of Earthdata Search, users must register at
{' '}
<a href="https://urs.earthdata.nasa.gov/home" target="_blank" rel="noopener noreferrer">urs.earthdata.nasa.gov</a>
- . The registration is provided free of charge. The user needs to set up a user ID, password, and provide
- additional information, such as, user name, affiliation, country and a valid e-mail address, in order to complete
- the registration process.
+ . The registration is provided free of charge. The user needs to set up a user ID,
+ password, and provide additional information, such as, user name, affiliation, country
+ and a valid e-mail address, in order to complete the registration process.
</p>
<h1 className="about-heading">Why must I register?</h1>
<p>
- As noted on the Earthdata homepage, the Earthdata Login provides a single mechanism for user registration and profile
- management for all ESDIS system components (DAACs, Tools, Services). Your Earthdata Login also helps the ESDIS program
- better understand the usage of ESDIS services to improve user experience through customization of tools and improvement
- of services. ESDIS data are openly available to all and free of charge except where governed by international agreements.
+ As noted on the Earthdata homepage, the Earthdata Login provides a single mechanism for
+ user registration and profile management for all ESDIS system components
+ (DAACs, Tools, Services). Your Earthdata Login also helps the ESDIS program better
+ understand the usage of ESDIS services to improve user experience through customization
+ of tools and improvement of services. ESDIS data are openly available to all and free
+ of charge except where governed by international agreements.
</p>
</div>
</div>
diff --git a/web/js/components/smart-handoffs/smart-handoff-not-available-modal.js b/web/js/components/smart-handoffs/smart-handoff-not-available-modal.js
index bff507ec4..b583e4608 100644
--- a/web/js/components/smart-handoffs/smart-handoff-not-available-modal.js
+++ b/web/js/components/smart-handoffs/smart-handoff-not-available-modal.js
@@ -5,12 +5,14 @@ export default function SmartHandoffNotAvailableModal() {
<div className="basic-modal">
<h1>Why are some layers not available for download?</h1>
<p>
- Data will not be available on dates outside of each layer&#39;s respective coverage date range.
- These layers will be hidden from the layers available to download.
+ Data will not be available on dates outside of each layer&#39;s
+ respective coverage date range. These layers will be hidden from the layers available to
+ download.
</p>
<p>
- In addition, some layers in @NAME@ do not have corresponding source data products available for download.
- These include Geostationary, Reference, Orbit Tracks, Earth at Night, and MODIS Corrected Reflectance products.
+ In addition, some layers in @NAME@ do not have corresponding source data products available
+ for download. These include Geostationary, Reference, Orbit Tracks, Earth at Night, and
+ MODIS Corrected Reflectance products.
</p>
<p>
For a downloadable product similar to MODIS Corrected Reflectance,
@@ -22,7 +24,9 @@ export default function SmartHandoffNotAvailableModal() {
.
</p>
<p>
- If you would like to download only an image, please use the “camera” icon in the upper right. Options include a georeferenced image snapshot in GeoTIFF, JPG with Worldfile, PNG with Worldfile, and KMZ formats.
+ If you would like to download only an image, please use the “camera” icon in the upper
+ right. Options include a georeferenced image snapshot in GeoTIFF, JPG with Worldfile, PNG
+ with Worldfile, and KMZ formats.
</p>
</div>
);
diff --git a/web/js/components/timeline/custom-interval-selector/custom-interval-selector.js b/web/js/components/timeline/custom-interval-selector/custom-interval-selector.js
index a4a0e1d0b..b683444ce 100644
--- a/web/js/components/timeline/custom-interval-selector/custom-interval-selector.js
+++ b/web/js/components/timeline/custom-interval-selector/custom-interval-selector.js
@@ -32,7 +32,10 @@ function CustomIntervalSelector(props) {
const dispatch = useDispatch();
const closeModal = () => dispatch(toggleCustomModal(false, undefined));
- const changeCustomInterval = (delta, timeScale) => dispatch(changeCustomIntervalAction(delta, timeScale));
+ const changeCustomInterval = (delta, timeScale) => dispatch(changeCustomIntervalAction(
+ delta,
+ timeScale,
+ ));
useEffect(() => {
if (modalOpen) {
diff --git a/web/js/components/timeline/kiosk-timestamp.js b/web/js/components/timeline/kiosk-timestamp.js
index 2ec49ba04..6ba5b2409 100644
--- a/web/js/components/timeline/kiosk-timestamp.js
+++ b/web/js/components/timeline/kiosk-timestamp.js
@@ -11,7 +11,8 @@ import { MONTH_STRING_ARRAY } from '../../modules/date/constants';
function getIsDaylightSavingsTime() {
const date = new Date().toLocaleString('en-US', { timeZone: 'America/New_York' });
const dateObj = new Date(date);
- const isDaylightSavingTime = dateObj.getTimezoneOffset() < new Date(dateObj.getFullYear(), 0, 1).getTimezoneOffset();
+ const isDaylightSavingTime = dateObj.getTimezoneOffset() < new Date(dateObj.getFullYear(), 0, 1)
+ .getTimezoneOffset();
return isDaylightSavingTime;
}
diff --git a/web/js/components/timeline/timeline-axis/date-tooltip/axis-hover-line.js b/web/js/components/timeline/timeline-axis/date-tooltip/axis-hover-line.js
index 0725d8bd0..f4e875cca 100644
--- a/web/js/components/timeline/timeline-axis/date-tooltip/axis-hover-line.js
+++ b/web/js/components/timeline/timeline-axis/date-tooltip/axis-hover-line.js
@@ -24,7 +24,8 @@ class AxisHoverLine extends PureComponent {
// check for timeline/animation dragging and showhover handled by parent
const isNoBlockingDragging = !isTimelineDragging && !isAnimationDraggerDragging;
const showHover = isNoBlockingDragging && showHoverLine;
- const panelDraggerHoverLine = isTimelineLayerCoveragePanelOpen && isNoBlockingDragging && isDraggerDragging;
+ const panelDraggerHoverLine = isTimelineLayerCoveragePanelOpen
+ && isNoBlockingDragging && isDraggerDragging;
const shouldDisplayHoverLine = showHover || panelDraggerHoverLine;
// init normal (no data coverage panel) line heights (svg container, inner line)
diff --git a/web/js/components/timeline/timeline-axis/grid-range/tile-text.js b/web/js/components/timeline/timeline-axis/grid-range/tile-text.js
index 97302fd97..f76050e69 100644
--- a/web/js/components/timeline/timeline-axis/grid-range/tile-text.js
+++ b/web/js/components/timeline/timeline-axis/grid-range/tile-text.js
@@ -59,5 +59,9 @@ const axisScaleTextElementWrapper = (item, index, gridWidth) => {
);
};
-const TileText = ({ item, index, gridWidth }) => axisScaleTextElementWrapper(item, index, gridWidth);
+const TileText = ({
+ item,
+ index,
+ gridWidth,
+}) => axisScaleTextElementWrapper(item, index, gridWidth);
export default TileText;
diff --git a/web/js/components/timeline/timeline-axis/timeline-axis.js b/web/js/components/timeline/timeline-axis/timeline-axis.js
index 18728d473..4e2886d9b 100644
--- a/web/js/components/timeline/timeline-axis/timeline-axis.js
+++ b/web/js/components/timeline/timeline-axis/timeline-axis.js
@@ -150,14 +150,21 @@ class TimelineAxis extends Component {
backDate,
} = this.props;
- if (activeLayers.length !== prevProps.activeLayers.length || frontDate !== prevProps.frontDate || backDate !== prevProps.backDate) {
+ if (activeLayers.length !== prevProps.activeLayers.length
+ || frontDate !== prevProps.frontDate || backDate !== prevProps.backDate) {
const backDateTime = new Date(backDate).getTime();
const startDateTime = new Date(frontDate).getTime();
const draggerTimeStateDate = new Date(draggerTimeState);
const draggerTimeStateTime = draggerTimeStateDate.getTime();
// Make sure that the dragger is within the new time range
- const maxBackDate = draggerTimeStateTime > backDateTime ? (draggerTimeStateDate.setDate(draggerTimeStateDate.getDate() + 1), draggerTimeStateDate.toISOString()) : backDate;
- const minFrontDate = draggerTimeStateTime < startDateTime ? (draggerTimeStateDate.setDate(draggerTimeStateDate.getDate() - 1), draggerTimeStateDate.toISOString()) : frontDate;
+ const maxBackDate = draggerTimeStateTime > backDateTime
+ ? (draggerTimeStateDate.setDate(draggerTimeStateDate.getDate() + 1),
+ draggerTimeStateDate.toISOString())
+ : backDate;
+ const minFrontDate = draggerTimeStateTime < startDateTime
+ ? (draggerTimeStateDate.setDate(draggerTimeStateDate.getDate() - 1),
+ draggerTimeStateDate.toISOString())
+ : frontDate;
activeLayers.forEach((layer) => this.addTimeRanges(layer, proj, [minFrontDate, maxBackDate]));
}
@@ -194,7 +201,8 @@ class TimelineAxis extends Component {
const hasFutureLayersUpdated = prevProps.hasFutureLayers !== hasFutureLayers;
const isTimelineInteracting = isDraggerDragging || isTimelineDragging;
const didTimelineEndDateLimitUpdate = timelineEndDateLimit !== prevProps.timelineEndDateLimit;
- if (didTimelineEndDateLimitUpdate && (!isAnimationPlaying || hasFutureLayersUpdated) && !isTimelineInteracting) {
+ if (didTimelineEndDateLimitUpdate
+ && (!isAnimationPlaying || hasFutureLayersUpdated) && !isTimelineInteracting) {
const updatedDraggerDate = hasFutureLayersUpdated
? new Date(draggerDate) > new Date(timelineEndDateLimit)
? timelineEndDateLimit
@@ -242,7 +250,8 @@ class TimelineAxis extends Component {
}
/**
- * @desc main function to update axis scale, time range, grids tiles/text, dragger A/B positions, animation start/end draggers
+ * @desc main function to update axis scale, time range, grids tiles/text,
+ * dragger A/B positions, animation start/end draggers
* @param {String} inputDate
* @param {String} updatedTimeScale
* @param {Number} leftOffsetFixedCoefficient
@@ -250,7 +259,13 @@ class TimelineAxis extends Component {
* @param {String} previousTimeScale - limited use for hover timeScale change
* @returns {void}
*/
- updateScale = (inputDate, timeScale, leftOffsetFixedCoefficient, hoverChange, previousTimeScale) => {
+ updateScale = (
+ inputDate,
+ timeScale,
+ leftOffsetFixedCoefficient,
+ hoverChange,
+ previousTimeScale,
+ ) => {
const {
dateA,
dateB,
@@ -293,8 +308,9 @@ class TimelineAxis extends Component {
gridNumber = monthTotal;
}
- // this is the middle on the axis based on number of tiles determined from width of axis and grid width
- // this is used to determine position and also to "reset" position after an axis drag has stopped
+ // this is the middle on the axis based on number of tiles determined from width of axis and
+ // grid width this is used to determine position and also to "reset" position after an axis
+ // drag has stopped
// eslint-disable-next-line no-mixed-operators
const midPoint = numberOfVisibleTiles / 2 * gridWidth - gridWidth * gridNumber / 2;
@@ -369,9 +385,12 @@ class TimelineAxis extends Component {
if (greaterToLesserTimescale) {
// determine how far hoverTime date is from end to compensate for bounds correction
- const hoverTimeToEndDateLimit = moment.utc(timelineEndDateLimit).diff(hoverTimeDate, timeScale);
+ const hoverTimeToEndDateLimit = moment
+ .utc(timelineEndDateLimit)
+ .diff(hoverTimeDate, timeScale);
if (hoverTimeToEndDateLimit < offSetHalved) {
- gridsToSubtract = gridsToSubtract + (offSetHalved - hoverTimeToEndDateLimit) - offSetGrids;
+ gridsToSubtract = gridsToSubtract
+ + (offSetHalved - hoverTimeToEndDateLimit) - offSetGrids;
gridsToAdd = gridsToAdd - (offSetHalved - hoverTimeToEndDateLimit) + offSetGrids;
}
}
@@ -407,8 +426,10 @@ class TimelineAxis extends Component {
let animationStartDraggerLocation = 0;
let animationEndDraggerLocation = 0;
if (animStartLocationDate) {
- animationStartDraggerLocation = moment.utc(animStartLocationDate).diff(frontDate, timeScale, true) * gridWidth;
- animationEndDraggerLocation = moment.utc(animEndLocationDate).diff(frontDate, timeScale, true) * gridWidth;
+ animationStartDraggerLocation = moment.utc(animStartLocationDate)
+ .diff(frontDate, timeScale, true) * gridWidth;
+ animationEndDraggerLocation = moment.utc(animEndLocationDate)
+ .diff(frontDate, timeScale, true) * gridWidth;
}
// get axis position
@@ -416,12 +437,16 @@ class TimelineAxis extends Component {
if (timeScale === 'year') {
position = timelineAxisWidth / 2 + (hoverLeftOffset - timelineAxisWidth / 2);
} else if (timeScale === 'month') {
- const pixelsToAddToDraggerNew = Math.abs(frontDate.diff(hoverTimeDate, timeScale, true) * gridWidth);
+ const pixelsToAddToDraggerNew = Math.abs(
+ frontDate.diff(hoverTimeDate, timeScale, true) * gridWidth,
+ );
const positionModified = pixelsToAddToDraggerNew - pixelsToAdd + 2;
- position = timelineAxisWidth / 2 + (hoverLeftOffset - timelineAxisWidth / 2) - positionModified;
+ position = timelineAxisWidth / 2
+ + (hoverLeftOffset - timelineAxisWidth / 2) - positionModified;
} else {
// - (offSetGridsDiff * gridWidth) to compensate off center zooming repositioning
- position = midPoint - (timelineAxisWidth / 2 - hoverLeftOffset).toFixed(10) - offSetGridsDiff * gridWidth;
+ position = midPoint - (timelineAxisWidth / 2
+ - hoverLeftOffset).toFixed(10) - offSetGridsDiff * gridWidth;
if (gridNumber % 2 !== 0) { // handle odd number gridNumber grid offset
position += gridWidth / 2;
}
@@ -438,7 +463,8 @@ class TimelineAxis extends Component {
rightBound = timelineAxisWidth * 0.25 + pixelsToAdd + 2;
}
- // handle position being set beyond bounds due to edge dates not precisely scaling to other timescales
+ // handle position being set beyond bounds due to edge
+ // dates not precisely scaling to other timescales
let boundsDiff = 0;
if (rightBound < position) {
const rightBoundDiff = position - rightBound;
@@ -644,7 +670,8 @@ class TimelineAxis extends Component {
/**
* @desc helper function used in updateTimeRangeFromDrag
- * @desc check dragger visibility and calculate newDraggerPosition if dragger initially false and now visible
+ * @desc check dragger visibility and calculate newDraggerPosition
+ * if dragger initially false and now visible
* @param {String} draggerTime
* @param {Boolean} draggerVisible
* @param {Number} newDraggerPosition
@@ -667,7 +694,8 @@ class TimelineAxis extends Component {
if (isBetween) {
if (draggerVisible === false) {
const frontDateObj = moment.utc(frontDate);
- updatedDraggerPosition = Math.abs(frontDateObj.diff(draggerTime, timeScale, true) * gridWidth) + position + transform - 50;
+ updatedDraggerPosition = Math.abs(frontDateObj
+ .diff(draggerTime, timeScale, true) * gridWidth) + position + transform - 50;
}
return {
newDraggerPosition: updatedDraggerPosition,
@@ -963,10 +991,12 @@ class TimelineAxis extends Component {
let otherDraggerVisible;
if (draggerSelected === 'selected') {
// check Dragger B visibility and then update Dragger A
- otherDraggerVisible = isCompareModeActive && getIsBetween(draggerTimeStateB, frontDate, backDate);
+ otherDraggerVisible = isCompareModeActive
+ && getIsBetween(draggerTimeStateB, frontDate, backDate);
} else {
// check Dragger A visibility and then update Dragger B
- otherDraggerVisible = isCompareModeActive && getIsBetween(draggerTimeState, frontDate, backDate);
+ otherDraggerVisible = isCompareModeActive
+ && getIsBetween(draggerTimeState, frontDate, backDate);
}
updateDraggerDatePosition(hoverTime, draggerSelected, null, true, otherDraggerVisible, false);
}
@@ -1017,12 +1047,14 @@ class TimelineAxis extends Component {
// determine approximate new dragger date and coefficient based on grid width
const gridWidthCoefficient = positionRelativeToFront / gridWidth;
const gridWidthCoefficientRemainder = gridWidthCoefficient - Math.floor(gridWidthCoefficient);
- const draggerDateAdded = moment.utc(frontDate).add(Math.floor(gridWidthCoefficient), timeScale);
+ const draggerDateAdded = moment.utc(frontDate)
+ .add(Math.floor(gridWidthCoefficient), timeScale);
// get ms time value
const draggerDateAddedValue = new Date(draggerDateAdded).getTime();
let newDraggerTime;
- if (!diffZeroValues) { // unknown scaleMs due to varying number of days per month and year (leap years)
+ // unknown scaleMs due to varying number of days per month and year (leap years)
+ if (!diffZeroValues) {
let daysCount;
if (timeScale === 'year') {
daysCount = draggerDateAdded.isLeapYear() ? 366 : 365;
@@ -1040,12 +1072,21 @@ class TimelineAxis extends Component {
let otherDraggerVisible;
if (draggerSelected === 'selected') {
// check Dragger B visibility and then update Dragger A
- otherDraggerVisible = isCompareModeActive && getIsBetween(draggerTimeStateB, frontDate, backDate);
+ otherDraggerVisible = isCompareModeActive
+ && getIsBetween(draggerTimeStateB, frontDate, backDate);
} else {
// check Dragger A visibility and then update Dragger B
- otherDraggerVisible = isCompareModeActive && getIsBetween(draggerTimeState, frontDate, backDate);
+ otherDraggerVisible = isCompareModeActive
+ && getIsBetween(draggerTimeState, frontDate, backDate);
}
- updateDraggerDatePosition(newDraggerTime, draggerSelected, null, true, otherDraggerVisible, false);
+ updateDraggerDatePosition(
+ newDraggerTime,
+ draggerSelected,
+ null,
+ true,
+ otherDraggerVisible,
+ false,
+ );
}
};
@@ -1064,7 +1105,8 @@ class TimelineAxis extends Component {
};
/**
- * @desc drag axis - will update date range if dragged into past/future past dragSentinelChangeNumber
+ * @desc drag axis - will update date range if dragged
+ * into past/future past dragSentinelChangeNumber
* @param {Event} mouse event
* @param {Object} draggable delta object
* @returns {void}
@@ -1134,7 +1176,8 @@ class TimelineAxis extends Component {
overDrag,
);
- const newDragSentinelCount = dragSentinelCount + deltaX - dragSentinelChangeNumber - overDragGrids * gridWidth;
+ const newDragSentinelCount = dragSentinelCount + deltaX - dragSentinelChangeNumber
+ - overDragGrids * gridWidth;
const frontDate = newCurrentTimeRange[0].rawDate;
const backDate = newCurrentTimeRange[newCurrentTimeRange.length - 1].rawDate;
const updatePositioningArguments = {
@@ -1156,7 +1199,8 @@ class TimelineAxis extends Component {
});
updatePositioning(updatePositioningArguments);
} else {
- // reset dragSentinelCount on direction change to remaining distance to dragSentinelChangeNumber
+ // reset dragSentinelCount on direction change to
+ // remaining distance to dragSentinelChangeNumber
const newDragSentinelCount = dragSentinelCount < 0
? dragSentinelChangeNumber + dragSentinelCount + deltaX
: dragSentinelCount + deltaX;
@@ -1198,7 +1242,8 @@ class TimelineAxis extends Component {
overDrag,
);
- const newDragSentinelCount = dragSentinelCount + deltaX + dragSentinelChangeNumber + overDragGrids * gridWidth;
+ const newDragSentinelCount = dragSentinelCount + deltaX + dragSentinelChangeNumber
+ + overDragGrids * gridWidth;
const frontDate = newCurrentTimeRange[0].rawDate;
const backDate = newCurrentTimeRange[newCurrentTimeRange.length - 1].rawDate;
const updatePositioningArguments = {
@@ -1220,7 +1265,8 @@ class TimelineAxis extends Component {
});
updatePositioning(updatePositioningArguments);
} else {
- // reset dragSentinelCount on direction change to remaining distance to dragSentinelChangeNumber
+ // reset dragSentinelCount on direction change to
+ // remaining distance to dragSentinelChangeNumber
const newDragSentinelCount = dragSentinelCount > 0
? -dragSentinelChangeNumber + dragSentinelCount + deltaX
: dragSentinelCount + deltaX;
@@ -1301,7 +1347,8 @@ class TimelineAxis extends Component {
const diffZeroValues = options.scaleMs;
const newHoverTimeValue = new Date(frontDate).getTime();
if (!diffZeroValues) {
- // calculate based on frontDate due to varying number of days per month and per year (leap years)
+ // calculate based on frontDate due to varying number of
+ // days per month and per year (leap years)
const hoverLinePositionRelativeToFrontDate = leftOffset - midPoint - newTransformX;
const gridWidthCoefficient = hoverLinePositionRelativeToFrontDate / gridWidth;
const hoverTimeAdded = moment.utc(frontDate).add(gridWidthCoefficient, timeScale);
@@ -1311,7 +1358,8 @@ class TimelineAxis extends Component {
} else if (timeScale === 'month') {
daysCount = hoverTimeAdded.daysInMonth();
}
- const gridWidthCoefficientRemainder = gridWidthCoefficient - Math.floor(gridWidthCoefficient);
+ const gridWidthCoefficientRemainder = gridWidthCoefficient
+ - Math.floor(gridWidthCoefficient);
const remainderMilliseconds = daysCount * 86400000 * gridWidthCoefficientRemainder;
hoverTimeDate = getISODateFormatted(hoverTimeAdded.add(remainderMilliseconds));
} else {
@@ -1366,7 +1414,8 @@ class TimelineAxis extends Component {
worker.terminate(); // terminate the worker
return addGranuleDateRanges(def, event.data); // dispatch the action
}
- // DOMParser is not available in workers so we parse the xml on the main thread before sending it back to the worker
+ // DOMParser is not available in workers so we parse the xml
+ // on the main thread before sending it back to the worker
const parser = new DOMParser();
const xmlDoc = parser.parseFromString(event.data, 'text/xml');
const domains = xmlDoc.querySelector('Domain')?.textContent;
@@ -1455,7 +1504,10 @@ class TimelineAxis extends Component {
* @param {Number} transformX
* @returns {Object} DOM SVG object
*/
- createMatchingCoverageLineDOMEl = (lineCoverageOptions, transformX) => lineCoverageOptions.map(({ leftOffset, visible, width }, i) => (
+ createMatchingCoverageLineDOMEl = (lineCoverageOptions, transformX) => lineCoverageOptions.map(({
+ leftOffset,
+ visible, width,
+ }, i) => (
<g
key={`matchingCoverageLine-${crypto.randomUUID()}`}
className="axis-matching-layer-coverage-line"
diff --git a/web/js/components/timeline/timeline-controls/animation-button.js b/web/js/components/timeline/timeline-controls/animation-button.js
index e6c602460..78d71488a 100644
--- a/web/js/components/timeline/timeline-controls/animation-button.js
+++ b/web/js/components/timeline/timeline-controls/animation-button.js
@@ -25,13 +25,18 @@ function AnimationButton(props) {
const labelText = label || 'Set up animation';
const getButtonClassName = () => {
- if (((isMobilePhone && isPortrait) || (!isMobileTablet && screenWidth < 670 && hasSubdailyLayers) || (!isMobileTablet && screenWidth < 575 && !hasSubdailyLayers)) && isEmbedModeActive) {
+ if (((isMobilePhone && isPortrait)
+ || (!isMobileTablet && screenWidth < 670 && hasSubdailyLayers)
+ || (!isMobileTablet && screenWidth < 575 && !hasSubdailyLayers)) && isEmbedModeActive) {
return 'phone-portrait-embed';
- } if ((isMobilePhone && isPortrait) || (!isMobileTablet && screenWidth < 670 && hasSubdailyLayers) || (!isMobileTablet && screenWidth < 575 && !hasSubdailyLayers)) {
+ } if ((isMobilePhone && isPortrait) || (
+ !isMobileTablet && screenWidth < 670 && hasSubdailyLayers
+ ) || (!isMobileTablet && screenWidth < 575 && !hasSubdailyLayers)) {
return `phone-portrait${subdailyID}`;
} if (isMobilePhone && isLandscape) {
return `phone-landscape${subdailyID}`;
- } if (((isMobileTablet && isPortrait) || !isMobile || (!isMobilePhone && screenWidth < breakpoints.small)) && isEmbedModeActive) {
+ } if (((isMobileTablet && isPortrait) || !isMobile || (!isMobilePhone
+ && screenWidth < breakpoints.small)) && isEmbedModeActive) {
return `tablet-portrait${subdailyID}-embed`;
} if ((isMobileTablet && isPortrait) || (!isMobilePhone && screenWidth < breakpoints.small)) {
return `tablet-portrait${subdailyID}`;
diff --git a/web/js/components/timeline/timeline-coverage/coverage-item-container.js b/web/js/components/timeline/timeline-coverage/coverage-item-container.js
index 935147c72..9424d56d5 100644
--- a/web/js/components/timeline/timeline-coverage/coverage-item-container.js
+++ b/web/js/components/timeline/timeline-coverage/coverage-item-container.js
@@ -126,7 +126,8 @@ class CoverageItemContainer extends Component {
} = getLayerItemStyles(visible, id);
// get line container dimensions
- const containerLineDimensions = getMatchingCoverageLineDimensions(layer).filter(({ visible }) => visible);
+ const containerLineDimensions = getMatchingCoverageLineDimensions(layer)
+ .filter(({ visible }) => visible);
return (
<div
className="layer-coverage-line"
@@ -143,9 +144,19 @@ class CoverageItemContainer extends Component {
const { date, interval } = itemRange;
const dateObj = new Date(date);
const nextDate = array[multiIndex + 1];
- const rangeDateEnd = getRangeDateEndWithAddedInterval(layer, dateObj, layerPeriod, interval, nextDate);
+ const rangeDateEnd = getRangeDateEndWithAddedInterval(
+ layer,
+ dateObj,
+ layerPeriod,
+ interval,
+ nextDate,
+ );
// get range line dimensions
- const multiLineRangeOptions = getMatchingCoverageLineDimensions(layer, dateObj, rangeDateEnd).filter(({ visible }) => visible);
+ const multiLineRangeOptions = getMatchingCoverageLineDimensions(
+ layer,
+ dateObj,
+ rangeDateEnd,
+ ).filter(({ visible }) => visible);
// create DOM line element
const key = `${id}-${multiIndex}`;
return (
diff --git a/web/js/components/timeline/timeline-coverage/coverage-item-list.js b/web/js/components/timeline/timeline-coverage/coverage-item-list.js
index 5dcc30873..a3b22d13e 100644
--- a/web/js/components/timeline/timeline-coverage/coverage-item-list.js
+++ b/web/js/components/timeline/timeline-coverage/coverage-item-list.js
@@ -129,7 +129,13 @@ class CoverageItemList extends Component {
* @param {Object} nextDate range object with date
* @returns {String} rangeDateEnd date ISO string
*/
- getRangeDateEndWithAddedInterval = (layer, rangeDate, layerPeriod, itemRangeInterval, nextDate) => {
+ getRangeDateEndWithAddedInterval = (
+ layer,
+ rangeDate,
+ layerPeriod,
+ itemRangeInterval,
+ nextDate,
+ ) => {
const { appNow } = this.props;
const { endDate, futureTime } = layer;
const {
@@ -259,14 +265,21 @@ class CoverageItemList extends Component {
// get dates within given date range
let dateIntervalStartDates = [];
const startLessThanOrEqualToEndDateLimit = startDateObj.getTime() <= endDateLimit.getTime();
- const endGreaterThanOrEqualToStartDateLimit = new Date(rangeEnd).getTime() >= startDateLimit.getTime();
+ const endGreaterThanOrEqualToStartDateLimit = new Date(rangeEnd)
+ .getTime() >= startDateLimit.getTime();
if (startLessThanOrEqualToEndDateLimit && endGreaterThanOrEqualToStartDateLimit) {
// check layer date array cache and use caches date array if available, if not add date array
this.layerDateArrayCache[id] ??= {};
const layerIdDates = `${appNow.toISOString()}-${frontDate}-${backDate}`;
if (this.layerDateArrayCache[id][layerIdDates] === undefined) {
- dateIntervalStartDates = datesInDateRanges(def, startDateLimit, startDateLimit, endDateLimit, appNow);
+ dateIntervalStartDates = datesInDateRanges(
+ def,
+ startDateLimit,
+ startDateLimit,
+ endDateLimit,
+ appNow,
+ );
this.layerDateArrayCache[id][layerIdDates] = dateIntervalStartDates;
} else {
dateIntervalStartDates = this.layerDateArrayCache[id][layerIdDates];
@@ -322,7 +335,10 @@ class CoverageItemList extends Component {
<div className="layer-coverage-list-empty">
<div className="layer-coverage-item-empty">
<FontAwesomeIcon icon="exclamation-triangle" className="error-icon" widthAuto />
- <p>No visible layers with defined coverage. Add layers or toggle &quot;Include Hidden Layers&quot; if current layers are hidden.</p>
+ <p>
+ No visible layers with defined coverage. Add layers or toggle
+ &quot;Include Hidden Layers&quot; if current layers are hidden.
+ </p>
</div>
</div>
);
@@ -386,10 +402,13 @@ class CoverageItemList extends Component {
: 1;
// conditional check to determine how layer coverage line will be built in child component
- const isLayerGreaterZoomWithMultipleCoverage = isLayerGreaterIncrementThanZoom && (multipleCoverageRanges || dateRangeIntervalZeroIndex);
- const isLayerEqualZoomWithMultipleCoverage = isLayerEqualIncrementThanZoom && dateRangeIntervalZeroIndex > 1;
+ const isLayerGreaterZoomWithMultipleCoverage = isLayerGreaterIncrementThanZoom
+ && (multipleCoverageRanges || dateRangeIntervalZeroIndex);
+ const isLayerEqualZoomWithMultipleCoverage = isLayerEqualIncrementThanZoom
+ && dateRangeIntervalZeroIndex > 1;
// determine date range building vs using startDate to endDate single coverage
- const needDateRangeBuilt = !!(isValidLayer && (isLayerGreaterZoomWithMultipleCoverage || isLayerEqualZoomWithMultipleCoverage));
+ const needDateRangeBuilt = !!(isValidLayer && (isLayerGreaterZoomWithMultipleCoverage
+ || isLayerEqualZoomWithMultipleCoverage));
const encodedId = util.encodeId(id);
const key = `layer-coverage-item-${encodedId}-${index}`;
diff --git a/web/js/components/timeline/timeline-coverage/coverage-line.js b/web/js/components/timeline/timeline-coverage/coverage-line.js
index 4330375c8..a741019b7 100644
--- a/web/js/components/timeline/timeline-coverage/coverage-line.js
+++ b/web/js/components/timeline/timeline-coverage/coverage-line.js
@@ -69,7 +69,16 @@ class CoverageLine extends PureComponent {
* @param {Number/String} index
* @returns {DOM Element} line
*/
- createMatchingCoverageLineDOMEl = (id, options, lineType, startDate, endDate, color, layerPeriod, index) => {
+ createMatchingCoverageLineDOMEl = (
+ id,
+ options,
+ lineType,
+ startDate,
+ endDate,
+ color,
+ layerPeriod,
+ index,
+ ) => {
const {
positionTransformX,
} = this.props;
diff --git a/web/js/components/timeline/timeline-coverage/info-modal.js b/web/js/components/timeline/timeline-coverage/info-modal.js
index 3ca2349aa..1883e8968 100644
--- a/web/js/components/timeline/timeline-coverage/info-modal.js
+++ b/web/js/components/timeline/timeline-coverage/info-modal.js
@@ -5,10 +5,14 @@ function LayerCoverageInfoModal() {
<div className="layer-coverage-info">
<header>
<p>
- Temporal availability of active time-varying layers is shown as a set of striped horizontal blue lines in the panel. The total temporal coverage of the layers is shown on the far right.
+ Temporal availability of active time-varying layers is shown as a set of striped
+ horizontal blue lines in the panel. The total temporal coverage of the layers is shown on
+ the far right.
</p>
<p>
- Time-varying layers that have matching temporal coverage are shown in the timeline (bottom of screen) as a solid blue line, making it easier to determine when multiple layers have temporally coincident imagery.
+ Time-varying layers that have matching temporal coverage are shown in the timeline
+ (bottom of screen) as a solid blue line, making it easier to determine when multiple
+ layers have temporally coincident imagery.
</p>
</header>
<div className="layer-coverage-info-item-container">
@@ -18,7 +22,8 @@ function LayerCoverageInfoModal() {
<section className="layer-coverage-info-item-right">
<div>
<p>
- Including layers that are hidden may affect the display of the timeline’s solid blue overlapping coverage line as it will take into account the dates of those layers, too.
+ Including layers that are hidden may affect the display of the timeline’s solid blue
+ overlapping coverage line as it will take into account the dates of those layers, too.
</p>
<img src="images/lc-toggle.png" />
</div>
@@ -26,7 +31,8 @@ function LayerCoverageInfoModal() {
<p>
<strong>Note:</strong>
{' '}
- Note: Active layers showing available temporal coverage may not have imagery available yet (e.g., monthly layers that are processed later in the month).
+ Note: Active layers showing available temporal coverage may not have imagery
+ available yet (e.g., monthly layers that are processed later in the month).
</p>
</div>
</section>
diff --git a/web/js/components/timeline/timeline-coverage/timeline-coverage.js b/web/js/components/timeline/timeline-coverage/timeline-coverage.js
index f324076cc..a2a3a3fe3 100644
--- a/web/js/components/timeline/timeline-coverage/timeline-coverage.js
+++ b/web/js/components/timeline/timeline-coverage/timeline-coverage.js
@@ -40,7 +40,8 @@ class TimelineLayerCoveragePanel extends Component {
const layers = this.getActiveLayers(activeLayers);
this.setActiveLayers(layers);
- // prevent bubbling to parent which the wheel event is blocked for timeline zoom in/out wheel event
+ // prevent bubbling to parent which the wheel event
+ // is blocked for timeline zoom in/out wheel event
document.querySelector('.timeline-layer-coverage-container').addEventListener('wheel', (e) => e.stopPropagation(), { passive: false });
// init populate of activeLayers
this.addMatchingCoverageToTimeline(shouldIncludeHiddenLayers, layers);
@@ -436,7 +437,10 @@ class TimelineLayerCoveragePanel extends Component {
id="toggle-layer-coverage-include-hidden"
containerClassAddition="toggle-layer-coverage-include-hidden"
label="Include Hidden Layers"
- toggle={() => this.addMatchingCoverageToTimeline(!shouldIncludeHiddenLayers, activeLayers)}
+ toggle={() => this.addMatchingCoverageToTimeline(
+ !shouldIncludeHiddenLayers,
+ activeLayers,
+ )}
/>
</header>
<Scrollbars style={scrollbarStyle}>
diff --git a/web/js/components/timeline/timeline-draggers/dragger-container.js b/web/js/components/timeline/timeline-draggers/dragger-container.js
index c64de05c6..9141df900 100644
--- a/web/js/components/timeline/timeline-draggers/dragger-container.js
+++ b/web/js/components/timeline/timeline-draggers/dragger-container.js
@@ -117,12 +117,17 @@ class DraggerContainer extends PureComponent {
const options = timeScaleOptions[timeScale].timeAxis;
const { gridWidth } = options;
const frontDateObj = moment.utc(frontDate);
- const pixelsToAddToDraggerNew = Math.abs(frontDateObj.diff(inputTime, timeScale, true) * gridWidth);
+ const pixelsToAddToDraggerNew = Math.abs(
+ frontDateObj.diff(inputTime, timeScale, true) * gridWidth,
+ );
newDraggerPosition = pixelsToAddToDraggerNew + position - draggerWidth + transformX + 2;
// determine max timelineEndDate position for dragger
- const endDateLimitPositionFromFront = Math.abs(frontDateObj.diff(timelineEndDateLimit, timeScale, true) * gridWidth);
- const endDatePosition = endDateLimitPositionFromFront + position - draggerWidth + transformX + 2;
+ const endDateLimitPositionFromFront = Math.abs(
+ frontDateObj.diff(timelineEndDateLimit, timeScale, true) * gridWidth,
+ );
+ const endDatePosition = endDateLimitPositionFromFront
+ + position - draggerWidth + transformX + 2;
// checks to prevent positioning outside of valid timeline range
const isBeforeFrontDate = new Date(inputTime) < new Date(frontDate);
@@ -190,10 +195,13 @@ class DraggerContainer extends PureComponent {
// only need to calculate difference in time unit for varying timescales - month and year
const diffZeroValues = options.scaleMs;
if (!diffZeroValues) {
- // calculate based on frontDate due to varying number of days per month and per year (leap years)
- const draggerPositionRelativeToFrontDate = draggerWidth - 2 + newDraggerPosition - position - transformX;
+ // calculate based on frontDate due to varying
+ // number of days per month and per year (leap years)
+ const draggerPositionRelativeToFrontDate = draggerWidth - 2
+ + newDraggerPosition - position - transformX;
const gridWidthCoefficient = draggerPositionRelativeToFrontDate / gridWidth;
- const draggerDateAdded = moment.utc(frontDate).add(Math.floor(gridWidthCoefficient), timeScale);
+ const draggerDateAdded = moment.utc(frontDate)
+ .add(Math.floor(gridWidthCoefficient), timeScale);
let daysCount;
if (timeScale === 'year') {
@@ -201,7 +209,8 @@ class DraggerContainer extends PureComponent {
} else if (timeScale === 'month') {
daysCount = draggerDateAdded.daysInMonth();
}
- const gridWidthCoefficientRemainder = gridWidthCoefficient - Math.floor(gridWidthCoefficient);
+ const gridWidthCoefficientRemainder = gridWidthCoefficient
+ - Math.floor(gridWidthCoefficient);
const remainderMilliseconds = daysCount * 86400000 * gridWidthCoefficientRemainder;
newDraggerTime = draggerDateAdded.add(remainderMilliseconds);
} else {
@@ -210,7 +219,11 @@ class DraggerContainer extends PureComponent {
}
// check if new dragger date is within valid date range and format or RETURN out of function
- const isBetweenValidTimeline = getIsBetween(newDraggerTime, timelineStartDateLimit, timelineEndDateLimit);
+ const isBetweenValidTimeline = getIsBetween(
+ newDraggerTime,
+ timelineStartDateLimit,
+ timelineEndDateLimit,
+ );
if (isBetweenValidTimeline) {
newDraggerTime = getISODateFormatted(newDraggerTime);
} else {
@@ -218,17 +231,34 @@ class DraggerContainer extends PureComponent {
// prevent over drag and set endDatePosition and time to timelineEndDateLimit
if (newDraggerTime > timelineEndDateLimitTime) {
const frontDateObj = moment.utc(frontDate);
- const endDateLimitPositionFromFront = Math.abs(frontDateObj.diff(timelineEndDateLimit, timeScale, true) * gridWidth);
- const endDatePosition = endDateLimitPositionFromFront + position - draggerWidth + transformX + 2;
+ const endDateLimitPositionFromFront = Math.abs(
+ frontDateObj.diff(timelineEndDateLimit, timeScale, true) * gridWidth,
+ );
+ const endDatePosition = endDateLimitPositionFromFront
+ + position - draggerWidth + transformX + 2;
- updateDraggerDatePosition(timelineEndDateLimit, draggerSelected, endDatePosition, null, null, true);
+ updateDraggerDatePosition(
+ timelineEndDateLimit,
+ draggerSelected,
+ endDatePosition,
+ null,
+ null,
+ true,
+ );
return;
}
return false;
}
// update parent dragger positioning
- updateDraggerDatePosition(newDraggerTime, draggerSelected, newDraggerPosition, null, null, true);
+ updateDraggerDatePosition(
+ newDraggerTime,
+ draggerSelected,
+ newDraggerPosition,
+ null,
+ null,
+ true,
+ );
});
};
diff --git a/web/js/components/tour/content-intro.js b/web/js/components/tour/content-intro.js
index 6bf1536e3..35710c6cb 100644
--- a/web/js/components/tour/content-intro.js
+++ b/web/js/components/tour/content-intro.js
@@ -7,8 +7,9 @@ function TourIntro(props) {
return (
<div className="tour-intro">
<p className="intro">
- Visually explore the past and the present of this dynamic planet from a satellite&apos;s perspective.
- Select from an array of stories below to learn more about @NAME@ (a part of
+ Visually explore the past and the present of this dynamic planet from a
+ satellite&apos;s perspective. Select from an array of stories below to learn more about
+ @NAME@ (a part of
{' '}
<a href="https://earthdata.nasa.gov/" target="_blank" rel="noreferrer">NASA Earthdata</a>
), the satellite imagery we provide and events occurring around the world.
diff --git a/web/js/components/util/checkbox.js b/web/js/components/util/checkbox.js
index 2c744024d..fe66e6604 100644
--- a/web/js/components/util/checkbox.js
+++ b/web/js/components/util/checkbox.js
@@ -9,14 +9,17 @@ import HoverTooltip from './hover-tooltip';
*/
export default function Checkbox (props) {
const {
- onCheck, checked, isRound, color, tooltipPlacement, classNames, id, name, title, label, children, disabled,
+ onCheck,
+ checked,
+ isRound, color, tooltipPlacement, classNames, id, name, title, label, children, disabled,
} = props;
const roundClassName = isRound ? 'wv-checkbox-round ' : '';
const defaultClassName = 'wv-checkbox ';
const checkedClassName = checked ? 'checked ' : '';
const disabledClassName = disabled ? ' disabled' : '';
- const caseClassName = defaultClassName + roundClassName + checkedClassName + color + disabledClassName;
+ const caseClassName = defaultClassName
+ + roundClassName + checkedClassName + color + disabledClassName;
const showDisabledToolTip = disabled && id && title;
return (
<>
diff --git a/web/js/components/vector-metadata/table.js b/web/js/components/vector-metadata/table.js
index a1eea26fa..9efa69811 100644
--- a/web/js/components/vector-metadata/table.js
+++ b/web/js/components/vector-metadata/table.js
@@ -7,7 +7,10 @@ import util from '../../util/util';
export default class VectorMetaTable extends React.Component {
shouldComponentUpdate(nextProps) {
const { id, title } = this.props;
- if (id && title && nextProps.id && nextProps.title && id === nextProps.id && title === nextProps.title) {
+ if (
+ id
+ && title && nextProps.id && nextProps.title
+ && id === nextProps.id && title === nextProps.title) {
return false;
}
return true;
diff --git a/web/js/containers/alerts.js b/web/js/containers/alerts.js
index e65941795..06fb8e346 100644
--- a/web/js/containers/alerts.js
+++ b/web/js/containers/alerts.js
@@ -44,7 +44,8 @@ class DismissableAlerts extends React.Component {
componentDidUpdate(prevProps) {
const { isDistractionFreeModeActive } = this.props;
const { distractionFreeModeInitLoad } = this.state;
- const isDistractionFreeModeActiveChanged = prevProps.isDistractionFreeModeActive && !isDistractionFreeModeActive;
+ const isDistractionFreeModeActiveChanged = prevProps.isDistractionFreeModeActive
+ && !isDistractionFreeModeActive;
if (distractionFreeModeInitLoad && isDistractionFreeModeActiveChanged) {
this.toggleDistractionFreeModeInitLoad(false);
}
diff --git a/web/js/containers/animation-widget/animation-widget.js b/web/js/containers/animation-widget/animation-widget.js
index b49c224c3..628cadbaf 100644
--- a/web/js/containers/animation-widget/animation-widget.js
+++ b/web/js/containers/animation-widget/animation-widget.js
@@ -96,7 +96,9 @@ function AnimationWidget (props) {
const subdailyWidgetWidth = 460;
const halfWidgetWidth = (subDailyMode ? subdailyWidgetWidth : widgetWidth) / 2;
- const [widgetPosition, setWidgetPosition] = useState({ x: screenWidth / 2 - halfWidgetWidth, y: -25 });
+ const [widgetPosition, setWidgetPosition] = useState(
+ { x: screenWidth / 2 - halfWidgetWidth, y: -25 },
+ );
const [collapsedWidgetPosition, setCollapsedWidgetPosition] = useState({ x: 0, y: 0 });
const [userHasMovedWidget, setUserHasMovedWidget] = useState(false);
const [speed, setSpeed] = useState(speedRedux);
@@ -138,7 +140,8 @@ function AnimationWidget (props) {
}
});
- // Prevent drag when interacting with child elements (e.g. buttons) Only allow drag when targeting "background" elements
+ // Prevent drag when interacting with child elements (e.g. buttons)
+ // Only allow drag when targeting "background" elements
const handleDragStart = (e, data) => {
const draggableTargets = [
'wv-animation-widget',
@@ -472,7 +475,8 @@ const mapStateToProps = (state) => {
proj,
promiseImageryForTime: (date) => promiseImageryForTime(state, date),
isEmbedModeActive,
- playDisabled: !screenSize.isMobileDevice ? numberOfFrames >= maxFrames || numberOfFrames === 1 : numberOfFrames >= mobileMaxFrames || numberOfFrames === 1,
+ playDisabled: !screenSize.isMobileDevice ? numberOfFrames >= maxFrames || numberOfFrames === 1
+ : numberOfFrames >= mobileMaxFrames || numberOfFrames === 1,
};
};
diff --git a/web/js/containers/animation-widget/collapsed-animation-widget.js b/web/js/containers/animation-widget/collapsed-animation-widget.js
index 122e7b034..3ba172902 100644
--- a/web/js/containers/animation-widget/collapsed-animation-widget.js
+++ b/web/js/containers/animation-widget/collapsed-animation-widget.js
@@ -37,7 +37,9 @@ function CollapsedAnimationWidget (props) {
const getWidgetIDs = () => {
if (isDistractionFreeModeActive && screenWidth < 670 && isPortrait) {
return '-phone-portrait-distraction-free';
- } if ((isMobilePhone && isPortrait) || (!isMobileTablet && screenWidth < 670 && hasSubdailyLayers) || (!isMobileTablet && screenWidth < 575 && !hasSubdailyLayers)) {
+ } if ((isMobilePhone && isPortrait)
+ || (!isMobileTablet && screenWidth < 670 && hasSubdailyLayers)
+ || (!isMobileTablet && screenWidth < 575 && !hasSubdailyLayers)) {
return `-phone-portrait${subdailyID}`;
} if (isMobilePhone && isLandscape) {
return `-phone-landscape${subdailyID}`;
diff --git a/web/js/containers/animation-widget/mobile-animation-widget.js b/web/js/containers/animation-widget/mobile-animation-widget.js
index 975bceba4..7ea74b2c8 100644
--- a/web/js/containers/animation-widget/mobile-animation-widget.js
+++ b/web/js/containers/animation-widget/mobile-animation-widget.js
@@ -47,9 +47,11 @@ function MobileAnimationWidget (props) {
const startingDate = getISODateFormatted(startDate);
const getMobileIDs = () => {
- if ((isMobilePhone && isLandscape) || (!isMobilePhone && !isMobileTablet && screenHeight < 800)) {
+ if ((isMobilePhone && isLandscape)
+ || (!isMobilePhone && !isMobileTablet && screenHeight < 800)) {
return 'mobile-phone-landscape';
- } if ((isMobilePhone && isPortrait) || (!isMobilePhone && !isMobileTablet && screenWidth < 550)) {
+ } if ((isMobilePhone && isPortrait)
+ || (!isMobilePhone && !isMobileTablet && screenWidth < 550)) {
return 'mobile-phone-portrait';
} if (isMobileTablet || screenWidth <= breakpoints.small) {
return 'tablet';
diff --git a/web/js/containers/image-download.js b/web/js/containers/image-download.js
index 164c2679b..f14bc25b0 100644
--- a/web/js/containers/image-download.js
+++ b/web/js/containers/image-download.js
@@ -72,7 +72,9 @@ class ImageDownloadContainer extends Component {
*/
getLatLongFromPixelValue(pixelX, pixelY) {
const { proj, map } = this.props;
- const coordinate = map.ui.selected.getCoordinateFromPixel([Math.floor(pixelX), Math.floor(pixelY)]);
+ const coordinate = map.ui.selected.getCoordinateFromPixel(
+ [Math.floor(pixelX), Math.floor(pixelY)],
+ );
const { crs } = proj.selected;
const [x, y] = olProj.transform(coordinate, crs, CRS.GEOGRAPHIC);
@@ -188,7 +190,12 @@ class ImageDownloadContainer extends Component {
hasSubdailyLayers={hasSubdailyLayers}
markerCoordinates={markerCoordinates}
date={date}
- datelineMessage={getAlertMessageIfCrossesDateline(date, bottomLeftLatLong, topRightLatLong, proj)}
+ datelineMessage={getAlertMessageIfCrossesDateline(
+ date,
+ bottomLeftLatLong,
+ topRightLatLong,
+ proj,
+ )}
url={url}
viewExtent={viewExtent}
getLayers={getLayers}
diff --git a/web/js/containers/map-interactions/ol-vector-interactions.js b/web/js/containers/map-interactions/ol-vector-interactions.js
index f13516bc7..f451c2bc6 100644
--- a/web/js/containers/map-interactions/ol-vector-interactions.js
+++ b/web/js/containers/map-interactions/ol-vector-interactions.js
@@ -88,7 +88,8 @@ export class VectorInteractions extends React.Component {
let toggledGranuleFootprint;
// only allow hover footprints on selected side of A/B comparison
- if (compareActive && !isFromActiveCompareRegion(pixels, activeString, compareState, swipeOffset)) {
+ if (compareActive
+ && !isFromActiveCompareRegion(pixels, activeString, compareState, swipeOffset)) {
return;
}
@@ -97,7 +98,11 @@ export class VectorInteractions extends React.Component {
.keys(granuleFootprints)
.forEach((date) => {
const points = granuleFootprints[date];
- const isValidPolygon = areCoordinatesAndPolygonExtentValid(points, mouseCoords, visibleExtent);
+ const isValidPolygon = areCoordinatesAndPolygonExtentValid(
+ points,
+ mouseCoords,
+ visibleExtent,
+ );
if (isValidPolygon) {
toggledGranuleFootprint = true;
events.trigger(GRANULE_HOVERED, granulePlatform, date);
@@ -125,11 +130,15 @@ export class VectorInteractions extends React.Component {
if (def.layergroup === 'Reference') isReferenceLayer = true;
const layerExtent = layer.get('extent');
const pixelCoords = map.getCoordinateFromPixel(pixel);
- const featureOutsideExtent = layerExtent && !olExtent.containsCoordinate(layerExtent, pixelCoords);
- if (!def || lodashIncludes(def.clickDisabledFeatures, feature.getGeometry().getType()) || featureOutsideExtent) return;
+ const featureOutsideExtent = layerExtent
+ && !olExtent.containsCoordinate(layerExtent, pixelCoords);
+ if (!def || lodashIncludes(def.clickDisabledFeatures, feature.getGeometry().getType())
+ || featureOutsideExtent) return;
const isWrapped = proj.id === 'geographic' && (def.wrapadjacentdays || def.wrapX);
- const isRenderedFeature = isWrapped ? lon > -250 || lon < 250 || lat > -90 || lat < 90 : true;
- if (isRenderedFeature && isFromActiveCompareRegion(pixel, layer.wv.group, compareState, swipeOffset)) {
+ const isRenderedFeature = isWrapped ? lon > -250
+ || lon < 250 || lat > -90 || lat < 90 : true;
+ if (isRenderedFeature
+ && isFromActiveCompareRegion(pixel, layer.wv.group, compareState, swipeOffset)) {
isActiveLayer = true;
}
});
@@ -186,7 +195,8 @@ export class VectorInteractions extends React.Component {
let clickObj = getDialogObject(pixels, map);
const metaArray = clickObj.metaArray || [];
const isAeronet = !!metaArray[0] && metaArray[0].id.includes('AERONET');
- clickObj = getDialogObject(pixels, map, isMobile ? screenSize.screenWidth : isAeronet ? 250 : 445);
+ clickObj = getDialogObject(pixels, map, isMobile
+ ? screenSize.screenWidth : isAeronet ? 250 : 445);
const selected = clickObj.selected || {};
const offsetLeft = clickObj.offsetLeft || 10;
const offsetTop = clickObj.offsetTop || 100;
@@ -197,7 +207,12 @@ export class VectorInteractions extends React.Component {
if (isCoordinatesMarker) return;
const mapRes = map.getView().getResolution();
- const hasNonClickableVectorLayerType = hasNonClickableVectorLayer(activeLayers, mapRes, proj.id, isMobile);
+ const hasNonClickableVectorLayerType = hasNonClickableVectorLayer(
+ activeLayers,
+ mapRes,
+ proj.id,
+ isMobile,
+ );
if (isMobile) {
const coord = map.getCoordinateFromPixel(pixels);
@@ -208,7 +223,15 @@ export class VectorInteractions extends React.Component {
if (hasNonClickableVectorLayerType && !isAeronet) {
activateVectorZoomAlert();
} else {
- openVectorDialog(dialogId, metaArray, offsetLeft, offsetTop, screenSize, isEmbedModeActive, isAeronet);
+ openVectorDialog(
+ dialogId,
+ metaArray,
+ offsetLeft,
+ offsetTop,
+ screenSize,
+ isEmbedModeActive,
+ isAeronet,
+ );
if (exceededLengthLimit) {
activateVectorExceededResultsAlert();
} else if (isVectorExceededAlertPresent) {
@@ -218,7 +241,8 @@ export class VectorInteractions extends React.Component {
} else if (hasNonClickableVectorLayerType) {
activateVectorZoomAlert();
}
- if (Object.entries(selected).length || (Object.entries(lastSelected).length && !isVectorModalOpen)) {
+ if (Object.entries(selected).length
+ || (Object.entries(lastSelected).length && !isVectorModalOpen)) {
if (isMobile && hasNonClickableVectorLayerType) return;
selectVectorFeatures(selected);
} else if (isVectorModalOpen && !Object.entries(selected).length) {
@@ -275,7 +299,13 @@ function mapStateToProps(state) {
screenSize,
isCoordinateSearchActive,
compareState: compare,
- getDialogObject: (pixels, olMap, modalWidth) => onMapClickGetVectorFeatures(pixels, olMap, state, swipeOffset, modalWidth),
+ getDialogObject: (pixels, olMap, modalWidth) => onMapClickGetVectorFeatures(
+ pixels,
+ olMap,
+ state,
+ swipeOffset,
+ modalWidth,
+ ),
isDistractionFreeModeActive: ui.isDistractionFreeModeActive,
isEmbedModeActive: embed.isEmbedModeActive,
isVectorExceededAlertPresent,
@@ -311,7 +341,15 @@ const mapDispatchToProps = (dispatch) => ({
activateVectorZoomAlert: () => dispatch({ type: ACTIVATE_VECTOR_ZOOM_ALERT }),
activateVectorExceededResultsAlert: () => dispatch({ type: ACTIVATE_VECTOR_EXCEEDED_ALERT }),
clearVectorExceededResultsAlert: () => dispatch({ type: DISABLE_VECTOR_EXCEEDED_ALERT }),
- openVectorDialog: (dialogId, metaArray, offsetLeft, offsetTop, screenSize, isEmbedModeActive, isAeronet) => {
+ openVectorDialog: (
+ dialogId,
+ metaArray,
+ offsetLeft,
+ offsetTop,
+ screenSize,
+ isEmbedModeActive,
+ isAeronet,
+ ) => {
const { screenHeight, screenWidth } = screenSize;
const isMobile = screenSize.isMobileDevice;
const dialogKey = new Date().getUTCMilliseconds();
diff --git a/web/js/containers/modal.js b/web/js/containers/modal.js
index ce6cf8ad1..ec5347be3 100644
--- a/web/js/containers/modal.js
+++ b/web/js/containers/modal.js
@@ -12,7 +12,10 @@ import { onToggle } from '../modules/modal/actions';
import ErrorBoundary from './error-boundary';
import DetectOuterClick from '../components/util/detect-outer-click';
-const InteractionWrap = ({ condition, wrapper, children }) => (condition ? wrapper(children) : children);
+const InteractionWrap = ({
+ condition,
+ wrapper, children,
+}) => (condition ? wrapper(children) : children);
const toggleWithClose = (onToggle, onClose, isOpen) => {
if (onClose && isOpen) {
return () => {
@@ -176,7 +179,10 @@ class ModalContainer extends Component {
</button>
);
const bounds = stayOnscreen ? {
- left: -(screenWidth / 2 - width / 2), right: screenWidth / 2 - width / 2, top: -style.top, bottom: screenHeight - height - style.top - 5,
+ left: -(screenWidth / 2 - width / 2),
+ right: screenWidth / 2 - width / 2,
+ top: -style.top,
+ bottom: screenHeight - height - style.top - 5,
} : '';
return (
<ErrorBoundary>
diff --git a/web/js/containers/sidebar/charting.js b/web/js/containers/sidebar/charting.js
index 7c9e07a8d..7168b2f1d 100644
--- a/web/js/containers/sidebar/charting.js
+++ b/web/js/containers/sidebar/charting.js
@@ -41,7 +41,8 @@ function ChartingLayerMenu (props) {
useEffect(() => {
if (!activeChartingLayer && Object.keys(renderedPalettes).length > 0) {
- updateActiveChartingLayer(activeLayersWithPalettes.filter((layer) => !layer.shouldHide)[0].id);
+ updateActiveChartingLayer(activeLayersWithPalettes
+ .filter((layer) => !layer.shouldHide)[0].id);
}
}, [renderedPalettes]);
diff --git a/web/js/containers/sidebar/events.js b/web/js/containers/sidebar/events.js
index 0fc3e48db..ab56339c0 100644
--- a/web/js/containers/sidebar/events.js
+++ b/web/js/containers/sidebar/events.js
@@ -143,7 +143,8 @@ function Events(props) {
>
<div id="wv-events">
{isLoading || hasRequestError ? (
- // notranslate included below to prevent Google Translate extension from crashing the page
+ // notranslate included below to prevent
+ // Google Translate extension from crashing the page
<div className="events-loading-text notranslate">
{hasRequestError && (<FontAwesomeIcon icon="exclamation-triangle" fixedWidth widthAuto />)}
{errorOrLoadingText}
diff --git a/web/js/containers/sidebar/footer-content.js b/web/js/containers/sidebar/footer-content.js
index aa5c00c89..31ff4fc19 100644
--- a/web/js/containers/sidebar/footer-content.js
+++ b/web/js/containers/sidebar/footer-content.js
@@ -142,7 +142,8 @@ const FooterContent = React.forwardRef((props, ref) => {
<div>
More than
{` ${LIMIT_EVENT_REQUEST_COUNT} `}
- events match the current filter criteria. Narrow your search by date, event type and/or map view.
+ events match the current filter criteria. Narrow your search by date, event type
+ and/or map view.
</div>
</UncontrolledTooltip>
</>
diff --git a/web/js/containers/sidebar/layer-list.js b/web/js/containers/sidebar/layer-list.js
index ac471fd2b..5656190ae 100644
--- a/web/js/containers/sidebar/layer-list.js
+++ b/web/js/containers/sidebar/layer-list.js
@@ -188,7 +188,9 @@ function LayerList(props) {
ref={provided.innerRef}
{...provided.droppableProps}
>
- {layers.sort((layerA, layerB) => (isChartingActive ? layerB.shouldHide === layerA.shouldHide ? 0 : layerB.shouldHide ? -1 : 1 : 0)).map(renderLayer)}
+ {layers.sort((layerA, layerB) => (isChartingActive
+ ? layerB.shouldHide === layerA.shouldHide
+ ? 0 : layerB.shouldHide ? -1 : 1 : 0)).map(renderLayer)}
{provided.placeholder}
</ul>
)}
diff --git a/web/js/containers/sidebar/layer-row.js b/web/js/containers/sidebar/layer-row.js
index c035e786b..acefef097 100644
--- a/web/js/containers/sidebar/layer-row.js
+++ b/web/js/containers/sidebar/layer-row.js
@@ -199,11 +199,14 @@ function LayerRow (props) {
// hook that checks if the ddv layer location alert should be enabled or disabled
useEffect(() => {
const { title } = layer;
- // if layer is ddv && layer IS NOT already in location alert list && location is at alertable coordinates
+ // if layer is ddv && layer IS NOT already in location alert list
+ // && location is at alertable coordinates
if (isLayerNotificationDismissable && !ddvLayerLocationNoticeActive && showGranuleAlert) {
enableDDVLocationAlert(title);
- // if layer is ddv && layer IS NOT already in location alert list && location is at alertable coordinates
- } else if (isLayerNotificationDismissable && ddvLayerLocationNoticeActive && !showGranuleAlert) {
+ // if layer is ddv && layer IS NOT already in location alert list
+ // && location is at alertable coordinates
+ } else if (isLayerNotificationDismissable
+ && ddvLayerLocationNoticeActive && !showGranuleAlert) {
disableDDVLocationAlert(title);
}
}, [showGranuleAlert]);
@@ -596,7 +599,8 @@ function LayerRow (props) {
))}
</div>
)}
- {showZoomAlert && !hideZoomAlert && !isLayerNotificationDismissable && !layer.shouldHide && (
+ {showZoomAlert && !hideZoomAlert
+ && !isLayerNotificationDismissable && !layer.shouldHide && (
<AlertUtil
id="zoom-alert"
isOpen
@@ -607,7 +611,8 @@ function LayerRow (props) {
onClick={openZoomAlertModal}
/>
)}
- {showGranuleAlert && !hideGranuleAlert && !isLayerNotificationDismissable && !layer.shouldHide && (
+ {showGranuleAlert && !hideGranuleAlert
+ && !isLayerNotificationDismissable && !layer.shouldHide && (
<AlertUtil
id="granule-alert"
isOpen
@@ -663,7 +668,8 @@ const makeMapStateToProps = () => {
compareState,
} = ownProps;
const {
- screenSize, palettes, config, embed, map, compare, proj, ui, settings, animation, layers, date,
+ screenSize, palettes, config, embed, map,
+ compare, proj, ui, settings, animation, layers, date,
} = state;
const isMobile = screenSize.isMobileDevice;
const { isDistractionFreeModeActive } = ui;
@@ -708,7 +714,8 @@ const makeMapStateToProps = () => {
isVectorLayer: isVector,
isChartableLayer: isChartable,
isAnimating: animation.isPlaying,
- hasClickableFeature: isVector && isVisible && isVectorLayerClickable(layer, mapRes, proj.id, isMobile),
+ hasClickableFeature: isVector && isVisible
+ && isVectorLayerClickable(layer, mapRes, proj.id, isMobile),
hasPalette,
getPalette: (layerId, i) => getPalette(layer.id, i, compareState, state),
paletteLegends,
diff --git a/web/js/containers/sidebar/layers-container.js b/web/js/containers/sidebar/layers-container.js
index de27bc1e1..842218a37 100644
--- a/web/js/containers/sidebar/layers-container.js
+++ b/web/js/containers/sidebar/layers-container.js
@@ -128,23 +128,22 @@ function LayersContainer (props) {
const shouldHideForEmbedNoOverlays = isEmbedModeActive && overlays.length === 0;
const shouldHideForEmbedNoBaseLayers = isEmbedModeActive && baselayers.length === 0;
return isActive && (
- <>
- <div id="layers-scroll-container" style={scrollContainerStyles}>
- <div className="layer-container sidebar-panel">
+ <div id="layers-scroll-container" style={scrollContainerStyles}>
+ <div className="layer-container sidebar-panel">
- {groupOverlays ? renderOverlayGroups() : !shouldHideForEmbedNoOverlays && (
- <LayerList
- title="Overlays"
- groupId="overlays"
- compareState={compareState}
- collapsed={overlaysCollapsed}
- toggleCollapse={() => toggleOverlaysCollapsed(!overlaysCollapsed)}
- layers={overlays}
- layerSplit={overlays.length}
- />
- )}
+ {groupOverlays ? renderOverlayGroups() : !shouldHideForEmbedNoOverlays && (
+ <LayerList
+ title="Overlays"
+ groupId="overlays"
+ compareState={compareState}
+ collapsed={overlaysCollapsed}
+ toggleCollapse={() => toggleOverlaysCollapsed(!overlaysCollapsed)}
+ layers={overlays}
+ layerSplit={overlays.length}
+ />
+ )}
- {!shouldHideForEmbedNoBaseLayers && (
+ {!shouldHideForEmbedNoBaseLayers && (
<div className="layer-group-baselayers">
<LayerList
title="Base Layers"
@@ -156,10 +155,9 @@ function LayersContainer (props) {
layerSplit={overlays.length}
/>
</div>
- )}
- </div>
+ )}
</div>
- </>
+ </div>
);
}
diff --git a/web/js/containers/sidebar/sidebar.js b/web/js/containers/sidebar/sidebar.js
index 42fbccf4e..82bfcb66e 100644
--- a/web/js/containers/sidebar/sidebar.js
+++ b/web/js/containers/sidebar/sidebar.js
@@ -123,7 +123,8 @@ class Sidebar extends React.Component {
const topOffset = 10;
const basePadding = 130;
newHeight = screenHeight
- - (iconHeight + topOffset + tabHeight + groupCheckboxHeight + basePadding + footerHeight + addLayersHeight)
+ - (iconHeight + topOffset + tabHeight + groupCheckboxHeight
+ + basePadding + footerHeight + addLayersHeight)
- 10;
} else {
newHeight = screenHeight - (tabHeight + groupCheckboxHeight + footerHeight + addLayersHeight);
diff --git a/web/js/containers/sidebar/smart-handoff.js b/web/js/containers/sidebar/smart-handoff.js
index 813dfa101..f2a4f8c0b 100644
--- a/web/js/containers/sidebar/smart-handoff.js
+++ b/web/js/containers/sidebar/smart-handoff.js
@@ -149,10 +149,11 @@ class SmartHandoff extends Component {
}
/**
- * Fires when the image cropper is moved around on the map; updates the SW and NE lat/lon coordinates.
+ * Fires when the image cropper is moved around on the map;
+ * updates the SW and NE lat/lon coordinates.
* @param {*} boundaries - the focal point to which layer data should be contained within
- * @param {boolean} setExtent - should the subsequent setState call set the extent, which will trigger
- * the granule count async requests
+ * @param {boolean} setExtent - should the subsequent setState call set the extent,
+ * which will trigger the granule count async requests
*/
onBoundaryChange(boundaries, setExtent) {
const { proj, map, selectedCollection } = this.props;
@@ -386,35 +387,36 @@ class SmartHandoff extends Component {
<div className="layer-title">{layer.title}</div>
<div className="layer-subtitle">{layer.subtitle}</div>
- {layer.conceptIds.filter(({ value }) => validatedConceptIds[value]).map((collection) => {
- const {
- type, value, version, quality,
- } = collection;
- const inputId = `${util.encodeId(value)}-${util.encodeId(layer.id)}-collection-choice`;
- const isSelected = (selectedCollection || {}).value === value && layerIsSelected;
- const labelId = `${inputId}-label`;
- const label = STD_NRT_MAP[type]
+ {layer.conceptIds.filter(({ value }) => validatedConceptIds[value])
+ .map((collection) => {
+ const {
+ type, value, version, quality,
+ } = collection;
+ const inputId = `${util.encodeId(value)}-${util.encodeId(layer.id)}-collection-choice`;
+ const isSelected = (selectedCollection || {}).value === value && layerIsSelected;
+ const labelId = `${inputId}-label`;
+ const label = STD_NRT_MAP[type]
+ (version ? ` - v${version}` : '')
+ (quality ? ' (Quality)' : '');
- return (
- <div className="collection-choice" key={inputId}>
- <input
- id={inputId}
- type="radio"
- name="smart-handoff-layer-radio"
- checked={isSelected}
- onChange={() => selectCollection(collection.value, layer.id)}
- />
- <label id={labelId} htmlFor={inputId}>
- {label}
- <FontAwesomeIcon id={`${util.encodeId(value)}-tooltip`} icon="info-circle" widthAuto />
- </label>
-
- {this.renderCollectionTooltip(collection, labelId)}
- </div>
- );
- })}
+ return (
+ <div className="collection-choice" key={inputId}>
+ <input
+ id={inputId}
+ type="radio"
+ name="smart-handoff-layer-radio"
+ checked={isSelected}
+ onChange={() => selectCollection(collection.value, layer.id)}
+ />
+ <label id={labelId} htmlFor={inputId}>
+ {label}
+ <FontAwesomeIcon id={`${util.encodeId(value)}-tooltip`} icon="info-circle" widthAuto />
+ </label>
+
+ {this.renderCollectionTooltip(collection, labelId)}
+ </div>
+ );
+ })}
</div>
);
@@ -504,7 +506,10 @@ class SmartHandoff extends Component {
<div className="smart-handoff-side-panel error">
{requestFailed
? (
- <h1>Data records from the Common Metadata Repository (CMR) could not be reached. Data downloads are not possible at this time.</h1>
+ <h1>
+ Data records from the Common Metadata Repository (CMR) could not be reached. Data
+ downloads are not possible at this time.
+ </h1>
)
: (
<>
@@ -564,7 +569,8 @@ class SmartHandoff extends Component {
} = this.state;
// Determine if the download button is enabled
- const validSelection = showBoundingBox ? !selectionOutsideExtents && !showZoomedIntoDatelineAlert : !showZoomedIntoDatelineAlert;
+ const validSelection = showBoundingBox
+ ? !selectionOutsideExtents && !showZoomedIntoDatelineAlert : !showZoomedIntoDatelineAlert;
const isValidDownload = selectedLayer && selectedLayer.id && validSelection;
if (isLoading) {
@@ -623,7 +629,8 @@ const mapStateToProps = (state) => {
screenSize, map, proj, smartHandoffs,
} = state;
const {
- conceptId, layerId, availableTools, validatedConceptIds, validatedLayers, isLoadingTools, isValidatingCollections, requestFailed,
+ conceptId, layerId, availableTools, validatedConceptIds,
+ validatedLayers, isLoadingTools, isValidatingCollections, requestFailed,
} = smartHandoffs;
const { screenWidth, screenHeight } = screenSize;
@@ -632,7 +639,8 @@ const mapStateToProps = (state) => {
const selectedDateFormatted = moment.utc(selectedDate).format('YYYY-MM-DD'); // 2020-01-01
const availableLayers = getValidLayersForHandoffs(state);
const selectedLayer = availableLayers.find(({ id }) => id === layerId);
- const selectedCollection = selectedLayer && (selectedLayer.conceptIds || []).find(({ value }) => value === conceptId);
+ const selectedCollection = selectedLayer && (selectedLayer.conceptIds || [])
+ .find(({ value }) => value === conceptId);
const isLoading = isLoadingTools || isValidatingCollections;
const isGranuleLayer = selectedLayer && selectedLayer.type === 'granule';
const { startDate, endDate } = selectedLayer
diff --git a/web/js/containers/timeline/timeline.js b/web/js/containers/timeline/timeline.js
index e1de43749..0119fcc8a 100644
--- a/web/js/containers/timeline/timeline.js
+++ b/web/js/containers/timeline/timeline.js
@@ -94,7 +94,8 @@ const checkLeftArrowDisabled = (
) => {
const nextDecMoment = moment.utc(date).subtract(delta, timeScaleChangeUnit);
const nextDecrementDate = new Date(nextDecMoment.seconds(0).format());
- const minMinusDeltaMoment = moment.utc(timelineStartDateLimit).subtract(delta, timeScaleChangeUnit);
+ const minMinusDeltaMoment = moment.utc(timelineStartDateLimit)
+ .subtract(delta, timeScaleChangeUnit);
const minMinusDeltaDate = new Date(minMinusDeltaMoment.seconds(0).format());
const nextDecrementDateTime = nextDecrementDate.getTime();
@@ -222,8 +223,16 @@ class Timeline extends React.Component {
// change timescale
this.debounceWheelTime = 60;
- this.debounceChangeTimeScaleWheel = lodashDebounce(this.throttleChangeTimeScaleWheel, this.debounceWheelTime, throttleSettings);
- this.throttleChangeTimeScaleWheelFire = lodashThrottle(this.changeTimeScaleScroll, 200, throttleSettings);
+ this.debounceChangeTimeScaleWheel = lodashDebounce(
+ this.throttleChangeTimeScaleWheel,
+ this.debounceWheelTime,
+ throttleSettings,
+ );
+ this.throttleChangeTimeScaleWheelFire = lodashThrottle(
+ this.changeTimeScaleScroll,
+ 200,
+ throttleSettings,
+ );
// application relative now time
this.appNowUpdateInterval = 0;
@@ -305,7 +314,8 @@ class Timeline extends React.Component {
// handle location update triggered from animation start/end date change from animation widget
if (isAnimationWidgetOpen) {
if (prevStartLocationDate && prevEndLocationDate) {
- const animStartDateChanged = prevStartLocationDate.getTime() !== animStartLocationDate.getTime();
+ const animStartDateChanged = prevStartLocationDate.getTime()
+ !== animStartLocationDate.getTime();
const animEndDateChanged = prevEndLocationDate.getTime() !== animEndLocationDate.getTime();
const frontDateChanged = prevState.frontDate !== frontDate;
if (animStartDateChanged || animEndDateChanged || frontDateChanged) {
@@ -369,7 +379,8 @@ class Timeline extends React.Component {
requestAnimationFrame(() => {
this.setState({
hoverTime: date,
- leftOffset: leftOffset - parentOffset, // relative location from parent bounding box of mouse hover position (i.e. BLUE LINE)
+ // relative location from parent bounding box of mouse hover position (i.e. BLUE LINE)
+ leftOffset: leftOffset - parentOffset,
});
});
};
@@ -451,12 +462,17 @@ class Timeline extends React.Component {
const diffFactor = diff / gridWidth;
const displayDateValue = currentDateValue + xHoverPositionInCurrentGrid * diffFactor;
- const isBetweenValidTimeline = getIsBetween(displayDateValue, timelineStartDateLimit, timelineEndDateLimit);
+ const isBetweenValidTimeline = getIsBetween(
+ displayDateValue,
+ timelineStartDateLimit,
+ timelineEndDateLimit,
+ );
if (isBetweenValidTimeline) {
const displayDateFormat = getISODateFormatted(displayDateValue);
this.displayDate(displayDateFormat, clientX);
this.setState({
- hoverLinePosition: index * gridWidth + xHoverPositionInCurrentGrid + transformX + position,
+ hoverLinePosition: index * gridWidth + xHoverPositionInCurrentGrid
+ + transformX + position,
});
}
});
@@ -599,7 +615,13 @@ class Timeline extends React.Component {
if (!disabled) {
const minDate = new Date(timelineStartDateLimit);
const maxDate = new Date(timelineEndDateLimit);
- this.onDateChange(getNextTimeSelection(delta, timeScaleChangeUnit, selectedDate, minDate, maxDate));
+ this.onDateChange(getNextTimeSelection(
+ delta,
+ timeScaleChangeUnit,
+ selectedDate,
+ minDate,
+ maxDate,
+ ));
}
}
@@ -838,7 +860,13 @@ class Timeline extends React.Component {
* @param {Boolean} otherDraggerVisibleArg
* @returns {void}
*/
- updateDraggerDatePosition = (newDate, draggerSelected, draggerPositionArg, draggerVisibleArg, otherDraggerVisibleArg) => {
+ updateDraggerDatePosition = (
+ newDate,
+ draggerSelected,
+ draggerPositionArg,
+ draggerVisibleArg,
+ otherDraggerVisibleArg,
+ ) => {
const {
draggerPosition,
draggerPositionB,
@@ -947,7 +975,8 @@ class Timeline extends React.Component {
isAnimationDraggerDragging,
} = self.state;
const { isAnimationPlaying, arrowDown } = self.props;
- const userIsInteracting = arrowDown || isTimelineDragging || isDraggerDragging || isAnimationDraggerDragging;
+ const userIsInteracting = arrowDown || isTimelineDragging
+ || isDraggerDragging || isAnimationDraggerDragging;
if (!userIsInteracting && !isAnimationPlaying) {
return resolve();
}
@@ -1487,7 +1516,11 @@ class Timeline extends React.Component {
}
}
>
- <KioskTimeStamp date={selectedDate} subdaily={hasSubdailyLayers} isKioskModeActive={isKioskModeActive} />
+ <KioskTimeStamp
+ date={selectedDate}
+ subdaily={hasSubdailyLayers}
+ isKioskModeActive={isKioskModeActive}
+ />
</div>
</section>
</ErrorBoundary>
diff --git a/web/js/containers/toolbar.js b/web/js/containers/toolbar.js
index 028889ac7..e297ad595 100644
--- a/web/js/containers/toolbar.js
+++ b/web/js/containers/toolbar.js
@@ -133,7 +133,8 @@ class toolbarContainer extends Component {
hasNonDownloadableLayer,
visibleLayersForProj,
} = this.props;
- const nonDownloadableLayers = hasNonDownloadableLayer ? getNonDownloadableLayers(visibleLayersForProj) : null;
+ const nonDownloadableLayers = hasNonDownloadableLayer
+ ? getNonDownloadableLayers(visibleLayersForProj) : null;
const paletteStore = lodashCloneDeep(activePalettes);
toggleDialogVisible(false);
await this.getPromise(hasCustomPalette, 'palette', clearCustomsSnapshot, 'Notice');
@@ -144,7 +145,8 @@ class toolbarContainer extends Component {
{
...CUSTOM_MODAL_PROPS.TOOLBAR_SNAPSHOT,
onClose: () => {
- refreshStateAfterImageDownload(hasCustomPalette ? paletteStore : undefined, rotation, nonDownloadableLayers);
+ refreshStateAfterImageDownload(hasCustomPalette
+ ? paletteStore : undefined, rotation, nonDownloadableLayers);
},
},
);
@@ -259,7 +261,9 @@ class toolbarContainer extends Component {
);
}
- // handle rendering of Location Search button 1) visibility and 2) control of click (mobile vs desktop)
+ // handle rendering of Location Search button
+ // 1) visibility and
+ // 2) control of click (mobile vs desktop)
renderLocationSearchButtonComponent = () => {
const {
config,
@@ -285,7 +289,8 @@ class toolbarContainer extends Component {
)
: () => toggleShowLocationSearch();
- const showButton = (isMobile || (!isMobile && !isLocationSearchExpanded) || shouldBeCollapsed) && !isDistractionFreeModeActive;
+ const showButton = (isMobile || (!isMobile && !isLocationSearchExpanded)
+ || shouldBeCollapsed) && !isDistractionFreeModeActive;
const mobileWvToolbarButtonStyle = isMobile ? {
fontSize: '14.3px',
height: '44px',
diff --git a/web/js/containers/tour.js b/web/js/containers/tour.js
index dbdb40a7d..e547a39e4 100644
--- a/web/js/containers/tour.js
+++ b/web/js/containers/tour.js
@@ -150,7 +150,8 @@ class Tour extends React.Component {
selectTour(e, currentStory, currentStoryIndex, currentStoryId) {
const {
- config, renderedPalettes, selectTour, processStepLink, isKioskModeActive, isEmbedModeActive, preProcessStepLink, promiseImageryForTour,
+ config, renderedPalettes, selectTour, processStepLink, isKioskModeActive,
+ isEmbedModeActive, preProcessStepLink, promiseImageryForTour,
} = this.props;
if (e) e.preventDefault();
const kioskParam = this.getKioskParam(isKioskModeActive);
@@ -262,7 +263,8 @@ class Tour extends React.Component {
currentStoryId,
} = this.state;
const {
- config, renderedPalettes, processStepLink, isKioskModeActive, activeTab, changeTab, isEmbedModeActive, preProcessStepLink, promiseImageryForTour,
+ config, renderedPalettes, processStepLink, isKioskModeActive, activeTab,
+ changeTab, isEmbedModeActive, preProcessStepLink, promiseImageryForTour,
} = this.props;
const kioskParam = this.getKioskParam(isKioskModeActive);
@@ -303,7 +305,8 @@ class Tour extends React.Component {
decreaseStep(e) {
const {
- config, renderedPalettes, processStepLink, isKioskModeActive, activeTab, changeTab, isEmbedModeActive,
+ config, renderedPalettes, processStepLink,
+ isKioskModeActive, activeTab, changeTab, isEmbedModeActive,
} = this.props;
const {
currentStep, currentStory, currentStoryId,
@@ -616,7 +619,11 @@ const mapStateToProps = (state) => {
screenHeight,
renderedPalettes: palettes.rendered,
activeTab: sidebar.activeTab,
- promiseImageryForTour: (layers, dateString, activeString) => promiseImageryForTour(state, layers, dateString, activeString),
+ promiseImageryForTour: (
+ layers,
+ dateString,
+ activeString,
+ ) => promiseImageryForTour(state, layers, dateString, activeString),
};
};
diff --git a/web/js/location.js b/web/js/location.js
index c6d0db52a..f93c51a18 100644
--- a/web/js/location.js
+++ b/web/js/location.js
@@ -525,7 +525,8 @@ const getParameters = function(config, parameters) {
serialize: (currentItemState, state) => {
const isChartingRange = get(state, 'charting.timeSpanSelection') === 'range';
const timeSpanEndDate = get(state, 'charting.timeSpanEndDate');
- return isChartingRange && !!timeSpanEndDate ? serializeDateChartingWrapper(currentItemState, state) : undefined;
+ return isChartingRange && !!timeSpanEndDate
+ ? serializeDateChartingWrapper(currentItemState, state) : undefined;
},
parse: (str) => parsePermalinkDate(now, str, parameters.l, config),
},
diff --git a/web/js/map/granule/granule-layer-builder.js b/web/js/map/granule/granule-layer-builder.js
index 469076b67..e19b9ba3f 100644
--- a/web/js/map/granule/granule-layer-builder.js
+++ b/web/js/map/granule/granule-layer-builder.js
@@ -62,7 +62,8 @@ export default function granuleLayerBuilder(cache, store, createLayerWMTS) {
/**
* Query CMR to get dates
* @param {object} def - Layer specs
- * @param {object} selectedDate - current selected date (Note: may not return this date, but this date will be the max returned)
+ * @param {object} selectedDate - current selected date (Note: may not return this date,
+ * but this date will be the max returned)
* @returns {array} granule dates
*/
const getQueriedGranuleDates = async (def, selectedDate) => {
@@ -185,30 +186,46 @@ export default function granuleLayerBuilder(cache, store, createLayerWMTS) {
* @param {Date} leadingEdgeDate - timeline date
* @returns {array}
*/
- const getVisibleGranules = (availableGranules, granuleCount, leadingEdgeDate, granuleDateRanges) => {
+ const getVisibleGranules = (
+ availableGranules,
+ granuleCount,
+ leadingEdgeDate,
+ granuleDateRanges,
+ ) => {
const { proj: { selected: { crs } } } = store.getState();
const visibleGranules = [];
const invisibleGranules = [];
const availableCount = availableGranules?.length;
if (!availableCount) return { visibleGranules, invisibleGranules };
const count = granuleCount > availableCount ? availableCount : granuleCount;
- const sortedAvailableGranules = availableGranules.sort((a, b) => new Date(b.date) - new Date(a.date));
+ const sortedAvailableGranules = availableGranules
+ .sort((a, b) => new Date(b.date) - new Date(a.date));
let totalLength = visibleGranules.length + invisibleGranules.length;
for (let i = 0; totalLength < count; i += 1) {
const item = sortedAvailableGranules[i];
if (!item) break;
const { date } = item;
const dateDate = new Date(date);
- leadingEdgeDate.setSeconds(59); // force currently selected time to be 59 seconds. This is to compensate for the inability to select seconds in the timeline
- const isWithinRange = isWithinRanges(leadingEdgeDate, granuleDateRanges); // check if currently selected time is within a date range
- const granuleIsWithinRange = isWithinRanges(dateDate, granuleDateRanges) ?? true; // check if the current granule is within a date range, defaults to true
+ // force currently selected time to be 59 seconds.
+ // This is to compensate for the inability to select seconds in the timeline
+ leadingEdgeDate.setSeconds(59);
+ // check if currently selected time is within a date range
+ const isWithinRange = isWithinRanges(leadingEdgeDate, granuleDateRanges);
+ // check if the current granule is within a date range, defaults to true
+ const granuleIsWithinRange = isWithinRanges(dateDate, granuleDateRanges) ?? true;
const gaps = identifyGaps(granuleDateRanges); // identify gaps between date ranges
- const currentlySelectedGap = !isWithinRange ? gaps.find(([start, end]) => leadingEdgeDate >= start && leadingEdgeDate <= end) : null; // get the gap that the currently selected time is within
- const granuleIsWithinSelectedGap = currentlySelectedGap ? dateDate >= currentlySelectedGap[0] && dateDate <= currentlySelectedGap[1] : true; // check if the current granule is within the currently selected gap
-
- if (dateDate <= leadingEdgeDate && isWithinRange && granuleIsWithinRange && isWithinBounds(crs, item)) {
+ // get the gap that the currently selected time is within
+ const currentlySelectedGap = !isWithinRange
+ ? gaps.find(([start, end]) => leadingEdgeDate >= start && leadingEdgeDate <= end) : null;
+ // check if the current granule is within the currently selected gap
+ const granuleIsWithinSelectedGap = currentlySelectedGap
+ ? dateDate >= currentlySelectedGap[0] && dateDate <= currentlySelectedGap[1] : true;
+
+ if (dateDate <= leadingEdgeDate && isWithinRange
+ && granuleIsWithinRange && isWithinBounds(crs, item)) {
visibleGranules.unshift(item);
- } else if (dateDate <= leadingEdgeDate && !granuleIsWithinRange && isWithinBounds(crs, item) && granuleIsWithinSelectedGap) {
+ } else if (dateDate <= leadingEdgeDate && !granuleIsWithinRange
+ && isWithinBounds(crs, item) && granuleIsWithinSelectedGap) {
invisibleGranules.unshift(item);
}
@@ -237,13 +254,18 @@ export default function granuleLayerBuilder(cache, store, createLayerWMTS) {
// get granule dates waiting for CMR query and filtering (if necessary)
const availableGranules = await getQueriedGranuleDates(def, date, group);
- const { visibleGranules, invisibleGranules } = getVisibleGranules(availableGranules, count, date, granuleDateRanges);
+ const {
+ visibleGranules,
+ invisibleGranules,
+ } = getVisibleGranules(availableGranules, count, date, granuleDateRanges);
const transformedVisibleGranules = transformGranulesForProj(visibleGranules, crs);
const transformedInvisibleGranules = transformGranulesForProj(invisibleGranules, crs);
return {
count,
- granuleDates: [...transformedVisibleGranules.map((g) => g.date), ...transformedInvisibleGranules.map((g) => g.date)],
+ granuleDates: [
+ ...transformedVisibleGranules.map((g) => g.date),
+ ...transformedInvisibleGranules.map((g) => g.date)],
visibleGranules: transformedVisibleGranules,
invisibleGranules: transformedInvisibleGranules,
granuleDateRanges,
@@ -275,9 +297,15 @@ export default function granuleLayerBuilder(cache, store, createLayerWMTS) {
const granuleAttributes = await getGranuleAttributes(def, options);
const { visibleGranules, invisibleGranules } = granuleAttributes;
const shouldShift = def.shiftadjacentdays ?? true; // defaults to true
- const shiftedVisibleGranules = shouldShift ? datelineShiftGranules(visibleGranules, date, crs) : visibleGranules;
- const shiftedInvisibleGranules = shouldShift ? datelineShiftGranules(invisibleGranules, date, crs) : invisibleGranules;
- const tileLayers = new OlCollection(createGranuleTileLayers(shiftedVisibleGranules, def, attributes));
+ const shiftedVisibleGranules = shouldShift
+ ? datelineShiftGranules(visibleGranules, date, crs) : visibleGranules;
+ const shiftedInvisibleGranules = shouldShift
+ ? datelineShiftGranules(invisibleGranules, date, crs) : invisibleGranules;
+ const tileLayers = new OlCollection(createGranuleTileLayers(
+ shiftedVisibleGranules,
+ def,
+ attributes,
+ ));
granuleLayer.setLayers(tileLayers);
granuleLayer.setExtent(crs === CRS.GEOGRAPHIC ? FULL_MAP_EXTENT : maxExtent);
granuleLayer.set('granuleGroup', true);
diff --git a/web/js/map/granule/util.js b/web/js/map/granule/util.js
index fbf924c68..8a318fda7 100644
--- a/web/js/map/granule/util.js
+++ b/web/js/map/granule/util.js
@@ -235,7 +235,12 @@ export const getParamsForGranuleRequest = (def, date, crs) => {
* @param {object} rangeStart - date object
* @param {object} rangeEnd - date object
*/
-export const getCMRQueryDateUpdateOptions = (CMRDateStoreForLayer, date, startQueryDate, endQueryDate) => {
+export const getCMRQueryDateUpdateOptions = (
+ CMRDateStoreForLayer,
+ date,
+ startQueryDate,
+ endQueryDate,
+) => {
let canExtendRange = false;
let needRangeUpdate = true;
let rangeStart;
@@ -269,8 +274,10 @@ export const getCMRQueryDateUpdateOptions = (CMRDateStoreForLayer, date, startQu
const newStartEqualsCurrentCMREnd = newStartTime === currentEndTime;
const newEndEqualsCurrentCMRStart = newEndTime === currentStartTime;
- const newEndCanExtendCurrentCMREnd = newStartBeforeCurrentCMRStart && newEndSameOrAfterCurentCMRStart;
- const newStartCanExtendCurrentCMRStart = newStartAfterCurrentCMRStart && newStartSameOrBeforeCurrentCMREnd;
+ const newEndCanExtendCurrentCMREnd = newStartBeforeCurrentCMRStart
+ && newEndSameOrAfterCurentCMRStart;
+ const newStartCanExtendCurrentCMRStart = newStartAfterCurrentCMRStart
+ && newStartSameOrBeforeCurrentCMREnd;
if (newStartSameOrAfterCurrentStart && newEndSameOrBeforeCurrentEnd) {
needRangeUpdate = false;
@@ -354,7 +361,11 @@ export const transformGranuleData = (entry, date, crs) => {
};
export const transformGranulesForProj = (granules, crs) => granules.map((granule) => {
- const transformedPolygon = granule.polygon.map((coords) => transform(coords, CRS.GEOGRAPHIC, crs));
+ const transformedPolygon = granule.polygon.map((coords) => transform(
+ coords,
+ CRS.GEOGRAPHIC,
+ crs,
+ ));
return {
...granule,
polygon: transformedPolygon,
diff --git a/web/js/map/granule/util.test.js b/web/js/map/granule/util.test.js
index 050424baf..ab42d8047 100644
--- a/web/js/map/granule/util.test.js
+++ b/web/js/map/granule/util.test.js
@@ -1,6 +1,7 @@
import {
- datelineShiftGranules, getCMRQueryDates, transformGranuleData, areCoordinatesAndPolygonExtentValid,
+ datelineShiftGranules, getCMRQueryDates,
+ transformGranuleData, areCoordinatesAndPolygonExtentValid,
} from './util';
import { CRS } from '../../modules/map/constants';
import util from '../../util/util';
diff --git a/web/js/map/layerbuilder.js b/web/js/map/layerbuilder.js
index 58089a456..267dc40cd 100644
--- a/web/js/map/layerbuilder.js
+++ b/web/js/map/layerbuilder.js
@@ -333,7 +333,8 @@ export default function mapLayerBuilder(config, cache, store) {
const createLayerWMTS = (def, options, day, state) => {
const { proj } = state;
const {
- id, layer, format, matrixIds, matrixSet, matrixSetLimits, period, source, style, wrapadjacentdays, type,
+ id, layer, format, matrixIds, matrixSet, matrixSetLimits,
+ period, source, style, wrapadjacentdays, type,
} = def;
const configSource = config.sources[source];
const { date, polygon, shifted } = options;
@@ -358,8 +359,14 @@ export default function mapLayerBuilder(config, cache, store) {
}
const { tileMatrices, resolutions, tileSize } = configMatrixSet;
- const { origin, extent } = calcExtentsFromLimits(configMatrixSet, matrixSetLimits, day, proj.selected);
- const sizes = !tileMatrices ? [] : tileMatrices.map(({ matrixWidth, matrixHeight }) => [matrixWidth, matrixHeight]);
+ const { origin, extent } = calcExtentsFromLimits(
+ configMatrixSet,
+ matrixSetLimits,
+ day,
+ proj.selected,
+ );
+ const sizes = !tileMatrices
+ ? [] : tileMatrices.map(({ matrixWidth, matrixHeight }) => [matrixWidth, matrixHeight]);
// Also need to shift this if granule is shifted
const tileGridOptions = {
@@ -572,7 +579,8 @@ export default function mapLayerBuilder(config, cache, store) {
const key = splitActive[5].split(',');
// Actual data starts at row index 6, loop through all data points
for (let i = 6; i < splitActive.length; i += 1) {
- // Split the current data point into each value, and assign them their respective key based on the key from row index 5
+ // Split the current data point into each value,
+ // and assign them their respective key based on the key from row index 5
const split2 = splitActive[i].split(',');
const rowObj = {};
for (let j = 0; j < split2.length; j += 1) {
@@ -605,7 +613,8 @@ export default function mapLayerBuilder(config, cache, store) {
const key = splitAll[1].split(',');
// Actual data starts at row index 2, loop through all data points
for (let i = 2; i < splitAll.length; i += 1) {
- // Split the current data point into each value, and assign them their respective key based on the key from row index 1
+ // Split the current data point into each value,
+ // and assign them their respective key based on the key from row index 1
const split2 = splitAll[i].split(',');
const rowObj = {};
for (let j = 0; j < split2.length; j += 1) {
@@ -624,7 +633,8 @@ export default function mapLayerBuilder(config, cache, store) {
active: !!takenNamesActive[rowObj.Site_Name],
coordinates: [parseFloat(rowObj['Longitude(decimal_degrees)']), parseFloat(rowObj['Latitude(decimal_degrees)'])],
MAIN_USE: featuresObj[rowObj.Site_Name].properties ? featuresObj[rowObj.Site_Name].properties.value : 'inactivesite',
- date: featuresObj[rowObj.Site_Name].properties ? featuresObj[rowObj.Site_Name].properties.date : new Date(date.toUTCString()),
+ date: featuresObj[rowObj.Site_Name].properties
+ ? featuresObj[rowObj.Site_Name].properties.date : new Date(date.toUTCString()),
};
takenNamesAll[rowObj.Site_Name] = true;
}
@@ -633,7 +643,8 @@ export default function mapLayerBuilder(config, cache, store) {
const geoJson = {
type: 'FeatureCollection',
- features: Object.values(featuresObj).sort((a, b) => a.properties.active > b.properties.active),
+ features: Object.values(featuresObj)
+ .sort((a, b) => a.properties.active > b.properties.active),
};
const formattedFeatures = vectorSource.getFormat().readFeatures(geoJson);
vectorSource.addFeatures(formattedFeatures);
@@ -670,7 +681,8 @@ export default function mapLayerBuilder(config, cache, store) {
let valueIndex;
// For active data points, define a color based on their value via the color palette
if (active) {
- valueIndex = values.findIndex((range) => value >= range[0] && (range.length < 2 || value < range[1]));
+ valueIndex = values.findIndex((range) => value >= range[0]
+ && (range.length < 2 || value < range[1]));
fillColor = `#${colors[valueIndex]}`;
fillColor = fillColor.substring(0, fillColor.length - 2);
} else {
@@ -1135,7 +1147,12 @@ export default function mapLayerBuilder(config, cache, store) {
} = wmtsDef;
const configSource = config.sources[source];
const configMatrixSet = configSource.matrixSets[matrixSet];
- const { extent } = calcExtentsFromLimits(configMatrixSet, matrixSetLimits, day, proj.selected);
+ const { extent } = calcExtentsFromLimits(
+ configMatrixSet,
+ matrixSetLimits,
+ day,
+ proj.selected,
+ );
const sourceOptions = {
url: `${configSource.url}/${layerName}/{z}/{x}/{y}`,
diff --git a/web/js/map/natural-events/cluster.js b/web/js/map/natural-events/cluster.js
index 7bc4af0fe..93d10ba17 100644
--- a/web/js/map/natural-events/cluster.js
+++ b/web/js/map/natural-events/cluster.js
@@ -42,7 +42,12 @@ export const naturalEventsClusterCreateObject = (proj) => new Supercluster({
* @param {String} date
* @return {Object} geoJSON point
*/
-export const clusterPointToGeoJSON = (id, coordinates, date, { magnitudeUnit, magnitudeValue }) => ({
+export const clusterPointToGeoJSON = (
+ id,
+ coordinates,
+ date,
+ { magnitudeUnit, magnitudeValue },
+) => ({
type: 'Feature',
properties: {
id: `${id}-${date}`,
diff --git a/web/js/map/natural-events/event-markers.js b/web/js/map/natural-events/event-markers.js
index 37021e1e2..65f473996 100644
--- a/web/js/map/natural-events/event-markers.js
+++ b/web/js/map/natural-events/event-markers.js
@@ -108,8 +108,10 @@ class EventMarkers extends React.Component {
proj, eventsDataIsLoading, isAnimatingToEvent, selectedEvent,
} = this.props;
const projChange = proj !== prevProps.proj;
- const finishedLoading = !eventsDataIsLoading && eventsDataIsLoading !== prevProps.eventsDataIsLoading;
- const animationFinished = !isAnimatingToEvent && isAnimatingToEvent !== prevProps.isAnimatingToEvent;
+ const finishedLoading = !eventsDataIsLoading
+ && eventsDataIsLoading !== prevProps.eventsDataIsLoading;
+ const animationFinished = !isAnimatingToEvent
+ && isAnimatingToEvent !== prevProps.isAnimatingToEvent;
const selectedEventChanged = selectedEvent && selectedEvent !== prevProps.selectedEvent;
if (finishedLoading || projChange || animationFinished || selectedEventChanged) {
@@ -202,7 +204,8 @@ class EventMarkers extends React.Component {
let willSelect = true;
let moveCount = 0;
const pinEl = marker.pin.element_ || marker.pin.element;
- // Use passiveSupport detect in ui. passive applied if supported, capture will be false either way.
+ // Use passiveSupport detect in ui.
+ // Passive applied if supported, capture will be false either way.
const options = mapUi.supportsPassive ? { passive: true } : false;
const onMouseDownTouchStart = (e) => {
willSelect = true;
diff --git a/web/js/map/natural-events/event-track.js b/web/js/map/natural-events/event-track.js
index 8cc70d8d0..6d4c00610 100644
--- a/web/js/map/natural-events/event-track.js
+++ b/web/js/map/natural-events/event-track.js
@@ -80,10 +80,24 @@ const updateSelection = function(newDate) {
* @param {Object} highlightOptions
* @return {Object} Object Containing track info and elements
*/
-const getTracksAndPoints = function (eventObj, proj, map, selectedDate, callback, showAllTracks, highlightOptions) {
+const getTracksAndPoints = function (
+ eventObj,
+ proj,
+ map,
+ selectedDate,
+ callback,
+ showAllTracks,
+ highlightOptions,
+) {
const pointsAndArrows = [];
const trackSegments = [];
- const { clusters, firstClusterObj, secondClusterObj } = getClusters(eventObj, proj, selectedDate, map, showAllTracks);
+ const { clusters, firstClusterObj, secondClusterObj } = getClusters(
+ eventObj,
+ proj,
+ selectedDate,
+ map,
+ showAllTracks,
+ );
const { isHighlighted } = highlightOptions;
clusters.forEach((clusterPoint, index) => {
@@ -112,7 +126,14 @@ const getTracksAndPoints = function (eventObj, proj, map, selectedDate, callback
pointsAndArrows.push(point);
});
return {
- track: getTrackLines(map, trackSegments, eventObj.id, getDefaultEventDate(eventObj), callback, highlightOptions),
+ track: getTrackLines(
+ map,
+ trackSegments,
+ eventObj.id,
+ getDefaultEventDate(eventObj),
+ callback,
+ highlightOptions,
+ ),
pointsAndArrows,
};
};
@@ -220,7 +241,20 @@ function EventTrack () {
const {
track,
pointsAndArrows,
- } = getTracksAndPoints(singleEvent, proj, mapRef.current, eventDate, selectEvent, showAllTracksRef.current, { callbackHighlight: highlightEvent, callbackUnhighlight: unHighlightEvent, isHighlighted: showAllTracks && (singleEvent.id === selectedEvent.id || singleEvent.id === highlightedEvent.id) });
+ } = getTracksAndPoints(
+ singleEvent,
+ proj,
+ mapRef.current,
+ eventDate,
+ selectEvent,
+ showAllTracksRef.current,
+ {
+ callbackHighlight: highlightEvent,
+ callbackUnhighlight: unHighlightEvent,
+ isHighlighted: showAllTracks
+ && (singleEvent.id === selectedEvent.id || singleEvent.id === highlightedEvent.id),
+ },
+ );
newTrackDetails = {
id: eventID,
@@ -257,7 +291,20 @@ function EventTrack () {
const {
track,
pointsAndArrows,
- } = getTracksAndPoints(event, proj, mapRef.current, date, selectEvent, null, { callbackHighlight: highlightEvent, callbackUnhighlight: unHighlightEvent, isHighlighted: showAllTracks && (event.id === selectedEvent.id || event.id === highlightedEvent.id) });
+ } = getTracksAndPoints(
+ event,
+ proj,
+ mapRef.current,
+ date,
+ selectEvent,
+ null,
+ {
+ callbackHighlight: highlightEvent,
+ callbackUnhighlight: unHighlightEvent,
+ isHighlighted: showAllTracks
+ && (event.id === selectedEvent.id || event.id === highlightedEvent.id),
+ },
+ );
newTrackDetails = {
id: event.id,
@@ -297,7 +344,8 @@ function EventTrack () {
setTrackDetails(newTrackDetails);
};
- // $$$ This function merely gets the selected event data from the events data and calls the update() function with that data, will likely not need it $$$
+ // $$$ This function merely gets the selected event data from the events data and
+ // calls the update() function with that data, will likely not need it $$$
const updateCurrentTrack = () => {
const { id, date } = selectedEvent;
if (!selectedEvent.id || !selectedEvent.date) return;
@@ -348,9 +396,11 @@ function EventTrack () {
const selectedDateChange = (selectedDate && selectedDate.valueOf())
!== (prevSelectedDate && prevSelectedDate?.valueOf());
const eventDeselect = (selectedEvent !== prevSelectedEvent?.id) && !selectedEvent?.id;
- const finishedAnimating = !isAnimatingToEvent && (isAnimatingToEvent !== prevIsAnimatingToEvent);
+ const finishedAnimating = !isAnimatingToEvent
+ && (isAnimatingToEvent !== prevIsAnimatingToEvent);
const eventsLoaded = eventsData && eventsData.length;
- const extentChange = prevExtent && (extent[0] !== prevExtent[0] || extent[1] !== prevExtent[1]);
+ const extentChange = prevExtent
+ && (extent[0] !== prevExtent[0] || extent[1] !== prevExtent[1]);
const highlightedEventChange = highlightedEvent?.id !== prevHighlightedEvent?.id;
const allTracksChange = showAllTracks !== prevShowAllTracks;
@@ -358,7 +408,11 @@ function EventTrack () {
if (prevMap) {
update(null);
removeTrack(prevMap);
- removePointOverlays(prevMap, trackDetailsRef.current.pointsAndArrows, createOverlayMapping(prevMap));
+ removePointOverlays(
+ prevMap,
+ trackDetailsRef.current.pointsAndArrows,
+ createOverlayMapping(prevMap),
+ );
if (showAllTracksRef.current) {
removeAllTracks(prevMap);
}
@@ -372,12 +426,15 @@ function EventTrack () {
}
// show all tracks when selecting as option
- if (showAllTracksRef.current && !isPlaying && (prevShowAllTracks !== showAllTracksRef.current || selectedDateChange || finishedAnimating || eventsLoaded || extentChange || highlightedEventChange)) {
+ if (showAllTracksRef.current && !isPlaying && (prevShowAllTracks !== showAllTracksRef.current
+ || selectedDateChange || finishedAnimating || eventsLoaded
+ || extentChange || highlightedEventChange)) {
debouncedUpdateAllTracks();
}
// show only selected track if show all tracks is not selected
- if (!showAllTracks && !isPlaying && (!showAllTracksRef.current || allTracksChange) && (selectedDateChange || finishedAnimating || eventsLoaded || extentChange)) {
+ if (!showAllTracks && !isPlaying && (!showAllTracksRef.current || allTracksChange)
+ && (selectedDateChange || finishedAnimating || eventsLoaded || extentChange)) {
debouncedTrackUpdate();
}
@@ -386,7 +443,8 @@ function EventTrack () {
removeTrack(mapRef.current);
}
},
- [map, isPlaying, extent, selectedDate, isAnimatingToEvent, eventsData, selectedEvent, showAllTracksRef.current, highlightedEvent, showAllTracks],
+ [map, isPlaying, extent, selectedDate, isAnimatingToEvent, eventsData, selectedEvent,
+ showAllTracksRef.current, highlightedEvent, showAllTracks],
);
return null;
diff --git a/web/js/map/runningdata.js b/web/js/map/runningdata.js
index 80affc318..fb23fbae5 100644
--- a/web/js/map/runningdata.js
+++ b/web/js/map/runningdata.js
@@ -44,9 +44,15 @@ export default function MapRunningData(compareUi, store) {
const isRenderedFeature = isWrapped ? lon > -250 || lon < 250 || lat > -90 || lat < 90 : true;
const coords = map.getCoordinateFromPixel(pixel);
const featureOutsideExtent = !olExtent.containsCoordinate(layer.get('extent'), coords);
- const inCompareRegion = isFromActiveCompareRegion(pixel, layer.wv.group, compare, swipeOffset);
+ const inCompareRegion = isFromActiveCompareRegion(
+ pixel,
+ layer.wv.group,
+ compare,
+ swipeOffset,
+ );
const hasPalette = !lodashIsEmpty(def.palette);
- return !isRenderedFeature || !inCompareRegion || featureOutsideExtent || !hasPalette || isCollapsed;
+ return !isRenderedFeature || !inCompareRegion
+ || featureOutsideExtent || !hasPalette || isCollapsed;
};
// Running data for vector layers
@@ -66,13 +72,16 @@ export default function MapRunningData(compareUi, store) {
if (!value) return;
const tooltips = legend.tooltips.map((c) => c.toLowerCase().replace(/\s/g, ''));
if (id.includes('AERONET')) {
- const colorIndex = tooltips.findIndex((range) => value >= range[0] && (range.length < 2 || value < range[1]));
+ const colorIndex = tooltips.findIndex((range) => value >= range[0]
+ && (range.length < 2 || value < range[1]));
color = legend.colors[colorIndex];
if (!color) {
const paletteLegendsAeronet = getPalette(id, 1, undefined, state);
const { legend: legendAeronet } = paletteLegendsAeronet;
const tooltipsAeronet = legendAeronet.tooltips;
- const colorIndexAeronet = tooltipsAeronet.findIndex((range) => parseFloat(value) >= parseFloat(range.split(' – ')[0]) && (range.split(' – ').length < 2 || parseFloat(value) < parseFloat(range.split(' – ')[1])));
+ const colorIndexAeronet = tooltipsAeronet.findIndex((range) => parseFloat(value)
+ >= parseFloat(range.split(' – ')[0]) && (range.split(' – ').length < 2
+ || parseFloat(value) < parseFloat(range.split(' – ')[1])));
color = legendAeronet.colors[colorIndexAeronet];
}
} else {
diff --git a/web/js/map/util.js b/web/js/map/util.js
index 697f346a1..12ef880bf 100644
--- a/web/js/map/util.js
+++ b/web/js/map/util.js
@@ -133,7 +133,8 @@ const getBestZoom = function(distance, start, end, view) {
zoom,
pixels: distance / view.getResolutionForZoom(zoom),
}));
- const bestFit = lines.sort((a, b) => Math.abs(idealLength - a.pixels) - Math.abs(idealLength - b.pixels))[0];
+ const bestFit = lines.sort((a, b) => Math.abs(idealLength - a.pixels)
+ - Math.abs(idealLength - b.pixels))[0];
return Math.max(2, Math.min(bestFit.zoom, start - 1, end - 1));
};
@@ -155,10 +156,15 @@ export function fly (map, proj, endPoint, endZoom = 5, rotation = 0, isKioskMode
const hasEndInView = olExtent.containsCoordinate(extent, endPoint);
const line = new OlGeomLineString([startPoint, endPoint]);
const distance = line.getLength(); // In map units, which is usually degrees
- const distanceDuration = polarProjectionCheck ? distance / 50000 : distance; // limit large polar projection distances from coordinate transforms
+ // limit large polar projection distances from coordinate transforms
+ const distanceDuration = polarProjectionCheck ? distance / 50000 : distance;
let duration = isKioskModeActive
- ? Math.max(5000, 2 * Math.floor(distanceDuration * 20 + 1000)) // Minimum 5 seconds, approx 12 seconds to go 360 degrees
- : Math.min(6000, Math.floor(distanceDuration * (15 * (startZoom + endZoom)) + (100 * (startZoom + endZoom)) + 1000)); // approx 6 seconds to go 360 degrees
+ // Minimum 5 seconds, approx 12 seconds to go 360 degrees
+ ? Math.max(5000, 2 * Math.floor(distanceDuration * 20 + 1000))
+ // approx 6 seconds to go 360 degrees
+ : Math.min(6000, Math.floor(
+ distanceDuration * (15 * (startZoom + endZoom)) + (100 * (startZoom + endZoom)) + 1000,
+ ));
const animationPromise = function(...args) {
return new Promise((resolve, reject) => {
diff --git a/web/js/mapUI/components/buffer-quick-animate/bufferQuickAnimate.js b/web/js/mapUI/components/buffer-quick-animate/bufferQuickAnimate.js
index 788ffa2c0..92ea2bb77 100644
--- a/web/js/mapUI/components/buffer-quick-animate/bufferQuickAnimate.js
+++ b/web/js/mapUI/components/buffer-quick-animate/bufferQuickAnimate.js
@@ -22,7 +22,8 @@ function BufferQuickAnimate(props) {
const preloadPromises = [];
const selectedDate = getSelectedDate(dateCompareState);
const dateState = { date };
- const currentBuffer = preloaded ? getNumberStepsBetween(dateState, selectedDate, lastPreloadDate) : 0;
+ const currentBuffer = preloaded
+ ? getNumberStepsBetween(dateState, selectedDate, lastPreloadDate) : 0;
if (currentBuffer >= BUFFER_SIZE) {
return;
diff --git a/web/js/mapUI/components/create-map/createMap.js b/web/js/mapUI/components/create-map/createMap.js
index 21662c7a6..0bc3cc7f6 100644
--- a/web/js/mapUI/components/create-map/createMap.js
+++ b/web/js/mapUI/components/create-map/createMap.js
@@ -207,7 +207,10 @@ function CreateMap(props) {
});
map.on('rendercomplete', onRenderComplete);
- granuleFootprintsObj = { ...granuleFootprintsObj, [proj.crs]: granuleFootprint(map, initialIsMobile) };
+ granuleFootprintsObj = {
+ ...granuleFootprintsObj,
+ [proj.crs]: granuleFootprint(map, initialIsMobile),
+ };
window.addEventListener('resize', () => {
map.getView().changed();
diff --git a/web/js/mapUI/components/dev-test-mode/find-orbit-tracks-mode/dev-find-orbit-tracks-mode.js b/web/js/mapUI/components/dev-test-mode/find-orbit-tracks-mode/dev-find-orbit-tracks-mode.js
index 5b8e3623e..a4ee9da14 100644
--- a/web/js/mapUI/components/dev-test-mode/find-orbit-tracks-mode/dev-find-orbit-tracks-mode.js
+++ b/web/js/mapUI/components/dev-test-mode/find-orbit-tracks-mode/dev-find-orbit-tracks-mode.js
@@ -59,7 +59,8 @@ function FindOrbitTracksMode () {
const verifyExtent = () => {
// This is a very loose measurement.. Should find a better way to find values...
- const unitedStatesExtent = [-125.0799167388867, 22.176358212699427, -62.489596269417106, 57.01542814447728];
+ const unitedStatesExtent = [-125.0799167388867,
+ 22.176358212699427, -62.489596269417106, 57.01542814447728];
const intersection = getIntersection(unitedStatesExtent, currentExtent);
const intersectionArea = getArea(intersection);
if (isEmpty(intersection)) {
diff --git a/web/js/mapUI/components/dev-test-mode/pixel-test-mode/dev-pixel-test.js b/web/js/mapUI/components/dev-test-mode/pixel-test-mode/dev-pixel-test.js
index f6b200ec1..3a9b95391 100644
--- a/web/js/mapUI/components/dev-test-mode/pixel-test-mode/dev-pixel-test.js
+++ b/web/js/mapUI/components/dev-test-mode/pixel-test-mode/dev-pixel-test.js
@@ -41,7 +41,11 @@ function PixelTestMode () {
let mercatorExtent;
if (visualMapExtentSetting) mercatorExtent = transformExtent(currentExtent, 'EPSG:4326', 'EPSG:3857');
try {
- const wmsImage = await fetchWMSImageExperimental(layerSelection.id, formattedDate, mercatorExtent);
+ const wmsImage = await fetchWMSImageExperimental(
+ layerSelection.id,
+ formattedDate,
+ mercatorExtent,
+ );
// Create an image and handle its loading and error events
const img = new Image();
diff --git a/web/js/mapUI/components/kiosk/kiosk-animations/kiosk-animations.js b/web/js/mapUI/components/kiosk/kiosk-animations/kiosk-animations.js
index 45a98aecd..d8fd679da 100644
--- a/web/js/mapUI/components/kiosk/kiosk-animations/kiosk-animations.js
+++ b/web/js/mapUI/components/kiosk/kiosk-animations/kiosk-animations.js
@@ -10,7 +10,9 @@ import { selectDate as selectDateAction } from '../../../../modules/date/actions
function KioskAnimations({ ui }) {
const dispatch = useDispatch();
const initiateAnimation = () => { dispatch(initiateAnimationAction()); };
- const playKioskAnimation = (startDate, endDate) => { dispatch(playKioskAnimationAction(startDate, endDate)); };
+ const playKioskAnimation = (startDate, endDate) => {
+ dispatch(playKioskAnimationAction(startDate, endDate));
+ };
const selectDate = (date) => { dispatch(selectDateAction(date)); };
const selectedDate = useSelector((state) => state.date.selected);
@@ -69,7 +71,8 @@ function KioskAnimations({ ui }) {
playKioskAnimation(startDate, endDate);
};
- // if subdaily animation check that date moved back one day otherwise check if animation should play
+ // if subdaily animation check that date moved back one day
+ // otherwise check if animation should play
const checkAnimationSettings = () => {
if (!ui.selected.frameState_) return;
if (eic === 'sa' && !subdailyAnimationDateUpdated) {
@@ -83,7 +86,8 @@ function KioskAnimations({ ui }) {
};
useEffect(() => {
- if (!ui.selected || !isKioskModeActive || !eicMeasurementComplete || isAnimationPlaying || !eicAnimationMode || eicMeasurementAborted) return;
+ if (!ui.selected || !isKioskModeActive || !eicMeasurementComplete
+ || isAnimationPlaying || !eicAnimationMode || eicMeasurementAborted) return;
checkAnimationSettings();
}, [map, eicMeasurementComplete]);
diff --git a/web/js/mapUI/components/kiosk/tile-measurement/tile-measurement.js b/web/js/mapUI/components/kiosk/tile-measurement/tile-measurement.js
index 770d486d0..f648406cf 100644
--- a/web/js/mapUI/components/kiosk/tile-measurement/tile-measurement.js
+++ b/web/js/mapUI/components/kiosk/tile-measurement/tile-measurement.js
@@ -22,11 +22,17 @@ function TileMeasurement({ ui }) {
const setEICMeasurementComplete = () => { dispatch(setEICMeasurementCompleteAction()); };
const setEICMeasurementAborted = () => { dispatch(setEICMeasurementAbortedAction()); };
const toggleStaticMap = (isActive) => { dispatch(toggleStaticMapAction(isActive)); };
- const toggleGroupVisibility = (ids, visible) => { dispatch(toggleGroupVisiblityAction(ids, visible)); };
+ const toggleGroupVisibility = (
+ ids,
+ visible,
+ ) => { dispatch(toggleGroupVisiblityAction(ids, visible)); };
const eic = useSelector((state) => state.ui.eic);
const realTime = useSelector((state) => state.date.appNow);
- const activeLayers = useSelector((state) => getActiveLayers(state, state.compare.activeString), shallowEqual);
+ const activeLayers = useSelector((state) => getActiveLayers(
+ state,
+ state.compare.activeString,
+ ), shallowEqual);
const eicLegacy = useSelector((state) => state.ui.eicLegacy);
const scenario = useSelector((state) => state.ui.scenario);
@@ -34,9 +40,10 @@ function TileMeasurement({ ui }) {
// #2 Filter all of the active layers that are also in the layersToMeasure array
const findLayersToMeasure = () => {
- const measurementLayersExtra = activeLayers.filter((layer) => layersToMeasure.includes(layer.id));
-
- const measurementLayers = measurementLayersExtra.map((layer) => ({ id: layer.id, period: layer.period }));
+ const measurementLayersExtra = activeLayers
+ .filter((layer) => layersToMeasure.includes(layer.id));
+ const measurementLayers = measurementLayersExtra
+ .map((layer) => ({ id: layer.id, period: layer.period }));
if (measurementLayers.length) console.log(`${measurementLayers.length} EIC layer(s) found to measure...`);
return measurementLayers;
};
@@ -145,7 +152,8 @@ function TileMeasurement({ ui }) {
let abort = false;
// In rare cases the TileLayer may not have finished loading tiles at the time of measurement
- // We can verify this by checking the otherTileStates array for values of 1 that indicate that tiles were still loading
+ // We can verify this by checking the otherTileStates array for values of 1 that indicate that
+ // tiles were still loading
let retries = 0;
while (retries < 10) {
console.log('Attempt #', retries + 1, 'to verify tiles on map...');
@@ -217,8 +225,9 @@ function TileMeasurement({ ui }) {
const fullImageryDate = await findFullImageryDate(measurementLayers, dateRange);
- // If we are using the best date, we need to make sure there are tiles on the map so we include the abort prodcedure parameter
- // This allows us to fall back to the static map if the best date fails as a last resort
+ // If we are using the best date, we need to make sure there are tiles on the map so we
+ // include the abort prodcedure parameter. This allows us to fall back to the static map if
+ // the best date fails as a last resort
const bestDate = findBestDate(measurementLayers, bestDates);
if (!fullImageryDate || bestDate === fullImageryDate) {
updateDate(bestDate, layerPeriod);
diff --git a/web/js/mapUI/components/kiosk/tile-measurement/utils/calculate-pixels.js b/web/js/mapUI/components/kiosk/tile-measurement/utils/calculate-pixels.js
index f92dd897f..c720bb04e 100644
--- a/web/js/mapUI/components/kiosk/tile-measurement/utils/calculate-pixels.js
+++ b/web/js/mapUI/components/kiosk/tile-measurement/utils/calculate-pixels.js
@@ -13,7 +13,8 @@ export default function calculateBlackPixelRatio(blobUrl) {
let blackPixelsCount = 0;
for (let i = 0; i < imgData.length; i += 4) {
// Check if pixel is black
- if (imgData[i] === 0 && imgData[i + 1] === 0 && imgData[i + 2] === 0 && (imgData[i + 3] === 255 || imgData[i + 3] === 0)) {
+ if (imgData[i] === 0 && imgData[i + 1] === 0
+ && imgData[i + 2] === 0 && (imgData[i + 3] === 255 || imgData[i + 3] === 0)) {
blackPixelsCount += 1;
}
}
diff --git a/web/js/mapUI/components/kiosk/tile-measurement/utils/date-util.js b/web/js/mapUI/components/kiosk/tile-measurement/utils/date-util.js
index ffcb33065..4686cf7a6 100644
--- a/web/js/mapUI/components/kiosk/tile-measurement/utils/date-util.js
+++ b/web/js/mapUI/components/kiosk/tile-measurement/utils/date-util.js
@@ -48,7 +48,8 @@ function getSubdailyDates (selectedDate) {
let currentDate = new Date(utcDateString);
// Subtract 30 minutes to start half an hour before the selectedDate
- // This is a performance improvement for EIC mode since most of the time, no full imagery is found in the first 30 minutes
+ // This is a performance improvement for EIC mode since most of the time,
+ // no full imagery is found in the first 30 minutes
currentDate = new Date(currentDate.getTime() - 30 * 60 * 1000);
// Round minutes down to nearest ten and seconds and milliseconds to zero
@@ -57,7 +58,8 @@ function getSubdailyDates (selectedDate) {
// Add 12 more dates in ten-minute intervals (for the past two hours)
for (let i = 1; i <= 12; i += 1) {
- const previousDate = new Date(currentDate.getTime() - i * 10 * 60 * 1000); // subtracts i*10 minutes
+ // subtracts i*10 minutes
+ const previousDate = new Date(currentDate.getTime() - i * 10 * 60 * 1000);
prevDates.push(formatSubdailyDate(previousDate));
}
return prevDates;
diff --git a/web/js/mapUI/components/kiosk/tile-measurement/utils/layer-data-eic.js b/web/js/mapUI/components/kiosk/tile-measurement/utils/layer-data-eic.js
index d763c96e8..3c0e1e3f2 100644
--- a/web/js/mapUI/components/kiosk/tile-measurement/utils/layer-data-eic.js
+++ b/web/js/mapUI/components/kiosk/tile-measurement/utils/layer-data-eic.js
@@ -29,7 +29,8 @@ export const layersToMeasure = [
];
// Object that contains the black pixel % threshold for each layer
-// Threshold values represent the amount of black pixels as a percentage that CAN be present in an image
+// Threshold values represent the amount of black pixels
+// as a percentage that CAN be present in an image
export const layerPixelData = {
MODIS_Terra_CorrectedReflectance_TrueColor: { threshold: 0.70 },
VIIRS_SNPP_DayNightBand_At_Sensor_Radiance: { threshold: 0.70 },
@@ -60,7 +61,8 @@ export const layerPixelData = {
};
// Back-up dates for each layer in case no date is found that satisfies the full imagery threshold
-// TO DO: These layers will eventually need to be prioritized if a scenario has layers from multiple best dates
+// TO DO: These layers will eventually need to be prioritized if a scenario has layers from multiple
+// best dates
export const bestDates = {
'GOES-East_ABI_GeoColor': { date: '2023-10-30T23:50:00.000Z' },
'GOES-West_ABI_GeoColor': { date: '2023-10-30T23:50:00.000Z' },
diff --git a/web/js/mapUI/components/kiosk/tile-measurement/utils/verify-map-tiles.js b/web/js/mapUI/components/kiosk/tile-measurement/utils/verify-map-tiles.js
index ba8f08017..1165ecfa2 100644
--- a/web/js/mapUI/components/kiosk/tile-measurement/utils/verify-map-tiles.js
+++ b/web/js/mapUI/components/kiosk/tile-measurement/utils/verify-map-tiles.js
@@ -21,7 +21,8 @@ const checkTileImage = (image) => {
for (let i = 0; i < data.length; i += 4) {
if (data[i + 3] !== 0) { // If alpha is not 0
isTransparent = false;
- if (data[i] !== firstPixel[0] || data[i + 1] !== firstPixel[1] || data[i + 2] !== firstPixel[2] || data[i + 3] !== firstPixel[3]) {
+ if (data[i] !== firstPixel[0] || data[i + 1] !== firstPixel[1]
+ || data[i + 2] !== firstPixel[2] || data[i + 3] !== firstPixel[3]) {
isSingleColor = false;
break;
}
@@ -99,7 +100,9 @@ export default function countTilesForSpecifiedLayers (ui, layersToCheck) {
const map = ui.selected;
const view = map.getView();
// Match only the layers that are in the layersToMeasure array
- const matchingLayers = map.getLayers().getArray().filter((layer) => layer.wv && layer.wv.id && layersToCheck.includes(layer.wv.id));
+ const matchingLayers = map.getLayers().getArray().filter(
+ (layer) => layer.wv && layer.wv.id && layersToCheck.includes(layer.wv.id),
+ );
let totalExpectedTileCount = 0;
let totalLoadedTileCount = 0;
diff --git a/web/js/mapUI/components/layers/addLayer.js b/web/js/mapUI/components/layers/addLayer.js
index f3f200804..401850791 100644
--- a/web/js/mapUI/components/layers/addLayer.js
+++ b/web/js/mapUI/components/layers/addLayer.js
@@ -76,7 +76,8 @@ function AddLayer(props) {
};
useEffect(() => {
- if (action.type === layerConstants.ADD_LAYER || action.type === layerConstants.UPDATE_DDV_LAYER) {
+ if (action.type === layerConstants.ADD_LAYER
+ || action.type === layerConstants.UPDATE_DDV_LAYER) {
const def = lodashFind(action.layers, { id: action.id });
if (def.type === 'granule') {
return granuleLayerAdd(def);
diff --git a/web/js/mapUI/components/markers/markers.js b/web/js/mapUI/components/markers/markers.js
index 5c9619a28..e5968b3e2 100644
--- a/web/js/mapUI/components/markers/markers.js
+++ b/web/js/mapUI/components/markers/markers.js
@@ -79,7 +79,12 @@ function Markers(props) {
* @param {Object} coordinatesObject - set of coordinates for marker
* @returns {void}
*/
- const addMarkerAndUpdateStore = (showDialog, geocodeResults, shouldFlyToCoordinates, coordinatesObject) => {
+ const addMarkerAndUpdateStore = (
+ showDialog,
+ geocodeResults,
+ shouldFlyToCoordinates,
+ coordinatesObject,
+ ) => {
const results = geocodeResults;
if (!results) return;
const remove = () => removeMarker(coordinatesObject);
@@ -143,7 +148,12 @@ function Markers(props) {
if (action.flyToExistingMarker) {
return flyToMarker(action.coordinates);
}
- return addMarkerAndUpdateStore(true, action.reverseGeocodeResults, action.isCoordinatesSearchActive, action.coordinates);
+ return addMarkerAndUpdateStore(
+ true,
+ action.reverseGeocodeResults,
+ action.isCoordinatesSearchActive,
+ action.coordinates,
+ );
}
case 'LOCATION_SEARCH/TOGGLE_DIALOG_VISIBLE': {
return addMarkerAndUpdateStore(false);
diff --git a/web/js/mapUI/components/update-collections/updateCollections.js b/web/js/mapUI/components/update-collections/updateCollections.js
index ccccc6b3d..68e8d83f0 100644
--- a/web/js/mapUI/components/update-collections/updateCollections.js
+++ b/web/js/mapUI/components/update-collections/updateCollections.js
@@ -67,9 +67,11 @@ function UpdateCollections () {
const layerInCollections = collections[layer.id];
if (!layerInCollections) return true; // Layer not in collections, needs to be updated
- const collectionDate = layerInCollections.dates.some((d) => d.date === date && d.projection === proj.id);
+ const collectionDate = layerInCollections.dates
+ .some((d) => d.date === date && d.projection === proj.id);
- return !collectionDate || forceUpdate; // If date exists in layer collection, don't query layer
+ // If date exists in layer collection, don't query layer
+ return !collectionDate || forceUpdate;
});
return wmtsLayers;
};
@@ -77,7 +79,12 @@ function UpdateCollections () {
const updateLayerCollections = async (forceUpdate = false) => {
const formattedDailyDate = formatDailyDate(selectedDate);
const formattedSubdailyDate = formatSubdailyDate(selectedDate);
- const layersToUpdate = findLayerCollections(layers, formattedDailyDate, formattedSubdailyDate, forceUpdate);
+ const layersToUpdate = findLayerCollections(
+ layers,
+ formattedDailyDate,
+ formattedSubdailyDate,
+ forceUpdate,
+ );
const headerPromises = layersToUpdate.map((layer) => getHeaders(layer, selectedDate));
try {
diff --git a/web/js/mapUI/components/update-date/updateDate.js b/web/js/mapUI/components/update-date/updateDate.js
index 243ca3bf2..04fbe0a2c 100644
--- a/web/js/mapUI/components/update-date/updateDate.js
+++ b/web/js/mapUI/components/update-date/updateDate.js
@@ -79,7 +79,8 @@ function UpdateDate(props) {
const layers = mapLayerCollection.getArray();
const activeLayers = getAllActiveLayers(state);
- const visibleLayers = activeLayers.filter(({ id, visible }) => layers.findIndex(({ wv }) => wv?.def?.id === id) !== -1 && visible);
+ const visibleLayers = activeLayers.filter(({ id, visible }) => layers
+ .findIndex(({ wv }) => wv?.def?.id === id) !== -1 && visible);
const layerPromises = visibleLayers.map(async (def) => {
const { id, type } = def;
@@ -122,7 +123,8 @@ function UpdateDate(props) {
}
return updateDate(action.outOfStep);
}
- if (action.type === layerConstants.TOGGLE_LAYER_VISIBILITY || action.type === layerConstants.TOGGLE_OVERLAY_GROUP_VISIBILITY) {
+ if (action.type === layerConstants.TOGGLE_LAYER_VISIBILITY
+ || action.type === layerConstants.TOGGLE_OVERLAY_GROUP_VISIBILITY) {
const outOfStep = false;
// if date not changing we do not want to recreate titiler layer
const skipTitiler = true;
diff --git a/web/js/mapUI/components/update-projection/updateProjection.js b/web/js/mapUI/components/update-projection/updateProjection.js
index 13caf5914..55d646368 100644
--- a/web/js/mapUI/components/update-projection/updateProjection.js
+++ b/web/js/mapUI/components/update-projection/updateProjection.js
@@ -84,10 +84,15 @@ function UpdateProjection(props) {
*
* @param {string} compareActiveString
* @param {string} compareDateString
- * @param {object} state object representing the layers, compare, & proj properties from global state
+ * @param {object} state object representing the layers,
+ * compare, & proj properties from global state
* @param {object} granuleOptions object representing selected granule layer options
*/
- async function getCompareLayerGroup([compareActiveString, compareDateString], state, granuleOptions) {
+ async function getCompareLayerGroup(
+ [compareActiveString, compareDateString],
+ state,
+ granuleOptions,
+ ) {
const { createLayer } = ui;
const compareSideLayers = getActiveLayers(state, compareActiveString);
const layers = getLayers(state, { reverse: true }, compareSideLayers)
@@ -132,7 +137,12 @@ function UpdateProjection(props) {
clearLayers(saveCache);
const defs = getLayers(layerStateRef.current, { reverse: true });
const layerPromises = defs.map((def) => {
- const options = getGranuleOptions(layerStateRef.current, def, compare.activeString, granuleOptions);
+ const options = getGranuleOptions(
+ layerStateRef.current,
+ def,
+ compare.activeString,
+ granuleOptions,
+ );
return createLayer(def, options);
});
const layerResults = await Promise.allSettled(layerPromises);
@@ -144,7 +154,8 @@ function UpdateProjection(props) {
stateArray.reverse(); // Set Layer order based on active A|B group
}
clearLayers(saveCache);
- const stateArrayGroups = stateArray.map(async (arr) => getCompareLayerGroup(arr, layerStateRef.current, granuleOptions));
+ const stateArrayGroups = stateArray
+ .map(async (arr) => getCompareLayerGroup(arr, layerStateRef.current, granuleOptions));
const compareLayerGroups = await Promise.all(stateArrayGroups);
mapUI?.setLayers(compareLayerGroups);
compareMapUi.create(mapUI, compare.mode);
@@ -386,10 +397,16 @@ function UpdateProjection(props) {
if (!ui.selected) return;
const prevL2Layers = selectL2Layers(prevActiveLayers);
const activeL2Layers = selectL2Layers(activeLayers);
- // Check if new date ranges have been added to L2 layers. We don't want to reload every time new ranges are added so also check if there were no ranges before.
- const hasNewDateRanges = activeL2Layers.some((dateRange, i) => dateRange?.length !== prevL2Layers[i]?.length) && prevL2Layers.includes(undefined);
- const hasNewLayers = prevActiveLayers.length !== activeLayers.length; // Check if new layers have been added
- const hasNewDate = selectedDate !== dateCompareState.date.selected; // Check if the date has changed
+ // Check if new date ranges have been added to L2 layers.
+ // We don't want to reload every time new ranges are added so
+ // also check if there were no ranges before.
+ const hasNewDateRanges = activeL2Layers.some(
+ (dateRange, i) => dateRange?.length !== prevL2Layers[i]?.length,
+ ) && prevL2Layers.includes(undefined);
+ // Check if new layers have been added
+ const hasNewLayers = prevActiveLayers.length !== activeLayers.length;
+ // Check if the date has changed
+ const hasNewDate = selectedDate !== dateCompareState.date.selected;
const needsReload = hasNewDateRanges || hasNewLayers || hasNewDate;
setSelectedDate(dateCompareState.date.selected);
if (needsReload) {
diff --git a/web/js/mapUI/util/util.js b/web/js/mapUI/util/util.js
index 88c557cdb..718e5a121 100644
--- a/web/js/mapUI/util/util.js
+++ b/web/js/mapUI/util/util.js
@@ -209,8 +209,9 @@ export function compareDailyDates(lastDateToCheck, selectedDate) {
}
/**
- * Compares two dates and returns true if ONLY the hour value in selectedDate is greater than 3 hours ahead of lastDateToCheck
- * Used as a safeguard to prevent automatically stepping back farther than 3 hours for subdaily tiles in kiosk mode
+ * Compares two dates and returns true if ONLY the hour value in selectedDate is greater than 3
+ * hours ahead of lastDateToCheck. Used as a safeguard to prevent automatically stepping back
+ * farther than 3 hours for subdaily tiles in kiosk mode
* @param {string} lastDateToCheck
* @param {string} selectedDate
* @returns {boolean}
diff --git a/web/js/modules/animation/gifstream.js b/web/js/modules/animation/gifstream.js
index 04798a9c6..a2e8e2fec 100644
--- a/web/js/modules/animation/gifstream.js
+++ b/web/js/modules/animation/gifstream.js
@@ -285,7 +285,8 @@ export default class GifStream {
},
});
return new GifWriter(rs, width, height, {
- loop: options.loop || 0, // From GIF: 0 = loop forever, null = not looping, n > 0 = loop n times and stop
+ // From GIF: 0 = loop forever, null = not looping, n > 0 = loop n times and stop
+ loop: options.loop || 0,
});
}
}
diff --git a/web/js/modules/animation/selectors.js b/web/js/modules/animation/selectors.js
index eac79bd60..e4787ac5b 100644
--- a/web/js/modules/animation/selectors.js
+++ b/web/js/modules/animation/selectors.js
@@ -87,7 +87,17 @@ export default function getImageArray(
products = getProducts(current, state);
const lonlats = imageUtilGetCoordsFromPixelValues(boundaries, map.ui.selected);
- const dlURL = getDownloadUrl(url, proj, products, lonlats, dimensions, current, false, false, markerCoordinates);
+ const dlURL = getDownloadUrl(
+ url,
+ proj,
+ products,
+ lonlats,
+ dimensions,
+ current,
+ false,
+ false,
+ markerCoordinates,
+ );
src = util.format(dlURL, strDate);
a.push({
diff --git a/web/js/modules/date/util.js b/web/js/modules/date/util.js
index 02deed9bc..b1f1b02cf 100644
--- a/web/js/modules/date/util.js
+++ b/web/js/modules/date/util.js
@@ -10,7 +10,8 @@ import {
import { getSelectedDate, getDeltaIntervalUnit } from './selectors';
import MonospaceDate from '../../components/util/monospace-date';
-export const filterProjLayersWithStartDate = (layers, projId) => layers.filter((layer) => layer.startDate && layer.projections[projId]);
+export const filterProjLayersWithStartDate = (layers, projId) => layers
+ .filter((layer) => layer.startDate && layer.projections[projId]);
/**
* Parses a UTC ISO 8601 date to a non UTC date
@@ -219,7 +220,8 @@ export function checkHasFutureLayers(state) {
if (compare.active) {
const compareALayersFiltered = filterProjLayersWithStartDate(layers.active.layers, proj.id);
const compareBLayersFiltered = filterProjLayersWithStartDate(layers.activeB.layers, proj.id);
- hasFutureLayers = [...compareALayersFiltered, ...compareBLayersFiltered].filter((layer) => layer.futureTime).length > 0;
+ hasFutureLayers = [...compareALayersFiltered,
+ ...compareBLayersFiltered].filter((layer) => layer.futureTime).length > 0;
} else {
const activeLayers = getActiveLayers(state);
const activeLayersFiltered = filterProjLayersWithStartDate(activeLayers, proj.id);
diff --git a/web/js/modules/image-download/util.js b/web/js/modules/image-download/util.js
index fd5aca40d..2a7e22849 100644
--- a/web/js/modules/image-download/util.js
+++ b/web/js/modules/image-download/util.js
@@ -308,7 +308,18 @@ export function getTruncatedGranuleDates(layerDefs) {
* @param {Boolean} isWorldfile
* @param {Array} markerCoordinates
*/
-export function getDownloadUrl(url, proj, layerDefs, bbox, dimensions, dateTime, fileType, isWorldfile, markerCoordinates, activePalettes) {
+export function getDownloadUrl(
+ url,
+ proj,
+ layerDefs,
+ bbox,
+ dimensions,
+ dateTime,
+ fileType,
+ isWorldfile,
+ markerCoordinates,
+ activePalettes,
+) {
const { crs } = proj.selected;
const {
layersArray,
diff --git a/web/js/modules/image-download/util.test.js b/web/js/modules/image-download/util.test.js
index e422b96b9..8e3188096 100644
--- a/web/js/modules/image-download/util.test.js
+++ b/web/js/modules/image-download/util.test.js
@@ -218,7 +218,18 @@ test('Download URL [imagedownload-url]', () => {
{ id: 1, longitude: 2.7117, latitude: -19.1609 },
{ id: 2, longitude: 71.173, latitude: -39.0961 },
];
- const dlURL = getDownloadUrl(url, proj, mockLayerDefs, lonlats, dimensions, dateTime, false, false, locationMarkers, undefined);
+ const dlURL = getDownloadUrl(
+ url,
+ proj,
+ mockLayerDefs,
+ lonlats,
+ dimensions,
+ dateTime,
+ false,
+ false,
+ locationMarkers,
+ undefined,
+ );
const expectedURL = 'http://localhost:3002/api/v1/snapshot'
+ '?REQUEST=GetSnapshot'
+ '&TIME=2019-06-24T00:00:00Z'
diff --git a/web/js/modules/layers/reducers.js b/web/js/modules/layers/reducers.js
index f25ec7a36..08cc9194d 100644
--- a/web/js/modules/layers/reducers.js
+++ b/web/js/modules/layers/reducers.js
@@ -127,7 +127,9 @@ export function layerReducer(state = initialState, action) {
overlayGroups: { $set: action.overlayGroups },
prevLayers: { $set: [] },
},
- eventLayers: action.eventLayers === undefined ? { $push: [] } : action.eventLayers.length ? { $set: action.eventLayers } : { $push: [] },
+ eventLayers: action.eventLayers === undefined
+ ? { $push: [] } : action.eventLayers.length
+ ? { $set: action.eventLayers } : { $push: [] },
});
case TOGGLE_OVERLAY_GROUPS:
@@ -403,8 +405,9 @@ export function layerReducer(state = initialState, action) {
});
}
- // This is required because to update band combinations we need to actually remove and re-add these layers
- // This case sets the ddv layer back to its original index before being removed and added again
+ // This is required because to update band combinations we need to actually remove
+ // and re-add these layers. This case sets the ddv layer back to its original index before being
+ // removed and added again
case UPDATE_DDV_LAYER: {
const { layerIndex, id, layers } = action;
const indexToMove = layers.findIndex((activeLayer) => activeLayer.id === id);
diff --git a/web/js/modules/layers/selectors.js b/web/js/modules/layers/selectors.js
index a6fb2211f..5fe0e8301 100644
--- a/web/js/modules/layers/selectors.js
+++ b/web/js/modules/layers/selectors.js
@@ -21,7 +21,17 @@ const getLayerState = ({ layers }) => layers;
const getConfig = ({ config }) => config;
const getLayerId = (state, { layer }) => layer && layer.id;
-export function addLayer(id, spec = {}, layersParam, layerConfig, overlayLength, projection, groupOverlays, bandComboParam, selectedPresetParam) {
+export function addLayer(
+ id,
+ spec = {},
+ layersParam,
+ layerConfig,
+ overlayLength,
+ projection,
+ groupOverlays,
+ bandComboParam,
+ selectedPresetParam,
+) {
const layers = lodashCloneDeep(layersParam);
if (lodashFind(layers, { id })) {
return layers;
@@ -121,13 +131,17 @@ export function resetLayers(config) {
export const getStartingLayers = createSelector([getConfig], (config) => resetLayers(config));
-export const isGroupingEnabled = ({ compare, layers }) => layers[compare.activeString].groupOverlays;
+export const isGroupingEnabled = ({
+ compare,
+ layers,
+}) => layers[compare.activeString].groupOverlays;
export const getCollections = (layers, dailyDate, subdailyDate, layer, projId) => {
if (!layers.collections[layer.id]) return;
const dateCollection = layers.collections[layer.id].dates;
for (let i = 0; i < dateCollection.length; i += 1) {
- if ((dateCollection[i].date === dailyDate || dateCollection[i].date === subdailyDate) && dateCollection[i].projection === projId) {
+ if ((dateCollection[i].date === dailyDate
+ || dateCollection[i].date === subdailyDate) && dateCollection[i].projection === projId) {
return dateCollection[i];
}
}
@@ -418,7 +432,13 @@ function forGroup(group, spec = {}, activeLayers, state) {
lodashEach(defs, (def) => {
const notInProj = !def.projections[projId];
// eslint-disable-next-line no-use-before-define
- const notRenderable = spec.renderable && !isRenderable(def.id, activeLayers, spec.date, null, state);
+ const notRenderable = spec.renderable && !isRenderable(
+ def.id,
+ activeLayers,
+ spec.date,
+ null,
+ state,
+ );
if (notInProj || notRenderable) {
return;
}
@@ -677,7 +697,11 @@ export const getAllActiveOverlaysBaselayers = createSelector(
*/
export const memoizedAvailable = createSelector(
[getSelectedDate, getActiveLayers, getConfigParameters],
- (currentDate, activeLayers, parameters) => lodashMemoize((id) => available(id, currentDate, activeLayers, parameters)),
+ (
+ currentDate,
+ activeLayers,
+ parameters,
+ ) => lodashMemoize((id) => available(id, currentDate, activeLayers, parameters)),
);
export const findEventLayers = (originalLayers, newLayers) => {
diff --git a/web/js/modules/layers/util.js b/web/js/modules/layers/util.js
index aaadc1f56..e2a2acb27 100644
--- a/web/js/modules/layers/util.js
+++ b/web/js/modules/layers/util.js
@@ -139,8 +139,10 @@ export function getOverlayGroups(layers, prevGroups = []) {
* @method getRevisedMaxEndDate
* @param {Object} minDate A date object
* @param {Object} maxEndDate A date object
- * @param {Object} startDateLimit A date object used as start date of timeline range for available data
- * @param {Object} endDateLimit A date object used as end date of timeline range for available data
+ * @param {Object} startDateLimit
+ * A date object used as start date of timeline range for available data
+ * @param {Object} endDateLimit
+ * A date object used as end date of timeline range for available data
* @return {Object} A date object
*/
const getRevisedMaxEndDate = (minDate, maxEndDate, startDateLimit, endDateLimit) => {
@@ -148,7 +150,8 @@ const getRevisedMaxEndDate = (minDate, maxEndDate, startDateLimit, endDateLimit)
const maxEndDateTime = maxEndDate.getTime();
const startDateLimitTime = startDateLimit.getTime();
const endDateLimitTime = endDateLimit.getTime();
- const frontDateWithinRange = startDateLimitTime >= minDateTime && startDateLimitTime <= maxEndDateTime;
+ const frontDateWithinRange = startDateLimitTime >= minDateTime
+ && startDateLimitTime <= maxEndDateTime;
const backDateWithinRange = endDateLimitTime <= maxEndDateTime && endDateLimitTime >= minDateTime;
if (frontDateWithinRange || backDateWithinRange) {
return endDateLimit;
@@ -329,7 +332,7 @@ const getBreakMaxDate = (period, rangeEndDate) => {
* @method getLimitedDateRange
* @param {Object} def A layer object
* @param {Object} currentDate A date object
- * @return {Array} An array of dates - previous, current, and next dates (if available)
+ * @return {Array} An array of dates - previous, current, and next dates (if available)
*/
const getLimitedDateRange = (def, currentDate) => {
const { period, dateRanges } = def;
@@ -392,7 +395,8 @@ const getLimitedDateRange = (def, currentDate) => {
};
/**
- * Return an array of dates from a yearly period layer based on the dateRange the current date falls in.
+ * Return an array of dates from a yearly period layer based on the dateRange the current date
+ * falls in.
*
* @method getYearDateRange
* @param {Number} currentDateTime Current date milliseconds
@@ -427,14 +431,16 @@ const getYearDateRange = (currentDateTime, minDate, maxDate, interval, dateArray
};
/**
- * Return an array of dates from a monthly period layer based on the dateRange the current date falls in.
+ * Return an array of dates from a monthly period layer based on the dateRange the current date
+ * falls in.
*
* @method getMonthDateRange
* @param {Object} A calculated time object based on period, current date, and date range
* @return {Array} An array of dates with normalized timezones
*/
const getMonthDateRange = ({
- rangeLimitsProvided, currentDateTime, startDateLimit, endDateLimit, minDate, maxDate, dateIntervalNum, dateArray,
+ rangeLimitsProvided, currentDateTime, startDateLimit,
+ endDateLimit, minDate, maxDate, dateIntervalNum, dateArray,
}) => {
let newDateArray = [...dateArray];
const { maxYear, maxMonth, maxDay } = util.getUTCNumbers(maxDate, 'max');
@@ -495,14 +501,16 @@ const getMonthDateRange = ({
};
/**
- * Return an array of dates from a daily period layer based on the dateRange the current date falls in.
+ * Return an array of dates from a daily period layer based on the dateRange the current date
+ * falls in.
*
* @method getDayDateRange
* @param {Object} A calculated time object based on period, current date, and date range
* @return {Array} An array of dates with normalized timezones
*/
const getDayDateRange = ({
- rangeLimitsProvided, currentDateTime, startDateLimit, endDateLimit, minDate, maxDate, dateIntervalNum, dateArray,
+ rangeLimitsProvided, currentDateTime, startDateLimit,
+ endDateLimit, minDate, maxDate, dateIntervalNum, dateArray,
}) => {
let newDateArray = [...dateArray];
const { maxYear, maxMonth, maxDay } = util.getUTCNumbers(maxDate, 'max');
@@ -562,14 +570,16 @@ const getDayDateRange = ({
};
/**
- * Return an array of dates from a subdaily period layer based on the dateRange the current date falls in.
+ * Return an array of dates from a subdaily period layer based on the dateRange the current date
+ * falls in.
*
* @method getSubdailyDateRange
* @param {Object} A calculated time object based on period, current date, and date range
* @return {Array} An array of dates with normalized timezones
*/
const getSubdailyDateRange = ({
- rangeLimitsProvided, currentDateTime, startDateLimit, endDateLimit, minDate, maxDate, dateIntervalNum, dateArray,
+ rangeLimitsProvided, currentDateTime, startDateLimit,
+ endDateLimit, minDate, maxDate, dateIntervalNum, dateArray,
}) => {
const newDateArray = [...dateArray];
const {
@@ -593,7 +603,13 @@ const getSubdailyDateRange = ({
let hourBeforeStartDateLimit;
let hourAfterEndDateLimit;
if (rangeLimitsProvided) {
- minMinuteDateMinusInterval = new Date(minYear, minMonth, minDay, minHour, minMinute - dateIntervalNum);
+ minMinuteDateMinusInterval = new Date(
+ minYear,
+ minMonth,
+ minDay,
+ minHour,
+ minMinute - dateIntervalNum,
+ );
minMinuteDateMinusIntervalOffset = util.getTimezoneOffsetDate(minMinuteDateMinusInterval);
const startDateLimitOffset = startDateLimit.getTimezoneOffset() * 60000;
@@ -601,7 +617,9 @@ const getSubdailyDateRange = ({
const startDateLimitSetMinutes = new Date(startDateLimit).setMinutes(minMinute);
const endDateLimitSetMinutes = new Date(endDateLimit).setMinutes(minMinute);
- hourBeforeStartDateLimit = new Date(startDateLimitSetMinutes - startDateLimitOffset - (60 * 60000));
+ hourBeforeStartDateLimit = new Date(
+ startDateLimitSetMinutes - startDateLimitOffset - (60 * 60000),
+ );
hourAfterEndDateLimit = new Date(endDateLimitSetMinutes - endDateLimitOffset + (60 * 60000));
} else {
// limit date range request to +/- one hour from current date
@@ -669,8 +687,10 @@ const getSubdailyDateRange = ({
* @method datesInDateRanges
* @param {Object} def A layer object
* @param {Object} date A date object for currently selected date
- * @param {Object} startDateLimit A date object used as start date of timeline range for available data
- * @param {Object} endDateLimit A date object used as end date of timeline range for available data
+ * @param {Object} startDateLimit
+ * A date object used as start date of timeline range for available data
+ * @param {Object} endDateLimit
+ * A date object used as end date of timeline range for available data
* @param {Object} appNow A date object of appNow (current date or set explicitly)
* @return {Array} An array of dates with normalized timezones
*/
@@ -756,9 +776,11 @@ export function datesInDateRanges(def, date, startDateLimit, endDateLimit, appNo
}
// revise currentDate to minDate to reduce earlier minDate than needed
- const minDateWithinRangeLimits = minDateTime > inputStartDateTime && minDateTime < inputEndDateTime;
+ const minDateWithinRangeLimits = minDateTime > inputStartDateTime
+ && minDateTime < inputEndDateTime;
const runningMinDateAndLastDateEarlier = runningMinDate && lastDateInDateArray > minDate;
- if (currentDateLessThanMinDate && (minDateWithinRangeLimits || runningMinDateAndLastDateEarlier)) {
+ if (currentDateLessThanMinDate
+ && (minDateWithinRangeLimits || runningMinDateAndLastDateEarlier)) {
currentDate = minDate;
currentDateTime = currentDate.getTime();
}
@@ -782,7 +804,13 @@ export function datesInDateRanges(def, date, startDateLimit, endDateLimit, appNo
// Yearly layers
if (period === 'yearly') {
- const yearArray = getYearDateRange(currentDateTime, minDate, maxDate, dateIntervalNum, dateArray);
+ const yearArray = getYearDateRange(
+ currentDateTime,
+ minDate,
+ maxDate,
+ dateIntervalNum,
+ dateArray,
+ );
dateArray = [...yearArray];
// Monthly layers
}
@@ -846,7 +874,9 @@ export function serializeLayers(layers, state, groupName) {
value: bandComboString,
});
}
- if (def.palette && (def.custom || def.min || def.max || def.squash || def.disabled || (palettes[def.id] && palettes[def.id].maps && palettes[def.id].maps.length > 1))) {
+ if (def.palette
+ && (def.custom || def.min || def.max || def.squash || def.disabled
+ || (palettes[def.id] && palettes[def.id].maps && palettes[def.id].maps.length > 1))) {
// If layer has palette and palette attributes
const paletteAttributeArray = getPaletteAttributeArray(
def.id,
@@ -1051,7 +1081,8 @@ const createLayerArrayFromState = function(layers, config) {
};
// this function takes an array of date ranges in this format:
-// [{ layer.period, dateRanges.startDate: Date, dateRanges.endDate: Date, dateRanges.dateInterval: Number}]
+// [{ layer.period, dateRanges.startDate: Date,
+// dateRanges.endDate: Date, dateRanges.dateInterval: Number}]
// the array is first sorted, and then checked for any overlap
export function dateOverlap(period, dateRanges) {
const sortedRanges = dateRanges.sort((previous, current) => {
@@ -1431,7 +1462,8 @@ export function adjustStartDates(layers) {
const [firstDateRange] = dateRanges;
const adjustedDate = adjustDate(rollingWindow);
- // To prevent a startDate greater than endDate for layers with a rollingWindow and specific start and end dates
+ // To prevent a startDate greater than endDate for layers with a rollingWindow and specific
+ // start and end dates
if (endDate && new Date(adjustedDate) > new Date(endDate)) {
return;
}
diff --git a/web/js/modules/location-search/actions.js b/web/js/modules/location-search/actions.js
index 5dad6529a..a818ad8f3 100644
--- a/web/js/modules/location-search/actions.js
+++ b/web/js/modules/location-search/actions.js
@@ -75,7 +75,9 @@ export function setPlaceMarker(coord, reverseGeocodeResults, isInputSearch) {
}
}
- const markerAlreadyExists = coordinates.find(({ longitude: lon, latitude: lat }) => lon === longitude && lat === latitude);
+ const markerAlreadyExists = coordinates.find(
+ ({ longitude: lon, latitude: lat }) => lon === longitude && lat === latitude,
+ );
if (markerAlreadyExists) {
return dispatch({
diff --git a/web/js/modules/location-search/reducers.js b/web/js/modules/location-search/reducers.js
index 33a39ed67..c0ecb530c 100644
--- a/web/js/modules/location-search/reducers.js
+++ b/web/js/modules/location-search/reducers.js
@@ -48,7 +48,8 @@ export function locationSearchReducer(state = locationSearchState, action) {
case REMOVE_MARKER:
return {
...state,
- coordinates: state.coordinates.filter((coordinate) => action.coordinates.id !== coordinate.id),
+ coordinates: state.coordinates
+ .filter((coordinate) => action.coordinates.id !== coordinate.id),
};
case SET_SUGGESTION:
return {
diff --git a/web/js/modules/location-search/util-api.js b/web/js/modules/location-search/util-api.js
index 334e77517..5cb066fb3 100644
--- a/web/js/modules/location-search/util-api.js
+++ b/web/js/modules/location-search/util-api.js
@@ -5,7 +5,8 @@ export const LOCATION_SEARCH_REQUEST_OPTIONS = {
redirect: 'follow',
},
// https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm
- // necessary to filter to remove fast food type suggestions, but still include relavant Places of Interest
+ // necessary to filter to remove fast food type suggestions, but still include relavant Places of
+ // Interest
GEOCODE_SUGGEST_CATEGORIES: [
'Address',
'Street Address',
diff --git a/web/js/modules/location-search/util.js b/web/js/modules/location-search/util.js
index c97c24fcd..759e9c749 100644
--- a/web/js/modules/location-search/util.js
+++ b/web/js/modules/location-search/util.js
@@ -76,7 +76,14 @@ const createPin = function(coordinates, pinProps, id, removeMarkerPin) {
* @param {Array} coordinates
* @param {Object} reverseGeocodeResults
*/
-export function getCoordinatesMarker(proj, coordinatesObject, results, removeMarker, isMobile, dialogVisible) {
+export function getCoordinatesMarker(
+ proj,
+ coordinatesObject,
+ results,
+ removeMarker,
+ isMobile,
+ dialogVisible,
+) {
const { crs } = proj.selected;
const { id, longitude, latitude } = coordinatesObject;
const coordinates = [longitude, latitude];
@@ -162,7 +169,8 @@ export function serializeCoordinatesWrapper(coordinates, state) {
const serializeCoordinatesArray = (coordinatesArray) => coordinatesArray
.map((coordinate) => serializeCoordinates(coordinate))
.filter((coordinate) => coordinate);
- const coordinatesURL = Array.isArray(coordinates) ? serializeCoordinatesArray(coordinates) : serializeCoordinates(coordinates);
+ const coordinatesURL = Array.isArray(coordinates)
+ ? serializeCoordinatesArray(coordinates) : serializeCoordinates(coordinates);
if (coordinatesURL.length > 0) {
return coordinatesURL.join('+');
}
@@ -180,4 +188,5 @@ export function setLocalStorageCollapseState(storageValue) {
* @param {Object} config
* @return {Boolean} is Location Search feature enabled
*/
-export const isLocationSearchFeatureEnabled = ({ features }) => !!(features.locationSearch && features.locationSearch.url);
+export const isLocationSearchFeatureEnabled = ({ features }) => !!(features.locationSearch
+ && features.locationSearch.url);
diff --git a/web/js/modules/map/util.js b/web/js/modules/map/util.js
index 5a8d81521..d55886cd7 100644
--- a/web/js/modules/map/util.js
+++ b/web/js/modules/map/util.js
@@ -152,8 +152,9 @@ let preloadMap;
* Adds the passed layer to a preloadMap, which is an invisible copy of our main OlMap
* The layer is then removed once it is fully loaded on the preloadMap
* This is done so because new version of OpenLayers (>= v10.2.x) no longer work properly with
- * displaying layers instantly on-screen during an animation with just pre-loading the tiles, and now
- * the layers themselves must have been rendered on an OlMap before animation to achieve the same results.
+ * displaying layers instantly on-screen during an animation with just pre-loading the tiles, and
+ * now the layers themselves must have been rendered on an OlMap before animation to achieve the
+ * same results.
*
* @method promiseTileLayer
* @param {object} layer _ol_layer_Tile_
@@ -203,7 +204,7 @@ function promiseTileLayer(layer, map) {
* a promise with an array of their fulfilled values is returned.
*
* @method promiseLayerGroup
- * @param {object} layer ol_Layer_Group object, contains values.layers for prev, current, next days
+ * @param {object} layer ol_Layer_Group object, contains values.layers for prev, current, next days
* @param {object} viewState Contains center, projection, resolution, rotation and zoom parameters
* @param {number} pixelRatio The window.devicePixelRatio, used to detect retina displays
* @param {object} map _ol_Map_ object
diff --git a/web/js/modules/palettes/actions.js b/web/js/modules/palettes/actions.js
index 4f68137da..48f06ab91 100644
--- a/web/js/modules/palettes/actions.js
+++ b/web/js/modules/palettes/actions.js
@@ -246,7 +246,12 @@ export function refreshPalettes(activePalettes) {
dispatch(setCustomPalette(key, colormap.custom, index, groupName));
}
if (colormap.max || colormap.min || colormap.squash) {
- dispatch(setThresholdRangeAndSquash(key, { squash: colormap.squash, min: colormap.min, max: colormap.max }, index, groupName));
+ dispatch(setThresholdRangeAndSquash(
+ key,
+ { squash: colormap.squash, min: colormap.min, max: colormap.max },
+ index,
+ groupName,
+ ));
}
if (colormap.disabled) {
dispatch(refreshDisabledClassification(key, colormap.disabled, index, groupName));
diff --git a/web/js/modules/palettes/util.js b/web/js/modules/palettes/util.js
index 16fdecf4d..bc1592c5a 100644
--- a/web/js/modules/palettes/util.js
+++ b/web/js/modules/palettes/util.js
@@ -104,7 +104,12 @@ export function drawSidebarPaletteOnCanvas(
ctx.fillStyle = util.hexToRGBA(color);
ctx.fillRect(Math.floor((binWidth * i) + 1), colorbarStartY, drawWidth, barHeight);
});
- ctx.rect(2 - thickness, colorbarStartY - thickness, width - 3 + (thickness * 2), barHeight + (thickness * 2));
+ ctx.rect(
+ 2 - thickness,
+ colorbarStartY - thickness,
+ width - 3 + (thickness * 2),
+ barHeight + (thickness * 2),
+ );
ctx.stroke();
}
}
@@ -137,7 +142,12 @@ export function drawTravelModePaletteOnCanvas(
ctx.fillStyle = util.hexToRGBA(color);
ctx.fillRect(Math.floor((binWidth * i) + 1), colorbarStartY, drawWidth, height);
});
- ctx.rect(2 - thickness, colorbarStartY - thickness, width - 3 + (thickness * 2), height + (thickness * 2));
+ ctx.rect(
+ 2 - thickness,
+ colorbarStartY - thickness,
+ width - 3 + (thickness * 2),
+ height + (thickness * 2),
+ );
ctx.stroke();
}
}
diff --git a/web/js/modules/product-picker/selectors.js b/web/js/modules/product-picker/selectors.js
index cb23e875d..67b5b8dd1 100644
--- a/web/js/modules/product-picker/selectors.js
+++ b/web/js/modules/product-picker/selectors.js
@@ -30,7 +30,10 @@ export const getLayersForProjection = createSelector(
}
return layer;
});
- return lodashSortBy(layersWithFacetProps, (layer) => lodashIndexOf(config.layerOrder, layer.id));
+ return lodashSortBy(
+ layersWithFacetProps,
+ (layer) => lodashIndexOf(config.layerOrder, layer.id),
+ );
},
);
diff --git a/web/js/modules/product-picker/util.js b/web/js/modules/product-picker/util.js
index cc70c99ce..0a554a86e 100644
--- a/web/js/modules/product-picker/util.js
+++ b/web/js/modules/product-picker/util.js
@@ -32,7 +32,8 @@ export function getRecentLayers(layerConfig, proj) {
const toLayerObj = ({ id }) => layerConfig[id];
const filterUnknownLayers = (layerDef) => layerDef !== undefined;
const layers = JSON.parse(safeLocalStorage.getItem(RECENT_LAYERS));
- return layers && layers[proj] ? layers[proj].sort(byUse).map(toLayerObj).filter(filterUnknownLayers) : [];
+ return layers && layers[proj]
+ ? layers[proj].sort(byUse).map(toLayerObj).filter(filterUnknownLayers) : [];
}
export function clearRecentLayers() {
diff --git a/web/js/modules/smart-handoff/actions.js b/web/js/modules/smart-handoff/actions.js
index 3c8b15e62..5db3706f0 100644
--- a/web/js/modules/smart-handoff/actions.js
+++ b/web/js/modules/smart-handoff/actions.js
@@ -74,7 +74,8 @@ export function validateLayersConceptIds (layers) {
));
validatedLayers = layers.reduce((prev, curr) => {
- const validIdsArray = (curr.conceptIds || []).filter(({ value }) => validatedConceptIds[value]);
+ const validIdsArray = (curr.conceptIds || [])
+ .filter(({ value }) => validatedConceptIds[value]);
if (validIdsArray.length) prev.push(curr);
return prev;
}, []);
diff --git a/web/js/modules/smart-handoff/selectors.js b/web/js/modules/smart-handoff/selectors.js
index 57f5758a1..493db2f25 100644
--- a/web/js/modules/smart-handoff/selectors.js
+++ b/web/js/modules/smart-handoff/selectors.js
@@ -53,8 +53,10 @@ export const getValidLayersForHandoffs = (state) => {
id, projections, disableSmartHandoff, conceptIds,
} = layer;
const isAvailable = memoizedAvailable(state)(id);
- const filteredConceptIds = (conceptIds || []).filter(({ type, value, version }) => type && value && version);
- return isAvailable && projections[proj.id] && !disableSmartHandoff && !!filteredConceptIds.length;
+ const filteredConceptIds = (conceptIds || [])
+ .filter(({ type, value, version }) => type && value && version);
+ return isAvailable && projections[proj.id]
+ && !disableSmartHandoff && !!filteredConceptIds.length;
};
return getActiveLayers(state).filter(filterForSmartHandoff);
};
diff --git a/web/js/modules/ui/actions.js b/web/js/modules/ui/actions.js
index 57719847e..38b737d6d 100644
--- a/web/js/modules/ui/actions.js
+++ b/web/js/modules/ui/actions.js
@@ -51,8 +51,9 @@ export function toggleStaticMap(isActive) {
};
}
-// When kiosk mode is active && (eic === 'sa' || eic === 'da') this action is dispatched once we step the date back to full imagery.
-// This signals that the animation availability to ready to be checked.
+// When kiosk mode is active && (eic === 'sa' || eic === 'da') this action is dispatched once we
+// step the date back to full imagery. This signals that the animation availability to ready to be
+// checked.
export function toggleReadyForKioskAnimation(toggleAnimation) {
return {
type: READY_FOR_KIOSK_ANIMATION,
@@ -60,9 +61,9 @@ export function toggleReadyForKioskAnimation(toggleAnimation) {
};
}
-// When kiosk mode is active && (eic === 'sa' || eic === 'da') this action is dispatched once the animation has been triggered.
-// Once availability is measured and passes the threshold metric this action will dispatch.
-// This signals that the animation is ready to be played.
+// When kiosk mode is active && (eic === 'sa' || eic === 'da') this action is dispatched once the
+// animation has been triggered. Once availability is measured and passes the threshold metric this
+// action will dispatch. This signals that the animation is ready to be played.
export function toggleCheckedAnimationAvailability(toggleCheck) {
return {
type: CHECK_ANIMATION_AVAILABILITY,
@@ -77,7 +78,8 @@ export function setEICMeasurementComplete() {
};
}
-// This action is dispatched when the EIC measurement process is aborted in TileMeasurement component
+// This action is dispatched when the EIC measurement process is aborted in TileMeasurement
+// component
export function setEICMeasurementAborted() {
return {
type: SET_EIC_MEASUREMENT_ABORTED,
@@ -92,7 +94,8 @@ export function setTravelMode(travelMode) {
};
}
-// Determines whether EIC mode should query backend (new EIC) or query data from the frontend (legacy)
+// Determines whether EIC mode should query backend (new EIC) or query data from
+// the frontend (legacy)
export function setEICLegacy(isLegacy) {
return {
type: SET_EIC_LEGACY,
diff --git a/web/js/modules/vector-styles/actions.js b/web/js/modules/vector-styles/actions.js
index a12d1a8ef..783df4c3b 100644
--- a/web/js/modules/vector-styles/actions.js
+++ b/web/js/modules/vector-styles/actions.js
@@ -47,7 +47,8 @@ export function setFilterRange(layerId, props, index, groupName) {
export function setStyle(layer, vectorStyleId, groupName) {
return (dispatch, getState) => {
const state = getState();
- const newActiveVectorStylesObj = setStyleFunction( // should probably place this inside map.ui as it is a rendering
+ // should probably place this inside map.ui as it is a rendering
+ const newActiveVectorStylesObj = setStyleFunction(
layer,
vectorStyleId,
state.vectorStyles.custom,
diff --git a/web/js/modules/vector-styles/selectors.js b/web/js/modules/vector-styles/selectors.js
index 915abcf4d..c67cf2994 100644
--- a/web/js/modules/vector-styles/selectors.js
+++ b/web/js/modules/vector-styles/selectors.js
@@ -156,7 +156,8 @@ const shouldRenderFeature = (feature, acceptableExtent) => {
* @param {Object} layer | OL layer object
* @param {Object} options | Layer options object
* @param {Object} state | The entire state of the application
- * @param {Boolean} styleSelection | Indicates if the request is triggered by user interaction with vector feature
+ * @param {Boolean} styleSelection | Indicates if the request is triggered by user interaction with
+ * vector feature
*/
export function setStyleFunction(opts) {
let { layer } = opts;
diff --git a/web/js/ol/lookupimagetile.js b/web/js/ol/lookupimagetile.js
index 9b2eace78..e7a3cd41a 100644
--- a/web/js/ol/lookupimagetile.js
+++ b/web/js/ol/lookupimagetile.js
@@ -122,7 +122,8 @@ LookupImageTile.prototype.load = async function () {
const rgbaStr = `${r},${g},${b},${a}`;
const drawThisColor = pixelsToDisplay[rgbaStr];
- // If the intended color exists in pixelsToDisplay obj, draw that color, otherwise transparent
+ // If the intended color exists in pixelsToDisplay obj, draw that color,
+ // otherwise transparent
if (drawThisColor !== undefined) {
outputData[outputIndex] = r;
outputData[outputIndex + 1] = g;
@@ -136,7 +137,8 @@ LookupImageTile.prototype.load = async function () {
}
}
} else {
- // For non-indexed PNG, copy pixel data to output, this will throw an error if the lengths differ
+ // For non-indexed PNG, copy pixel data to output, this will throw an error if the
+ // lengths differ
outputData.set(pixelData);
// Apply transparency based on color proximity
diff --git a/web/js/ol/util.js b/web/js/ol/util.js
index 0f95d59b2..21c7b1bfc 100644
--- a/web/js/ol/util.js
+++ b/web/js/ol/util.js
@@ -227,7 +227,11 @@ const parsePNG = async (buffer) => {
if (!ihdrChunk) throw new Error('Missing IHDR chunk');
// Parse IHDR data
- const ihdrView = new DataView(ihdrChunk.data.buffer, ihdrChunk.data.byteOffset, ihdrChunk.data.byteLength);
+ const ihdrView = new DataView(
+ ihdrChunk.data.buffer,
+ ihdrChunk.data.byteOffset,
+ ihdrChunk.data.byteLength,
+ );
const width = ihdrView.getUint32(0, false);
const height = ihdrView.getUint32(4, false);
const bitDepth = ihdrView.getUint8(8);
@@ -249,8 +253,17 @@ const parsePNG = async (buffer) => {
// Create indexed data if this is an indexed color PNG
let indexedData = null;
- // For true indexed PNGs, the pixel data is already indices. We'll need to extract it from the canvas data
- if (isIndexed && palette) indexedData = extractIndexedData(pixels, palette, width, height, alphaValues);
+ // For true indexed PNGs, the pixel data is already indices.
+ // We'll need to extract it from the canvas data
+ if (isIndexed && palette) {
+ indexedData = extractIndexedData(
+ pixels,
+ palette,
+ width,
+ height,
+ alphaValues,
+ );
+ }
const tabsObj = {
PLTE: palette,
diff --git a/web/js/util/util.js b/web/js/util/util.js
index ce82d4f4d..1b95ceb61 100644
--- a/web/js/util/util.js
+++ b/web/js/util/util.js
@@ -196,10 +196,12 @@ export default (function(self) {
};
/**
- * Uses canvas.measureText to compute and return the width of the given text of given font in pixels.
+ * Uses canvas.measureText to compute and return the width of the given text of given font in
+ * pixels.
*
* @param {String} text The text to be rendered.
- * @param {String} font The css font descriptor that text is to be rendered with (e.g. "bold 14px verdana").
+ * @param {String} font The css font descriptor that text is to be rendered with (e.g. "bold 14px
+ * verdana").
*
* @see https://stackoverflow.com/questions/118241/calculate-text-width-with-javascript/21015393#21015393
*/
@@ -651,7 +653,8 @@ export default (function(self) {
if (Math.abs(longitude) < 180) return longitude;
const isNegative = longitude < 0;
const remainder = longitude % 360;
- return isNegative && remainder < -180 ? remainder + 360 : !isNegative && remainder > 180 ? remainder - 360 : remainder;
+ return isNegative && remainder < -180
+ ? remainder + 360 : !isNegative && remainder > 180 ? remainder - 360 : remainder;
};
// Allows simple printf functionality with strings
diff --git a/web/js/workers/cmr.worker.js b/web/js/workers/cmr.worker.js
index 4e40544f4..c1cdf688b 100644
--- a/web/js/workers/cmr.worker.js
+++ b/web/js/workers/cmr.worker.js
@@ -24,13 +24,17 @@ function mergeSortedGranuleDateRanges(granules) {
const endTime = makeTime(end) + 60000;
const lastRangeEndTime = makeTime(acc.at(-1)[1]);
const lastRangeStartTime = makeTime(acc.at(-1)[0]);
- if ((startTime >= lastRangeStartTime && startTime <= lastRangeEndTime) && (endTime >= lastRangeStartTime && endTime <= lastRangeEndTime)) { // within current range, ignore
+ // within current range, ignore
+ if ((startTime >= lastRangeStartTime
+ && startTime <= lastRangeEndTime)
+ && (endTime >= lastRangeStartTime && endTime <= lastRangeEndTime)) {
return acc;
}
if (startTime > lastRangeEndTime) { // discontinuous, add new range
return [...acc, [start, end]];
}
- if (startTime <= lastRangeEndTime && endTime > lastRangeEndTime) { // intersects current range, merge
+ if (startTime <= lastRangeEndTime
+ && endTime > lastRangeEndTime) { // intersects current range, merge
return acc.with(-1, [acc.at(-1)[0], end]);
}
return acc;
@@ -100,8 +104,12 @@ async function getLayerGranuleRanges(layer) {
nonNRTGranules = await requestGranules(nonNRTParams);
}
const granules = [...nonNRTGranules, ...nrtGranules];
- const granuleDateRanges = granules.map(({ time_start: timeStart, time_end: timeEnd }) => [timeStart, timeEnd]);
- const mergedGranuleDateRanges = mergeSortedGranuleDateRanges(granuleDateRanges); // merge overlapping granule ranges to simplify rendering
+ const granuleDateRanges = granules.map(({
+ time_start: timeStart,
+ time_end: timeEnd,
+ }) => [timeStart, timeEnd]);
+ // merge overlapping granule ranges to simplify rendering
+ const mergedGranuleDateRanges = mergeSortedGranuleDateRanges(granuleDateRanges);
return mergedGranuleDateRanges;
}
diff --git a/web/js/workers/describe-domains.worker.js b/web/js/workers/describe-domains.worker.js
index 5a1d9df41..b96b9a704 100644
--- a/web/js/workers/describe-domains.worker.js
+++ b/web/js/workers/describe-domains.worker.js
@@ -98,7 +98,10 @@ function mergeDomains(domains, timeBuffer) {
endTime += periodToTime(period);
}
- if (!acc.length) return [[makeDateString(startTime), makeDateString(endTime)]]; // add the first range to the accumulator
+ if (!acc.length) {
+ return [[makeDateString(startTime),
+ makeDateString(endTime)]];
+ } // add the first range to the accumulator
// round start time down and end time up by a set time to account for small range gaps
const bufferedStartTime = startTime - timeBuffer;
@@ -107,7 +110,10 @@ function mergeDomains(domains, timeBuffer) {
const lastRangeEndTime = makeTime(acc.at(-1)[1]);
const lastRangeStartTime = makeTime(acc.at(-1)[0]);
- if ((bufferedStartTime >= lastRangeStartTime && bufferedStartTime <= lastRangeEndTime) && (bufferedEndTime >= lastRangeStartTime && bufferedEndTime <= lastRangeEndTime)) { // within current range, ignore
+ if ((bufferedStartTime >= lastRangeStartTime
+ && bufferedStartTime <= lastRangeEndTime)
+ && (bufferedEndTime >= lastRangeStartTime
+ && bufferedEndTime <= lastRangeEndTime)) { // within current range, ignore
return acc;
}
@@ -115,7 +121,8 @@ function mergeDomains(domains, timeBuffer) {
return [...acc, [makeDateString(startTime), makeDateString(endTime)]];
}
- if (bufferedStartTime <= lastRangeEndTime && bufferedEndTime > lastRangeEndTime) { // intersects current range, merge
+ if (bufferedStartTime <= lastRangeEndTime
+ && bufferedEndTime > lastRangeEndTime) { // intersects current range, merge
return acc.with(-1, [acc.at(-1)[0], makeDateString(endTime)]);
}