Re: [sage-support] plot3d doesn't work in jupyterlab / jupyter notebook

2018-11-19 Thread Kolen Cheung


Thanks all for the comments. In the end I choose this temporary fix 
plot3d(sin(pi 
* sqrt(x**2 + y**2)) / sqrt(x**2 + y**2), (x, -5, 5), (y, -5, 5), 
viewer='threejs', online=True). I prefer to stick to jupyterlab hub and 
using conda to manage it so I didn’t try symlink those from sage in the 
jupyterlab environment.

Regarding the three.js shipped by Arch, may be it didn’t work. But it isn’t 
the original of the problem I’m experiencing since in the browser’s console 
it clearly indicates the three.js cannot be found. I tried to install 
three.js the “jupyter way”, i.e. jupyter labextension install 
jupyter-threejs, but it didn’t work for both jupyterlab and jupyter 
notebook.
​

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] plot3d doesn't work in jupyterlab / jupyter notebook

2018-11-19 Thread slelievre
Mon 2018-11-19 05:50:09 UTC+1, Antonio Rojas:
>
> The three.js version shipped by Arch is too new and not
> supported by Sage. Either use jsmol (which is still the default),
> or use the online version of three.js (viewer='threejs', online=True)
> (with sagemath 8.4-4, in previous versions the online version
> doesn't work either)

See Sage Trac ticket 26718 for upgrading to the latest version of three.js:

https://trac.sagemath.org/ticket/26718

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] plot3d doesn't work in jupyterlab / jupyter notebook

2018-11-18 Thread Antonio Rojas

El domingo, 18 de noviembre de 2018, 4:24:58 (UTC+1), Kolen Cheung escribió:
>
> Currently it's like this: on an ArchLinux machine, install sage through 
> pacman, and install the sagemath kernel to my jupyterlab hub. And then 
> through the jupyterlab-hub I remote it and use the sagemath kernel and 
> typed the above commands.
>
> I'm guessing it requires some widgets to be installed in jupyter for them 
> to work. Since I'm not using the Sage notebook interface but a 
> Jupyterlab-hub instance that has the sagemath kernel installed.
>
> ​
>>>
>>
The three.js version shipped by Arch is too new and not supported by Sage. 
Either use jsmol (which is still the default), or use the online version of 
three.js (viewer='threejs', online=True) (with sagemath 8.4-4, in previous 
versions the online version doesn't work either)

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] plot3d doesn't work in jupyterlab / jupyter notebook

2018-11-18 Thread Enrique Artal
If I am not wrong it works from a terminal and also if one uses either sage 
-m jupyter or sage -n jupyterlab. 
It is possible to use it directly from jupyter or jupyter lab if the 
sagemath kernel is availabe to jupyter, e.g. at 
/usr/local/share/jupyter/kernels or .local/share/jupyter/kernels, and the 
nbextensions (jsmol,mathjax threejs) linked should not interfere your 
jupyter installation.. 
It may be more complicated using jupyterhub; at least for threejs, if I am 
not wrong something must be changed in order to look for the non-found 
files in external places since jupyterhub is not able to find them locally. 
At some point I was able to use it changing some sage files but I do not 
know how to do it properly.

El lunes, 19 de noviembre de 2018, 3:38:49 (UTC+1), Kolen Cheung escribió:
>
> I tried to install threejs by jupyter labextension install jupyter-threejs 
> but it still doesn’t work. I tried on both jupyter and jupyterlab. I didn’t 
> tried symlinking the directories you mentioned though, because I don’t want 
> to mess up the virtual environments created by conda (my jupyterlab 
> environment is created using conda.)
> ​
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] plot3d doesn't work in jupyterlab / jupyter notebook

2018-11-18 Thread Enrique Artal
If I am not wrong it works from a terminal and also if one uses either sage 
-m jupyter or sage -n jupyterlab. 
It is possible to use it directly from jupyter or jupyter lab if the 
sagemath kernel is availabe to jupyter, e.g. at 
/usr/local/share/jupyter/kernels or .local/share/jupyter/kernels, and the 
nbextensions (jsmol,mathjax threejs) linked should not interfere your 
jupyter installation.. 
It may be more complicated using jupyterhub; at least for threejs, if I am 
not wrong something must be changed in order to look for the non-found 
files in external places since jupyterhub is not able to find them locally. 
At some point I was able to use it changing some sage files but I do not 
know how to do it properly.

