Reorderable Adjacency Matrix
This is the Vega Reorderable Matrix Example
Vega example
NetPanorama example
Vega specification
Rendering the background for empty table cells requires creating a new dataset (cross).
Rendering the upper- and lower- halves of the matrix requires separate marks.
The table uses a scale to set the x- and y- coordinates; there's no way to switch to using matrix seriation methods.
The signal flow needed to re-order in response to dragging is complex, and difficult to either read or write.
| |
Define various signals After a drag to re-order, src will be set to the corresponding item, and dest to its new position. | |
| |
Load node data and do some transforms?? | |
Load edge data | |
Creat new dataset used to render background cells. | |
| |
| |
Render background for empty table cells (light grey, or darker gray for row/column that are being re-ordered) | |
Render half of the matrix | |
Render other half of the matrix | |
Label the columns (with blue text for the column being reordered) | |
Label the rows (with blue text for the row being reordered) | |
|
NetPanorama specification
NetPanorama has more limited support for interactions: it doesn't allow matching an arbitrary expression against an event stream. On the other hand, implementation of those interactions that it does support is simpler than it would be using Vega.
| |
Import data and construct network, and cluster nodes. | |
...and assemble into a network. | |
Create two color scales. | |
Order nodes based on the cluster id. | |
Construct a table. | |
Draw contents of adjacency matrix,a nd label the rows and columns. | |
"rowLines": { "stroke": "white" }, "colLines": { "stroke": "white" } | |
"condition": { "test": "datum.size < 1", "value": "#f5f5f5" }, | |