[Framework examples →](../)

# Data loader to generate PNG from canvas

View live: <https://observablehq.observablehq.cloud/framework-example-loader-canvas-to-png/>

This Observable Framework example demonstrates how to write a Node.js data loader that creates a map using [node-canvas](https://github.com/Automattic/node-canvas) and D3, then writes the map to standard out as a PNG. The data loader lives in [`src/data/us-map.png.js`](./src/data/us-map.png.js).
