Skip to content

Conversation

@timhoffm
Copy link
Member

@timhoffm timhoffm commented Jan 7, 2026

The current widgets API documentation is quite messy.

This PR improves this by:

  • Structure the page into widgets and helpers. This requires explicit listing of the classes, but is bearable as we don't often add new classes
  • Limit the inheritance diagram to the Widget subclasses instead of also showning the helper classes there
  • Add documentation for _SelectorWidget. It's important to understand its subclasses. This also results in correctly showing the selector inheritance in the inheritance diagram

@github-actions github-actions bot added topic: widgets/UI Documentation: API files in lib/ and doc/api labels Jan 7, 2026
@timhoffm timhoffm added this to the v3.11.0 milestone Jan 7, 2026
@timhoffm
Copy link
Member Author

timhoffm commented Jan 8, 2026

LassoSelector
PolygonSelector
SpanSelector
RadioButtons
Copy link
Member

Choose a reason for hiding this comment

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

Radio buttons are related to check buttons, so I would put this after them.

:show-inheritance:
Widget
AxesWidget
MultiCursor
Copy link
Member

Choose a reason for hiding this comment

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

Also unsure why this isn't near plain Cursor?

- Structure the page into widgets and helpers.
  This requires explicit listing of the classes, but is bearable as we
  don't often add new classes
- Limit the inheritance diagram to the Widget subclasses instead of also
 showning the helper classes there
- Add documentation for `_SelectorWidget`. It's important to understand
its subclasses. This also results in correctly showing the selector
inheritance in the inheritance diagram
@timhoffm timhoffm force-pushed the doc-widget-inheritance branch 2 times, most recently from 575891f to 2da7bc2 Compare January 10, 2026 10:36
@timhoffm
Copy link
Member Author

@QuLogic I initially just took over the order the classes were in in the code. Now I've completely reordered to:

  • Widget, AxesWidget as the base classes
  • Cursor, MultiCursor
  • Button, CheckButtons, RadioButtons
  • Sliders
  • TextBox
  • Selectors
  • SubplotTool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants