Thanks to a lot of good work a few years back, we have fairly close 
alignment between historic @interact behavior on the Jupyter notebook (from 
ipywidgets) and the previous sagenb behavior.  Sage cell server and CoCalc 
Sage worksheets are very close indeed.

One fairly glaring difference I'm noting is the default for a single 
integer or real value.  In the past (and on Sage cell) this would uniformly 
give a text box which would allow for the user to input different values - 
not a slider or drop-down list, for which we have other syntax. 
 See 
https://sagecell.sagemath.org/?z=eJxzyMwrSS1KTC7h5UpJTVOI10i0NdW04uVSAILijPxyjcQ4I00A0wwKWA==&lang=sage&interacts=eJyLjgUAARUAuQ==

However, at the time that support was given to have single objects like 
matrices and colors (again, awesome!), apparently this fell through the 
cracks. 
 At 
https://github.com/sagemath/sage/blob/develop/src/sage/repl/ipython_kernel/interact.py#L150
 
after those cases are handled, then they are sent to ipywidget defaults, 
which are pretty ad-hoc - see this, which has things like 
        elif value > 0:
            vrange = (-value, 3*value)
        else:
            vrange = (3*value, -value)
https://github.com/jupyter-widgets/ipywidgets/blob/fcadca8fbdc18ef1d8dc5694e8e6e759af6c7749/ipywidgets/widgets/interaction.py#L96

I think it would be pretty easy to restore previous behavior by simply 
removing the attempt at existing ipywidgets here.  However, it's probably 
been long enough now that there are too many different implementations to 
do so without at least asking on sage-devel.  I would definitely be in 
favor of making the behavior as similar on all outputs as possible (note: I 
have not used Jupyterlab yet, so I haven't a clue what will happen there, 
hopefully same as Jupyter proper w/ipywidgets).  I probably could even dust 
off my git skillz enough to send a branch to Trac.  

Any thoughts, including from Andrey and/or William as caretakers of Sage 
cell and CoCalc implementations, would be most welcome.  Thanks!
- crisman

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/3e34f4ee-12b6-4686-b019-3cf4fb7dcc2fn%40googlegroups.com.

Reply via email to