Skip to main content
100%

D3 and SVG smile

✓ Published0🌍 Public
EElena Dreosti
Last edited Sep 30, 2020
Created on Sep 30, 2020
Forked from D3 and SVG smile

This example shows a simple smiling face constructed entirely with SVG shapes, drawn on a red background. The face consists of a yellow circle for the head, two small rectangles for eyes, two circles for pupils, and a black arc for the mouth. The code uses D3 version 6 to select the SVG element, set its dimensions and background, and append the geometric primitives with chained `.attr()` calls. It also uses `d3.arc()` to generate the path data for the smile, demonstrating how D3’s arc generator can be used with SVG paths.

AI-generated description

A bare minimum HTML page.

See also React Starter.

MIT Licensed

Similar vizzes