Skip to content

Instantly share code, notes, and snippets.

@amzoss
amzoss / .block
Created September 4, 2016 20:40 — forked from mbostock/.block
Brushable Network, II
license: gpl-3.0
@amzoss
amzoss / README.md
Last active December 17, 2015 14:09 — forked from mbostock/.block
Network with Google Spreadsheet support

This code extends the original (described below) by generalizing the layout of the graph so that data can be loaded either from JSON or a Google Spreadsheet.

Original description:

This brushable and draggable network supports multiple selections via the SHIFT key. Click and drag the background area to make a rectangular selection (brushing). Once you’ve selected some nodes, drag them around to reposition the network. You might use this technique to hand-tweak a force-directed layout for better appearance, saving the manually-adjusted node positions back to a file.

For greater control, you can hold down the SHIFT key to add to or remove from an existing selection, either by creating a new rectangular selection or clicking on an individual nodes. You can use the OPTION and SPACE keys to modify the rectangular selection while dragging. You can also use the arrow keys to nudge selected nodes.

A further improvement to this example would be to allow ri