CS 725 Information Visualization - VI3
This example shows how interactive buttons control two distinct D3.js visualizations on a single page: a scatterplot and a polygon. The scatterplot initially displays data points as circles, and clicking a button triggers a transition that enlarges their radii and applies color based on the data values. A separate button animates the polygon’s shape, position, and fill color, with a circle appearing at the end of the transition. The code uses D3’s `transition.attr` and `style` methods, alongside scale functions (`d3.scale.linear` and `d3.scale.ordinal`), to drive the animations.
AI-generated descriptionChristos Tsolakis
- Just a few lines of code can make your graphs interesting (see scatterplot)
- Very often it happens that transitions work but they are too fast, use the duration parameter wisely.
- When using short duration transitions, use buttons to help users follow the animations
Live at http://bl.ocks.org/ChristosT/f73384946e17e4b1b46a
forked from <a href='http://bl.ocks.org/ChristosT/'>ChristosT</a>'s block: <a href='http://bl.ocks.org/ChristosT/52239ed074878b9a60ca'> CS 725 Information Visualization - VI2</a>