Skip to content

Conversation

@Azaya89
Copy link
Collaborator

@Azaya89 Azaya89 commented Jun 20, 2025

closes #1611

@Azaya89
Copy link
Collaborator Author

Azaya89 commented Jun 20, 2025

Still a WIP but here's the current implementation with two sub-sections added:

image

@maximlt maximlt added the NF SDG 2025 NumFocus Software Development Grant 2025 label Jun 21, 2025
Copy link
Member

Choose a reason for hiding this comment

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

You may have noticed that we don't store the thumbnails of the current gallery in the repo but on S3 (see the conf.py that links to https://assets.holoviz.org/hvplot/thumbnails). We'll do the same for these new thumbnails.

I'm also not a big fan of generating squared thumbnails by distorting them, they don't look so good, don't they? Minor thing but just wanted to mention it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm all for storing the thumbnails on S3, but the thumbnails do look OK to me in the built docs though. I guess you may look at it differently when you see it in the cards?

Copy link
Member

Choose a reason for hiding this comment

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

the thumbnails do look OK to me in the built docs though

This is where I politely disagree :)

@maximlt
Copy link
Member

maximlt commented Jul 14, 2025

I haven't checked but I thought that one nice goal to achieve with the gallery would be to have at least one example per plotting method. I.e. all the plotting methods referenced on this page https://hvplot.holoviz.org/ref/api/index.html (excluding NetworkX method for now).

@Azaya89
Copy link
Collaborator Author

Azaya89 commented Jul 14, 2025

I haven't checked but I thought that one nice goal to achieve with the gallery would be to have at least one example per plotting method. I.e. all the plotting methods referenced on this page https://hvplot.holoviz.org/ref/api/index.html (excluding NetworkX method for now).

Sounds like a good idea.

@maximlt
Copy link
Member

maximlt commented Jul 14, 2025

The idea being that would be a good place for users to find all the types of plots hvPlot can make, and from these examples they can then easily find their reference API for more information.

@Azaya89
Copy link
Collaborator Author

Azaya89 commented Jul 14, 2025

The idea being that would be a good place for users to find all the types of plots hvPlot can make, and from these examples they can then easily find their reference API for more information.

Makes sense. I'll try to add a few more as I can.

ahuang11 and others added 4 commits July 18, 2025 13:03
* Add coastline

* Update doc/gallery/geospatial/geopoints.ipynb

Co-authored-by: Azaya <[email protected]>

* clean nb

* change thumbnail image

---------

Co-authored-by: Azaya <[email protected]>
Co-authored-by: Isaiah Akorita <[email protected]>
@Azaya89 Azaya89 marked this pull request as ready for review July 18, 2025 17:52
@Azaya89 Azaya89 requested a review from maximlt July 18, 2025 17:52
Copy link
Member

@maximlt maximlt left a comment

Choose a reason for hiding this comment

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

Leaving various comments made while reviewing the changes made in this PR. Not expecting any change as I'm making them while I go. But please @Azaya89 have a look at them and answer the questions when you can.

pixi.toml Outdated
name = "hvplot"
channels = ["pyviz/label/dev", "conda-forge"]
platforms = ["linux-64", "osx-arm64", "osx-64", "win-64"]
preview = ["pixi-build"] # temp until 0.1.4 release
Copy link
Member

Choose a reason for hiding this comment

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

Why is this needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was to enable pixi download the dev version of hvsampledata (0.1.4a2) until 0.1.4 is fully released. I think it can be removed now.

Copy link
Member

Choose a reason for hiding this comment

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

Sounds strange because we depend on the pyviz/label/dev channel and push hvsampledata dev releases on this channel. I've removed that change.

[feature.doc]
channels = [
    # To get dev HoloViews, not always needed.
    "pyviz/label/dev",
    # To get dev nbsite, not always needed.
    "pyviz/label/tooling_dev",
    "conda-forge"
]

(basic-charts)=
## Basic Charts

::::{grid} 1 2 2 4
Copy link
Member

Choose a reason for hiding this comment

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

IIRC you said you adopted the same approach as Panel. Panel uses a mix of approaches, it uses nbsite's gallery extension for the Component Gallery (https://github.com/holoviz/panel/blob/13419c763105fadc563bc8a6263d39aea33e6041/doc/conf.py#L139) and this custom sphinx-design grid for other pages that include a gallery/grid.

