External SVG
✓ Published0🌍 Public
Mmbostock
Last edited Jul 8, 2016
Created on Jun 8, 2011
This example demonstrates how to load an external SVG file and insert it directly into a web page using D3 v4’s `d3.xml` method. It fetches `rect01.svg`, which contains two rectangles: a thin blue outline of the canvas and a larger yellow rectangle with a thick navy border. The code specifies the MIME type as `image/svg+xml` and appends the parsed SVG document element to the page body. No data transformation or interactive behavior occurs—only static SVG retrieval and embedding.
AI-generated descriptiongpl-3.0 Licensed