Skip to main content
100%

Fork of Fork of Clickable Circles

✓ Published0🌍 Public
Ggedamrajani336@gmail.com
Last edited Sep 23, 2025
Created on Sep 23, 2025

This interactive visualization replaces typical scatterplot circles with smiley faces rendered using the D3.js v7 library. Each face is an SVG group containing a colored circle, two eyes, and a smiling arc, positioned according to x and y coordinates from a static dataset. Clicking any face applies a black outline and raises it to the front, with selection state managed through a unidirectional data flow pattern. The code relies on D3’s `selectAll` with `.join`, `.attr`, and event listeners to construct and update the elements.

AI-generated description

Smiley Faces Visualization

This project renders interactive smiley faces instead of plain circles. Each smiley face consists of:

  • A face circle with unique color and size
  • Two eyes positioned relative to the face size
  • A smiling mouth represented as an arc

When you click on any smiley face, it becomes highlighted with a black border and moves to the front.

How It Works

The visualization uses D3.js to create SVG elements. Instead of rendering simple circles, it now creates groups (<g>) for each face, containing:

  • A main circle for the face
  • Two smaller circles for the eyes
  • A path element for the smile

The state management follows a unidirectional data flow pattern.

MIT Licensed

Similar vizzes