Skip to main content
100%

Make a face with D3.js

✓ Published1🌍 Public
Aavirathtib
Last edited Dec 29, 2021
Created on Dec 29, 2021

A smiley face is rendered in an SVG canvas using D3.js v7, with a yellow circle for the head and two black circles for the eyes. The code appends each circle to the selected `svg` element, setting its radius and horizontal/vertical position via `attr` in relation to the SVG’s `width` and `height`. The styling is handled by an external CSS file that removes page margins. This example demonstrates basic D3 shape creation and attribute manipulation for static visual output.

AI-generated description
MIT Licensed

Similar vizzes