Skip to main content
100%

JS Bin

✓ Published0🌍 Public
WWillNetsky
Last edited May 18, 2016
Created on May 18, 2016

This example uses D3 to generate a 40-by-40 grid of SVG rectangles, each initially filled red. The visualization responds to mouseover events, changing a hovered rectangle’s fill to green via the `style` method. The grid is positioned using an ordinal scale with `rangeBands` across an 800-pixel square. The code defines an `onClick` function that toggles a rectangle’s color between red and green, though this handler is not attached to any event in the visible code.

AI-generated description

Similar vizzes