Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Donut Platter

Public visualization

Viewing a saved revision (read-only)

6389c05aee7d4a75b1a3351788087959

Donut Platter

0 stars4🌍 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.