-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.mjs
More file actions
39 lines (35 loc) · 990 Bytes
/
main.mjs
File metadata and controls
39 lines (35 loc) · 990 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import {precip_geo, precip_topo} from "./module/parse_netcdf_test.mjs";
const levels = precip_geo[0].map(d => d.value)
const features = precip_topo[0].objects.map(objt => ChartGeo.topojson.feature(precip_topo[0], objt))
const chart = new Chart(document.getElementById('canvas').getContext('2d'), {
type: 'choropleth',
data: {
labels: precip_topo.objects.keys,
datasets: [
{
label: 'Levels',
outline: level,
data: features.map((f) => ({
feature: f,
value: 1,
})),
},
],
},
options: {
showOutline: false,
showGraticule: false,
plugins: {
legend: {
display: false,
},
},
scales: {
projection: {
axis: 'x',
projection: 'equalEarth',
padding: 10,
},
},
},
})