Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GHG -> main #679

Merged
merged 66 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from 62 commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
92f0574
Thorw errors if too many statistics are requested
hanbyul-here Sep 22, 2023
db3fd08
Merge branch 'main' of github.com:NASA-IMPACT/veda-ui into feature/li…
nerik Sep 25, 2023
441f059
Return the guessed number of items based on collection metadata
nerik Sep 25, 2023
42de6bc
Fixed types and variable names
nerik Sep 25, 2023
c0f6b72
Memoize datasets
nerik Sep 25, 2023
64a81aa
Check only day level equality
hanbyul-here Sep 25, 2023
f1e7171
Updated analysis flow wording
nerik Sep 26, 2023
9b24cd4
Added sticky footer
nerik Sep 26, 2023
35bd7fa
Prevent users from selecting datasets with too many data points
nerik Sep 26, 2023
2af6225
Fixed number of data points estimate when isPeriodic=false using time…
nerik Sep 26, 2023
0a4a000
Changed date presets
nerik Sep 26, 2023
a67f413
Replace reset icon
nerik Sep 26, 2023
fd884ee
Added north america preset
nerik Sep 26, 2023
30ec70b
Fix getNumberOfItem logic when dataset is not periodic, add unit test
hanbyul-here Sep 26, 2023
7f5c11f
Style for 1,2,3 step
hanbyul-here Sep 26, 2023
180447b
Use fold for footer items
hanbyul-here Sep 26, 2023
d27f634
Align date selection tools, lint
hanbyul-here Sep 27, 2023
ee5a107
Select 2018-2022 date range by default
nerik Sep 27, 2023
a40244d
Hardcode min and max dates to 1980-01-01 through 2022-12-31
nerik Sep 27, 2023
f9ae022
Initialize the map with North America AoI
nerik Sep 27, 2023
5c7a87d
Correct month
j08lue Sep 27, 2023
15a3227
Revert "Correct month"
nerik Sep 27, 2023
240017f
Revert "Initialize the map with North America AoI"
nerik Sep 27, 2023
9abac3b
Some design polish
nerik Sep 27, 2023
e85073e
Feature/analysis flow (#677)
nerik Sep 27, 2023
31a9865
Limit the datasets for analysis (#675)
nerik Sep 27, 2023
a500bc9
Fixed linter errors
nerik Sep 27, 2023
5886af7
Temporary fox of critical error encoutered during demos
amarouane-ABDELHAK Sep 27, 2023
e00951a
Remove logs in production
nerik Sep 27, 2023
54cf01e
Added disclaimer text on analysis results
nerik Sep 27, 2023
a41df01
Remove error log from production
hanbyul-here Sep 27, 2023
586e5ad
Use as 'a'
hanbyul-here Sep 27, 2023
51219d8
Fix lint
hanbyul-here Sep 27, 2023
df3367d
Temporary fix of critical error encoutered during demos (#680)
hanbyul-here Sep 27, 2023
de182bc
Revert "Proper redirect"
nerik Sep 28, 2023
4af5113
Revert "Redirect to overview when explore is not allowed"
nerik Sep 28, 2023
143f695
Reberts navlink back to use react router for testing
hanbyul-here Sep 28, 2023
8b6588e
Remove redirect logics
hanbyul-here Sep 28, 2023
d6b1ee6
Change link back to a tag
hanbyul-here Sep 28, 2023
e344607
Remove legacy redirect
hanbyul-here Sep 28, 2023
8cac5bd
Fixed linter
nerik Sep 28, 2023
45e6fce
Fixed linter
nerik Sep 28, 2023
aedbf51
Reverts routing related changes (#684)
nerik Sep 28, 2023
b13279b
Do not pass initial position at all if there is none
hanbyul-here Sep 28, 2023
afa6e8e
Revert a link to router link
hanbyul-here Oct 3, 2023
49d04c7
Revert a link to router link (#689)
hanbyul-here Oct 4, 2023
403b887
Remove shadow scroll
hanbyul-here Oct 4, 2023
c47ca57
Lint
hanbyul-here Oct 4, 2023
808bba8
Lint, Put max height for mapoption container
hanbyul-here Oct 4, 2023
bd95167
Add scrolly attribute to layer legend style
hanbyul-here Oct 5, 2023
0d567fa
Moving away from ShadowScroll because of this issue: https://github.c…
hanbyul-here Oct 5, 2023
1ab127e
Remove shadow scroll (#691)
hanbyul-here Oct 5, 2023
dbb3e22
Check only day level equality for selected date (#676)
hanbyul-here Oct 5, 2023
2d0a44d
Add styles to make panel scrollable
hanbyul-here Oct 5, 2023
53ed47d
Remove unneeded attribute
hanbyul-here Oct 5, 2023
f04141a
Do not pass initial position at all if there is none (#687)
hanbyul-here Oct 6, 2023
cf8a812
Fix typo
hanbyul-here Oct 6, 2023
e2c4b90
Add styles to make panel scrollable (#692)
hanbyul-here Oct 6, 2023
0971af0
Do not make scroll to appear when not needed
hanbyul-here Oct 6, 2023
b3a3a75
Style fix for panel body (#695)
hanbyul-here Oct 6, 2023
fa4a261
Remove unneeded attribute (#694)
hanbyul-here Oct 9, 2023
21c4186
Make buttons rounded
danielfdsilva Oct 10, 2023
7868db7
Add overscroll:none for dropdown and layer legend
hanbyul-here Oct 11, 2023
93fda36
Add scroll style
hanbyul-here Oct 11, 2023
63f6dc0
Remove scroll style for now
hanbyul-here Oct 11, 2023
1c6cee6
Lint
hanbyul-here Oct 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions app/scripts/components/analysis/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { FeatureCollection, Polygon } from 'geojson';
import { featureCollection } from '@turf/helpers';

export type RegionPreset = 'world' | 'north-america';

export const FeatureByRegionPreset: Record<
RegionPreset,
FeatureCollection<Polygon>
> = {
world: featureCollection([
{
type: 'Feature',
id: 'world',
properties: {},
geometry: {
coordinates: [
[
[-180, -89],
[180, -89],
[180, 89],
[-180, 89],
[-180, -89]
]
],
type: 'Polygon'
}
}
]),
'north-america': featureCollection([
{
type: 'Feature',
id: 'north-america',
properties: {},
geometry: {
coordinates: [
[
[-180, 0],
[-180, 89],
[-60, 89],
[-60, 0],
[-180, 0]
]
],
type: 'Polygon'
}
}
])
};

export const MAX_QUERY_NUM = 300;
28 changes: 19 additions & 9 deletions app/scripts/components/analysis/define/aoi-selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,19 @@ import {
import { Button, ButtonGroup } from '@devseed-ui/button';
import { Dropdown, DropMenu, DropTitle } from '@devseed-ui/dropdown';
import {
CollecticonArrowLoop,
CollecticonTrashBin,
CollecticonHandPan,
CollecticonMarker,
CollecticonPencil,
CollecticonUpload2
} from '@devseed-ui/collecticons';
import { FeatureByRegionPreset, RegionPreset } from './constants';
import { FeatureByRegionPreset, RegionPreset } from '../constants';
import AoIUploadModal from './aoi-upload-modal';
import { FoldWGuideLine, FoldTitleWOAccent } from '.';
import {
Fold,
FoldHeader,
FoldHeadline,
FoldHeadActions,
FoldTitle,
FoldBody
} from '$components/common/fold';
import MapboxMap, { MapboxMapRef } from '$components/common/mapbox';
Expand Down Expand Up @@ -120,24 +119,28 @@ export default function AoiSelector({
const [aoiModalRevealed, setAoIModalRevealed] = useState(false);

return (
<Fold>
<FoldWGuideLine number={1}>
<AoIUploadModal
setFeatureCollection={setFeatureCollection}
revealed={aoiModalRevealed}
onCloseClick={() => setAoIModalRevealed(false)}
/>
<FoldHeader>
<FoldHeadline>
<FoldTitle>Area</FoldTitle>
<FoldTitleWOAccent>Select area of interest</FoldTitleWOAccent>
<p>
Use the pencil tool to draw a shape on the map or upload your own
shapefile.
</p>
</FoldHeadline>
<AoiHeadActions>
<Toolbar>
<ToolbarIconButton
variation='primary-fill'
variation='danger-fill'
onClick={() => onAoiEvent('aoi.clear')}
disabled={!featureCollection?.features.length}
>
<CollecticonArrowLoop title='Clear map' meaningful />
<CollecticonTrashBin title='Clear map' meaningful />
</ToolbarIconButton>
<VerticalDivider variation='dark' />
<ButtonGroup variation='primary-fill'>
Expand Down Expand Up @@ -179,6 +182,13 @@ export default function AoiSelector({
World
</DropMenuItemButton>
</li>
<li>
<DropMenuItemButton
onClick={() => onRegionPresetClick('north-america')}
>
North America
</DropMenuItemButton>
</li>
</DropMenu>
</Dropdown>
</Toolbar>
Expand All @@ -194,6 +204,6 @@ export default function AoiSelector({
/>
</MapContainer>
</FoldBody>
</Fold>
</FoldWGuideLine>
);
}
29 changes: 0 additions & 29 deletions app/scripts/components/analysis/define/constants.ts

This file was deleted.

Loading