Skip to content

ScatterInspector does not deselect all on index == None #26

@amalec

Description

@amalec

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.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions