Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Let's make a face with CSS and D3.js!

Public visualization

Let's make a face with CSS and D3.js!

0 stars0🌍 Public
TTMorgan99
Last edited Jan 13, 2020
Created on Jan 12, 2020

A smiling face rendered in SVG uses D3.js to construct its geometry, while CSS custom properties define all visual dimensions and positions. The face, eyes, eyebrows, and mouth are created by appending SVG shapes with D3's selection API. Eyebrow movement is prepared through commented-out D3 transition code, with offsets stored as CSS variables. The example demonstrates how D3 v5 DOM manipulation can combine with CSS variables for styling, though the animation logic remains incomplete.

AI-generated description

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

In this code, I moved the variables to CSS. I have yet to re-attach the transition code, ( sigh )

Comments

Sign in to join the discussion.

MIT Licensed