Viewing a saved revision (read-only)
15171f820482471c89a9f72c61fcb73c
Fork of Let's make a boba tea
This example displays a stylized boba tea cup with a green lid, a red straw, black tapioca pearls, and semi-transparent ice cubes, all rendered as static SVG shapes. The code builds the visualization by appending D3-selected SVG elements—rectangles, ellipses, and circles—positioned relative to a centered group. It uses d3.select, .append, and .attr to set coordinates and styles, with random placement for the boba and ice cubes to distribute them within the cup. The visualization demonstrates basic SVG drawing techniques with D3 v5, relying on hardcoded dimensions and no external data source.
AI-generated descriptionDemonstrates fundamental DOM manipulation using D3.js by making a smiley face whose eyebrows move.