Skip to main content
100%

Fork of Smiley Face Part-3 (React and d3)

✓ Published0🌍 Public
AAliUrden
Last edited Oct 28, 2021
Created on Oct 28, 2021

This example shows a simple smiley face rendered as an SVG, with a yellow circle for the head, two black circles for eyes, and an arc-shaped mouth. The face is built using React for component structure and d3-shape’s `arc()` helper to generate the mouth’s path. SVG group elements and the `transform` attribute position the face at the center of a 960×500 viewport. The code uses React 16.13.1, d3 v6, and ES6 template literals for the transform string.

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