Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Let's make a face with D3.js!

Public visualization

Viewing a saved revision (read-only)

968614e1fd084c74a76406e3eb45b607

Let's make a face with D3.js!

0 stars0🌍 Public
JJulianWgs
Last edited Dec 25, 2019
Created on Dec 25, 2019

This example demonstrates basic DOM manipulation with D3.js by arranging red rectangles into a grid and positioning them within an SVG canvas. The code uses D3’s `select` and data joins (`selectAll().data().enter().append()`) to generate groups and rectangles based on calculated coordinates. It explicitly references `d3.arc` (imported but unused), while the visible rendering relies on SVG `rect` elements positioned via transform attributes. The layout logic computes row and column counts from a given number of replicas, though the current implementation produces a simple static grid rather than an animated face.

AI-generated description

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