🌍 Public
Viewing a saved revision (read-only)
ce3d404cbd274d26af1bd41e2a51a658
Menu_NH_2
This example shows a dropdown menu with six pet options—dog, cat, hamster, parrot, spider, and goldfish—where changing the selection updates the application state, though no visible output reflects the current choice. The visualization is built with D3 v7, using a unidirectional data flow where a `viz` function renders the menu and a `setState` callback updates the state and triggers re-rendering. The `menu` module uses D3’s `.join()` to create the `select` and `option` elements, binding the change event to `onChange`, while the `index.js` orchestrates the state management and rendering cycle.
AI-generated descriptionA circle that follows the mouse using unidirectional data flow.