ipywidgets-static icon indicating copy to clipboard operation
ipywidgets-static copied to clipboard

Skipped values of RangeWidget

Open akhmerov opened this issue 10 years ago • 7 comments

Sometimes the RangeWidget doesn't correctly update the displayed output. I was able to reproduce the behavior with minimal code:

import ipywidgets
ipywidgets.StaticInteract((lambda x: x), x=ipywidgets.RangeWidget(2, 4, 0.2))

Bug description: with the widget above there is no output shown when the slider is set to x=3 or x=4.

This should be something very basic. I know the project is not active for a while, but some pointers to the origin of the error would be greatly appreciated.

akhmerov avatar Jan 27 '15 12:01 akhmerov

Here's a demonstration: http://nbviewer.ipython.org/urls/dl.dropboxusercontent.com/u/763585/ipywidgets_bug.ipynb

The bug is present in the current master branch.

akhmerov avatar Jan 27 '15 12:01 akhmerov

This is likely due to floating point representations in Javascript. The best fix is to refactor the code so that the range values are integers.

jakevdp avatar Jan 27 '15 17:01 jakevdp

Do you mind reopening this? It's still a bug even though the origin may be known.

akhmerov avatar Feb 03 '15 14:02 akhmerov

Sure

jakevdp avatar Feb 03 '15 16:02 jakevdp

I mainly closed it because I've stopped supporting this package, and I don't anticipate anyone coming along to fix it :smile:

jakevdp avatar Feb 03 '15 16:02 jakevdp

I understand. Just as a quick check: do you use something else nowadays?

On Tue, Feb 3, 2015 at 5:47 PM, Jake Vanderplas [email protected] wrote:

I mainly closed it because I've stopped supporting this package, and I don't anticipate anyone coming along to fix it [image: :smile:]

— Reply to this email directly or view it on GitHub https://github.com/jakevdp/ipywidgets/issues/15#issuecomment-72686284.

akhmerov avatar Feb 03 '15 16:02 akhmerov

I use IPython's built-in HTML widgets. They require a Python kernel so they don't yet allow static output (i.e. nbviewer or HTML-rendered web pages), but that feature is on the roadmap.

jakevdp avatar Feb 03 '15 17:02 jakevdp