d3.geoPath + node-canvas
✓ Published0🌍 Public
Mmbostock
Last edited Nov 15, 2016
Created on Nov 3, 2016
This example demonstrates how to render geographic data to a Canvas element using d3.geoPath with node-canvas, producing a stroked mesh of United States county boundaries. The rasterize script loads US Atlas TopoJSON data, converts it to GeoJSON with topojson-client, and passes it through d3.geoPath’s context method to draw paths into a 960×600 canvas. It then writes the resulting bitmap to a PNG file, showing server-side vector-to-raster conversion without a browser.
AI-generated descriptionThis example shows how to use d3.geoPath with node-canvas and us-atlas.
GPL-3.0 Licensed