Skip to main content
100%

Lets make a face with D3.js

✓ Published0🌍 Public
Tthakkelk
Last edited Jul 21, 2020
Created on Jul 20, 2020

This example builds a simple cartoon face using D3.js v5 in a React application, rendering SVG shapes onto a 960×500 canvas. It shows how to compose a face from primitive geometric elements—circles for the head and eyes, rectangles for eyebrows, and an arc-generated path for the mouth. The code imports `select` and `arc` from D3, uses `svg.append()` to add each shape, and applies attributes like `cx`, `cy`, and `r` for positioning. The mouth path is created using the `arc()` generator with specified inner and outer radii and angle values.

AI-generated description

A bare minimum HTML page.

See also React Starter.

MIT Licensed

Similar vizzes