This examples demonstrates how to use D3's brush component to implement focus + context zooming. Click and drag in the small chart below to pan or zoom. With the abitility to zoom and pan in the Focus view using d3.zoom behavior.
function it(name) { | |
function success() { | |
// Add Postman result | |
if (tests) { | |
tests[name] = true; | |
} | |
// Log to console |
# Editor backup files | |
*.bak | |
*~ |
height: 540 |
A simple freehand drawing application, based on Bostock's Line Drawing gist.
Use your stylus, fingers or mouse to draw. The color of the line can be changed by interacting with the color palette, and the canvas can be cleared by clicking the trash in the upper-right corner of the UI.
The application uses two stacked SVG elements, one for the UI and one for the canvas. This is used to disable drawing when interacting with UI elements.
Unlike Bostock's example, this application maintains a DOM-independent object to store all the drawing's data (just look at the JavaScript console each time you complete a line).
Colors are from Colorbrewer's Dark2 palette.
This illustrates the different layouts that the d3.pack
layout produces when the circles are all of equal size.
license: gpl-3.0 | |
border: no |
height: 960 |
license: gpl-3.0 |
license: gpl-3.0 | |
height: 200 |