From f1e7171c64e8198772ee2c9848e4cb00f9ab7fb9 Mon Sep 17 00:00:00 2001
From: Erik Escoffier
Date: Tue, 26 Sep 2023 11:06:22 +0200
Subject: [PATCH 01/18] Updated analysis flow wording
---
.../components/analysis/define/aoi-selector.tsx | 6 +++++-
app/scripts/components/analysis/define/index.tsx | 14 +++++++++++---
app/scripts/components/common/fold.tsx | 4 +++-
3 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/app/scripts/components/analysis/define/aoi-selector.tsx b/app/scripts/components/analysis/define/aoi-selector.tsx
index ce7b05da7..3bbe5a8a3 100644
--- a/app/scripts/components/analysis/define/aoi-selector.tsx
+++ b/app/scripts/components/analysis/define/aoi-selector.tsx
@@ -128,7 +128,11 @@ export default function AoiSelector({
/>
- Area
+ Select area of interest
+
+ Use the pencil tool to draw a shape on the map or upload your own
+ shapefile.
+
diff --git a/app/scripts/components/analysis/define/index.tsx b/app/scripts/components/analysis/define/index.tsx
index 503613123..0864735eb 100644
--- a/app/scripts/components/analysis/define/index.tsx
+++ b/app/scripts/components/analysis/define/index.tsx
@@ -237,7 +237,7 @@ export default function Analysis() {
description='Generate timeseries data for your area of interest.'
/>
(
- Date
+ Pick a date period
+
+ Select start and end date of time series, or choose a pre-set date
+ range.
+
@@ -350,7 +354,11 @@ export default function Analysis() {
- Datasets
+ Select datasets
+
+ Select from available dataset layers for the area and date range
+ selected.
+
diff --git a/app/scripts/components/common/fold.tsx b/app/scripts/components/common/fold.tsx
index a00f7d393..7b412b1cf 100644
--- a/app/scripts/components/common/fold.tsx
+++ b/app/scripts/components/common/fold.tsx
@@ -49,7 +49,9 @@ export const FoldHeader = styled.div`
`;
export const FoldHeadline = styled.div`
- /* styled-component */
+ p {
+ margin: 1rem 0 0 0;
+ }
`;
export const FoldHeadActions = styled.div`
From 9b24cd4e350edb8a5ee9853d4d5657c8b45ae72f Mon Sep 17 00:00:00 2001
From: Erik Escoffier
Date: Tue, 26 Sep 2023 12:49:25 +0200
Subject: [PATCH 02/18] Added sticky footer
---
.../components/analysis/define/index.tsx | 366 ++++++++++--------
.../analysis/define/page-footer.actions.tsx | 132 +++++++
.../analysis/define/page-hero-actions.tsx | 130 -------
.../components/analysis/results/index.tsx | 1 +
.../analysis/saved-analysis-control.tsx | 10 +-
5 files changed, 340 insertions(+), 299 deletions(-)
create mode 100644 app/scripts/components/analysis/define/page-footer.actions.tsx
delete mode 100644 app/scripts/components/analysis/define/page-hero-actions.tsx
diff --git a/app/scripts/components/analysis/define/index.tsx b/app/scripts/components/analysis/define/index.tsx
index 0864735eb..01b32028d 100644
--- a/app/scripts/components/analysis/define/index.tsx
+++ b/app/scripts/components/analysis/define/index.tsx
@@ -49,6 +49,9 @@ import {
} from '$utils/date';
import DropMenuItemButton from '$styles/drop-menu-item-button';
import { MapboxMapRef } from '$components/common/mapbox';
+import PageFooterActions from './page-footer.actions';
+import SavedAnalysisControl from '../saved-analysis-control';
+import { ANALYSIS_PATH } from '$utils/routes';
const FormBlock = styled.div`
display: flex;
@@ -100,6 +103,23 @@ export const Note = styled.div`
}
`;
+const FloatingFooter = styled.div<{ isSticky: boolean }>`
+ position: sticky;
+ left: 0;
+ right: 0;
+ // trick to get the IntersectionObserver to fire
+ bottom: -1px;
+ padding: ${variableGlsp(0.5)};
+ background: ${themeVal('color.surface')};
+ z-index: 99;
+ margin-bottom: ${variableGlsp(1)};
+ ${(props) =>
+ props.isSticky &&
+ `
+ box-shadow: 0 0 10px 0 #0003;
+ `}
+`;
+
const findParentDataset = (layerId: string) => {
const parentDataset = Object.values(datasets).find((dataset) =>
(dataset as VedaDatum).data.layers.find(
@@ -206,7 +226,7 @@ export default function Analysis() {
// read/set state loop
}, [selectableDatasetLayers, setAnalysisParam]);
- const showTip = !readyToLoadDatasets || !datasetsLayers?.length;
+ const notReady = !readyToLoadDatasets || !datasetsLayers?.length;
const infoboxMessage = useMemo(() => {
if (
@@ -230,171 +250,189 @@ export default function Analysis() {
}
}, [readyToLoadDatasets, stacSearchStatus, selectableDatasetLayers.length]);
+ const footerRef = useRef(null);
+ const [isFooterSticky, setIsFooterSticky] = React.useState(false);
+ useEffect(() => {
+ if (!footerRef.current) return;
+ const observer = new IntersectionObserver(
+ ([e]) => {
+ setIsFooterSticky(e.intersectionRatio < 1);
+ },
+ { threshold: [1] }
+ );
+ observer.observe(footerRef.current);
+ return () => observer.disconnect();
+ }, []);
+
return (
-
-
- (
-
- )}
- />
-
-
-
-
-
-
- Pick a date period
-
- Select start and end date of time series, or choose a pre-set date
- range.
-
-
-
-
- Actions
- (
-
-
-
- )}
- >
- Select a date preset
-
-
- onDatePresetClick(e, 'yearToDate')}
- >
- This year
-
-
-
- onDatePresetClick(e, 'last30Days')}
- >
- Last 30 days
-
-
-
- onDatePresetClick(e, 'lastYear')}
- >
- Last year
-
-
-
- onDatePresetClick(e, 'last10Years')}
- >
- Last 10 years
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Select datasets
-
- Select from available dataset layers for the area and date range
- selected.
-
-
-
-
- {!infoboxMessage ? (
+ <>
+
+
+ (
+
+ )}
+ />
+
+
+
+
+
+
+ Pick a date period
+
+ Select start and end date of time series, or choose a pre-set
+ date range.
+
+
+
+
+ Actions
+ (
+
+
+
+ )}
+ >
+ Select a date preset
+
+
+ onDatePresetClick(e, 'yearToDate')}
+ >
+ This year
+
+
+
+ onDatePresetClick(e, 'last30Days')}
+ >
+ Last 30 days
+
+
+
+ onDatePresetClick(e, 'lastYear')}
+ >
+ Last year
+
+
+
+ onDatePresetClick(e, 'last10Years')}
+ >
+ Last 10 years
+
+
+
+
+
+
+
+
- ) : (
-
-
- {infoboxMessage}
-
- )}
-
-
-
+
+
+
+
+
+
+ Select datasets
+
+ Select from available dataset layers for the area and date range
+ selected.
+
+
+
+
+ {!infoboxMessage ? (
+
+ ) : (
+
+
+ {infoboxMessage}
+
+ )}
+
+
+
+
+
+
+ >
);
}
diff --git a/app/scripts/components/analysis/define/page-footer.actions.tsx b/app/scripts/components/analysis/define/page-footer.actions.tsx
new file mode 100644
index 000000000..3febcada6
--- /dev/null
+++ b/app/scripts/components/analysis/define/page-footer.actions.tsx
@@ -0,0 +1,132 @@
+import React, { useMemo } from 'react';
+import { Link } from 'react-router-dom';
+import { format } from 'date-fns';
+import { Button, ButtonProps } from '@devseed-ui/button';
+import { CollecticonTickSmall } from '@devseed-ui/collecticons';
+
+import { analysisParams2QueryString } from '../results/use-analysis-params';
+import useSavedSettings from '../use-saved-settings';
+
+import { composeVisuallyDisabled } from '$utils/utils';
+import { ANALYSIS_RESULTS_PATH } from '$utils/routes';
+import { DatasetLayer } from 'veda';
+import { FeatureCollection, Polygon } from 'geojson';
+import styled from 'styled-components';
+import { calcFeatCollArea } from '$components/common/aoi/utils';
+
+const SaveButton = composeVisuallyDisabled(Button);
+
+interface PageFooterActionsProps {
+ isNewAnalysis: boolean;
+ start?: Date;
+ end?: Date;
+ datasetsLayers?: DatasetLayer[];
+ aoi?: FeatureCollection | null;
+ disabled?: boolean;
+}
+
+const FooterActions = styled.div`
+ display: flex;
+ flex-flow: row nowrap;
+ align-items: center;
+ justify-content: space-between;
+ gap: 1rem;
+`;
+
+const FooterRight = styled.div`
+ display: flex;
+ flex-flow: row nowrap;
+ align-items: center;
+ gap: 1rem;
+`;
+
+const AnalysisDescription = styled.div`
+ font-size: 0.875rem;
+ opacity: 0.5;
+`
+
+export default function PageFooterActions({
+ // size,
+ isNewAnalysis,
+ start,
+ end,
+ datasetsLayers,
+ aoi,
+ disabled
+}: PageFooterActionsProps) {
+ const analysisParamsQs = useMemo(() => {
+ if (!start || !end || !datasetsLayers || !aoi) return '';
+ return analysisParams2QueryString({
+ start,
+ end,
+ datasetsLayers,
+ aoi
+ });
+ }, [start, end, datasetsLayers, aoi]);
+
+ const { onGenerateClick } = useSavedSettings({
+ analysisParamsQs,
+ params: {
+ start,
+ end,
+ datasets: datasetsLayers?.map((d) => d.name),
+ aoi: aoi ?? undefined
+ }
+ });
+
+ const analysisDescription = useMemo(() => {
+ if (!start || !end || !datasetsLayers || !aoi) return '';
+ const dataset =
+ datasetsLayers.length === 1
+ ? datasetsLayers[0].name
+ : `${datasetsLayers.length} datasets`;
+ const area = `over a ${calcFeatCollArea(aoi)} km² area`
+ const dates = `from ${format(start, 'MMM d, yyyy')} to ${format(end, 'MMM d, yyyy')}`
+ return [dataset, area, dates].join(' ');
+ }, [start, end, datasetsLayers, aoi]);
+
+ return (
+
+
+ {!isNewAnalysis && (
+
+ Cancel
+
+ )}
+
+
+ {analysisDescription}
+
+ {disabled ? (
+
+ Generate analysis
+
+ ) : (
+
+ Generate analysis
+
+ )}
+
+
+ );
+}
diff --git a/app/scripts/components/analysis/define/page-hero-actions.tsx b/app/scripts/components/analysis/define/page-hero-actions.tsx
deleted file mode 100644
index 225ad2aab..000000000
--- a/app/scripts/components/analysis/define/page-hero-actions.tsx
+++ /dev/null
@@ -1,130 +0,0 @@
-import React, { useMemo } from 'react';
-import { Link } from 'react-router-dom';
-import { sticky } from 'tippy.js';
-import { FeatureCollection, Polygon } from 'geojson';
-import { Button, ButtonProps } from '@devseed-ui/button';
-import {
- CollecticonTickSmall,
- CollecticonXmarkSmall
-} from '@devseed-ui/collecticons';
-import { VerticalDivider } from '@devseed-ui/toolbar';
-import { DatasetLayer } from 'veda';
-
-import { analysisParams2QueryString } from '../results/use-analysis-params';
-import useSavedSettings from '../use-saved-settings';
-import SavedAnalysisControl from '../saved-analysis-control';
-
-import { Tip } from '$components/common/tip';
-import { composeVisuallyDisabled } from '$utils/utils';
-import { useMediaQuery } from '$utils/use-media-query';
-import { ANALYSIS_PATH, ANALYSIS_RESULTS_PATH } from '$utils/routes';
-
-const SaveButton = composeVisuallyDisabled(Button);
-
-interface PageHeroActionsProps {
- size: ButtonProps['size'];
- isNewAnalysis: boolean;
- showTip: boolean;
- start?: Date;
- end?: Date;
- datasetsLayers?: DatasetLayer[];
- aoi?: FeatureCollection | null;
-}
-
-export default function PageHeroActions({
- size,
- isNewAnalysis,
- showTip,
- start,
- end,
- datasetsLayers,
- aoi
-}: PageHeroActionsProps) {
- const { isLargeUp } = useMediaQuery();
-
- const analysisParamsQs = useMemo(() => {
- if (!start || !end || !datasetsLayers || !aoi) return '';
- return analysisParams2QueryString({
- start,
- end,
- datasetsLayers,
- aoi
- });
- }, [start, end, datasetsLayers, aoi]);
-
- const { onGenerateClick } = useSavedSettings({
- analysisParamsQs,
- params: {
- start,
- end,
- datasets: datasetsLayers?.map((d) => d.name),
- aoi: aoi ?? undefined
- }
- });
-
- let tipContents;
-
- if (showTip) {
- tipContents = 'To get results, ';
- let instructions: string[] = [];
- if (!start || !end)
- instructions = [...instructions, 'pick start and end dates'];
- if (!aoi) instructions = [...instructions, 'define an area'];
- if (!datasetsLayers?.length)
- instructions = [...instructions, 'select datasets'];
-
- const instructionsString = instructions
- .join(', ')
- .replace(/,\s([^,]+)$/, ' and $1.');
-
- tipContents = [tipContents, instructionsString].join('');
- }
-
- return (
- <>
- {!isNewAnalysis && (
-
- Cancel
-
- )}
- {showTip ? (
-
-
- Generate
-
-
- ) : (
-
- Generate
-
- )}
-
-
-
-
- >
- );
-}
diff --git a/app/scripts/components/analysis/results/index.tsx b/app/scripts/components/analysis/results/index.tsx
index d99ad8477..264215d94 100644
--- a/app/scripts/components/analysis/results/index.tsx
+++ b/app/scripts/components/analysis/results/index.tsx
@@ -193,6 +193,7 @@ export default function AnalysisResults() {
forwardedAs={Link}
to={`${ANALYSIS_PATH}${analysisParamsQs}`}
size={size}
+ radius='square'
variation='achromic-outline'
>
Refine
diff --git a/app/scripts/components/analysis/saved-analysis-control.tsx b/app/scripts/components/analysis/saved-analysis-control.tsx
index 4a6463f23..635ecd275 100644
--- a/app/scripts/components/analysis/saved-analysis-control.tsx
+++ b/app/scripts/components/analysis/saved-analysis-control.tsx
@@ -4,10 +4,9 @@ import { FeatureCollection, Polygon } from 'geojson';
import styled, { useTheme } from 'styled-components';
import bbox from '@turf/bbox';
import { glsp, themeVal } from '@devseed-ui/theme-provider';
-import { ButtonProps } from '@devseed-ui/button';
+import { Button, ButtonProps } from '@devseed-ui/button';
import { CollecticonClockBack } from '@devseed-ui/collecticons';
-import { ToolbarIconButton } from '@devseed-ui/toolbar';
import {
Dropdown,
DropMenu,
@@ -91,14 +90,15 @@ export default function SavedAnalysisControl({
(
-
-
-
+ Past analyses
+
)}
>
Past analyses
From 35bd7fadd2714cfa34dff03eda75f0f912af7b43 Mon Sep 17 00:00:00 2001
From: Erik Escoffier
Date: Tue, 26 Sep 2023 14:35:15 +0200
Subject: [PATCH 03/18] Prevent users from selecting datasets with too many
data points
---
.../components/analysis/define/index.tsx | 140 ++++++++++++++----
.../define/use-stac-collection-search.ts | 26 +++-
2 files changed, 128 insertions(+), 38 deletions(-)
diff --git a/app/scripts/components/analysis/define/index.tsx b/app/scripts/components/analysis/define/index.tsx
index 01b32028d..7ceb7eb4e 100644
--- a/app/scripts/components/analysis/define/index.tsx
+++ b/app/scripts/components/analysis/define/index.tsx
@@ -17,14 +17,14 @@ import {
} from '@devseed-ui/form';
import {
CollecticonCircleInformation,
- CollecticonEllipsisVertical
+ CollecticonEllipsisVertical,
+ CollecticonSignDanger
} from '@devseed-ui/collecticons';
import { Overline } from '@devseed-ui/typography';
import { datasets, DatasetLayer, VedaDatum, DatasetData } from 'veda';
import { useAnalysisParams } from '../results/use-analysis-params';
import AoiSelector from './aoi-selector';
-import PageHeroActions from './page-hero-actions';
import { useStacCollectionSearch } from './use-stac-collection-search';
import { variableGlsp } from '$styles/variable-utils';
@@ -103,6 +103,38 @@ export const Note = styled.div`
}
`;
+const UnselectableInfo = styled.div`
+ font-size: 0.825rem;
+ font-weight: bold;
+ display: flex;
+ align-items: center;
+ gap: ${variableGlsp(0.5)};
+
+ & path {
+ fill: ${themeVal('color.danger')};
+ }
+`;
+
+const FormCheckableUnselectable = styled(FormCheckableCustom)`
+ pointer-events: none;
+ background: #f0f0f5;
+`;
+
+const DataPointsWarning = styled.div`
+ display: flex;
+ align-items: center;
+ background: ${themeVal('color.danger-100')};
+ border-radius: 99px;
+ font-size: 0.825rem;
+ font-weight: bold;
+ margin-top: ${variableGlsp(0.5)};
+ paddding: 4px;
+
+ & path {
+ fill: ${themeVal('color.danger')};
+ }
+`;
+
const FloatingFooter = styled.div<{ isSticky: boolean }>`
position: sticky;
left: 0;
@@ -203,12 +235,16 @@ export default function Analysis() {
[setAnalysisParam, datasetsLayers]
);
- const { selectableDatasetLayers, stacSearchStatus, readyToLoadDatasets } =
- useStacCollectionSearch({
- start,
- end,
- aoi: aoiDrawState.featureCollection
- });
+ const {
+ selectableDatasetLayers,
+ unselectableDatasetLayers,
+ stacSearchStatus,
+ readyToLoadDatasets
+ } = useStacCollectionSearch({
+ start,
+ end,
+ aoi: aoiDrawState.featureCollection
+ });
// Update datasetsLayers when stac search is refreshed in case some
// datasetsLayers are not available anymore
@@ -390,30 +426,70 @@ export default function Analysis() {
{!infoboxMessage ? (
-
+ <>
+
+ {unselectableDatasetLayers.length && (
+ <>
+
+
+ The current area and date selection has returned (
+ {unselectableDatasetLayers.length}) datasets with a very
+ large number of data points. To make them available,
+ please define a smaller area or a select a shorter date
+ period.
+
+
+
+ >
+ )}
+ >
) : (
diff --git a/app/scripts/components/analysis/define/use-stac-collection-search.ts b/app/scripts/components/analysis/define/use-stac-collection-search.ts
index 66bfd7d3c..4e09e090e 100644
--- a/app/scripts/components/analysis/define/use-stac-collection-search.ts
+++ b/app/scripts/components/analysis/define/use-stac-collection-search.ts
@@ -16,6 +16,7 @@ import { TimeseriesDataResult } from '../results/timeseries-data';
import { allAvailableDatasetsLayers } from '.';
import { utcString2userTzDate } from '$utils/date';
+import { MAX_QUERY_NUM } from '../constants';
interface UseStacSearchProps {
start?: Date;
@@ -24,7 +25,7 @@ interface UseStacSearchProps {
}
export type DatasetWithTimeseriesData = TimeseriesDataResult &
- DatasetLayer & { numberOfItems?: number };
+ DatasetLayer & { numberOfItems: number };
const DATE_INTERVAL_FN = {
day: eachDayOfInterval,
@@ -52,7 +53,7 @@ export function useStacCollectionSearch({
enabled: readyToLoadDatasets
});
- const selectableDatasetLayers = useMemo(() => {
+ const datasetLayersInRange = useMemo(() => {
try {
return getInTemporalAndSpatialExtent(result.data, aoi, {
start,
@@ -63,16 +64,29 @@ export function useStacCollectionSearch({
}
}, [result.data, aoi, start, end]);
- const selectableDatasetLayersWithNumberOfItems: DatasetWithTimeseriesData[] =
+ const datasetLayersInRangeWithNumberOfItems: DatasetWithTimeseriesData[] =
useMemo(() => {
- return selectableDatasetLayers.map((l) => {
+ return datasetLayersInRange.map((l) => {
const numberOfItems = getNumberOfItemsWithinTimeRange(start, end, l);
return { ...l, numberOfItems };
});
- }, [selectableDatasetLayers, start, end]);
+ }, [datasetLayersInRange, start, end]);
+
+ const selectableDatasetLayers = useMemo(() => {
+ return datasetLayersInRangeWithNumberOfItems.filter(
+ (l) => l.numberOfItems <= MAX_QUERY_NUM
+ );
+ }, [datasetLayersInRangeWithNumberOfItems]);
+
+ const unselectableDatasetLayers = useMemo(() => {
+ return datasetLayersInRangeWithNumberOfItems.filter(
+ (l) => l.numberOfItems > MAX_QUERY_NUM
+ );
+ }, [datasetLayersInRangeWithNumberOfItems]);
return {
- selectableDatasetLayers: selectableDatasetLayersWithNumberOfItems,
+ selectableDatasetLayers,
+ unselectableDatasetLayers,
stacSearchStatus: result.status,
readyToLoadDatasets
};
From 2af6225281bac5e034edfd48214c15c99a727947 Mon Sep 17 00:00:00 2001
From: Erik Escoffier
Date: Tue, 26 Sep 2023 14:53:01 +0200
Subject: [PATCH 04/18] Fixed number of data points estimate when
isPeriodic=false using timeseries
---
app/scripts/components/analysis/define/index.tsx | 2 +-
.../analysis/define/use-stac-collection-search.ts | 10 +++++++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/app/scripts/components/analysis/define/index.tsx b/app/scripts/components/analysis/define/index.tsx
index 7ceb7eb4e..5127317ed 100644
--- a/app/scripts/components/analysis/define/index.tsx
+++ b/app/scripts/components/analysis/define/index.tsx
@@ -451,7 +451,7 @@ export default function Analysis() {
))}
- {unselectableDatasetLayers.length && (
+ {!!unselectableDatasetLayers.length && (
<>
diff --git a/app/scripts/components/analysis/define/use-stac-collection-search.ts b/app/scripts/components/analysis/define/use-stac-collection-search.ts
index 4e09e090e..b3353bed9 100644
--- a/app/scripts/components/analysis/define/use-stac-collection-search.ts
+++ b/app/scripts/components/analysis/define/use-stac-collection-search.ts
@@ -99,7 +99,15 @@ export function useStacCollectionSearch({
function getNumberOfItemsWithinTimeRange(userStart, userEnd, collection) {
const { isPeriodic, timeDensity, domain, timeseries } = collection;
if (!isPeriodic) {
- return timeseries.length; // Check in with back-end team
+ const numberOfItems = timeseries.reduce((acc, t) => {
+ const date = new Date(t);
+ if (date >= userStart && date <= userEnd) {
+ return acc + 1;
+ } else {
+ return acc;
+ }
+ }, 0);
+ return numberOfItems; // Check in with back-end team
}
const eachOf = DATE_INTERVAL_FN[timeDensity];
const start =
From 0a4a000d4bcbdc0b037248ee65489a85a39ffc1e Mon Sep 17 00:00:00 2001
From: Erik Escoffier
Date: Tue, 26 Sep 2023 15:06:44 +0200
Subject: [PATCH 05/18] Changed date presets
---
.../components/analysis/define/index.tsx | 63 +++++--------------
app/scripts/utils/date.ts | 8 ++-
2 files changed, 21 insertions(+), 50 deletions(-)
diff --git a/app/scripts/components/analysis/define/index.tsx b/app/scripts/components/analysis/define/index.tsx
index 5127317ed..0b5a7c4a4 100644
--- a/app/scripts/components/analysis/define/index.tsx
+++ b/app/scripts/components/analysis/define/index.tsx
@@ -7,8 +7,7 @@ import React, {
} from 'react';
import styled from 'styled-components';
import { media, multiply, themeVal } from '@devseed-ui/theme-provider';
-import { Toolbar, ToolbarIconButton, ToolbarLabel } from '@devseed-ui/toolbar';
-import { Dropdown, DropMenu, DropTitle } from '@devseed-ui/dropdown';
+import { Toolbar, ToolbarLabel } from '@devseed-ui/toolbar';
import {
Form,
FormCheckable,
@@ -17,7 +16,6 @@ import {
} from '@devseed-ui/form';
import {
CollecticonCircleInformation,
- CollecticonEllipsisVertical,
CollecticonSignDanger
} from '@devseed-ui/collecticons';
import { Overline } from '@devseed-ui/typography';
@@ -52,6 +50,7 @@ import { MapboxMapRef } from '$components/common/mapbox';
import PageFooterActions from './page-footer.actions';
import SavedAnalysisControl from '../saved-analysis-control';
import { ANALYSIS_PATH } from '$utils/routes';
+import { Button, ButtonGroup } from '@devseed-ui/button';
const FormBlock = styled.div`
display: flex;
@@ -334,57 +333,25 @@ export default function Analysis() {
- Actions
- (
-
-
-
- )}
+ Presets
+
- Select a date preset
-
-
- onDatePresetClick(e, 'yearToDate')}
- >
- This year
-
-
-
- onDatePresetClick(e, 'last30Days')}
- >
- Last 30 days
-
-
-
- onDatePresetClick(e, 'lastYear')}
- >
- Last year
-
-
-
- onDatePresetClick(e, 'last10Years')}
- >
- Last 10 years
-
-
-
-
+ onDatePresetClick(e, 'last10Years')} >
+ Last 10 years
+
+ onDatePresetClick(e, '2018-2022')}>
+ 2018 - 2022
+
+
-
+
);
}
diff --git a/app/scripts/components/analysis/define/index.tsx b/app/scripts/components/analysis/define/index.tsx
index 0b5a7c4a4..3dd3bb8d7 100644
--- a/app/scripts/components/analysis/define/index.tsx
+++ b/app/scripts/components/analysis/define/index.tsx
@@ -21,9 +21,12 @@ import {
import { Overline } from '@devseed-ui/typography';
import { datasets, DatasetLayer, VedaDatum, DatasetData } from 'veda';
+import { Button, ButtonGroup } from '@devseed-ui/button';
import { useAnalysisParams } from '../results/use-analysis-params';
+import SavedAnalysisControl from '../saved-analysis-control';
import AoiSelector from './aoi-selector';
import { useStacCollectionSearch } from './use-stac-collection-search';
+import PageFooterActions from './page-footer.actions';
import { variableGlsp } from '$styles/variable-utils';
import { PageMainContent } from '$styles/page';
@@ -45,12 +48,9 @@ import {
getRangeFromPreset,
inputFormatToDate
} from '$utils/date';
-import DropMenuItemButton from '$styles/drop-menu-item-button';
+
import { MapboxMapRef } from '$components/common/mapbox';
-import PageFooterActions from './page-footer.actions';
-import SavedAnalysisControl from '../saved-analysis-control';
import { ANALYSIS_PATH } from '$utils/routes';
-import { Button, ButtonGroup } from '@devseed-ui/button';
const FormBlock = styled.div`
display: flex;
@@ -151,9 +151,54 @@ const FloatingFooter = styled.div<{ isSticky: boolean }>`
`}
`;
+const FoldWithBullet = styled(Fold)<{number: string}>`
+ ${media.largeUp`
+ padding-left: ${variableGlsp(1)};
+ > div {
+ padding-left: ${variableGlsp(2)};
+ position: relative;
+ // bullet
+ &::after {
+ position: absolute;
+ top: 0;
+ left: -20px;
+ width: 40px;
+ height: 40px;
+ background-color: #1565EF;
+ color: ${themeVal('color.surface')};
+ border-radius: ${themeVal('shape.ellipsoid')};
+ font-size: 1.75rem;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ font-weight: 600;
+ ${(props) => `content: "${props.number}";`}
+ }
+ }
+`}
+`;
+export const FoldWOBottomPadding = styled(FoldWithBullet)`
+ ${media.largeUp`
+ padding-bottom: 0;
+ > div {
+ border-left : 3px solid ${themeVal('color.base-200a')};
+ padding-bottom: ${variableGlsp(2)};
+ }
+ `}
+`;
+
+export const FoldTitleWOAccent = styled(FoldTitle)`
+ ${media.largeUp`
+ &::before {
+ content: none;
+ }
+ `}
+`;
+
+
const findParentDataset = (layerId: string) => {
const parentDataset = Object.values(datasets).find((dataset) =>
- (dataset as VedaDatum).data.layers.find(
+ (dataset!).data.layers.find(
(l) => l.id === layerId
)
);
@@ -163,7 +208,7 @@ const findParentDataset = (layerId: string) => {
export const allAvailableDatasetsLayers: DatasetLayer[] = Object.values(
datasets
)
- .map((dataset) => (dataset as VedaDatum).data.layers)
+ .map((dataset) => (dataset!).data.layers)
.flat()
.filter((d) => d.type !== 'vector' && !d.analysis?.exclude);
@@ -252,7 +297,7 @@ export default function Analysis() {
const selectableDatasetLayersIds = selectableDatasetLayers.map(
(layer) => layer.id
);
- const cleanedDatasetsLayers = datasetsLayers?.filter((l) =>
+ const cleanedDatasetsLayers = datasetsLayers.filter((l) =>
selectableDatasetLayersIds.includes(l.id)
);
@@ -307,13 +352,12 @@ export default function Analysis() {
description='Generate timeseries data for your area of interest.'
/>
(
)}
/>
-
-
+
- Pick a date period
+ Pick a date period
Select start and end date of time series, or choose a pre-set
date range.
@@ -338,7 +382,7 @@ export default function Analysis() {
variation='base-outline'
radius='square'
>
- onDatePresetClick(e, 'last10Years')} >
+ onDatePresetClick(e, 'last10Years')}>
Last 10 years
onDatePresetClick(e, '2018-2022')}>
@@ -379,12 +423,12 @@ export default function Analysis() {
-
+
-
+
- Select datasets
+ Select datasets
Select from available dataset layers for the area and date range
selected.
@@ -464,7 +508,7 @@ export default function Analysis() {
)}
-
+
Date: Tue, 26 Sep 2023 16:26:47 -0400
Subject: [PATCH 10/18] Use fold for footer items
---
.../components/analysis/define/index.tsx | 33 ++++++++++++-------
1 file changed, 21 insertions(+), 12 deletions(-)
diff --git a/app/scripts/components/analysis/define/index.tsx b/app/scripts/components/analysis/define/index.tsx
index 3dd3bb8d7..3e1e57fb9 100644
--- a/app/scripts/components/analysis/define/index.tsx
+++ b/app/scripts/components/analysis/define/index.tsx
@@ -160,10 +160,10 @@ const FoldWithBullet = styled(Fold)<{number: string}>`
// bullet
&::after {
position: absolute;
- top: 0;
- left: -20px;
- width: 40px;
- height: 40px;
+ top: ${variableGlsp(-0.25)};
+ left: ${variableGlsp(-1)};
+ width: ${variableGlsp(2)};
+ height: ${variableGlsp(2)};
background-color: #1565EF;
color: ${themeVal('color.surface')};
border-radius: ${themeVal('shape.ellipsoid')};
@@ -177,6 +177,7 @@ const FoldWithBullet = styled(Fold)<{number: string}>`
}
`}
`;
+
export const FoldWOBottomPadding = styled(FoldWithBullet)`
${media.largeUp`
padding-bottom: 0;
@@ -187,6 +188,10 @@ export const FoldWOBottomPadding = styled(FoldWithBullet)`
`}
`;
+const FoldWOPadding = styled(Fold)`
+ padding: 0;
+`;
+
export const FoldTitleWOAccent = styled(FoldTitle)`
${media.largeUp`
&::before {
@@ -511,14 +516,18 @@ export default function Analysis() {
-
+
+
+
+
+
>
);
From d27f63475e34c4287dc23cc8094774e545eee936 Mon Sep 17 00:00:00 2001
From: Hanbyul Jo
Date: Tue, 26 Sep 2023 21:08:42 -0400
Subject: [PATCH 11/18] Align date selection tools, lint
---
.../analysis/define/aoi-selector.tsx | 8 +--
.../components/analysis/define/index.tsx | 71 ++++++++++---------
.../analysis/define/page-footer.actions.tsx | 18 +++--
package.json | 2 +-
4 files changed, 54 insertions(+), 45 deletions(-)
diff --git a/app/scripts/components/analysis/define/aoi-selector.tsx b/app/scripts/components/analysis/define/aoi-selector.tsx
index a130f22ab..4ba1a3d87 100644
--- a/app/scripts/components/analysis/define/aoi-selector.tsx
+++ b/app/scripts/components/analysis/define/aoi-selector.tsx
@@ -27,13 +27,11 @@ import {
} from '@devseed-ui/collecticons';
import { FeatureByRegionPreset, RegionPreset } from '../constants';
import AoIUploadModal from './aoi-upload-modal';
-import {FoldWOBottomPadding, FoldTitleWOAccent} from '.';
+import { FoldWGuideLine, FoldTitleWOAccent } from '.';
import {
- Fold,
FoldHeader,
FoldHeadline,
FoldHeadActions,
- FoldTitle,
FoldBody
} from '$components/common/fold';
import MapboxMap, { MapboxMapRef } from '$components/common/mapbox';
@@ -121,7 +119,7 @@ export default function AoiSelector({
const [aoiModalRevealed, setAoIModalRevealed] = useState(false);
return (
-
+
-
+
);
}
diff --git a/app/scripts/components/analysis/define/index.tsx b/app/scripts/components/analysis/define/index.tsx
index 3e1e57fb9..65248ed7d 100644
--- a/app/scripts/components/analysis/define/index.tsx
+++ b/app/scripts/components/analysis/define/index.tsx
@@ -20,7 +20,7 @@ import {
} from '@devseed-ui/collecticons';
import { Overline } from '@devseed-ui/typography';
-import { datasets, DatasetLayer, VedaDatum, DatasetData } from 'veda';
+import { datasets, DatasetLayer } from 'veda';
import { Button, ButtonGroup } from '@devseed-ui/button';
import { useAnalysisParams } from '../results/use-analysis-params';
import SavedAnalysisControl from '../saved-analysis-control';
@@ -56,7 +56,6 @@ const FormBlock = styled.div`
display: flex;
flex-flow: row nowrap;
gap: ${variableGlsp(0.5)};
-
> * {
width: 50%;
}
@@ -151,7 +150,7 @@ const FloatingFooter = styled.div<{ isSticky: boolean }>`
`}
`;
-const FoldWithBullet = styled(Fold)<{number: string}>`
+const FoldWithBullet = styled(Fold)<{ number: string }>`
${media.largeUp`
padding-left: ${variableGlsp(1)};
> div {
@@ -178,7 +177,7 @@ const FoldWithBullet = styled(Fold)<{number: string}>`
`}
`;
-export const FoldWOBottomPadding = styled(FoldWithBullet)`
+export const FoldWGuideLine = styled(FoldWithBullet)`
${media.largeUp`
padding-bottom: 0;
> div {
@@ -200,12 +199,24 @@ export const FoldTitleWOAccent = styled(FoldTitle)`
`}
`;
+const FormGroupStructureCustom = styled(FormGroupStructure)`
+ ${media.largeUp`
+ display: inline-flex;
+ align-items: center;
+ `}
+`;
+
+const FoldBodyCustom = styled(FoldBody)`
+ ${media.largeUp`
+ flex-flow: row;
+ flex-grow: 3;
+ justify-content: space-between;
+ `}
+`;
const findParentDataset = (layerId: string) => {
const parentDataset = Object.values(datasets).find((dataset) =>
- (dataset!).data.layers.find(
- (l) => l.id === layerId
- )
+ dataset!.data.layers.find((l) => l.id === layerId)
);
return parentDataset?.data;
};
@@ -213,7 +224,7 @@ const findParentDataset = (layerId: string) => {
export const allAvailableDatasetsLayers: DatasetLayer[] = Object.values(
datasets
)
- .map((dataset) => (dataset!).data.layers)
+ .map((dataset) => dataset!.data.layers)
.flat()
.filter((d) => d.type !== 'vector' && !d.analysis?.exclude);
@@ -371,7 +382,7 @@ export default function Analysis() {
onAoiEvent={onAoiEvent}
/>
-
+
Pick a date period
@@ -380,27 +391,12 @@ export default function Analysis() {
date range.
-
-
- Presets
-
- onDatePresetClick(e, 'last10Years')}>
- Last 10 years
-
- onDatePresetClick(e, '2018-2022')}>
- 2018 - 2022
-
-
-
-
+
-
+
-
-
+
+ Presets
+
+ onDatePresetClick(e, 'last10Years')}>
+ Last 10 years
+
+ onDatePresetClick(e, '2018-2022')}>
+ 2018 - 2022
+
+
+
+
+
diff --git a/app/scripts/components/analysis/define/page-footer.actions.tsx b/app/scripts/components/analysis/define/page-footer.actions.tsx
index cb3f73ecc..fdaa862ad 100644
--- a/app/scripts/components/analysis/define/page-footer.actions.tsx
+++ b/app/scripts/components/analysis/define/page-footer.actions.tsx
@@ -4,14 +4,14 @@ import { format } from 'date-fns';
import { Button, ButtonProps } from '@devseed-ui/button';
import { CollecticonTickSmall } from '@devseed-ui/collecticons';
+import { DatasetLayer } from 'veda';
+import { FeatureCollection, Polygon } from 'geojson';
+import styled from 'styled-components';
import { analysisParams2QueryString } from '../results/use-analysis-params';
import useSavedSettings from '../use-saved-settings';
import { composeVisuallyDisabled } from '$utils/utils';
import { ANALYSIS_RESULTS_PATH } from '$utils/routes';
-import { DatasetLayer } from 'veda';
-import { FeatureCollection, Polygon } from 'geojson';
-import styled from 'styled-components';
import { calcFeatCollArea } from '$components/common/aoi/utils';
const SaveButton = composeVisuallyDisabled(Button);
@@ -43,7 +43,7 @@ const FooterRight = styled.div`
const AnalysisDescription = styled.div`
font-size: 0.875rem;
opacity: 0.5;
-`
+`;
export default function PageFooterActions({
// size,
@@ -75,13 +75,17 @@ export default function PageFooterActions({
});
const analysisDescription = useMemo(() => {
- if (!start || !end || !datasetsLayers || !aoi || !datasetsLayers.length) return '';
+ if (!start || !end || !datasetsLayers || !aoi || !datasetsLayers.length)
+ return '';
const dataset =
datasetsLayers.length === 1
? datasetsLayers[0].name
: `${datasetsLayers.length} datasets`;
- const area = `over a ${calcFeatCollArea(aoi)} km² area`
- const dates = `from ${format(start, 'MMM d, yyyy')} to ${format(end, 'MMM d, yyyy')}`
+ const area = `over a ${calcFeatCollArea(aoi)} km² area`;
+ const dates = `from ${format(start, 'MMM d, yyyy')} to ${format(
+ end,
+ 'MMM d, yyyy'
+ )}`;
return [dataset, area, dates].join(' ');
}, [start, end, datasetsLayers, aoi]);
diff --git a/package.json b/package.json
index 3006101ee..83f483556 100644
--- a/package.json
+++ b/package.json
@@ -121,9 +121,9 @@
"@turf/bbox-polygon": "^6.5.0",
"@turf/boolean-intersects": "^6.5.0",
"@turf/centroid": "^6.5.0",
+ "@turf/helpers": "^6.5.0",
"@turf/simplify": "^6.5.0",
"@turf/union": "^6.5.0",
- "@turf/helpers": "^6.5.0",
"@types/geojson": "^7946.0.10",
"@types/mdx": "^2.0.1",
"@types/react": "^18.2.12",
From ee5a107a0529d72d446a1fc4fd8ce238cbf87daf Mon Sep 17 00:00:00 2001
From: Erik Escoffier
Date: Wed, 27 Sep 2023 10:48:50 +0200
Subject: [PATCH 12/18] Select 2018-2022 date range by default
---
.../components/analysis/results/use-analysis-params.ts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/scripts/components/analysis/results/use-analysis-params.ts b/app/scripts/components/analysis/results/use-analysis-params.ts
index b377be0f8..4877578ab 100644
--- a/app/scripts/components/analysis/results/use-analysis-params.ts
+++ b/app/scripts/components/analysis/results/use-analysis-params.ts
@@ -25,8 +25,8 @@ type AnyAnalysisParamsKey = keyof AnalysisParams;
type AnyAnalysisParamsType = Date | DatasetLayer[] | FeatureCollection;
const initialState: AnalysisParamsNull = {
- start: undefined,
- end: undefined,
+ start: new Date(2018, 0, 1),
+ end: new Date(2022, 11, 31),
datasetsLayers: undefined,
aoi: undefined,
errors: null
From a40244d3276809b665f535209ea67fcdd39785a4 Mon Sep 17 00:00:00 2001
From: Erik Escoffier
Date: Wed, 27 Sep 2023 10:53:04 +0200
Subject: [PATCH 13/18] Hardcode min and max dates to 1980-01-01 through
2022-12-31
---
app/scripts/components/analysis/define/index.tsx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/scripts/components/analysis/define/index.tsx b/app/scripts/components/analysis/define/index.tsx
index 65248ed7d..3ec862248 100644
--- a/app/scripts/components/analysis/define/index.tsx
+++ b/app/scripts/components/analysis/define/index.tsx
@@ -404,7 +404,7 @@ export default function Analysis() {
name='start-date'
value={start ? dateToInputFormat(start) : ''}
onChange={onStartDateChange}
- min='1900-01-01'
+ min='1980-01-01'
max={dateToInputFormat(end)}
/>
@@ -418,7 +418,7 @@ export default function Analysis() {
value={end ? dateToInputFormat(end) : ''}
onChange={onEndDateChange}
min={dateToInputFormat(start)}
- max={new Date().toISOString().split('T')[0]}
+ max='2022-12-31'
/>
From f9ae022c4782c65f6341cd1e54e4fd2a3c8e0d65 Mon Sep 17 00:00:00 2001
From: Erik Escoffier
Date: Wed, 27 Sep 2023 11:05:57 +0200
Subject: [PATCH 14/18] Initialize the map with North America AoI
---
.../components/analysis/define/aoi-selector.tsx | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/app/scripts/components/analysis/define/aoi-selector.tsx b/app/scripts/components/analysis/define/aoi-selector.tsx
index 4ba1a3d87..6964dcde8 100644
--- a/app/scripts/components/analysis/define/aoi-selector.tsx
+++ b/app/scripts/components/analysis/define/aoi-selector.tsx
@@ -3,6 +3,7 @@ import React, {
useCallback,
useEffect,
useMemo,
+ useRef,
useState
} from 'react';
import styled from 'styled-components';
@@ -42,6 +43,7 @@ import {
import DropMenuItemButton from '$styles/drop-menu-item-button';
import { makeFeatureCollection } from '$components/common/aoi/utils';
import { variableGlsp } from '$styles/variable-utils';
+import { useEffectPrevious } from '$utils/use-effect-previous';
const MapContainer = styled.div`
position: relative;
@@ -75,6 +77,19 @@ export default function AoiSelector({
}: AoiSelectorProps) {
const { drawing, featureCollection } = aoiDrawState;
+ // TODO revise this. This is not a great hack aimed at initializing the AoI with North America when
+ // no qs AoI is set. Ideally this would be set in use-analysis-params initialState.
+ const timeOutRef = useRef | null>(null);
+ useEffect(() => {
+ if (!qsAoi) {
+ timeOutRef.current = setTimeout(() => {
+ setFeatureCollection(FeatureByRegionPreset['north-america']);
+ }, 100);
+ } else {
+ if (timeOutRef.current) clearTimeout(timeOutRef.current);
+ }
+ }, [qsAoi]);
+
// For the drawing tool, the features need an id.
const qsFc: FeatureCollection | null = useMemo(() => {
return qsAoi
@@ -173,7 +188,7 @@ export default function AoiSelector({
)}
>
- Select a region (BETA)
+ Select a region
Date: Wed, 27 Sep 2023 12:48:06 +0200
Subject: [PATCH 15/18] Correct month
---
app/scripts/components/analysis/results/use-analysis-params.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/scripts/components/analysis/results/use-analysis-params.ts b/app/scripts/components/analysis/results/use-analysis-params.ts
index 4877578ab..e8a47eb8c 100644
--- a/app/scripts/components/analysis/results/use-analysis-params.ts
+++ b/app/scripts/components/analysis/results/use-analysis-params.ts
@@ -26,7 +26,7 @@ type AnyAnalysisParamsType = Date | DatasetLayer[] | FeatureCollection;
const initialState: AnalysisParamsNull = {
start: new Date(2018, 0, 1),
- end: new Date(2022, 11, 31),
+ end: new Date(2022, 12, 31),
datasetsLayers: undefined,
aoi: undefined,
errors: null
From 15a32275c512e672c5fed5133f13109cb249e2e8 Mon Sep 17 00:00:00 2001
From: Erik Escoffier
Date: Wed, 27 Sep 2023 13:01:05 +0200
Subject: [PATCH 16/18] Revert "Correct month"
This reverts commit 5c7a87ddd15f2178c1c9dfcfd019429da26581d1.
---
app/scripts/components/analysis/results/use-analysis-params.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/scripts/components/analysis/results/use-analysis-params.ts b/app/scripts/components/analysis/results/use-analysis-params.ts
index e8a47eb8c..4877578ab 100644
--- a/app/scripts/components/analysis/results/use-analysis-params.ts
+++ b/app/scripts/components/analysis/results/use-analysis-params.ts
@@ -26,7 +26,7 @@ type AnyAnalysisParamsType = Date | DatasetLayer[] | FeatureCollection;
const initialState: AnalysisParamsNull = {
start: new Date(2018, 0, 1),
- end: new Date(2022, 12, 31),
+ end: new Date(2022, 11, 31),
datasetsLayers: undefined,
aoi: undefined,
errors: null
From 240017f39c2768d16d2750cef0b29f9dec2b8fa5 Mon Sep 17 00:00:00 2001
From: Erik Escoffier
Date: Wed, 27 Sep 2023 13:01:22 +0200
Subject: [PATCH 17/18] Revert "Initialize the map with North America AoI"
This reverts commit f9ae022c4782c65f6341cd1e54e4fd2a3c8e0d65.
---
.../components/analysis/define/aoi-selector.tsx | 17 +----------------
1 file changed, 1 insertion(+), 16 deletions(-)
diff --git a/app/scripts/components/analysis/define/aoi-selector.tsx b/app/scripts/components/analysis/define/aoi-selector.tsx
index 6964dcde8..4ba1a3d87 100644
--- a/app/scripts/components/analysis/define/aoi-selector.tsx
+++ b/app/scripts/components/analysis/define/aoi-selector.tsx
@@ -3,7 +3,6 @@ import React, {
useCallback,
useEffect,
useMemo,
- useRef,
useState
} from 'react';
import styled from 'styled-components';
@@ -43,7 +42,6 @@ import {
import DropMenuItemButton from '$styles/drop-menu-item-button';
import { makeFeatureCollection } from '$components/common/aoi/utils';
import { variableGlsp } from '$styles/variable-utils';
-import { useEffectPrevious } from '$utils/use-effect-previous';
const MapContainer = styled.div`
position: relative;
@@ -77,19 +75,6 @@ export default function AoiSelector({
}: AoiSelectorProps) {
const { drawing, featureCollection } = aoiDrawState;
- // TODO revise this. This is not a great hack aimed at initializing the AoI with North America when
- // no qs AoI is set. Ideally this would be set in use-analysis-params initialState.
- const timeOutRef = useRef | null>(null);
- useEffect(() => {
- if (!qsAoi) {
- timeOutRef.current = setTimeout(() => {
- setFeatureCollection(FeatureByRegionPreset['north-america']);
- }, 100);
- } else {
- if (timeOutRef.current) clearTimeout(timeOutRef.current);
- }
- }, [qsAoi]);
-
// For the drawing tool, the features need an id.
const qsFc: FeatureCollection | null = useMemo(() => {
return qsAoi
@@ -188,7 +173,7 @@ export default function AoiSelector({
)}
>
- Select a region
+ Select a region (BETA)
Date: Wed, 27 Sep 2023 13:38:14 +0200
Subject: [PATCH 18/18] Some design polish
---
.../components/analysis/define/index.tsx | 27 ++++++++++++-------
app/scripts/styles/theme.ts | 2 ++
2 files changed, 20 insertions(+), 9 deletions(-)
diff --git a/app/scripts/components/analysis/define/index.tsx b/app/scripts/components/analysis/define/index.tsx
index 3ec862248..1fd1a8104 100644
--- a/app/scripts/components/analysis/define/index.tsx
+++ b/app/scripts/components/analysis/define/index.tsx
@@ -115,18 +115,19 @@ const UnselectableInfo = styled.div`
const FormCheckableUnselectable = styled(FormCheckableCustom)`
pointer-events: none;
- background: #f0f0f5;
+ background: #F0F0F5;
`;
const DataPointsWarning = styled.div`
display: flex;
align-items: center;
- background: ${themeVal('color.danger-100')};
+ background: #FC3D2119;
border-radius: 99px;
font-size: 0.825rem;
font-weight: bold;
margin-top: ${variableGlsp(0.5)};
- paddding: 4px;
+ padding: 2px 0 2px 6px;
+ color: ${themeVal('color.danger')};
& path {
fill: ${themeVal('color.danger')};
@@ -159,10 +160,8 @@ const FoldWithBullet = styled(Fold)<{ number: string }>`
// bullet
&::after {
position: absolute;
- top: ${variableGlsp(-0.25)};
- left: ${variableGlsp(-1)};
- width: ${variableGlsp(2)};
- height: ${variableGlsp(2)};
+ width: ${variableGlsp(1.5)};
+ height: ${variableGlsp(1.5)};
background-color: #1565EF;
color: ${themeVal('color.surface')};
border-radius: ${themeVal('shape.ellipsoid')};
@@ -181,8 +180,14 @@ export const FoldWGuideLine = styled(FoldWithBullet)`
${media.largeUp`
padding-bottom: 0;
> div {
- border-left : 3px solid ${themeVal('color.base-200a')};
padding-bottom: ${variableGlsp(2)};
+ &::before {
+ position: absolute;
+ content: '';
+ height: 100%;
+ left: ${variableGlsp(0.7)};
+ border-left : 3px solid ${themeVal('color.base-200a')};
+ }
}
`}
`;
@@ -206,6 +211,10 @@ const FormGroupStructureCustom = styled(FormGroupStructure)`
`}
`;
+const ToolbarLabelWithSpace = styled(ToolbarLabel)`
+ margin-right: ${variableGlsp(0.5)};
+`;
+
const FoldBodyCustom = styled(FoldBody)`
${media.largeUp`
flex-flow: row;
@@ -424,7 +433,7 @@ export default function Analysis() {
- Presets
+ Presets
onDatePresetClick(e, 'last10Years')}>
Last 10 years
diff --git a/app/scripts/styles/theme.ts b/app/scripts/styles/theme.ts
index f5498e7a4..1bbadb824 100644
--- a/app/scripts/styles/theme.ts
+++ b/app/scripts/styles/theme.ts
@@ -21,6 +21,7 @@ export const VEDA_OVERRIDE_THEME = {
color: {
base: '#2c3e50',
primary: '#2276ac',
+ danger: '#FC3D21',
infographicA: '#fcab10',
infographicB: '#f4442e',
infographicC: '#b62b6e',
@@ -57,6 +58,7 @@ export const VEDA_OVERRIDE_THEME = {
};
export default function themeOverrides() {
+ console.log(defaultsDeep({}, theme, VEDA_OVERRIDE_THEME))
if (theme) {
return createUITheme(defaultsDeep({}, theme, VEDA_OVERRIDE_THEME));
} else {