I'm quite tempted to use nbsite's gallery here as it should make the contributor experience a little better.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

if it makes things better I'm all for it.

Copy link
Member

Choose a reason for hiding this comment

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

Yes I've switched to the nbsite gallery implementation. Made some changes to nbsite to customize the design a bit and facilitate a few things.

image

# cell execution timeout in seconds (-1 to ignore, 30 by default)
nb_execution_timeout = 240

if os.getenv('HVPLOT_REFERENCE_GALLERY') not in ('False', 'false', '0'):
Copy link
Member

Choose a reason for hiding this comment

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

When we remove pages, we should always add redirect links. In this case, we'll need to keep two sets of redirects:

  • links from reference/pandas/foo to reference/tabular/foo
  • links from reference/tabular/foo to whatever is the best replacement for this now (plotting API page I think)

<meta http-equiv='refresh' content='0; URL=../index.html#advanced'>
</head>

# Advanced Plots
Copy link
Member

Choose a reason for hiding this comment

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

I'll see if I can find a better name for this category. Otherwise "Advanced" will end up being a collection of random examples.

"# Category Breakdown Bar Chart\n",
"\n",
"A grouped bar chart that shows how each species of penguin is distributed across different islands. \n",
"This example uses the `penguins` dataset from hvplot's built-in sample data."
Copy link
Member

Choose a reason for hiding this comment

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

The sample datasets aren't really built-in.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will modify

Copy link
Member

Choose a reason for hiding this comment

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

Already done :)

"metadata": {},
"source": [
":::{note}\n",
"The `groupby` widget interactivity is only supported in the **Bokeh** backend \n",
Copy link
Member

Choose a reason for hiding this comment

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

Not true, this is supported by all the backends.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

My assumption was that all interactivity options don't work in the mpl backend. My bad...

Copy link
Member

Choose a reason for hiding this comment

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

HoloViews originally supported Matplotlib only and had already these widgets to drill down a multi-dimensional dataset https://proceedings.scipy.org/articles/Majora-7b98e3ed-00a.pdf.

"source": [
":::{note}\n",
"The `groupby` widget interactivity is only supported in the **Bokeh** backend \n",
"and requires a **live Python environment** (e.g. Jupyter Notebook, JupyterLab, or Panel app).\n",
Copy link
Member

Choose a reason for hiding this comment

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

In the docs we use the dynamic=False trick to provide a better user experience.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah but IIRC, I thought we wanted to stop doing that so as not to confuse users since we don't really explain what dynamic=False does in the plot?

Copy link
Member

Choose a reason for hiding this comment

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

True I would like at some point to have a way to deal with that in a better way, with a custom sphinx extension that does the right thing. As it doesn't exist yet so let's stick to dynamic=False :)

"source": [
"import hvplot.xarray # noqa\n",
"\n",
"ds = hvplot.sampledata.air_temperature(\"xarray\").sel(time=\"2014-02-25 12:00\")\n",
Copy link
Member

Choose a reason for hiding this comment

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

I don't think using quadmesh on a regular grid like this dataset brings much vs. image?

"metadata": {},
"source": [
":::{note}\n",
"The `multi_y=True` option enables dual y‑axes **only for the Bokeh backend**. When used with Matplotlib, it falls back to a single shared axis and issues a warning indicating multi‑axis support is unavailable. See [Customizing Plots](https://holoviews.org/user_guide/Customizing_Plots.html#twin-axes).\n",
Copy link
Member

Choose a reason for hiding this comment

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

Nice to add this example! But the multi_y option should be documented as a HoloViews feature, the example doesn't make that clear.

Comment on lines 12 to 13
Penguins App <penguins_app>
Sine Wave <sine_curve>
Copy link
Member

Choose a reason for hiding this comment

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

Penguins App and Sine Wave are very similar: 2 widgets, a plot function, and pn.bind.

@maximlt
Copy link
Member

maximlt commented Aug 27, 2025

TODO:

Copy link
Member

@maximlt maximlt left a comment

Choose a reason for hiding this comment

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

Thanks @Azaya89 !

@maximlt maximlt merged commit c41bb35 into main Aug 28, 2025
11 checks passed
@maximlt maximlt deleted the gallery-examples branch August 28, 2025 20:10
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.

Create a new gallery

4 participants