From a8bae0a5919059e973cd1e6a4fa5a55efac98ee1 Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Fri, 5 Jan 2024 17:46:48 +0000 Subject: [PATCH] Slightly improve weird color bug --- web/src/RenderNeighbourhood.svelte | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/src/RenderNeighbourhood.svelte b/web/src/RenderNeighbourhood.svelte index 2e0c9ce..9273754 100644 --- a/web/src/RenderNeighbourhood.svelte +++ b/web/src/RenderNeighbourhood.svelte @@ -23,9 +23,10 @@ let gj: FeatureCollection; let maxShortcuts: number; - $: render(gjInput, $showBasemap); + // TODO if we could set both reactively, thatd be ideal + $: render(gjInput); - function render(x: FeatureCollection, y: boolean) { + function render(x: FeatureCollection) { // A qualitative palette from colorbrewer2.org, skipping the red hue (used // for levels of shortcutting) and grey (too close to the basemap) let cell_colors = [ @@ -50,6 +51,7 @@ if (f.properties.color == "disconnected") { f.properties.color = "red"; } else if (Object.hasOwn(f.properties, "color")) { + // TODO Uhh weird when this runs twice f.properties.color = cell_colors[f.properties.color % cell_colors.length]; }