Skip to main content
Public

Share visualization

Loading preview…

Fork of Practic 06 | Bowl of Fruit

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Fork of Practic 06 | Bowl of Fruit

1
Hhimanshucse2012
Last edited Nov 6, 2021
Created on Nov 6, 2021

This example demonstrates a dynamic fruit bowl visualization using D3.js where five apples are initially rendered as circles, one is removed, and another transforms into a lemon over time. The code uses D3's `select`, `scaleOrdinal` for color and radius scales, and `range` to generate the fruit array. It manipulates the SVG document directly by appending, updating, and removing circle elements through the `render` function to reflect changes in the data array. The visual comparison between the red apples and yellow lemon is created using a categorical color scale.

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