Skip to main content
100%

Shapes with SVG and CSS

✓ Published0🌍 Public
Rrkdunn
Last edited Jan 2, 2020
Created on Jan 2, 2020

This example uses D3.js to build a smiling face entirely from SVG shapes—circles, rectangles, and an arc path—with animated eyebrows. The SVG canvas is selected directly, and D3’s `transition()` and `duration()` methods move the eyebrow group up and down in a looping motion. The page also includes static SVG circles and rectangles with CSS-defined fills to demonstrate basic shape styling. Rendering relies on SVG elements created via D3 selections, with the face centered using width and height attributes from the SVG element.

AI-generated description

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

MIT Licensed

Similar vizzes