Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/customizing_guide/viewer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ which should be used as follows::

def __init__(self, *args, **kwargs):
super(TutorialViewerState).__init__(*args, **kwargs)
MyExampleState.linestyle.set_choices(['solid', 'dashed', 'dotted'])
self.linestyle.set_choices(['solid', 'dashed', 'dotted'])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.linestyle.set_choices(['solid', 'dashed', 'dotted'])
TutorialViewerState.linestyle.set_choices(['solid', 'dashed', 'dotted'])

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the proposed fix fails for me because self.linestyle is a just initialised SelectionCallbackProperty() here.
The equivalent in existing classes seems to be
https://github.com/glue-viz/glue/blob/f933d4bb69395c986ef1e2b3ec6ef0e64d422aea/glue/viewers/scatter/state.py#L319

Copy link
Contributor

@dhomeier dhomeier Mar 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems to be another similar leftover further down at

class TutorialLayerArtist(LayerArtist):
_layer_artist_cls = TutorialLayerState
def __init__(self, *args, **kwargs):
super(MyLayerArtist, self).__init__(*args, **kwargs)
self.state.add_callback('fill', self._on_fill_change)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bmorris3 would you have time to make the change to super(TutorialLayerArtist, self) there as well, along with @Carifio24's suggestion? Then we could get this fixed in the same PR.


This then makes it so that the ``linestyle`` property knows about what valid
values are, and this will come in useful when developing for example Qt widgets
Expand Down
Loading