diff --git a/web/src/DebugDemandMode.svelte b/web/src/DebugDemandMode.svelte index 4c3f0cf..8ca8943 100644 --- a/web/src/DebugDemandMode.svelte +++ b/web/src/DebugDemandMode.svelte @@ -1,31 +1,76 @@ @@ -52,17 +97,19 @@

{gj.features.length.toLocaleString()} zones

+ + {#if current && hoveredId != null} {current.properties.name}

- Total trips from here: {sum( - current.properties.counts_from, - ).toLocaleString()} + Total trips from here: {current.properties.sum_from.toLocaleString()}

- Total trips to here: {sum( - current.properties.counts_to, - ).toLocaleString()} + Total trips to here: {current.properties.sum_to.toLocaleString()}

Total intra-zonal trips starting and ending here: {current.properties @@ -71,6 +118,13 @@ {:else}

Hover on a zone

{/if} + +
+

+ Trips {showTo ? "from" : "to"} + {hoveredId == null ? "each zone" : "this zone"}: +

+
@@ -78,7 +132,7 @@ { - return JSON.parse(this.inner.getDemandModel()); + let gj = JSON.parse(this.inner.getDemandModel()); + for (let f of gj.features) { + f.properties.sum_from = sum(f.properties.counts_from); + f.properties.sum_to = sum(f.properties.counts_to); + } + return gj; } } @@ -215,6 +221,8 @@ export type ZoneDemandProps = { name: string; counts_from: number[]; counts_to: number[]; + sum_from: number; + sum_to: number; }; export interface RenderNeighbourhoodOutput {