Skip to main content
100%

Drag + Zoom + Slider

✓ Published0🌍 Public
RRicCheng
Last edited Sep 21, 2016
Created on Sep 21, 2016

This example shows a scatterplot of dots from a TSV file, where users can both drag individual circles and zoom the entire view pane. An HTML5 range slider below the chart controls the zoom level, updating the SVG group’s transform scale in real time. Implemented with D3.js v3, it combines `d3.behavior.zoom` for pan/zoom interactions, `d3.behavior.drag` for moving circles, and a slider event handler that calls `zoom.scale(...).event(svg)` to drive the zoom behavior programmatically.

AI-generated description

An extension of this example to include an HTML5 slider in answer to this question.

forked from <a href='http://bl.ocks.org/bollwyvl/'>bollwyvl</a>'s block: <a href='http://bl.ocks.org/bollwyvl/871b7c781b92fd0044f5'>Drag + Zoom + Slider</a>

mit Licensed

Similar vizzes