Run the following in a sagews cell. It's the same as an example in sage_salvus.py, except that the loop below terminates. When the cell is run, the interact is not visible.
@interact(width=30, style="background-color:lightorange; position:absolute; z-index:1000; box-shadow : 8px 8px 4px #888;")
def f(prime=text_control(label="Counting primes: ")):
salvus.javascript("cell.element.closest('.salvus-cell-output-interact').draggable().resizable()")
p = 2
c = 1
while c < 10:
interact.prime = '%s, %.2f'%(p, float(c)/p)
p = next_prime(p)
c += 1
sleep(.25)
Tagging this as wontfix, because it will be fixed indirectly by creating a sage worksheet style mode (and kernel) for Jupyter notebooks. That will be https://github.com/sagemathinc/cocalc/issues/6374.
6374 will completely deprecate sagews interacts in favor of ipywidgets.
Run the following in a sagews cell. It's the same as an example in sage_salvus.py, except that the loop below terminates. When the cell is run, the interact is not visible.