Closed mef closed 4 years ago
Design notes - work in progress.
graphology
may be used to manage the graph data.
When receiving a tweet from the API:
mergeNode
addEdge
, or updateEdgeAttribute
to increment weight - depending on whether the edge already exists (reference).The subgraph to be sent to the client must be limited to the n top nodes (perhaps using their HITS authority measure). This subgraph does not need to be maintained in real time, perhaps one update per minute is relevant.
Todo: validate that HITS can be executed with a decent performance on the full graph. Alternative: use node degree...
Update 2020-01-07: top n nodes are determined using degree measure. HITS is not needed, since the graph is undirected.
Nodes must have a last update timestamp attribute, to be updated each time mergeNode
is called. This attribute is to be used in order to clear records older than 24h. Good news is that dropNode
also removes "all its attached edges from the graph", so it won't be necessary to iterate to the edges, in addition to the nodes.
Update 2020-01-07: last update timestamp has been removed from node attributes. Cleanup is done based on the timestamp stored in the tweets array, this allows to decrement edges weights in addition to updating node counts.
Remains to do for the graph display:
filterGraph
function (c.f. just-debounce)console.time
(should be only active for perf debug logging).~<button onclick="document.querySelector('#wikiArticle').mozRequestFullScreen()">Toggle</button>
implemented in v4.0.0
Experiment with the implementation of the following solution: