Published
Edited
Feb 11, 2019
1 fork
2 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
csvData = Generators.disposable(d3.csv(URL.createObjectURL(csv)), x => x.dispose())
Insert cell
Insert cell
geocoded = csvData.map(row => {
if (row.Address) {
geocoder.geocode({address: row.Address, countryCode: 'GB'}).then( response => {
if (response
&& response.candidates.length > 0
&& response.candidates[0].score > 95 > 0 ) {
row.latitude = response.candidates[0].location.y
row.longitude = response.candidates[0].location.x
} else {
row.latitude = 0
row.longitude = 0
}
})
} else {
row.latitude = 0
row.longitude = 0
}
return row
})
Insert cell
Insert cell
{
let container = DOM.element(
'div', { style: `width:${width}px; height:${width/1.6}px` }
)
yield container
map(geocoded, container)
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
html`<link href='${resolve('leaflet@1.4.0/dist/leaflet.css')}' rel='stylesheet' />`
Insert cell

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.
Learn more