Open tomshanley opened 6 years ago
Proposal to create a function on the sankey object that updates an existing graph with new link values. It won't create new links/nodes (ie assume that is only updating nodes/links that already exist). Values could be set to 0, which would effectively hide the node or link, and the user could decide to filter those out afterwards.
The function would take a graph which was generated from sankey, along with an array of new links (using the same ID). Any new IDs are ignored.
If values are increasing, it would work best if there is adequate padding in place from the first generated sankey, but this can be trialled by the user, on nodePaddingRatio
The returned graph.nodes and .links can then be joined on the existing elements and updated/transitioned
Currently, if a graph (similar nodes, links) is updated with new values, it may (small probability) result in a sankey where the nodes are in different positions, which makes it harder for the user to compare changes across different versions. Also, it would involve calling the sankey function again, which would involve a lot of unecessary calculations, which increases the time between updates.