Repository navigation
feat: show reference data sources as shaded areas on public maps - #552
Merged
Merged
Conversation
Data (reference data) sources can now be added to a public map from the publish editor. Each public map colour scheme gains a secondary colour, used for a second area layer; trans-pride's was missing its #. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reference data sources geocoded by area code or name will be drawn as shaded areas on public maps, so the markers endpoint now sends the code of each record's area when called in a public map context. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reference data sources geocoded by area are drawn on public maps by filtering the choropleth boundary tileset for their area set to the records' area codes, instead of as markers. Area sources alternate between the colour scheme's primary and secondary colours. The marker filtering (timeline, past events, public filters) moves into useVisibleMarkers so markers and areas hide the same records. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Hovering a shaded area darkens it, clicking it selects every record geocoded to that area, and clicking a listing for an area source zooms out far enough to see the area. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Matches clicking a marker: centre on the area, zooming in no further than needed to see all of it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Hovering a shaded area shows the same popover as a marker, listing the names (and dates, where shown) of the records in that area, up to five. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Area shading, hover and click now share one index of each area-drawn source's visible records, so filtered-out records no longer appear in the popover or selection. Also zoom listings by how a source is actually drawn, avoid rescanning markers on every mouse move, and move area constants and helpers to their own files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reference data ("Data") sources can now be added to a public map. They're drawn as shaded areas instead of markers.
Previously the Publish page's data source dropdown hid Data sources completely. That's why the "Make Polluters Pay Campaigns" source, which is geocoded to council areas, couldn't be added to its public map.
What's included
secondarycolour, added to every scheme. Trans-pride's secondary was missing its#, so it's been replaced.secondaryMutedis left alone because the sidebar header already uses it./api/data-sources/[id]/markersadds anareaCodeto each feature of these sources.useVisibleMarkers, so markers and areas hide the same records.resources/dataSets/sampleCouncilCampaigns.csv, 22 made-up council campaigns onLAD25codes. It includes two records in one council and one county code that won't geocode.Not included
Testing
npm run lintpasses. New unit tests are intests/unit/utils/dataSource.test.ts.🤖 Generated with Claude Code