Skip to content

Conversation

Azaya89
Copy link
Collaborator

@Azaya89 Azaya89 commented Aug 5, 2025

fixes #1641

  • Create how-to section and notebook for widgets exploration
  • Move panel widgets part to reference section
  • Create Explanation section and notebook for groupby vs by vs color

CI failures unrelated and will be fixed in holoviz/geoviews#794

@Azaya89 Azaya89 requested a review from Copilot August 5, 2025 15:12
Copilot

This comment was marked as resolved.

@Azaya89 Azaya89 self-assigned this Aug 8, 2025
@Azaya89 Azaya89 added the NF SDG 2025 NumFocus Software Development Grant 2025 label Aug 8, 2025
"metadata": {},
"source": [
":::{warning}\n",
"This functionality requires Panel to be installed. The API shown here may change in future versions.\n",
Copy link
Member

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",
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
" 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."
Copy link
Member

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

Suggested change
"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."
Copy link
Member

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.

Suggested change
"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."
Copy link
Member

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.

Copy link
Member

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.

Copy link
Collaborator Author

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:"
Copy link
Member

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",
Copy link
Member

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)"
Copy link
Member

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",
Copy link
Member

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?

Copy link
Collaborator Author

@Azaya89 Azaya89 Aug 28, 2025

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.

@Azaya89 Azaya89 requested a review from maximlt August 28, 2025 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NF SDG 2025 NumFocus Software Development Grant 2025
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Break down the Widgets user guide
2 participants