Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Smiley Face Part II

Public visualization

Viewing a saved revision (read-only)

8e944f94569d488cb79de32b16695b00

Fork of Smiley Face Part II

0 stars0🌍 Public
Ddarrenm95
Last edited Jun 18, 2021
Created on Jun 18, 2021

This example shows a yellow smiley face drawn with SVG circles in React, where one circle follows the user’s mouse movements across the screen. The face includes two static eyes and a large yellow head with a black outline, while the nose moves dynamically. It uses React’s `useState` and `useCallback` hooks to track mouse coordinates via an `onMouseMove` event handler, re-rendering the circle’s `cx` and `cy` attributes. The visualization is built with React 16.9 and rendered as SVG, with a fixed canvas size of 960 by 500 pixels.

AI-generated description

Smiley face implementation with React.