Skip to content

Commit d35d38c

Browse files
committed
Revert "Adjust SIMD legend into quintiles and tweak popup copy."
This reverts commit 8b30d57.
1 parent 8b30d57 commit d35d38c

6 files changed

+13
-61
lines changed

web/src/AutoBoundariesMode.svelte

+2-4
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,6 @@
168168
<p>The colors are arbitrary, just to distinguish better.</p>
169169
{/if}
170170

171-
<hr />
172-
173171
<button class="secondary" on:click={download}>Export to GeoJSON</button>
174172

175173
<label>
@@ -201,8 +199,8 @@
201199
<b>Area:</b>
202200
{props.area_km2.toFixed(1)} km²
203201
{:else if selectedPrioritization == "simd"}
204-
<b>SIMD:</b>
205-
Less deprived than {props.simd.toFixed(1)}% of data zones.
202+
<b>Fake SIMD:</b>
203+
{props.simd.toFixed(1)}
206204
{:else if selectedPrioritization == "stats19"}
207205
<b>
208206
Density of pedestrian and cyclist collisions (collisions per

web/src/PickNeighbourhoodMode.svelte

+4-4
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,8 @@
244244
</span>
245245
{:else if selectedPrioritization == "simd"}
246246
<span>
247-
<b>SIMD:</b>
248-
Less deprived than {simd.toFixed(1)}% of data zones.
247+
<b>SIMD (percentile):</b>
248+
{simd.toFixed(1)}
249249
</span>
250250
{/if}
251251
</li>
@@ -323,8 +323,8 @@
323323
<b>Area:</b>
324324
{props.area_km2.toFixed(1)} km²
325325
{:else if selectedPrioritization == "simd"}
326-
<b>SIMD:</b>
327-
Less deprived than {props.simd.toFixed(1)}% of data zones.
326+
<b>Fake SIMD:</b>
327+
{props.simd.toFixed(1)}
328328
{:else if selectedPrioritization == "stats19"}
329329
<b>
330330
Density of pedestrian and cyclist collisions (collisions per

web/src/common/SequentialLegendBucketed.svelte

-22
This file was deleted.

web/src/common/colors.ts

-8
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,3 @@ export let areaLimits = [0.0, 0.3, 0.6, 1.0, 1.5, 2.0];
4141

4242
export let stats19Limits = [0, 1.0, 10.0, 50.0, 100.0, 1000.0];
4343
export let stats19ColorScale = demandColorScale;
44-
45-
export function bucketize(limits: number[]) {
46-
let buckets = [];
47-
for (let i = 1; i <= limits.length; i++) {
48-
buckets.push(i);
49-
}
50-
return buckets;
51-
}

web/src/context/Population.svelte

+5-12
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88
import { SequentialLegend } from "svelte-utils";
99
import { makeRamp, Popup } from "svelte-utils/map";
1010
import { layerId } from "../common";
11-
import { bucketize, simdColorScale, simdLimits } from "../common/colors";
11+
import { simdColorScale, simdLimits } from "../common/colors";
1212
import ContextLayerButton from "../common/ContextLayerButton.svelte";
13-
import SequentialLegendBucketed from "../common/SequentialLegendBucketed.svelte";
1413
import { assetUrl } from "../stores";
1514
1615
let showSIMD = false;
@@ -23,14 +22,8 @@
2322

2423
<ContextLayerButton label="SIMD" bind:show={showSIMD}>
2524
<div slot="legend">
26-
<SequentialLegendBucketed
27-
colorScale={simdColorScale}
28-
buckets={bucketize(simdLimits)}
29-
/>
30-
<div style="display: flex; justify-content: space-between;">
31-
<span>More deprived</span>
32-
<span>Less deprived</span>
33-
</div>
25+
<SequentialLegend colorScale={simdColorScale} limits={simdLimits} />
26+
<p>Darker colours are more deprived</p>
3427
</div>
3528

3629
<p slot="help">
@@ -85,8 +78,8 @@
8578
<p>
8679
Data zone {props.id}
8780
has {props.population.toLocaleString()}
88-
people, and a SIMD rank of {props.imd_rank}, making it less deprived
89-
than {props.imd_percentile}% of people.
81+
people, and a SIMD rank of {props.imd_rank}, putting it in the {props.imd_percentile}
82+
percentile.
9083
</p>
9184
</Popup>
9285
</FillLayer>

web/src/prioritization/PrioritizationSelect.svelte

+2-11
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22
import { SequentialLegend } from "svelte-utils";
33
import {
44
areaLimits,
5-
bucketize,
65
simdColorScale,
76
simdLimits,
87
stats19ColorScale,
98
stats19Limits,
109
} from "../common/colors";
11-
import SequentialLegendBucketed from "../common/SequentialLegendBucketed.svelte";
1210
import { projectName } from "../stores";
1311
import type { Prioritization } from "./index";
1412
@@ -49,20 +47,13 @@
4947
<select id="prioritization-selection" bind:value={selectedPrioritization}>
5048
<option value="none">None</option>
5149
<option value="area">Area (km²)</option>
52-
<option value="simd">SIMD</option>
50+
<option value="simd">Fake SIMD (percentile)</option>
5351
<option value="stats19">Collisions</option>
5452
</select>
5553
</div>
5654

5755
{#if selectedPrioritization == "simd"}
58-
<SequentialLegendBucketed
59-
colorScale={simdColorScale}
60-
buckets={bucketize(simdLimits)}
61-
/>
62-
<div style="display: flex; justify-content: space-between;">
63-
<span>More deprived</span>
64-
<span>Less deprived</span>
65-
</div>
56+
<SequentialLegend colorScale={simdColorScale} limits={simdLimits} />
6657
{:else if selectedPrioritization == "area"}
6758
<SequentialLegend colorScale={simdColorScale} limits={areaLimits} />
6859
{:else if selectedPrioritization == "stats19"}

0 commit comments

Comments
 (0)