enthought/chaco — Issue #26: ScatterInspector does not deselect all on index == None
Author: amalec
Created: 2011-10-26 06:16:14+00:00
State: open

I've been playing around with the scattertoggle.py example. Maybe I'm missing something, but the ScatterInspector seems to fail to deselect all points when clicking on whitespace on the plot (that is, index == None). Something along the lines of this seems to fix it.

```python
class PatchedScatterInspector(ScatterInspector):
def _deselect(self, index=None):
plot = self.component
if index:
super(PatchedScatterInspector, self)._deselect(index)
else:
for name in ('index', 'value'):
if not hasattr(plot, name):
continue
md = getattr(plot, name).metadata
md[self.selection_metadata_name] = []
getattr(plot, name).metadata_changed = True
return
```

Cheers,

-A