Closed martingraham closed 6 years ago
Right, the errors were not re-thrown, now they are https://github.com/arose/ngl/commit/4ececc67c57dea8a6d44297afad219da3fb35386. Can you try the ts2 branch?
Thanks Alex, I'll give it a go tomorrow (uk time)
Thanks, using the ts2 branch I can catch file errors now, thanks, but 2 caveats (I guess since it's labelled as 2.0.0 a fair bit is changing from the version I was using)
I needed to change one of the lines in package.json so it worked on windows, the mkdir command looked like it was expecting the mac version:
"ts": "tsc && cp src/shader/.vert src/shader/.frag build/js/src/shader/ && mkdir \"build/js/src/shader/chunk\" && cp src/shader/chunk/*.glsl build/js/src/shader/chunk/ && cp package.json build/js/",
I suppose a pure npm solution using one of the various makedir modules could be attempted
Is there a way to just use the old cylinder-style representations to represent my cross-links or tell the dashing to turn off for the distance reps?
1) should be fixed by 7560902f398c61c0f0be06b86a3dd3000772857a, please try
2) Added a parameter useCylinder
to the distance representation (0036603667bff81e6d465274ca3eff1137f3254d), please try. Could you please make an example with a number of links on codepen? I would like to include it in the example scripts.
Had to switch to using 'copyfiles' as 'copy' kept chucking npm errors on my windows machine, but it was a straight swap - changed copy to copyfiles in the ts task.
Superb! That worked straight off. I'll look at adding a codepen, just need to make it so I'm not adding all my code as well, just set up a protein with some preset links
Thanks a lot, Martin
Alex, have a look at this, see what you think --> https://codepen.io/martingraham/pen/RjqXmQ
This is great! Do you want to make a PR? I.e. put it into examples/scripts/interactive/crosslink.js
. Otherwise I can copy your code myself.
Using our app which includes NGL, we let users type in pdb codes and sometimes these are just plain wrong / don't exist - on these occasions we get errors in the console like below, as NetworkStreamer throws an error:
With this being asynchronous I can't wrap the .loadfile in a try/catch to get the error, and the promise catch clause isn't reached and .then isn't either
So how do I get some sort of indication back from loadfile that things have failed?