Fork of Fork of Clickable Circles
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 descriptionSmiley 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.