File tree Expand file tree Collapse file tree 3 files changed +1573
-4
lines changed
lib/components/data-vis/map
wrappers/components/data-vis/map Expand file tree Collapse file tree 3 files changed +1573
-4
lines changed Original file line number Diff line number Diff line change 11
11
ControlButton ,
12
12
ControlGroup ,
13
13
} from " svelte-maplibre" ;
14
- import { contrastingColor , colorPalette } from " ./colors.ts" ;
14
+ import { contrastingColor } from " ./colors.ts" ;
15
+ import { colorbrewer } from " ./colorbrewer.js" ;
15
16
import { hoverStateFilter } from " svelte-maplibre/filters.js" ;
16
17
import type { maplibregl , ExpressionSpecification } from " maplibre-gl" ;
17
18
import fullTopo from " ./fullTopo.json" ;
38
39
scaleControl,
39
40
scaleControlPosition = " bottom-left" ,
40
41
scaleControlUnit = " metric" ,
42
+ colorPalette = " YlGnBu" ,
41
43
showBorder = false ,
42
44
maxBorderWidth = 1.5 ,
43
45
tooltip,
53
55
center = [- 2.5 , 53 ],
54
56
zoom = 5 ,
55
57
} = $props ();
56
- $inspect ( navigationControlPosition );
58
+
57
59
let mapData = $derived (data ?.filter ((d ) => d .year == year )[0 ]?.data );
58
60
59
61
let filteredMapData = $derived (
70
72
71
73
let filteredGeoJsonData = $derived (filterGeo (geojsonData , year ));
72
74
73
- let fillColor = $derived (colorPalette [numberOfBreaks ]);
74
- $inspect ( fillColor );
75
+ let fillColor = $derived (colorbrewer [ colorPalette ] [numberOfBreaks ]);
76
+
75
77
let borderColor = " #003300" ;
76
78
77
79
let map: maplibregl .Map | undefined = $state ();
You can’t perform that action at this time.
0 commit comments