You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have ipywidgets installed into your python environment
Pre test steps
Go to a command prompt
Activate the python environment with jupyter in it
Run jupyter with the following command line : jupyter notebook --no-browser --NotebookApp.allow_origin=*
Note the URL it generates for connecting
Start insiders.vscode.dev
Make sure Jupyter prerelease extension is installed
Bring up command palette
Pick 'Jupyter: Specify jupyter server for connections'
Pick 'Existing'
Enter the URL from step 4
Test standard widgets
Open a new notebook
Pick the 'Python 3' kernel
Try some of the standard widgets from the blog post. Here's an example:
import ipywidgets as widgets
widgets.IntSlider()
Make sure the widget can be interacted with (the example above should generate something like so:)
Try other standard widgets
Test more complex widgets
Create another notebook
Go to a new command prompt
Activate your python environment that jupyter is using
Conda/Pip install the following:
numpy
pandas
ipyleaflets
k3d
bqplot
Go back to insiders.vscode.dev and add these cells to the notebook
from ipyleaflet import Map, Marker
center = (52.204793, 360.121558)
m = Map(center=center, zoom=15)
marker = Marker(location=center, draggable=True)
m.add_layer(marker);
display(m)
import k3d
import numpy as np
from numpy import sin,cos,pi
from ipywidgets import interact, interactive, fixed
import ipywidgets as widgets
import time
import math
plot = k3d.plot()
plot.camera_auto_fit = False
T = 1.618033988749895
r = 4.77
zmin,zmax = -r,r
xmin,xmax = -r,r
ymin,ymax = -r,r
Nx,Ny,Nz = 77,77,77
x = np.linspace(xmin,xmax,Nx)
y = np.linspace(ymin,ymax,Ny)
z = np.linspace(zmin,zmax,Nz)
x,y,z = np.meshgrid(x,y,z,indexing='ij')
p = 2 - (cos(x + T*y) + cos(x - T*y) + cos(y + T*z) + cos(y - T*z) + cos(z - T*x) + cos(z + T*x))
iso = k3d.marching_cubes(p.astype(np.float32),xmin=xmin,xmax=xmax,ymin=ymin,ymax=ymax, zmin=zmin, zmax=zmax, level=0.0)
plot += iso
plot.display()
import numpy as np
from bqplot import pyplot as plt
# And creating some random data
size = 100
np.random.seed(0)
x_data = np.arange(size)
y_data = np.cumsum(np.random.randn(size) * 100.0)
plt.figure(title='My First Plot')
plt.plot(x_data, y_data)
plt.show()
You should be asked to allow usage of a CND for widgets. Pick yes.
Verify you get some sort of output in the cell from running the widget.
The text was updated successfully, but these errors were encountered:
Testing the jupyter web extension loading ipywidgets
Refs: #9984
Complexity: 5
Authors: @rchiodo
Create Issue
Requirements
Pre test steps
jupyter notebook --no-browser --NotebookApp.allow_origin=*
Test standard widgets
Test more complex widgets
The text was updated successfully, but these errors were encountered: