D3 Tutorial
Interactions
Edit by Jiayi Xu and Han-Wei Shen, The Ohio State University
D3 Tutorial Interactions Edit by Jiayi Xu and Han-Wei Shen, The - - PowerPoint PPT Presentation
D3 Tutorial Interactions Edit by Jiayi Xu and Han-Wei Shen, The Ohio State University Interactions It is often required to interact with our visualizations, e.g. hovering, zooming, clicking etc., to change the appearance of the visual
Interactions
Edit by Jiayi Xu and Han-Wei Shen, The Ohio State University
zooming, clicking etc., to change the appearance of the visual elements or drill drown information
mouseover etc. are vey common in UI interaction
different colors
bars, we use different colors to highlight bars.
related rect element
we repaint bars in black.
container
the text and circle tag
relative to the specified container (svg)
enabling drag-and-drop interaction on selections
points
register a listener dragged
to circles
coordinates of the circle according to the position of our mouse
drag behavior
let the user focus on a region of interest by restricting the view
also be used with visualizations such as time-series and scatterplots
scatterplot which supports zooming and panning
detail
coordinates of points on the screen
Important!
panning behavior
and max zooming scale factors
(!) and shifting (∆# %&' ∆() of points
automatically for you
d3.event.transform.toString() outputs “translate(7,33) scale(1)”
transform.rescaleX(yScale) can automatically apply current zooming scale (!) and panning shifting (∆# %&' ∆() to the original scales
update the axes manually
behavior
a one- or two-dimensional selected region using a pointing gesture
elements, such as dots in a scatterplot
brushing
become weird
use brushing to select circles
circles are within our selection area to determine whether they are selected
selection area which is an array [[x0, y0], [x1, y1]], where