Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Make a Face with D3.js

Public visualization

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

Comments

Sign in to join the discussion.

MIT Licensed