Scatterplot of weights
Within each cell of the adjacency matrix, we can use the x-coordinate to encode time, and the y-coordinate to encode the friendship rating. This can be drawn as a scatterplot, line chart or area plot, with only very minor changes tot he specification.
Scatterplot
In the specification for a scatterplot glyph, the mark
is:
"mark": {
"type": "circle",
"area": 20,
"x": {"field": "time", "scale": "x"},
"y": {"field": "weight", "scale": "y2"},
"fill": "black"
}
Line Chart glyphs
A line chart can be drawn by changing the mark
block to:
"mark": {
"type": "line",
"x": {"field": "time", "scale": "x"},
"y": {"field": "weight", "scale": "y2"},
"stroke": "black"
}
Area plot glyphs
An area plot can be drawn by changing the mark
block to:
"mark": {
"type": "area",
"x": {"field": "time", "scale": "x"},
"y": {"field": "weight", "scale": "y2"},
"y2": {"value": 0, "scale": "y2"},
"fill": "grey",
"stroke": "black"
}
Full specification
The complete specification for the scatterplot example is:
|