Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

A Code Baked Layered Cake

Public visualization

A Code Baked Layered Cake

0 stars0🌍 Public
Ssanthoshdachepally333@gmail.com
Last edited Feb 23, 2025
Created on Feb 23, 2025

This example uses D3.js to draw a layered birthday cake in an SVG canvas. It demonstrates fundamental DOM manipulation by appending SVG shapes such as rectangles, ellipses, paths, and circles to create the cake base, icing, cherries, and candles. The cake is constructed from three distinct layers, each with a different height and dripping icing, with decorative elements added through custom functions that calculate positions. The code directly uses `d3.select` and `.append` methods to build the static illustration without any data-driven interaction.

AI-generated description

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

Comments

Sign in to join the discussion.

MIT Licensed