Skip to main content
100%

Svelte + D3: Datawrapper Web Component

✓ Published0🌍 Public
MMatthias Stahl
Last edited Nov 26, 2025
Created on Mar 15, 2024

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 description

Include a Datawrapper chart

MIT Licensed

Similar vizzes