Open dnwerner opened 3 years ago
I believe this is something that should be handled in JSROOT
's side, so I'm adding @linev to the issue so he knows about your suggestion! :slightly_smiling_face:
Probably I understand source of the problem.
Seems to be, inside WebView
JSROOT tries to load content of complete ROOT file.
May be WebView does not support partial requests.
@AlbertoPdRF, can you point me place in the code where access to ROOT file is provided?
With normal HTTP progress bar appears and JavaScript VM in browser uses moderate amount of memory (~10MB)
https://jsroot.gsi.de/latest/?file=https://jsroot.gsi.de/files/tmp/large.root&item=ntuple;133/px
I'm not entirely sure where to point you. Do you mean this line? Or this function?
The first is when I think that the file is actually being read, but I don't know if it's loaded in memory or something before. The second is the function VS Code calls with a file uri for our extension to return a new CustomDocument for that resource, but in our case everything that should happen at this point is that the uri gets saved for later usage.
Yes, this is exactly I was asking for.
And most probably here partial reading is not works. All kinds of such interfaces ignores "Ranges" settings in requests.
The only solution would be: https://code.visualstudio.com/api/extension-guides/webview#scripts-and-message-passing
I can add support for arbitrary I/O proxy to JSROOT.
Once it is there, we could try to use it inside WebView
If you think that could work, I'm down for it!
@AlbertoPdRF
I trying to use your extension from local disk, but somehow fail. That exactly I should do to get it running - I want to test changes concerning large files reading
From the base folder of the extension, in a terminal:
yarn
code .
Once VS Code opens:
F5
I believe it should be enough with that, let me know if you have any problems!
Now I got it! I create PR - only to show code: https://github.com/AlbertoPdRF/root-file-viewer/pull/20
Can you check how node modules can be used inside?
Finally PR #20 is working with large files. Also images can be stored directly. One also can enable back 'tabs' layout - JSROOT master supports it now
Is there any progress on the issue? On slow internet connections some files containing ~150 histograms (mixed TH1 and TH2, file size: 60 MB) start to load, but simply stop after a while (the loading indicator just vanished and nothing happens anymore). Are there internal timeouts interrupting the loading progress?
Hey @dnwerner, sorry for the very late reply, I was busy finalizing my PhD and other stuff.
Sadly, there has never been a reply by the VS Code guys regarding the issue blocking #20. I will try to look for a workaround to land it, as it's been way too long now.
Hey @AlbertoPdRF,
no problem! Thanks for the reply and good luck with your PhD! :) I currently work around the issue by manually copying the files I want to view onto my machine and accessing them locally (not ideal, but no deal breaker).
If you find the time, the larger problem for our team currently seems to be #3 (bright text on white tabs).
It would be very helpful to show a progress indicator while loading large trees, because sometimes loading apparently stalls and loading of large trees can take quite a while.