Skip to main content
100%

Framework

✓ Published0🌍 Public
Ttsmithv11
Last edited Apr 19, 2020
Created on Apr 19, 2020

This example demonstrates how to build a simple interactive framework using D3.js by modifying SVG elements in response to user input. It displays a blue rectangle centered within an SVG canvas, and clicking on the rectangle changes its fill color to green. The code uses D3 selections and the `select` and `arc` imports from the d3 module, with the `on("click", ...)` method to attach the event handler. The visualization relies on D3 v5 and renders directly to SVG with dimensions of 960 by 500 pixels.

AI-generated description

Demonstrates fundamental DOM manipulation using D3.js by making a smiley face whose eyebrows move.

MIT Licensed

Similar vizzes