Skip to main content
100%

Make a Face with D3

✓ Published3🌍 Public
GGordon Yang
Last edited Apr 1, 2021
Created on Jan 10, 2021

This example demonstrates how to construct a smiling face using D3 version 6 and React. It builds the face from SVG shapes—a yellow circle for the head, two black circles for eyes, and a path for the mouth—all centered and scaled with data from the SVG's width and height attributes. The eyebrows are animated using D3's `transition` API, moving them vertically over two sequential 2-second intervals. The code leverages D3's `select`, `arc`, and `attr` methods, along with React's `render` function to manage the SVG output.

AI-generated description

A demonstration of how to start using D3 version 6.

MIT Licensed

Similar vizzes