Skip to main content
100%

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

✓ Published0🌍 Public
RRochisman Datta
Last edited Sep 25, 2021
Created on Sep 25, 2021

This example shows a yellow smiley face drawn as an SVG, whose mouth is created with the `arc` helper from d3-shape. Circles render the face and eyes, while a path element uses the arc’s defined radius and angles for the mouth. Built with the React framework, the code uses ES6 template literals for the SVG group’s `transform` attribute to center the composition. All elements are statically defined, with no interactivity or external data source.

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