Skip to content

Commit

Permalink
Latest staging to production: Fixes and content updates (#2723)
Browse files Browse the repository at this point in the history
* chore: pass minesweeper options down

* chore: yeet origin coords, add size temporarily

* chore: few optimizations

* test: resolution

* changes to how raster data is fetched

* fix: adjust size and bbox

* fix: flip data vertically

* chore: use two lines for readability

* fix: board aspect ratio by taking hexagon geometry into account

* fix: transparency

* fix: set hexagon scaling correction to 120%

* feat: start building new minesweeper modals and their stats

* refactor: use new minesweeper modal component to reduce bloating of map component

* feat: enable setting flags on cells using right-click

* chore: add reveal-all method and fix linter errors

* chore: add game modes, modify text and run linter auto-fix

* feat: centralize board and rendering states in new `Minesweeper` class for consistency

* chore: update to new minesweeper class, add reveal button and fix linter errors

* feat: implement simple game flow event handlers

* feat: push current half-working state

* chore: disable minesweeper query parameter

* fix: remove second query param check

* fix: broken game over modal and remove v-model prop warning

* feat: add mine counter

* fix: make sure modal actually shows

* feat: implement working stats for gameover state

* feat: add win mode and pass in elapsed seconds as a prop

* feat: add game flow methods

* feat: complete game flow event handling, implement timer

* fix: re-add lost revealAllTiles method and remove console bloat

* fix: update winning text

* fix: linter errors and remove duplicate reveal function

* fix: include flags in completion indicator

* fix: mine flags

* feat: enable copying stats if the user has won the game

* chore: integrate IND2 as cog rendering

* feat: also provide stats copy-button when the game is lost

* chore: various changes and lint

* feat: work with multiple locations, for now static

* fix: game size better computed now

* fix: manually compute window because bbox is buggy

* feat: various fixes
- fix game flow when flagging
- setup teardown and layer cleanup
- remove dependency on ol-games
- zoom to selected location
- setup cog extent to location only
- cleanup unused methods

* feat: adding Locations change functionality

* chore: update package-lock

* fix: refactor event handling on map click
so they are actually removable due to usage of bind

* feat: integrate osmtogeojson

* chore: visualize HOPI

* fix: update power inframap sprite url

* fix: filters for indicator 1

* chore: dissolve layers ind1 and ind4 as overlays

* feat: implement CustomAlert on timeout 15s

* chore: redo legendUrl and update LayerControl

* fix: previous commit

* fix: minor bugfix

* feat: implement various enhancements for I4

* fix: display features.legendUrl for I4

* chore: refactor overpass api fetch

* chore: minor updates

* feat: implement custom features parameters

* fix: dissolved wildlife layer nodata transparent

client-side fix for areas where all bands ==0

* chore: create configs for auxiliary data for ideas_i4 (#2496)

* chore: create configs for auxiliary data

* chore: add GHS built up area 2020

* add two other builtup area layers

* chore: add two osm tags and update color mapping

* chore: add 'content' tag to OSM allowed props

* chore: add legend to GHSPopulation

* feat: implement world bounds from which smaller bboxes can be chosen randomly

* feat: implement randomization algorithm

* chore: update formatting of worldBounds

* feat: add a prng so that we can have repeatable bbox generations

* doc: update jsdoc of `cyrb128` function

* chore: add config for indicator3
currently without overpass api integration
because the resulting vectorlayer configured via .features for some reason does not work with Geotiff layer together

* fix: a lot of linter errors

* chore: features config working together with cog source

* chore: remove worldBounds and add configurable horizontal extents for each minesweep location

* feat: use new randomizer to set the bounding box

* fix: linter error by actually exporting new randomizer fn

* update of IND1_1

* Update IND2_1

* add IND3_1

* feat: pass randomly generated bounding box into minesweeper code

* fix: shrink all of the horizontal extents so they fit into the defined world boxes

* chore: update ideas i3 aux data

* feat: use the new crop bbox also as a constraint for the hex board itself

* feat: integrate new ind1 data

* feat: add data for wildlife plant and animal species

* chore: rename species index

* feat: show discovered species in dialog and copy text

* feat: add logic to extrapolate present species for a given minesweeper bbox

* chore: only display common name if it is not unknown, put in parens if there

* fix: linting

* fix: shorten lines

* chore: make species list reusable

* chore: make species list completely modular

* chore: revert to pevious `winMinesweep` method since the species code now runs in dedicated component

* fix: enable drawing buttons for `IND2_1`

* feat: add species enumeration for selected areas

* fix: comparison of webgl layers
according to Viglino/ol-ext#1054

* chore: move index json to bucket

* chore: update  config to use EU-wide dataset

* fix: comparison of webgl layer works now

* chore: minor fix

* chore: lint

* feat: aggregrate species with same index to prevent multiples and display a count

* chore: fix linter errors

* feat: enable species extraction also for lost games both in-dialog and in text

* refactor: remove old confusing minesweeper variable

* fix: move discovered species into DataPanel so they are visible without scrolling

* style: reduce spacing between species items

* feat: expose covered mine count as a getter and display remaining mines in minesweeper options

* Update IND3_1.md

* chore: add mine and flag counts, improve counting mechanism

* fix: implement counter properly so that it does not allow cheating

* chore: add `@turf/turf` and `@turf/intersect` dependencies for intersection detection

* chore: update dependencies

* chore: update package lock

* feat: define method for detecting intersections between europe geojson and sweeper bbox

* chore: regenerate seed and bounding box iteratively if no intersections are found

* chore: add geojson with countries that belong to wildlife dataset

* fix: linter errors

* chore: remove console logs

* chore: slightly refactor specieslist
adding watcher or prop to refresh on new area drawn

* fix: relative path for testing deployments

* chore: adjust the welcome message to give intro to game

* feat: configure new HULK endpoint

* chore: hide species info box in sidebar if minesweeper is configured

* chore: hide "reveal all" button behind debug flag as a query parameter

* chore: remove location dropdown for now

* chore: move "copy to clipboard" button to bottom of dialog

* chore: sort species by descending count and limit to 5 results

* fix: copy-to-clipboard species by moving species sorting into minesweeper dialog for consistency

* wip: change mine icon to a flower emoji and get started with revealing board when mine is clicked

* style: implement requested field colors

* feat: update minesweeper to use corine and esa landcover layers
remove original wildlife
lint

* chore: minor update of intro text

* chore: minor brush up on the initial popup in minesweeper
add opacity for layers

* fix: NaN poisoning and simplify color interpolation; reveal board when mine is clicked

* feat: enable easy restarting with a new-game button

* fix: change "new game" to "restart game" and make sure it always renders when appropriate

* fix: linter errors

* chore: zoom to location bbox

* update style

* fix: update ind4 image and show selected value in wmsVariables dropdown

* fix: broken NaN checker

* feat: integrate species images

* style: transform species name to uppercase

* feat: add new area statistics component

* chore: replace species index with S3 version

* fix: add missing s3 link

* minor update of text

* chore: add mock scenarios

* chore: adapt indicator 4

* fix: chart rendering

* feat: add question mark placeholders

* fix: switch descriptions of confidence and storm_surge

* update species index file

* chore: push latest state with styles

* fix: and simplify aggregation, add loading indicator

* fix: preselection

* feat: implement user hint

* fix: use narrower design on smaller screens

* feat: rework layout on smaller screens; adjust to new variable names from ideas_i4

* chore: fix linter errors

* chore: remove temp files

* chore: remove comment

* Update IND1_1.md

* feat: integrate minesweeper for ind2

* fix: unify bbox for minesweeps

* update version

* fix: minesweeper options reset instead of selectedLocationIndex

* fix: OSM features shown again
defaults seen in WMS options
minesweeper for houhpi filter 0s
note: never touch this code again

* chore: remove blue boxes in legend

* feat: rework state display, integrate promise handling

* fix: finally get aggregation working again; properly use pre-set variables

* fix: push working chart rendering with aggregation (almost done)

* feat: almost finalizing integration of statistics charts for indicator 4

* feat: implement species conservation status for minesweeper stats

* chore: add hint label

* chore: lint

* feat: change baselayer for HOUHPI  minesweeper to days exceeding who threshold

* fix: enableCustomAreaStatistics

* fix: reordering logic and map export state for custom area data (#2656)

* fix: adding ids to layers to make sure reordering in layercontrol works

* chore: linting

* fix: wrong layer order exported for analysis layers

* Adaptations of ideas deployment (#2659)

* fix: adaptations of ideas deployment
ref #2650

* update image icons for game indicators

* fix: double format caps/lowercase

* Merging of new vector filter capabilities (#2663)

* feat: added possibility to pass flat style style

* chore: added initial vector layer for sawmill data

* feat: implemented initial idea for vector tile feature filtering

* chore: cleanup of component, added category info to filter definition

* fix: made sure colormap is loaded in correct layer for forest disturbance

* chore: added truck supported roads network as layer to fcm2, added sawmill capabilities also to fcm3

* chore: removed adress from tooltip

* Stories july (#2653)

4 new stories added

* first set of updates for ideas indicators

* fix: several ideas fixes

* chore: bump package versions

intentionally not bumping stacinfo to 0.4.0 because even when adhering to breaking changes, it does not show here

* feat: add automatic opening of analysis panel

* merge staging into ideas_i4

* fix: cleanupand merge conflict resolution

* fix: multiple fixes

* fix: styling and display fixes after merge

* feat: remote GTIF brand check from DataPanel
!potentially regression causing change

* fix: minor config fixes

* fix: review ideas merge into staging

* fix: syntax

* chore: lint

* fix: styling issues, separate into catalogs

* fix: regression

* Update eodashMarkdown_EXTREME_SST.md

* fix: href links to images, remove ?catalog queru from dashboard link

* Update eodashMarkdown_EXTREME__TEMPERATURES_2.md (#2675)

* Update eodashMarkdown_EXTREME__TEMPERATURES_2.md

* Update stories.json

* update wind layer to a global one

* update storytelling to 1.1.0

* fix: override SLSTR1 dateformat function

* feat: add ideas 5 indicator

* fix: legend

* fix: format for SLSTR1

* chore: minor update of step for ind5

* fix: WSF

* Final story review (#2679)

* Update eodashMarkdown_EXTREME_SST.md

* Update eodashMarkdown_EXTREME_SST.md

added link between Ocean content and Marine Heat wave

* Update eodashMarkdown_EXTREME_SST.md

link between ocean content and marine heat waves

* Update eodashMarkdown_EXTREME_SST.md

* Add files via upload

* Update eodashMarkdown_EXTREME__TEMPERATURES_2.md

Change name of the story

* Update eodashMarkdown_EXTREME_SST.md

* Update eodashMarkdown_EXTREME_POLLUTION_2.md

* Update eodashMarkdown_HUNGA_ERUPTION_2.md

* Update eodashMarkdown_EXTREME__TEMPERATURES_2.md

* Update about.md

* Update about.md

* Update about.md

* chore: update s3 date in story

---------

Co-authored-by: Anca Anghelea <[email protected]>
Co-authored-by: santilland <[email protected]>

* chore: fixed map config issues in story

* Update stories.json (#2686)

updated titles to official stories on main page

* chore: updated game dialog text (#2705)

* Update eodashMarkdown_HUNGA_ERUPTION_2.md (#2702)

* Update eodashMarkdown_HUNGA_ERUPTION_2.md

* Update eodashMarkdown_EXTREME_POLLUTION_2.md

updates based on review of authors

* Update eodashMarkdown_EXTREME_POLLUTION_2.md

* Update eodashMarkdown_EXTREME_POLLUTION_2.md

* Update stories.json

Correct name of author of Extreme Pollution story

* Update eodashMarkdown_EXTREME_POLLUTION_2.md

More updates to the story - inclusion of an animation requested by the authors.

* Update eodashMarkdown_HUNGA_ERUPTION_2.md

Updated with ALOS-PALSAR2 images where you can actually see the disappearance of the the island - as requested by the authros.

* Update eodashMarkdown_EXTREME_POLLUTION_2.md

Add video animation as requested by the authors.

* Update eodashMarkdown_EXTREME_POLLUTION_2.md

Removing placeholder map

* Update eodashMarkdown_EXTREME_POLLUTION_2.md (#2718)

* Update eodashMarkdown_EXTREME_POLLUTION_2.md

correct links to winds and CO animations

* Update eodashMarkdown_EXTREME_POLLUTION_2.md

using raw links to datasets

---------

Co-authored-by: Daniel Santillan <[email protected]>

* Feat: Implementation of COG source change and minor style fix (#2721)

* feat: implemented change of cog source based on time information

* fix: spinner style

* fix: made sure only create map export string if dialog is open, should help with performance; fix: made sure style is exported correctly (#2722)

---------

Co-authored-by: Moritz Riede <[email protected]>
Co-authored-by: Lubomir Dolezal <[email protected]>
Co-authored-by: Lubomír Doležal <[email protected]>
Co-authored-by: UndeadFairy <[email protected]>
Co-authored-by: Moritz Riede <[email protected]>
Co-authored-by: Anca Anghelea <[email protected]>
Co-authored-by: AparicioSF <[email protected]>
  • Loading branch information
8 people authored Dec 20, 2024
1 parent 7600b4f commit 22467c5
Show file tree
Hide file tree
Showing 7 changed files with 170 additions and 92 deletions.
156 changes: 91 additions & 65 deletions app/public/data/storytelling-md/eodashMarkdown_EXTREME_POLLUTION_2.md

Large diffs are not rendered by default.

50 changes: 27 additions & 23 deletions app/public/data/storytelling-md/eodashMarkdown_HUNGA_ERUPTION_2.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions app/src/components/Modal/MinesweeperDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
</v-card-title>
<v-card-text>
<p>
Welcome to the Minesweeper game mode! For more information look at the Description in the Information panel!
</p>
<p>
<b>Quick overview:</b><br/>
Identify and flag <b>(right-click)</b> areas with very high
<b><span v-if="indicatorObject.indicator === 'IND1_1_minesweeper'">
health risks
Expand Down
4 changes: 2 additions & 2 deletions app/src/components/OLExportButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<div>
Copy and paste this code into the map <b>layers</b> field of the storytelling editor:
</div>
<div
<div v-if="dialog"
class="pa-3"
style="background-color: #ddd;font-family: monospace;font-size: 11px;max-height: 300px; overflow-y: auto;">
{{ layersConfig }}
Expand Down Expand Up @@ -283,7 +283,7 @@ Text describing the current step of the tour and why it is interesting what the
if (foundType === 'Vector') {
// We can't export a function style function
// only flat styles, for now we ignore this case
if (typeof l.getStyle !== 'function') {
if (typeof l.getStyle() !== 'function') {
layerConfig.style = l.getStyle();
}
}
Expand Down
37 changes: 37 additions & 0 deletions app/src/components/map/MapOverlay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,43 @@ export default {
border-bottom: 0;
margin-left: -10px;
margin-bottom: -10px;
}
.loading-indicator {
top: unset;
bottom: 0.5em !important;
left: 0.5em !important;
height: 22px;
pointer-events: none !important;
}
.loading-indicator.hidden {
display: none;
}
@keyframes spinner {
to {
transform: rotate(360deg);
}
}
.spinner:after {
content: "";
box-sizing: border-box;
position: absolute;
top: 50%;
left: 50%;
width: 18px;
height: 18px;
margin-top: -9px;
margin-left: -9px;
border-radius: 50%;
border: 5px solid rgba(180, 180, 180, 0.6);
border-top-color: rgba(0, 0, 0, 0.6);
animation: spinner 0.6s linear infinite;
}
.theme--dark .spinner:after {
border: 5px solid rgba(180, 180, 180, 0.6);
border-top-color: rgba(255, 255, 255, 0.6);
}`;
if ('mapContainer' in this.$parent.$refs && this.$parent.$refs.mapContainer.shadowRoot) {
this.$parent.$refs.mapContainer.shadowRoot.appendChild(style);
Expand Down
9 changes: 8 additions & 1 deletion app/src/components/map/timeLayerUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import GeoTIFF from 'ol/source/GeoTIFF';

// eslint-disable-next-line import/prefer-default-export
export function updateTimeLayer(layer, config, time, drawnArea, sourceGet = 'updateTime') {
if (config.protocol === 'cog' && !config.features) {
if (config.protocol === 'cog' && 'sources' in config && !config.features) {
const updatedSources = config.sources.map((item) => {
const url = item.url.replace(/{time}/i, config.dateFormatFunction(time));
return { url };
Expand All @@ -21,6 +21,13 @@ export function updateTimeLayer(layer, config, time, drawnArea, sourceGet = 'upd
normalize: config.normalize ? config.normalize : false,
interpolate: false,
}));
} else if (Array.isArray(time)) {
// This case if for geotiff assets passed in the time
layer.setSource(new GeoTIFF({
sources: time[1].map((url) => ({ url })),
normalize: config.normalize ? config.normalize : false,
interpolate: false,
}));
} else {
const source = layer.getSource();
const updateTimeFunction = source.get(sourceGet);
Expand Down
2 changes: 1 addition & 1 deletion app/src/config/stories.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
"air-pollution-extremes": {
"storyMarkdown": "./data/storytelling-md/eodashMarkdown_EXTREME_POLLUTION_2.md",
"title": "Extreme air pollution episodes in Northern India and Pakistan",
"subtitle": "Authors: Selviga Sinnathamby, Natacha Kaminski, Ellie Zoghbi - Sorbonne Universite, Paris, France",
"subtitle": "Authors: Selviga Sinnathamby, Natacha Kaminski, Elie Zoghbi - Sorbonne Universite, Paris, France",
"image": "https://raw.githubusercontent.com/eurodatacube/eodash-assets/main/stories/ScienceHub-Challenge-February-2024/AirPollutionIndia/cover-pakistan.jpg",
"imagePlaceholder": "https://raw.githubusercontent.com/eurodatacube/eodash-assets/main/stories/ScienceHub-Challenge-February-2024/AirPollutionIndia/cover-pakistan-small.jpg",
"logoAlternative": "https://raw.githubusercontent.com/eurodatacube/eodash-assets/main/stories/ScienceHub-Challenge-February-2024/sorbonne-logos-white.png"
Expand Down

0 comments on commit 22467c5

Please sign in to comment.