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

Allow choropleth to be toggled on and off #168

Merged
merged 8 commits into from
Dec 18, 2024

Conversation

Moggach
Copy link

@Moggach Moggach commented Dec 17, 2024

Description

This PR adds an option to select None in the Type dropdown in the Data Visualisation section to turn off the choropleth

Untitled

Motivation and Context

Addresses issue MAP-711

How Can It Be Tested?

Download the branch and run locally
Create a map or navigate to an existing one
Go to configuration tab and select None under Type in Data Visualisation
Observe that selecting None turns off the choropleth (and reselecting Chropleth toggles it back on again)

Copy link

linear bot commented Dec 17, 2024

@commonknowledge-bot commonknowledge-bot deployed to feature/map-711-toggle-choropleth-on-off - meep-database PR #168 December 17, 2024 18:26 — with Render Active
@commonknowledge-bot commonknowledge-bot temporarily deployed to feature/map-711-toggle-choropleth-on-off - meep-intelligence-hub-backend PR #168 December 17, 2024 18:26 — with Render Destroyed
@commonknowledge-bot commonknowledge-bot temporarily deployed to feature/map-711-toggle-choropleth-on-off - meep-intelligence-hub-backend PR #168 December 17, 2024 18:26 — with Render Destroyed
@commonknowledge-bot commonknowledge-bot temporarily deployed to feature/map-711-toggle-choropleth-on-off - meep-intelligence-hub-frontend PR #168 December 17, 2024 18:27 — with Render Destroyed
@commonknowledge-bot commonknowledge-bot deployed to feature/map-711-toggle-choropleth-on-off - meep-intelligence-hub-worker PR #168 December 17, 2024 18:27 — with Render Active
…wDataVisualisation property to dataVisualisation in ReportConfig
@commonknowledge-bot commonknowledge-bot temporarily deployed to feature/map-711-toggle-choropleth-on-off - meep-intelligence-hub-frontend PR #168 December 18, 2024 13:09 — with Render Destroyed
@commonknowledge-bot commonknowledge-bot temporarily deployed to feature/map-711-toggle-choropleth-on-off - meep-intelligence-hub-frontend PR #168 December 18, 2024 13:11 — with Render Destroyed
@commonknowledge-bot commonknowledge-bot temporarily deployed to feature/map-711-toggle-choropleth-on-off - meep-intelligence-hub-backend PR #168 December 18, 2024 13:11 — with Render Destroyed
@commonknowledge-bot commonknowledge-bot temporarily deployed to feature/map-711-toggle-choropleth-on-off - meep-intelligence-hub-backend PR #168 December 18, 2024 13:11 — with Render Destroyed
@commonknowledge-bot commonknowledge-bot temporarily deployed to feature/map-711-toggle-choropleth-on-off - meep-intelligence-hub-backend PR #168 December 18, 2024 13:11 — with Render Destroyed
@commonknowledge-bot commonknowledge-bot temporarily deployed to feature/map-711-toggle-choropleth-on-off - meep-intelligence-hub-worker PR #168 December 18, 2024 13:12 — with Render Destroyed
@commonknowledge-bot commonknowledge-bot temporarily deployed to feature/map-711-toggle-choropleth-on-off - meep-intelligence-hub-worker PR #168 December 18, 2024 13:12 — with Render Destroyed
Comment on lines 80 to 95
{showChoropleth && (
<>
<Layer
beforeId="road-simple"
id={`${tileset.mapboxSourceId}-fill`}
source={tileset.mapboxSourceId}
source-layer={tileset.sourceLayerId}
type="fill"
filter={getChoroplethFillFilter(dataByBoundary, tileset)}
paint={getChoroplethFill(
dataByBoundary,
visibility === 'visible'
)}
/>
</>
)}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will change the layer order in ways that might break the visualisation.

There is already a const visibility statement further up. Let's just add an extra condition into that instead.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done now I think

@commonknowledge-bot commonknowledge-bot temporarily deployed to feature/map-711-toggle-choropleth-on-off - meep-intelligence-hub-frontend PR #168 December 18, 2024 15:55 — with Render Destroyed
@janbaykara janbaykara merged commit 83b3784 into main Dec 18, 2024
4 checks passed
@janbaykara janbaykara deleted the feature/map-711-toggle-choropleth-on-off branch December 18, 2024 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants