Skip to main content
100%

Parse SVG picture

✓ Published0🌍 Public
VVicfreak10
Last edited Jun 19, 2020
Created on May 27, 2020
Forked from Tree with labels

This example parses an external SVG file and injects its contents into a D3.js visualization. The code uses `d3.xml` to load the `drawing.svg`, then appends the document element directly into the SVG container, which is sized to the browser viewport via `document.body.clientWidth` and `clientHeight`. Styling defined in CSS applies to the imported paths, lines, and text. The result displays the original vector picture, with tree layout functions imported from D3 but not used in the final rendering.

AI-generated description
MIT Licensed

Similar vizzes