Multiple jmol graphics seem to interfere...

29 views
Skip to first unread message

Kwankyu Lee

unread,
Nov 7, 2018, 6:49:10 AM11/7/18
to sage-cell
This does not work in sagecell while it works fine in jupyter.

g = arrow((0,0,1), (5,5,5))
show
(g)
h
= arrow((0,0,1), (5,5,5), color=(1,0,0))
show
(h)

I wonder if this is a bug or a feature(inherent defect of sagecell). Any idea?

Andrey Novoseltsev

unread,
Nov 11, 2018, 2:19:38 PM11/11/18
to sage-cell
It is a featured bug... There is only one instance of JSMol that SageMathCell is using, so if you try to show multiple scenes, they conflict in a not quite predictable way. A fix is to use threejs:

show(cube(), viewer="threejs")
show(sphere(), viewer="threejs")

My current viewpoint is that improving JSMol handling is a waste of time as it is tricky and it is likely to be gone sooner or later. Past experience shows that later is more likely, but threejs is available already if you can deal with its own issues (if you can't - please fix them ;-)). I have stopped using JMol/JSMol many years ago even though I like the quality of its pictures when they do work.

Kwankyu Lee

unread,
Nov 11, 2018, 7:23:57 PM11/11/18
to sage-cell


On Monday, November 12, 2018 at 4:19:38 AM UTC+9, Andrey Novoseltsev wrote:
It is a featured bug... There is only one instance of JSMol that SageMathCell is using, so if you try to show multiple scenes, they conflict in a not quite predictable way. A fix is to use threejs:

show(cube(), viewer="threejs")
show(sphere(), viewer="threejs")

Ok. The example was an artificial one. A real problem that I experience is that if you have multiple sagecell instances (with separate input and output elements) in one web page, you have jsmol graphics intefering with each other.  
 
My current viewpoint is that improving JSMol handling is a waste of time as it is tricky and it is likely to be gone sooner or later. Past experience shows that later is more likely, but threejs is available already if you can deal with its own issues (if you can't - please fix them ;-)). I have stopped using JMol/JSMol many years ago even though I like the quality of its pictures when they do work.

I agree. I think we should switch to threejs at a point when threejs in sage is mature enough, even though not perfect...

Thank you for clarifying the situation!

 

Andrey Novoseltsev

unread,
Nov 11, 2018, 7:36:20 PM11/11/18
to sage-cell
On Sunday, 11 November 2018 17:23:57 UTC-7, Kwankyu Lee wrote:
I agree. I think we should switch to threejs at a point when threejs in sage is mature enough, even though not perfect...

That was my plan, but I dislike when code copied between different interfaces behaves substantially differently, which is the case if you switch between Jmol and threejs. Given that it is possible to use threejs now explicitly, I think it is better to do that than alter defaults for SageMathCell compared to "plain Sage".

Samuel Lelièvre

unread,
Nov 30, 2018, 8:16:18 PM11/30/18
to sage-cell


Mon 2018-11-12 01:36:20 UTC+1, Andrey Novoseltsev:
On Sunday, 11 November 2018 17:23:57 UTC-7, Kwankyu Lee wrote:
I agree. I think we should switch to threejs at a point when threejs in sage is mature enough, even though not perfect...

That was my plan, but I dislike when code copied between different interfaces behaves substantially differently, which is the case if you switch between Jmol and threejs. Given that it is possible to use threejs now explicitly, I think it is better to do that than alter defaults for SageMathCell compared to "plain Sage".

For the record: reported again on sage-support:
 

Kwankyu Lee

unread,
Dec 1, 2018, 5:33:48 AM12/1/18
to sage-cell
I now realized that I actually have a fix for this issue. See this PR

Reply all
Reply to author
Forward
0 new messages