Skip to main content

Scatterplots

In this view, each entry of the adjacency matrix is a scatterplot:

  • x-position encodes the weight
  • y-position encoded the reverse-weight
  • color encodes time

This means that a vertical or horizontal band of points means that for the corresponding pair of people, one changed their perception of how close they were to the other, but the other person's perception was unchanged.


{
"x": 300,
"y": 300,

"width": 1000,
"height": 1000,

"data": [
{
"name": "data",
"url": "/data/fraternity_network.json"
}
],

"networks": [
{
"name": "network",
"links": "data.links",
"nodes": "data.nodes",
"directed": true,
"source_node": [ "id", "source" ],
"target_node": [ "id", "target" ]
}
],


"orderings": [
{
"name": "nodeOrder",
"data": "network.nodes",
"orderBy": [{"field": "rank"}],
"allowTies": false
}
],

"tables": [
{
"name": "adjacencyMatrix",
"data": "network.links",
"rowOrder": {
"order": "nodeOrder",
"field": "source" //.id is implicit
},
"colOrder": {
"order": "nodeOrder",
"field": "target" // .id is implicit
}
}
],

"scales": [
{
"name": "color",
"type": "linear",
"scheme": "blues", // or redblue
"domain": [0, 14]
},


],


"vis": [
{
"table": "adjacencyMatrix",

"rowLabels": { "field": "source.id", "align": "right", "dx": -10 },
"colLabels": { "field": "target.id", "dx": 20 },

"rowLines": {"stroke": "black"},
"colLines": {"stroke": "black"},

"scales": [
{
"name": "y",
"type": "linear",
"domain": [0, 16]
"rangeExpressions": ["0","bounds.height"]
},
{
"name": "y2",
"type": "linear",
"domain": [0, 16]
"rangeExpressions": ["bounds.height", "0"]
},
{
"name": "x",
"type": "linear",
"domain": [0, 16]
"rangeExpressions": ["0","bounds.width"]
},
],






"vis": [
{
"entries": "entry.data.weights",

"mark": {
"type": "circle", // should be able to change to lie

"area": 20,

"x": {"field": "reverse_weight", "scale": "x"},
"y": {"field": "weight", "scale": "y2"},

"fill": {"field": "time", "scale": "color"}
"tooltip": {"expression": "datum.weight + ', ' + datum.reverse_weight"}
}
},
}

]
}
]
}