-
-
Notifications
You must be signed in to change notification settings - Fork 113
Reorganize Widgets User guide #1654
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
base: main
Are you sure you want to change the base?
Conversation
"metadata": {}, | ||
"source": [ | ||
":::{warning}\n", | ||
"This functionality requires Panel to be installed. The API shown here may change in future versions.\n", |
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.
Panel is always installed with hvPlot since hvPlot directly depends on it.
"metadata": {}, | ||
"source": [ | ||
":::{note}\n", | ||
" When viewing on a static website, the widgets will be inoperable. To explore this functionality fully, download the notebook and run it in a live python environment.\n", |
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.
" When viewing on a static website, the widgets will be inoperable. To explore this functionality fully, download the notebook and run it in a live python environment.\n", | |
"When viewing on a static website, the widgets will be inoperable. To explore this functionality fully, download the notebook and run it in a live python environment.\n", |
"source": [ | ||
"## Basic Widget Creation with groupby\n", | ||
"\n", | ||
"When you use `groupby`, hvPlot automatically selects the appropriate widget type based on your data. For categorical data like the 'species' column (composed of strings), hvPlot creates a Select widget." |
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.
Can you add links to the options you reference? Here that would be
"When you use `groupby`, hvPlot automatically selects the appropriate widget type based on your data. For categorical data like the 'species' column (composed of strings), hvPlot creates a Select widget." | |
"When you use [`groupby`](option-groupby), hvPlot automatically selects the appropriate widget type based on your data. For categorical data like the 'species' column (composed of strings), hvPlot creates a Select widget." |
"source": [ | ||
"## Basic Widget Creation with groupby\n", | ||
"\n", | ||
"When you use `groupby`, hvPlot automatically selects the appropriate widget type based on your data. For categorical data like the 'species' column (composed of strings), hvPlot creates a Select widget." |
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.
"Select widget" is more generally known as a drop-down menu.
"When you use `groupby`, hvPlot automatically selects the appropriate widget type based on your data. For categorical data like the 'species' column (composed of strings), hvPlot creates a Select widget." | |
"When you use `groupby`, hvPlot automatically selects the appropriate widget type based on your data. For categorical data like the 'species' column (composed of strings), hvPlot creates a drop-down menu (from a [Panel Select widget](https://panel.holoviz.org/reference/widgets/Select.html))." |
"source": [ | ||
"## Customizing Widget Placement\n", | ||
"\n", | ||
"You can control where the widget appears using the `widget_location` option. This is useful for creating layouts that work better with your specific visualization needs." |
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.
Link to widget_location docs.
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.
When you reference e.g. groupby
can you add a link to the reference doc like [groupby](option-groupby)
? That won't work for users running the notebook locally but that's fine.
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.
OK
"id": "60b4c757", | ||
"metadata": {}, | ||
"source": [ | ||
"### Indexing and access:" |
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.
Same, some more text to explain why in this case this is not possible.
"groupby_plot = penguins.hvplot.scatter(\n", | ||
" x='bill_length_mm', y='bill_depth_mm',\n", | ||
" groupby='species', title=\"groupby='species'\",\n", | ||
" frame_width=width, widget_location='bottom_right',\n", |
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.
Add shared_axes=False
to groupby_plot
as otherwise updating the widget affects the view of the other plots.
" frame_width=width,\n", | ||
")\n", | ||
"\n", | ||
"pn.Column(pn.Row(by_plot, color_plot), groupby_plot)" |
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.
Put groupby first? Like in the order of how they are documented. In fact all in a Column would work I think.
"id": "817592aa", | ||
"metadata": {}, | ||
"source": [ | ||
"## Overview of the Three Approaches\n", |
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.
Adding this comment after going through the whole notebook. I like it but think it can be re-organized a little to be even better. How I see it is that there are three main use cases:
- Drilling down a dataset with widgets ->
groupby
- Facetting a dataset ->
by
+subplots
- Color a dataset
The first two are pretty straightforward to explain. The last one is where things are a bit more subtle are users can use wither by
or c/color
but there are differences:
by
:- Creates containers (can be indexed and stuff)
- Accept a list of dimensions
- Generates an overlay -> If many overlays (many values in a dimension) then performance can be affected
- Works only for categorical data (i.e. no nice colorbar for numerical data)
color
:- Single Element returned
- Does not accept a list of dimensions
- Can also be used for getting a nice colorbar
And I would document color
before by
as I think most users should probably use color
?
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.
Arranging them this way is a bit more 'poetic' as it kinda rolls off the tongue better: groupby -> by -> color. Putting color in-between both kinda breaks the flow IMO.
fixes #1641
groupby
vsby
vscolor
CI failures unrelated and will be fixed in holoviz/geoviews#794