Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

D3.js in action!

Public visualization

Viewing a saved revision (read-only)

f77e4aa854cc44a3a50ad036b54cc2bf

D3.js in action!

0 stars0🌍 Public
SSagar Malviya
Last edited Jun 3, 2019
Created on Jun 3, 2019

This example shows a red square with a thick black border rendered inside an SVG canvas, demonstrating basic D3.js DOM manipulation. The code uses `d3.selectAll('svg')` to target the SVG element and appends a `rect` with attributes for position, size, stroke, and fill. It relies on the D3 v5 library loaded from a CDN, and renders the shape as pure SVG geometry without any data binding or interaction. The result is a static visual, illustrating how D3 can directly create and style SVG elements.

AI-generated description

Demonstrates fundamental DOM manipulation using D3.js by making a smiley face whose eyebrows move.