Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

dots

Public visualization

Viewing a saved revision (read-only)

636bfc4c02ba49fda510b6a3be1db5ce

dots

0 stars0🌍 Public
KKhatera Alizada
Last edited Jan 20, 2023
Created on Jan 15, 2023

This example displays ten colored rectangles that can be dragged around an SVG canvas. The shapes are randomly positioned and sized using D3’s `d3.range` and `Math.random()`, with each rectangle filled via the `d3.schemePastel1` color scheme. The interactive drag behavior is implemented with `d3.drag()`, which updates the x and y attributes in the `dragged` event and raises the selected element to the front on drag start.

AI-generated description

Drag circle around.