LePa-YU / Visualizer

A web based tool to represent the AIR model of LePa project
Creative Commons Zero v1.0 Universal
0 stars 0 forks source link

Save node position after stablization event to increase the load speed #22

Open ElmiraOn opened 1 year ago

ElmiraOn commented 1 year ago

goal: After the network is stabilized, update the node and edge list with their current position to speed up the load process

ElmiraOn commented 1 year ago

the node position can be saved in the dataset after an event (currently on "stabilized" event) using storePosition() and reflected on the dataset, however, switching between views/ dataset, results in reading the HTML file from top to bottom making the whole process of the saving positions to increase stabilization meaningless.

one remedy would be to have a single HTML file where the whole network processing such as the addition of the nodes and relationship is performed there (instead of in Python and NetworkX ) so the switch in the dataset does not create the HTML file but invoke one that already exists. However, that means we won't be able to use network X.

Edit: another solution would be to make each html/js file into singletons so there is only one instance exist (theoretically works but not so sure about a real-life example)

the third solution would be to save the x and y positions in the same CSV file, download, and re-upload/ update the dataset origins. Then update the addition of nodes and edges in a way that when x and y fields exist, the program would not go through the random positioning and stabilization (more feasible and probably easier but might take some time and restructuring)

P.S. There is JSNetworkX where NetworkX is being ported into netwrokX however the Python library is only ported 24% and is not maintained anymore (something to keep in mind for future versions)