Range(and other) selection difficulties.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Range(and other) selection difficulties.

Jordan Ilott
Hi everyone. I'm working on an application that makes extensive use of Chaco's linked selection capabilities, but I've run into a snag. My problem is related to the naming of the selection metadata and some assumptions that are made in the tools and overlays. One example is that of a combined line and scatter plot. If a RangeSelection tool is added to the plot along with a RangeSelectionOverlay, everything appears to work fine at first. Selecting a range will select the points on the scatter plot. The first sign of trouble comes when the range is deselected. The range overlay clears, as expected; however, all of the points are left in the selected state. At first, this appeared related to a collision of assumption on the range and scatter selections. The range selection mechanism assumes that the 'selections' metadata is to be a tuple indicating the lower and upper range of the selection. The scatter selection mechanism imposes that the selections metadata should be a list of indices indicating the selected points. When the range is deselected, it leaves an empty list in metadata. The problem may also be somehow related to the selection_masks metadata, but I'm not completely sure. Initially, to avoid the problem of colliding metadata names, I set the range selection metadata(in the RangeSelection and RangeSelectionOverlay instances) to be 'range_selections'. This didn't solve the problem with the scatter plot rendering all of the points as selected when the range was deselected, but it did introduce a new problem. When attempting to drag the selection, exceptions are thrown. I've attached a modified version of the range_selection_demo that demonstrates the last scenario.

It seems like there is some inconsistency in the selection mechanisms used in Chaco both at the rendering and data model level. I'm not sure how difficult some of these problems would be to resolve or how deep they might go. I'm hoping that someone who is more familiar with the entire package could offer some advice for a work-around or perhaps a patch.

Jordan

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev

range_selection_demo.py (3K) Download Attachment