Skip to content

Commit ed97c72

Browse files
committed
hide non-existent stats from non-cnt users
1 parent 7ad4ef6 commit ed97c72

File tree

1 file changed

+34
-33
lines changed

1 file changed

+34
-33
lines changed

web/src/AutoBoundariesMode.svelte

+34-33
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,7 @@
222222
<div style="border: dashed black 2px; padding: 8px">
223223
{#if selectedBoundary}
224224
<div style="display: flex; justify-content: space-between;">
225-
<b>Your Neighbourhood Overall</b>
226-
<!--REVIEW: good place for a name input field? -->
225+
<b>Your neighbourhood overall</b>
227226
<button
228227
class="icon-btn destructive"
229228
aria-label="Clear selection"
@@ -244,37 +243,39 @@
244243
{selectedBoundary.properties.area_km2.toFixed(1)} km²
245244
</td>
246245
</tr>
247-
<tr>
248-
<th>Population density</th>
249-
<td>
250-
{Math.round(
251-
selectedBoundary.properties.population /
252-
selectedBoundary.properties.area_km2,
253-
).toLocaleString()} people / km²
254-
</td>
255-
</tr>
256-
<tr>
257-
<th>SIMD</th>
258-
<td>{selectedBoundary.properties.simd.toFixed(1)}%</td>
259-
</tr>
260-
<tr>
261-
<th>Collision density</th>
262-
<td>
263-
{(
264-
selectedBoundary.properties.number_stats19_collisions /
265-
selectedBoundary.properties.area_km2
266-
).toFixed(1)} / km²
267-
</td>
268-
</tr>
269-
<tr>
270-
<th>POI density</th>
271-
<td>
272-
{(
273-
selectedBoundary.properties.number_pois /
274-
selectedBoundary.properties.area_km2
275-
).toFixed(1)} / km²
276-
</td>
277-
</tr>
246+
{#if $appFocus == "cnt"}
247+
<tr>
248+
<th>Population density</th>
249+
<td>
250+
{Math.round(
251+
selectedBoundary.properties.population /
252+
selectedBoundary.properties.area_km2,
253+
).toLocaleString()} people / km²
254+
</td>
255+
</tr>
256+
<tr>
257+
<th>SIMD</th>
258+
<td>{selectedBoundary.properties.simd.toFixed(1)}%</td>
259+
</tr>
260+
<tr>
261+
<th>Collision density</th>
262+
<td>
263+
{(
264+
selectedBoundary.properties.number_stats19_collisions /
265+
selectedBoundary.properties.area_km2
266+
).toFixed(1)} / km²
267+
</td>
268+
</tr>
269+
<tr>
270+
<th>POI density</th>
271+
<td>
272+
{(
273+
selectedBoundary.properties.number_pois /
274+
selectedBoundary.properties.area_km2
275+
).toFixed(1)} / km²
276+
</td>
277+
</tr>
278+
{/if}
278279
</table>
279280
{:else}
280281
<p>Choose an area to use as the boundary for your neighbourhood.</p>

0 commit comments

Comments
 (0)