Skip to main content
100%

Smiley Face Part-3 (Assignment)

✓ Published0🌍 Public
IIlgar Akalın
Last edited Sep 16, 2021
Created on Sep 16, 2021

This example shows a yellow smiley face drawn with SVG shapes, including two eyes and an arc-shaped mouth, all centered within a fixed 960×500 viewport. The face is built using React for component rendering and D3’s `arc` helper from the `d3-shape` package to generate the mouth’s path. Circle elements handle the head and eyes, while a group element with a `transform` attribute positions everything at the center. The mouth’s inner and outer radii, along with start and end angles, are configured through method chaining on the `arc` constructor.

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