El lunes, 19 de noviembre de 2018, 3:38:49 (UTC+1), Kolen Cheung escribió:
>
> I tried to install threejs by jupyter labextension install jupyter-threejs 
> but it still doesn’t work. I tried on both jupyter and jupyterlab. I didn’t 
> tried symlinking the directories you mentioned though, because I don’t want 
> to mess up the virtual environments created by conda (my jupyterlab 
> environment is created using conda.)
> ​
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] plot3d doesn't work in jupyterlab / jupyter notebook

2018-11-18 Thread Kolen Cheung


I tried to install threejs by jupyter labextension install jupyter-threejs 
but it still doesn’t work. I tried on both jupyter and jupyterlab. I didn’t 
tried symlinking the directories you mentioned though, because I don’t want 
to mess up the virtual environments created by conda (my jupyterlab 
environment is created using conda.)
​

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] plot3d doesn't work in jupyterlab / jupyter notebook

2018-11-18 Thread Nils Bruin
It depends a little bit on how you install the sage kernel into your 
jupyter notebook server, but chances are you have to do some extra work to 
install some notebook extensions.

In the sage install, in "/local/share" there are 3 subdirs 
"jsmol, "mathjax", "threejs". These need to be findable as "nbextensions" 
by your jupyter. Having them symlinked in, say, 
/usr/local/share/jupyter/nbextensions should do the trick [if your sage 
kernel lives in .../kernels/sagemath , you would probably want to symlink 
these extensions from .../nbextensions ] 

On Sunday, November 18, 2018 at 2:25:43 PM UTC-8, Kolen Cheung wrote:
>
> sage: y = var('y')
> sage: plot3d(x * y, (x, -1, 1), (y, -1, 1), viewer='threejs')
> Launched html viewer for Graphics3d Object
>
> I didn’t see anything since I’m remote ssh. I tried both ssh -X and ssh -Y 
> but they doesn’t work.
>
> I don’t have a local machine that has a working sage yet. So can’t test 
> that.
>
> Thanks.
> ​
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] plot3d doesn't work in jupyterlab / jupyter notebook

2018-11-18 Thread Kolen Cheung


sage: y = var('y')
sage: plot3d(x * y, (x, -1, 1), (y, -1, 1), viewer='threejs')
Launched html viewer for Graphics3d Object

I didn’t see anything since I’m remote ssh. I tried both ssh -X and ssh -Y 
but they doesn’t work.

I don’t have a local machine that has a working sage yet. So can’t test 
that.

Thanks.
​

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] plot3d doesn't work in jupyterlab / jupyter notebook

2018-11-17 Thread Kolen Cheung
I have the command line tool. I use `brew cask install sage` and it finishes 
download without proceeding. It is possible the formula in caskroom need to be 
updated though.

But the problem is that I can't get it work even on the Linux installation 
where everything else' fine so far, except plot3d.

Regards,
Kolen
On Nov 17, 2018, 10:34 PM -0800, John H Palmieri , 
wrote:
>
>
> On Saturday, November 17, 2018 at 7:24:58 PM UTC-8, Kolen Cheung wrote:
> > I couldn't install sage on macOS Mojave, I'm guessing it isn't compatible 
> > with Mojave yet.
>
> My message said that I had installed it on OS X 10.14.1, which is Mojave. You 
> need to have Xcode installed with the command line tools, or at least the 
> command line tools. Try searching the google group sage-devel for information 
> about installing with Mojave.
>
> >
> > Currently it's like this: on an ArchLinux machine, install sage through 
> > pacman, and install the sagemath kernel to my jupyterlab hub. And then 
> > through the jupyterlab-hub I remote it and use the sagemath kernel and 
> > typed the above commands.
> >
> > I'm guessing it requires some widgets to be installed in jupyter for them 
> > to work. Since I'm not using the Sage notebook interface but a 
> > Jupyterlab-hub instance that has the sagemath kernel installed.
> >
> > On Saturday, November 17, 2018 at 7:21:02 PM UTC-8, John H Palmieri wrote:
> > > This is on OS X? How did you install Sage? (It works for me with Sage 
> > > built from scratch on both OS X 10.13.6 and OS X 10.14.1.)
> > >
> > >   John
> > >
> > >
> > > On Saturday, November 17, 2018 at 5:32:34 PM UTC-8, Kolen Cheung wrote:
> > > > I tried both
> > > > plot3d(sin(pi * sqrt(x**2 + y**2)) / sqrt(x**2 + y**2), (x, -5, 5), (y, 
> > > > -5, 5), viewer='threejs')
> > > > ...
> > > > p1 = sphere(color='red', opacity='.5')
> > > > p2 = sphere((-1,-1,1), color='cyan', opacity='.3')
> > > > p3 = sphere((1,-1,-1), color='yellow', opacity='.7')
> > > > show(p1 + p2 + p3, viewer='threejs')
> > > > Again on both jupyter notebook and jupyterlab, on both Safari and 
> > > > Chrome. Are you sure there isn’t other dependencies?
> > > > I checked the HTML console and found this:
> > > > [Error] Failed to load resource: the server responded with a status of 
> > > > 404 (Not Found) (preact.min.js.map, line 0)
> > > > [Error] Failed to load resource: the server responded with a status of 
> > > > 404 (Not Found) (index.js.map, line 0)
> > > > [Error] Failed to load resource: the server responded with a status of 
> > > > 404 (Not Found) (preact-compat.min.js.map, line 0)
> > > > Are there any jupyter widgets that I should install?
> > > >
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] plot3d doesn't work in jupyterlab / jupyter notebook

