Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

cake formation with 2 layers

Public visualization

Viewing a saved revision (read-only)

99b320edfb3f4e35add697369faf63c6

cake formation with 2 layers

0 stars0🌍 Public
Bbhargavinalamothu@gmail.com
Last edited Feb 24, 2025
Created on Feb 24, 2025
Forked from Donut Platter

This example uses D3.js v5 to draw a two-layer cake with decorative elements. The visualization shows a bottom and top cake tier, five candles with flames, a knife, three balloons, and ten randomly placed sprinkles. The code builds the scene by appending SVG shapes directly to the document, using `d3.select()` for DOM manipulation and `selectAll().data().enter()` for iterative creation of repetitive elements like candles and sprinkles, with randomized positioning for the latter.

AI-generated description

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