Repository navigation
Conversation
The note under the UK local-area maps now reads "N of M constituencies are not reported" (or local authorities), and a withheld boundary's tooltip on the geographic map reads "Not reported", in v3 and in the four v2 charts. Tests for the three v2 charts that had none check the note and the tooltip. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HexagonalMap takes `missingAreas`: areas it places but has no value
for, such as ones disclosure control withheld. Each is drawn in its
place with grey stripes on the map's background, which no colour on
the scale resembles, and its tooltip reads its name and
`missingAreaText` ("No data" by default). Missing areas take no part in
the colour range, cannot be selected, and the map's frame fits them
with the valued areas.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
withheldUKHexAreas gives the constituencies or local authorities of a report's region that a result does not hold, each at its hex layout position and named, with its ONS code as its id: every area of the layout for a UK-wide report, and the nation's for a nation's report. It lists none when the result cannot be matched to the layout: an area with no code, a code outside the region's layout, or a region that is neither the UK nor a nation. The names come from two new files beside the layouts, built from the boundary files' PCON24NM and LAD23NM, which a test checks against them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
For a level from a local-area breakdown, the v3 and v2 constituency and local authority hex maps draw every area of the report's region: all 650 constituencies or 361 local authorities for a UK-wide report, and the nation's for a nation's report. An area the result leaves out is drawn hatched in its place, outside the colour scale, and its tooltip reads its name and "Not reported". It has no value, so it is not in the colour range or v3's rankings, and it cannot be selected. A saved level, a result with an area that has no code, or one with a code outside the region's layout still draws only its own areas, and the note on areas the layout cannot place stays separate from the note on withheld areas. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v3's geographic map labelled every boundary without a result "Not reported" whenever the report had a breakdown, including on a saved level beside it, which disclosure control did not apply to. It now does so only on a level the breakdown supplied, as the hex map does; a saved level's boundary without a result reads "No data". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
On the UK-wide constituency hex map each hexagon's radius is about 4.7 pixels, so the hatching's stripes repeated 2.3 pixels apart. That is close enough to blend into a flat light grey, which the colour scale's grey arm holds, so a withheld constituency could read as a small loss. The stripes now repeat no closer than 4 SVG units (pixels at full width), and a withheld hexagon has a grey edge where a valued one's is the background colour, kept at the same screen width when zoomed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#1436 drops the note under the UK hex maps about areas the layout cannot place. The conflicts were the v2 chart tests' imports, resolved to keep this branch's withheld-area fixtures without the dropped note's. v3's test of a breakdown area without a code no longer checks that note; it still checks that the hex map draws no withheld areas. The "not reported" note for withheld areas stays. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 27, 2026
Collaborator
Author
anth-volk
added a commit
that referenced
this pull request
Oct 27, 2026
#1448 (1A · 2) holds #1433's six commits, cherry-picked unchanged, and #1447's work adapted to main: the hex maps draw the areas a disclosure-controlled breakdown withheld, hatched, as "Not reported", but only on the tiled grid, because areas still carry x and y there. This branch now builds on it. The conflicts keep this branch's behaviour and #1448's withheld areas: - The app reads no x or y: placeOnUKHexLayout takes the adapters' UKAreaChoroplethDataPoint, leaves out an area the layout cannot place, and returns only the placed points. #1448's Welsh fixture points lose their positions, and its fixture with every API position at the origin is dropped. - HexagonalMap draws only the tiled grid. #1448's missingAreas are positioned as the valued areas are, by a positionOnGrid with no coordinate scale or row-spacing argument, and count in the bounds. The duplicate "tiled frame" tests and the missing-area tests' tiled config are dropped. - No note says which areas are left off. - The withheld areas are kept. Under this branch every map tiles, so the callers' "only when tiled" checks are gone: v3's UKLocalAreaMaps and the four v2 charts ask withheldUKHexAreas for a breakdown level's withheld areas whenever the level is disclosure-controlled. withheldUKHexAreas still lists none when any of the result's areas has no code or a code outside the region's layout. That check is about matching the result to the layout, not about the grid: a layout area the result lacks may be covered by one of its unmatched areas, such as the districts a 2023 unitary authority replaced, so calling it withheld could be wrong. A map that leaves out unplaceable areas therefore draws no withheld areas, and the function's comment says why. #1448's v3 test for a breakdown area without a code now expects that: Gower left off, the other constituencies tiled, and no withheld areas. The README keeps both sides' text, and the tests take #1448's "not reported" wording. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
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.
Fixes #1446
Stacked on #1436 (which is stacked on #1433). Like the rest of the UK clean-up, it waits to merge until after the UK Budget on 28 October.
What changes
Local-area breakdowns (
breakdown=local_areas) come from .py with disclosure control, and an area whose estimate fails the disclosure rules is absent from the result. Until now the v2 and v3 hex maps drew only the areas in the result, so a withheld area left a gap.For a level from a breakdown, the v3 "Local areas" hex map and the four v2 hex charts (absolute and relative change, by constituency and by local authority) now draw every area of the report's region:
An area the result leaves out:
The note under the maps now reads "N of M constituencies are not reported" (or local authorities), and the geographic maps' tooltip for a withheld boundary reads "Not reported", so the map, its tooltips and the note use the same term. The note is one component (
UKAreaDisclosureNotes), shown under v3's maps (with or without areas) and under each of the four v2 charts.Unchanged
Geographic map
UKAreaChoroplethMapalready drew every boundary: a withheld one was solidgray[300]with "Not published" in its tooltip. It now reads "Not reported". v3 also used that text on a saved level whenever the other level came from a breakdown. It now uses it only on the breakdown's level, as the hex map does, and a saved level's boundary without a result reads "No data". The fill is unchanged.gray[300]sits between two stops on the scale's grey side, so a later change could hatch it as the hex map now does.How
HexagonalMaptakesmissingAreas(areas it places without a value) andmissingAreaText. It hatches them with an SVG pattern sized to the hexagons, with stripes never closer than 4 SVG units (pixels at full width) so they don't blend into a flat grey, gives them a grey edge, and fits its frame to them as well as to the valued areas.withheldUKHexAreas(level, points, region)inukHexLayout.tslists the region's layout codes that the result lacks, each at its layout position. It returns none when the result can't be matched, or when the region is neither the UK nor a nation.constituency_names_2024.jsonandlocal_authority_names_2023.json, built from the boundary files'PCON24NMandLAD23NM.ukBoundaryFiles.test.tschecks them against the boundary files. They add about 34 KB, before compression, to the bundle that already holds the layouts.Commits
Each commit was done red-green: its tests were written first and seen failing for the expected reason, then the code was written and committed with them.
HexagonalMap).withheldUKHexAreasand the name files).chore/remove-uk-area-xy, which drops Remove the app's handling of x and y on UK area results #1436's note on areas the layout can't place. The conflicts were imports in the v2 chart tests, and v3's test of an uncoded breakdown area no longer checks that note. The "not reported" note stays.Testing
vitestruns on Node 26 for the changed and related suites, plusmake format,make lintandmake typecheck.review-coderounds: the first found the blended stripes (fixed red-green in commit 6), and the second found no bugs.🤖 Generated with Claude Code