New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make Three.js work offline redux #22670
Comments
This comment has been minimized.
This comment has been minimized.
comment:2
Some more thoughts: we should avoid code duplication as much as feasible here so that we don't have to chase all places where the version of the threejs is used when we want to change it. Perhaps something like this will work:
This way when upgrading threejs package one has also to bump version number in the generic method (and perhaps it should be mentioned in |
Branch: u/paulmasson/22670 |
comment:4
Andrey, please have a look at this. I'm using the internal There is currently a failing doctest for something called "BackendDoctest". I'll fix that once I know we're on the right track. New commits:
|
Commit: |
comment:5
Automatic version matching is great, thanks for figuring it out! It still seems to me that in scripts = backend.threejs_scripts(options['online']) with the base backend class handling |
Reviewer: Andrey Novoseltsev |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:8
Hopefully this is closer to what you had in mind. I've included an error test in the base method, but this causes a doctest in A workaround is to have the base method return an empty string when |
Changed branch from u/paulmasson/22670 to u/novoselt/22670 |
Work Issues: option handling |
comment:10
Tweaked a bit backend code. Regarding option ignoring - that's because you ignore them instead of doing New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:12
Improved option handing, but now the error is
which makes me wonder why these options are sent to the output at all?.. |
comment:13
OK, looking at the template I see how they are used, but I am not sure what's the correct way to proceed: fix representation of texture option, drop if from threejs output, or send only options which are known to be used in JavaScript? |
comment:14
I don't see how invoking All the other changes look good. And FYI |
comment:15
FYI the |
comment:16
|
comment:17
Replying to @paulmasson:
But you are using some of the options that are "standard" like |
comment:18
Replying to @novoselt:
If it gets things to work then good, but I'm not yet seeing the standard means. Sorry about the |
Changed work issues from option handling to none |
comment:24
Regarding CDN releases - in principle the version matters, although the problems are presumably more frequent when using old instead of new. So we may try to omit the version and use the master branch of threejs. |
comment:25
Replying to @novoselt:
With Three.js the version number can matter greatly, unfortunately. Mr. Doob has made radical changes in the past that render the code not backward compatible. That doesn't happen too often but it will be an ongoing concern. |
comment:26
OK, possible solutions:
|
comment:27
Options 2,3 and 4 rely on theejs to be installed locally, a distro may very decide to make that optional (if at all - properly packaging this kind of stuff is a pain) and to rely on online availability by default. Alternative to (1) declare a variable in |
comment:28
Replying to @novoselt:
Why is this a bad thing to do?
Only the IPython notebook does this, to provide a fallback requested by Eric. How would you do this more properly?
The server directory to Three.js files doesn't exist in the current version of the notebook. A pull request was merged to provide that and the method will be altered when a newer version of the notebook is available. Couple minor things:
|
comment:29
Andrey, scenes render for all three backends and both on/offline, but you've introduced a problem with IPython offline. The closing script tags need to be written as |
comment:30
Replying to @kiwifb:
Our three.js package contrains only two files that we use instead of the whole repository, so it does not seem a big deal to me to keep it installed as part of Sage. In any case I think that for now (i.e. this ticket) we should keep it as is and modify to something else once (and if) it becomes a problem. |
comment:31
For sage on its own, in its corner playing all alone, by itself, there is no problem. There is never a problem, you are self contained. I don't suggest you change the status standard package for threejs either. I am encouraging you to think of a bigger picture regarding package management when you are not on your little island. It will be a problem for anyone doing sage-on-distro/conda as soon as it is merged. I probably should publicise this ticket on the |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:33
Replying to @paulmasson:
Because backends are supposed to be isolated! It was really, really painful to have a lot of places spread over Sage that were doing different things depending on the way it was launched and I would prefer none of them coming back ;-)
No how, it is just a bit unfortunate that this problem arises in the first place.
Great!
Fixed.
That's why I put this code right next to template filling, but different name works just as well, done. |
comment:34
Replying to @kiwifb:
I am not trying to stay put on my island and I am all for isolation etc. But if use of |
comment:35
Replying to @novoselt:
Yes, you are right there should be a higher level policy on this. |
comment:36
Documentation won't build. Looks like some extra whitespace somewhere:
|
Changed branch from u/novoselt/22670 to u/paulmasson/22670 |
comment:38
Figured out it was the Setting to positive review unless someone else wants to test it further. New commits:
|
Changed reviewer from Andrey Novoseltsev to Andrey Novoseltsev, Paul Masson |
Changed author from Paul Masson to Paul Masson, Andrey Novoseltsev |
comment:39
I suspect it might have been fixed if you made the string raw, i.e., use |
Changed branch from u/paulmasson/22670 to |
Changed commit from |
comment:41
See #25665 for a follow-up |
The Three.js scripts used by various backends for offline viewing should be generated by methods in the backends, not in
plot3d/base.pyx
.Continuation of discussion after #22488 was closed.
CC: @novoselt @egourgoulhon
Component: graphics
Author: Paul Masson, Andrey Novoseltsev
Branch:
668eeee
Reviewer: Andrey Novoseltsev, Paul Masson
Issue created by migration from https://trac.sagemath.org/ticket/22670
The text was updated successfully, but these errors were encountered: