Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

The General Update Pattern(Enter Update Exit Merge[enter+update])

Public visualization

Viewing a saved revision (read-only)

dfb72ca98fe4476a94bf83f156fb4f68

The General Update Pattern(Enter Update Exit Merge[enter+update])

0 stars1🌍 Public
Lluojiandan
Last edited Apr 18, 2020
Created on Apr 18, 2020
Forked from HTML Starter

This example demonstrates the general update pattern with mixed enter and update selections using D3.js v5 and SVG animations. It shows a row of apples that transition into lemons and disappear over time, with new circles smoothly merging into the existing selection. The code uses `selection.enter().append()`, `selection.merge()`, `selection.exit()`, and `transition.attr()` to animate radius and color changes. Data is generated with `d3.range` and mapped to fruit types, while `d3.scaleOrdinal` maps types to colors and sizes.

AI-generated description

使用D3.JS创建一个笑脸