I'm trying to build a simple widget application in voilĂ . It is working very well inside the Jupyter notebook, but when I deploy it as a voilĂ application, every time I change the slider the whole page refreshes.
This is my code:
from bqplot import Figure
from bqplot import pyplot as plt
import numpy as np
import ipywidgets as widgets
def scatter_plot(n):
fig = plt.figure()
x = np.random.uniform(-1,1,n)
y = np.random.uniform(-1,1,n)
scatter = plt.scatter(x,y,default_size=10)
plt.show()
slider = widgets.IntSlider(min=0,max=1000,value=10)
widgets.interact(scatter_plot, n=slider)
The code is supposed to show some random points in the grid and the slider changes the number of points. Again, the code works but my only problem is that it keeps refreshing when I change the slider (when it is a voila application).