"LUX":"blue",// Use your desired color for each region
// Add more regions as needed
};
returncolorMap[region]||"white";// Default to white for unknown regions
};}
projection2=d3.geoMercator()
.scale(7000)
.center([7.0153,46.2533])
.translate([width/2,900/1])
Plot.plot({
width:900,
height:600,
projection:projection,
marks:[
Plot.sphere({fill:"#ADD8E6"}),
Plot.geo(countries,{fill:"#ccc",stroke:"#fff"}),
Plot.geo(accidents,{
stroke:"#fff",
tip:true
}),
]
})
accidents1=accidents[0]
accidents2=accidents[9]
accidents=data.features
projection=d3.geoMercator()
.scale(35000)
.center([6.0153,49.0533])
.translate([width/2,900/1])
import{countries}from'@d3/world-tour'
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.