2018-11-17 Thread John H Palmieri


On Saturday, November 17, 2018 at 7:24:58 PM UTC-8, Kolen Cheung wrote:
>
> I couldn't install sage on macOS Mojave, I'm guessing it isn't compatible 
> with Mojave yet.
>

My message said that I had installed it on OS X 10.14.1, which is Mojave. 
You need to have Xcode installed with the command line tools, or at least 
the command line tools. Try searching the google group sage-devel for 
information about installing with Mojave.
 

>
> Currently it's like this: on an ArchLinux machine, install sage through 
> pacman, and install the sagemath kernel to my jupyterlab hub. And then 
> through the jupyterlab-hub I remote it and use the sagemath kernel and 
> typed the above commands.
>
> I'm guessing it requires some widgets to be installed in jupyter for them 
> to work. Since I'm not using the Sage notebook interface but a 
> Jupyterlab-hub instance that has the sagemath kernel installed.
>
> On Saturday, November 17, 2018 at 7:21:02 PM UTC-8, John H Palmieri wrote:
>>
>> This is on OS X? How did you install Sage? (It works for me with Sage 
>> built from scratch on both OS X 10.13.6 and OS X 10.14.1.)
>>
>>   John
>>
>>
>> On Saturday, November 17, 2018 at 5:32:34 PM UTC-8, Kolen Cheung wrote:
>>>
>>> I tried both
>>>
>>> plot3d(sin(pi * sqrt(x**2 + y**2)) / sqrt(x**2 + y**2), (x, -5, 5), (y, -5, 
>>> 5), viewer='threejs')
>>> ...
>>> p1 = sphere(color='red', opacity='.5')
>>> p2 = sphere((-1,-1,1), color='cyan', opacity='.3')
>>> p3 = sphere((1,-1,-1), color='yellow', opacity='.7')
>>> show(p1 + p2 + p3, viewer='threejs')
>>>
>>> Again on both jupyter notebook and jupyterlab, on both Safari and 
>>> Chrome. Are you sure there isn’t other dependencies?
>>>
>>> I checked the HTML console and found this:
>>>
>>> [Error] Failed to load resource: the server responded with a status of 404 
>>> (Not Found) (preact.min.js.map, line 0)
>>> [Error] Failed to load resource: the server responded with a status of 404 
>>> (Not Found) (index.js.map, line 0)
>>> [Error] Failed to load resource: the server responded with a status of 404 
>>> (Not Found) (preact-compat.min.js.map, line 0)
>>>
>>> Are there any jupyter widgets that I should install?
>>> ​
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] plot3d doesn't work in jupyterlab / jupyter notebook

2018-11-17 Thread Kolen Cheung
I couldn't install sage on macOS Mojave, I'm guessing it isn't compatible 
with Mojave yet.

Currently it's like this: on an ArchLinux machine, install sage through 
pacman, and install the sagemath kernel to my jupyterlab hub. And then 
through the jupyterlab-hub I remote it and use the sagemath kernel and 
typed the above commands.

I'm guessing it requires some widgets to be installed in jupyter for them 
to work. Since I'm not using the Sage notebook interface but a 
Jupyterlab-hub instance that has the sagemath kernel installed.

