Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

click 的选中效果动画

Public visualization

Viewing a saved revision (read-only)

232e9f6bbdcb464caf17e33b332ee65a

click 的选中效果动画

0 stars1🌍 Public
HHillKinsh
Last edited Dec 27, 2020
Created on Dec 21, 2020

This example demonstrates the animated selection effect when clicking on circles in an SVG scene. Fruits are rendered as colored and sized circles that change appearance based on their type, and clicking a circle highlights it with a black stroke. The code uses D3 v5’s `select`, `range`, and `scaleOrdinal` APIs, along with the custom `fruitBowl` component, which handles enter, update, and exit transitions via the `transition()` method over a 1000-millisecond duration. Data is generated randomly in JavaScript, while the underlying bar chart uses population data from `data.csv`.

AI-generated description

A 动画一 click 的选中效果of d3js. HTML page demonstrating use of CSS and JavaScript