Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Make a Face with D3.js

Public visualization

Viewing a saved revision (read-only)

7df9d57052454851b4b2d0615d7b2527

Make a Face with D3.js

0 stars1🌍 Public
VVipul Basapati
Last edited Dec 31, 2018
Created on Dec 31, 2018

This example shows a simple smiling face constructed from three circles: a large yellow head and two black eyes positioned symmetrically within an SVG canvas. Using D3.js version 5, the code selects the SVG element, reads its dimensions, and appends circles with radii and coordinates calculated from the canvas height and width. The head is centered, while the eyes are offset by quarter-dimensions to create facial symmetry, with the `attr` method setting fill colors and stroke properties.

AI-generated description