Published
Edited
Oct 5, 2018
Insert cell
Insert cell
plot = {
const t0 = performance.now();

const projection = d3.geoAzimuthalEqualArea()
.rotate([110, -43, 0])
.scale(800);
const svg = d3.select(DOM.svg(1080, 600))
.style("width", "100%")
.style("height", "auto");
const barbsGroup = svg.append("g").attr("class", "wind-barbs");
const geojsonUrl = "https://geojson-ldxdcwirxw.now.sh/metar-api-sample-json-10945.json";
d3.metar.stations(geojsonUrl).then(stations => {
stations.forEach(s => {
if(s.properties.wspd > 26){
s.properties.wspd = 65;
}
});
d3.metar.barbs(stations, barbsGroup, projection, priority);
const t1 = performance.now();
console.log("Call to svg took " + (t1 - t0) + " milliseconds.");
});

return svg.node();
}
Insert cell
Insert cell
d3.metar
Insert cell
d3 = (await d3_r.require("d3", "d3-cogeo", "d3-metar@0.1.4"))
Insert cell
d3_r = require("d3-require")
Insert cell
Insert cell
topojson = require("topojson-client@3")
Insert cell
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