Skip to main content
100%

Donut Platter

✓ Published4🌍 Public
Nnagasuryaharsha999@gmail.com
Last edited Feb 23, 2025
Created on Feb 23, 2025

This example renders a decorative donut on a plate using D3.js. The visualization layers concentric SVG circles to form a gray plate, a brown donut base, and a matching hole, then adds a pink frosting arc via a custom path. A loop generates 50 randomly positioned and rotated colored rectangles as sprinkles, while eight white lines with rounded caps represent a drizzle pattern. The code uses D3’s `select` and `append` functions to build the SVG scene, with manual coordinate calculations for placement.

AI-generated description

Demonstrates fundamental DOM manipulation using D3.js by making a smiley face whose eyebrows move.

MIT Licensed

Similar vizzes