Skip to main content
100%

Smiley Face Part 6

✓ Published0🌍 Public
Ssakhabutdinov
Last edited Mar 21, 2020
Created on Mar 21, 2020
Forked from Smiley Face Part 6

This example renders one or more procedurally generated smiley faces as SVG, each built from reusable React components for the background, eyes, eyebrows, mouth, teeth, and tongue. It uses d3.arc to draw the mouth and tongue paths, and d3.range to create a grid of faces. Randomized props control each face’s rotation, gradients, colors, and feature sizes. Eyebrows animate via SVG <animate> elements and change color on hover through CSS custom properties.

AI-generated description

Smiley Face Tutorial with React. Following Curran's tutorial below but also including:

  • Basic hover effects on the eyebrows (turns them blue on-hover)
  • Animation to raise and lower the eyebrows (random number of times and speed)
  • Single parameter to select how many faces should appear on the x and y aspects of the svg (e.g. a rangeBasic of 5 gives 25 (5 * 5) faces)
  • Random variation on most parts of the face(s)

Source: Datavis 2020 Episode 10 - Let's Make a Face Part VI (React & D3) - Compartmentalizing Complexity

Looking forward to learning how to apply this logic to data visualizations!!

MIT Licensed

Similar vizzes