iVis-at-Bilkent / newt

A web application to visualize and edit pathway models
http://newteditor.org
GNU Lesser General Public License v3.0
53 stars 27 forks source link

Spinner not working consistently for large graphs #688

Closed hasanbalci closed 2 months ago

hasanbalci commented 2 years ago

We use spinner to show the process of both file loading and layout. Ideally, spinner starts when we start loading a file or applying layout and it stops when file has loaded or layout has finished. However, start and stop times of the spinner are currently not correct especially for the large graphs.

For example, while we are loading the below file (please delete .txt before loading), spinner works correctly. However, when we click on the layout button, spinner starts very late and stops at correct time.

central_plant_metabolism_doubled.nwt.txt

Another example is while trying to load a large sbml file from URL. When we try to open the following link, spinner stops after some time, before map appears in the canvas.

https://web.newteditor.org/?URL=https://www.ebi.ac.uk/biomodels/model/download/MODEL1108160000.2?filename=MODEL1108160000_url.xml&inferNestingOnLoad=true&applyLayoutOnURL=true

hasanbalci commented 2 years ago

I think this is ok now, so I'm closing the issue.

ugurdogrusoz commented 2 years ago

Can we perhaps put a notice (below the spinner?) that says something like "This might take a while. Please wait..." in case it takes longer than 30 seconds?

SelbiEreshova commented 2 years ago

The spinner starts immediately when loading an SBML file to Newt through URL. When loading the file, the file size is checked. If the size is more than 250KB, then the text "Take a sip of your coffee while you wait" is shown too. Otherwise, only the spinner is shown.

ugurdogrusoz commented 2 years ago

Thanks @SelbiEreshova seems to work fine. Please:

hasanbalci commented 2 years ago

Probably after these changes, now when there is no graph element and we click on the layout button, spinner is started but never stopped.

umut-er commented 2 months ago

Probably after these changes, now when there is no graph element and we click on the layout button, spinner is started but never stopped.

@hasanbalci I pushed a change to address this. You can check this on the internal server.

hasanbalci commented 2 months ago

@umut-er Can you try moving var cy = chiseInstance.getCy(); above if statement? Otherwise, if statement may not check the correct cy instance. Also, please apply same fix for perform-static-layout below.

umut-er commented 2 months ago

Should be good to go.

hasanbalci commented 2 months ago

@umut-er I think you submitted the changes to your local repo, not here.

umut-er commented 2 months ago

Yes sorry it is here now: b09f105148bd8b08be2bda3e74afba6e3e3c70df.