Svelte + D3: Datawrapper Web Component
✓ Published0🌍 Public
This example demonstrates how to embed a Datawrapper chart in a Svelte application by creating a reusable web component. The code loads a Datawrapper visualization using the chart ID `EdaYj` through the `https://datawrapper.dwcdn.net/{id}/embed.js` script, with a fallback image for environments where JavaScript is disabled. The App component imports and renders the Datawrapper component, while the project configuration includes D3 as a library dependency, though the embedded chart’s data and rendering are handled entirely by Datawrapper’s external service.
AI-generated descriptionInclude a Datawrapper chart
MIT Licensed