[IPython-dev] Quick Question about Widgets
hugadams
hughesadam87 at gmail.com
Mon Oct 6 14:52:30 EDT 2014
Hi Nicholas,
Sorry to bother you off of the mailing list. We have been working on the
example you composed for us in regard to spectroscopy widgets, and it's
really working nicely. Thank you for this!
We've encounted one hiccup that we thought you might immediately know how
to resolve. I posted it on the list recently, but think it's pretty
specialized and most users wouldn't have encountered it yet.
Our prototype is working, and nicely separates model and view following
your original design.
http://nbviewer.ipython.org/github/hugadams/pyuvvis/blob/master/pyuvvis/interact/ipynbs/prototypes/widgets_slicing.ipynb
So here's the issue. Imagine the user creates a widget with one dataset.
We have a couple of widgets that are set based on the extents of the
dataset itself. For example, imagine our data is a set of values from 0 to
1000 and we'd like to have a slider widget that runs from 0 to 1000. This
works great; however, what if the user wants to switch datasets? Inside
the gui, there's a dropdown menu that has DataA, DataB, DataC. If the user
switches to DataC, we'd like the view to effectively reset. Imagine that
DataC has values that range from 0 to 500: in this case, the float slider
which originall ran from 0 to 1000 should redraw and run from 0 to 500.
Unfortunately, that means the slider in the view needs to redraw when the
model changes. We can't figure out how to execute such a redraw/reset.
What's happening is that the slider tries to slice the new DataC values at
0 to 1000 and results in an IndexError. We're looking for a workaround for
such a case. Does anything come to mind?
Alternatively, if such a use case is impossible (or very difficult) to make
work, we can redesign things with the idea of one gui per dataset. This
will change our design patterns for all of the gui's to come, so it's
really critical for us to obviate this problem as soon as possible.
If you have any ideas, they would help us tremendously. And thank you for
all of your help with this already.
--
View this message in context: http://python.6.x6.nabble.com/Quick-Question-about-Widgets-tp5073833.html
Sent from the IPython - Development mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20141006/126e3f25/attachment.html>
More information about the IPython-dev
mailing list