Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

WV-3529 Charting Updates (#5759)

christof-wittreich0ebb36b626dd
diff --git a/e2e/features/charting/charting-test.spec.js b/e2e/features/charting/charting-test.spec.js
index 6448bbee1..8e23aee44 100644
--- a/e2e/features/charting/charting-test.spec.js
+++ b/e2e/features/charting/charting-test.spec.js
@@ -68,18 +68,6 @@ test('Entering & exiting Charting Mode works properly', async () => {
}
})
-test('Select an Area of Interest works appropriately', async () => {
- await page.goto(multipleDataLayers)
- const isChartingEnabled = await page.$('#chart-toggle-button')
- if (isChartingEnabled) {
- await page.locator('#chart-toggle-button').click()
- const aoiBtn = page.locator('#wv-charting-mode-container > div.charting-aoi-container > .edit-coordinates')
- await expect(aoiBtn).toHaveText('Entire Screen')
- await aoiBtn.click()
- await expect(aoiBtn).toHaveText('Area Selected')
- }
-})
-
test('Confirm defaults for time span selection', async () => {
const { chartingDateSingleButton, chartingDateRangeButton } = selectors
await page.goto(multipleDataLayers)
@@ -100,7 +88,7 @@ test('Date selector opens datepicker modal', async () => {
if (isChartingEnabled) {
await page.locator('#chart-toggle-button').click()
await page.locator('#charting-date-button').click()
- const chartingDateModal = page.locator('#charting_date_modal > div > div > div.modal-header > h5')
+ const chartingDateModal = page.locator('#charting-date-modal > div > div > div.modal-header > h5')
await expect(chartingDateModal).toHaveText('Charting Mode Date Selection')
}
})
@@ -111,11 +99,11 @@ test('Info modal opens on mode start & on icon click', async () => {
if (isChartingEnabled) {
await page.locator('#chart-toggle-button').click()
const infoModal = page.locator('#charting_info_modal > div > div > div.modal-header > h5')
- await expect(infoModal).toHaveText('Charting Tool')
+ await expect(infoModal).toHaveText('Charting Tool - BETA')
await page.locator('#charting_info_modal > div > div > div.modal-header > button').click()
await expect(infoModal).toHaveCount(0)
await page.locator('#charting-info-container svg').click()
- await expect(infoModal).toHaveText('Charting Tool')
+ await expect(infoModal).toHaveText('Charting Tool - BETA')
}
})
diff --git a/web/js/components/charting/chart-component.js b/web/js/components/charting/chart-component.js
index b4032b64f..064c450c0 100644
--- a/web/js/components/charting/chart-component.js
+++ b/web/js/components/charting/chart-component.js
@@ -249,11 +249,11 @@ function ChartComponent (props) {
</b>
has been reduced from
<b>
- {` ${numRangeDays} `}
+ {` ${numRangeDays} days`}
</b>
to
<b>
- {` ${STEP_NUM}`}
+ {` ${STEP_NUM} days`}
</b>
.
</i>
diff --git a/web/js/components/sidebar/charting-mode-options.js b/web/js/components/sidebar/charting-mode-options.js
index a1e4ed5da..f501024c2 100644
--- a/web/js/components/sidebar/charting-mode-options.js
+++ b/web/js/components/sidebar/charting-mode-options.js
@@ -698,8 +698,15 @@ const mapStateToProps = (state) => {
isOpen, id,
} = modal;
const projections = Object.keys(config.projections).map((key) => config.projections[key].crs);
- const timelineStartDate = date.selected < date.selectedB ? date.selected : date.selectedB;
- const timelineEndDate = date.selected < date.selectedB ? date.selectedB : date.selected;
+ const dateSelected = util.dateAdd(date.selected, 'day', 1);
+ const dateTenBefore = util.dateAdd(dateSelected, 'day', -10);
+ const dateTenAfter = util.dateAdd(dateSelected, 'day', 10);
+ const timelineStartDate = date.appNow < dateTenAfter
+ ? dateTenBefore
+ : dateSelected;
+ const timelineEndDate = date.appNow < dateTenAfter
+ ? dateSelected
+ : dateTenAfter;
const olMap = map.ui.selected;
const mapView = olMap?.getView();
const viewExtent = mapView?.calculateExtent(olMap.getSize());
diff --git a/web/js/containers/sidebar/footer-content.js b/web/js/containers/sidebar/footer-content.js
index 49c21df12..f283921d5 100644
--- a/web/js/containers/sidebar/footer-content.js
+++ b/web/js/containers/sidebar/footer-content.js
@@ -88,14 +88,26 @@ const FooterContent = React.forwardRef((props, ref) => {
<div className="product-buttons">
{!isMobile && !isCompareActive && chartFeature
&& (
- <Button
- id="chart-toggle-button"
- aria-label={chartBtnText}
- className={!isCompareActive && chartingModeAccessible ? 'chart-toggle-button btn' : 'chart-toggle-button btn disabled'}
- style={!chartFeature ? { display: 'none' } : null}
- onClick={!isCompareActive && chartingModeAccessible ? onClickToggleCharting : null}
- text={chartBtnText}
- />
+ <>
+ <Button
+ id="chart-toggle-button"
+ aria-label={chartBtnText}
+ className={!isCompareActive && chartingModeAccessible ? 'chart-toggle-button btn' : 'chart-toggle-button btn disabled'}
+ style={!chartFeature ? { display: 'none' } : null}
+ onClick={!isCompareActive && chartingModeAccessible ? onClickToggleCharting : null}
+ text={chartBtnText}
+ />
+ {!chartingModeAccessible
+ && (
+ <UncontrolledTooltip
+ id="center-align-tooltip"
+ placement="bottom"
+ target="chart-toggle-button"
+ >
+ Add a layer with a color palette to create a time series chart of a single variable
+ </UncontrolledTooltip>
+ )}
+ </>
)}
{!isChartingActive
&& (
@@ -193,7 +205,7 @@ const mapDispatchToProps = (dispatch) => ({
// This is the charting tool info window from the wireframes
dispatch(
openCustomContent('CHARTING_INFO_MODAL', {
- headerText: 'Charting Tool',
+ headerText: 'Charting Tool - BETA',
backdrop: false,
bodyComponent: ChartingInfo,
wrapClassName: 'clickable-behind-modal',
diff --git a/web/scss/features/sidebar.scss b/web/scss/features/sidebar.scss
index 9c49e0156..3009747a4 100644
--- a/web/scss/features/sidebar.scss
+++ b/web/scss/features/sidebar.scss
@@ -660,10 +660,13 @@ div#group-overlays-checkbox-case {
font-weight: bold;
}
+.charting-chart-container .charting-disclaimer {
+ padding: 18px;
+}
+
.charting-disclaimer {
line-height: 1.3em;
text-align: left;
- padding: 18px;
}
.charting-disclaimer-pre {