Skip to main content
100%

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

✓ Published0🌍 Public
PPedro Fonseca
Last edited Oct 12, 2021
Created on Oct 12, 2021

This example shows a smiling face built as an SVG component, composed of a yellow circle for the head, two dark circles for eyes, and a curved arc for the mouth. The face is rendered in React using SVG elements, with the mouth generated by the `arc` helper from the d3-shape package, which defines inner and outer radii plus start and end angles. A group element centers all parts via a translate transform, and the entire face is drawn with fixed numeric constants for dimensions and offsets.

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