checking if template.html file is available in local system for pyvis to use..
From relationships.csv
file, we create latest graph html file for maximum year. We create this file for purpose that would be clear in next step.
Any one could see this generated html file with interactive graph. This is not efficient. Also voila forbids loading the file..
The file created earlier using pyvis has best positioned nodes. We extract this for our custom node positions in next step, where for every year we want to see the graph. If we do not hard code best node position, for every year, pyvis decides its own positions, which make tracking the yearly changes very difficult visually.
To achieve this, we use hints from here to extract and dump the positions, and read that file directly in our next step.
function download(content, fileName, contentType) {
var a = document.createElement("a");
var file = new Blob([content], {type: contentType});
a.href = URL.createObjectURL(file);
a.download = fileName;
a.click();
}
network.storePositions();
download(JSON.stringify(data.nodes.get()), 'positions.txt', 'text/plain');
Now that we have best positions from file for nodes, for every year, for matching nodes, we create graph at those positions only as below. Sometimes, output does not show up here, but it will in voila server.
The change from previous year and shown year, would be displayed in yellow edges, so it would be clear what changed every year. This is one important visual hint to get to know what delta happened in an year.