Scatterplot
Posn. Nodes Relatively on x by attribute0
Posn. Nodes Relatively on y by attribute1
Show x Axis
Show y Axis
Hide Links
Size Nodes Relatively by attribute
Set Target Generation 0
Set Source Generation 0
| |
Import data, construct network, and compute metrics. |
|
Define scales |
|
Define a layout that positions nodes based on the x and y scales. |
|
| |
Draw a circle for each node... |
|
|
Labelling points
It's easy to label points by adding an extra entry to the vis
section:
{
"entries": "le-mis-network.nodes",
"mark": {
"type": "text",
"text": {"field": "name"},
"fill": { "expression": "datum['undirected-betweeness'] > 70 ? 'black' : 'none'"},
"dx": 10,
"x": { "field": "undirected-betweeness", "scale": "x" },
"y": { "field": "degree", "scale": "y" }
}
}
Adding edges
Edges can be added by adding:
{
"entries": "le-mis-network.links",
"layout": "l",
"mark": {
"type": "linkpath",
"start": "source",
"end": "target"
}
}