Struggling to use the new Promise way of d3v5?

Have you seen this error: await is only valid in async function

That means that you need to wrap your d3 code inside a function:

async function map() {
	const data = await d3.json('your.geojson');
}
map();


Written by Mila

See Also

shorthand functions

Small tip for writing less boilerplate

Bubble Map Radius

Small tip for your bubble maps.

Default Projection Paramameters

What are the default projection params in d3.js