jakevdp / ipywidgets-static

[obsolete] Static Widgets for IPython Notebooks
BSD 3-Clause "New" or "Revised" License
108 stars 24 forks source link

Skipped values of RangeWidget #15

Open akhmerov opened 9 years ago

akhmerov commented 9 years ago

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 commented 9 years ago

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.

jakevdp commented 9 years ago

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.

akhmerov commented 9 years ago

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

jakevdp commented 9 years ago

Sure

jakevdp commented 9 years ago

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

akhmerov commented 9 years ago

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

On Tue, Feb 3, 2015 at 5:47 PM, Jake Vanderplas notifications@github.com 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.

jakevdp commented 9 years ago

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.