Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Let's make a face with D3.js!

Public visualization

Let's make a face with D3.js!

0 stars1🌍 Public
AAbhi
Last edited Dec 8, 2020
Created on Dec 2, 2020

This example demonstrates how to build a smiley face with D3.js, highlighting the library’s fundamental DOM manipulation capabilities. The code uses D3 selections and the `enter()` method to append SVG `path` elements, which are projected using `geoMercator` and `geoPath` based on TopoJSON country data from the World Atlas. While the face itself is not fully implemented in the visible code, the example lays the groundwork by rendering geographic country shapes as green paths with black outlines. The page loads D3 v5 and TopoJSON from a CDN, with a stylesheet styling all paths.

AI-generated description

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

Comments

Sign in to join the discussion.

MIT Licensed