Ejercicio 1.2 Let’s draw a face in with D3.js!
✓ Published2🌍 Public
This example draws a simple cartoon face in an SVG canvas using D3.js v5. It shows a yellow circle for the head, two black ellipses for eyes, and a black rectangle for the mouth. The code uses D3 selections and the `.attr()` method to position these shapes, calculating coordinates from the SVG’s width and height attributes. The face is centered, with eye spacing and offsets hardcoded for a symmetric layout. No data is loaded; all elements are created programmatically. Styles are applied via CSS for stroke properties.
AI-generated descriptionMIT Licensed