-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Widget plugins #1564
feat: Widget plugins #1564
Conversation
/** | ||
* Listen for panel open events so we know when to open a panel | ||
*/ | ||
useListener(layout.eventHub, PanelEvent.OPEN, handlePanelOpen); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should deprecate the PanelEvent.OPEN
, and change it to like WidgetEvent.OPEN
or something. Since one widget can open multiple panels (defined with ui.panel
). Re-hydrating the children panels will be interested as well.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1564 +/- ##
==========================================
+ Coverage 46.44% 46.65% +0.20%
==========================================
Files 572 575 +3
Lines 36082 36189 +107
Branches 9035 9063 +28
==========================================
+ Hits 16759 16883 +124
+ Misses 19271 19254 -17
Partials 52 52
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
Fixes #1455
Fixes #1167 by allowing widget plugins to advertise their supported types. Dashboard plugins don't make as much sense supporting specific types and all of our existing dashboard plugins that open widgets from the server could be converted to widget plugins.
I debated making
supportedTypes
have a type ofstring | { type: string, icon: Icon }
(+ array version), but felt it complicated things unnecessarily for our current types/icons. We can always add it in the future, but for now each widget plugin could support multiple types, but have 1 icon for the console.I converted the pandas plugin as a test of widget plugins. Confirmed that if I create a dataframe and apply a sort/filter those persist across page refreshes.
Example code to make a dataframe
Still needed