Skip to main content
100%

Fork of Viz-Hub Smiley

✓ Published0🌍 Public
SSharmilaChowdhari
Last edited Feb 19, 2022
Created on Feb 19, 2022
Forked from Viz-Hub Smiley

This example renders a yellow smiley face using React and D3 version 6, with SVG group and path elements. The face is drawn with three circles for the head and eyes, while the mouth uses the `arc` helper from the `d3-shape` package, configured with inner and outer radii and start/end angles. The SVG group’s `transform` attribute centers the face via ES6 template literals. D3’s `arc` generates the mouth path, and React’s `ReactDOM.render` mounts the component to the page, demonstrating a basic integration of D3 geometry with React’s declarative JSX syntax.

AI-generated description

Part-3) D3 intro

  • Getting started with the D3 library

  • Using arc from the d3-shape package arc is a helper function used for drawing an arc shape for the mouth.

  • SVG path elements

  • SVG group elements and the transform attribute

  • Using ES6 Template Literals

  • Adding the mouth to our face

Assignment: Tweak the Face!!

MIT Licensed

Similar vizzes