Representing time with node position
Rather than positioning nodes with a force-based layout, let's position them based on the value of two of their attributes - their overall number of followers, and number of followers on #EuroVis2019
.
As an alternative to positioning nodes based on their attributes, we could instead position them using a force-based layout, and represent the attributes using a glyph.
| |
We import data for a different file... |
|
| |
...which has a different name for the node id column. |
|
| |
We apply a calculate transform to convert the timestamp of each tweet from a string to a Date() object. |
|
| |
We define a time scale (the domain is in unix time) |
|
We define a cartesian layout, which distributes nodes along the x-axis using the time scale. |
|
And apply a beeswarm transform to reposition nodes to avoid overlaps. The gravityY is 0, as we aren't trying to control the y-coordinates. |
|
| |
We render nodes and links as for the force-directed example. |
|
|