On Saturday, November 17, 2018 at 7:21:02 PM UTC-8, John H Palmieri wrote:
>
> This is on OS X? How did you install Sage? (It works for me with Sage 
> built from scratch on both OS X 10.13.6 and OS X 10.14.1.)
>
>   John
>
>
> On Saturday, November 17, 2018 at 5:32:34 PM UTC-8, Kolen Cheung wrote:
>>
>> I tried both
>>
>> plot3d(sin(pi * sqrt(x**2 + y**2)) / sqrt(x**2 + y**2), (x, -5, 5), (y, -5, 
>> 5), viewer='threejs')
>> ...
>> p1 = sphere(color='red', opacity='.5')
>> p2 = sphere((-1,-1,1), color='cyan', opacity='.3')
>> p3 = sphere((1,-1,-1), color='yellow', opacity='.7')
>> show(p1 + p2 + p3, viewer='threejs')
>>
>> Again on both jupyter notebook and jupyterlab, on both Safari and Chrome. 
>> Are you sure there isn’t other dependencies?
>>
>> I checked the HTML console and found this:
>>
>> [Error] Failed to load resource: the server responded with a status of 404 
>> (Not Found) (preact.min.js.map, line 0)
>> [Error] Failed to load resource: the server responded with a status of 404 
>> (Not Found) (index.js.map, line 0)
>> [Error] Failed to load resource: the server responded with a status of 404 
>> (Not Found) (preact-compat.min.js.map, line 0)
>>
>> Are there any jupyter widgets that I should install?
>> ​
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] plot3d doesn't work in jupyterlab / jupyter notebook

2018-11-17 Thread John H Palmieri
This is on OS X? How did you install Sage? (It works for me with Sage built 
from scratch on both OS X 10.13.6 and OS X 10.14.1.)

  John


On Saturday, November 17, 2018 at 5:32:34 PM UTC-8, Kolen Cheung wrote:
>
> I tried both
>
> plot3d(sin(pi * sqrt(x**2 + y**2)) / sqrt(x**2 + y**2), (x, -5, 5), (y, -5, 
> 5), viewer='threejs')
> ...
> p1 = sphere(color='red', opacity='.5')
> p2 = sphere((-1,-1,1), color='cyan', opacity='.3')
> p3 = sphere((1,-1,-1), color='yellow', opacity='.7')
> show(p1 + p2 + p3, viewer='threejs')
>
> Again on both jupyter notebook and jupyterlab, on both Safari and Chrome. 
> Are you sure there isn’t other dependencies?
>
> I checked the HTML console and found this:
>
> [Error] Failed to load resource: the server responded with a status of 404 
> (Not Found) (preact.min.js.map, line 0)
> [Error] Failed to load resource: the server responded with a status of 404 
> (Not Found) (index.js.map, line 0)
> [Error] Failed to load resource: the server responded with a status of 404 
> (Not Found) (preact-compat.min.js.map, line 0)
>
> Are there any jupyter widgets that I should install?
> ​
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] plot3d doesn't work in jupyterlab / jupyter notebook

2018-11-17 Thread Kolen Cheung


I tried both

plot3d(sin(pi * sqrt(x**2 + y**2)) / sqrt(x**2 + y**2), (x, -5, 5), (y, -5, 5), 
viewer='threejs')
...
p1 = sphere(color='red', opacity='.5')
p2 = sphere((-1,-1,1), color='cyan', opacity='.3')
p3 = sphere((1,-1,-1), color='yellow', opacity='.7')
show(p1 + p2 + p3, viewer='threejs')

Again on both jupyter notebook and jupyterlab, on both Safari and Chrome. 
Are you sure there isn’t other dependencies?

I checked the HTML console and found this:

[Error] Failed to load resource: the server responded with a status of 404 (Not 
Found) (preact.min.js.map, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not 
Found) (index.js.map, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not 
Found) (preact-compat.min.js.map, line 0)

Are there any jupyter widgets that I should install?
​

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] plot3d doesn't work in jupyterlab / jupyter notebook

2018-11-17 Thread Dima Pasechnik
On Sat, Nov 17, 2018 at 11:34 PM Kolen Cheung  wrote:
>
> Hi,
>
> I'm running SageMath 8.4 kernel in jupyterlab and also jupyter notebook. But 
> running `plot3d(x * y, (x, -1, 1), (y, -1, 1))` gives me a blank space. Is 
> there a command I first need to run before it shows? I tried `%matplotlib 
> inline` but it doesn't help.

Have a look at http://doc.sagemath.org/html/en/reference/plot3d/threejs.html

there are several plotting 3d backends available in Sage, you may try
finding one that works in your
setting.http://doc.sagemath.org/html/en/reference/plot3d/index.html#backends


> `plot` works though.
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.