holoviz / panel

Panel: The powerful data exploration & web app framework for Python
https://panel.holoviz.org
BSD 3-Clause "New" or "Revised" License
4.42k stars 484 forks source link

Are the png, webp, etc. Panes still necessary, when pn.pane.Image can accommodate these formats? #6857

Open Coderambling opened 1 month ago

Coderambling commented 1 month ago

In the component gallery, there is the image pane. Then there are 5+ separate panes for specific image formats.

That is 10% plus of the panes in the Gallery.

Is that a huge duplication, and should that be addressed, to reduce the footprint of the Panel API?

See also remark in this discussion that mentions reducing the visual API surface of Panel. https://github.com/holoviz/panel/issues/6729

Are all the current other image formats, with separate panes, covered by pn.Image? With feature parity?

Does it accommodate moving gifs?

From the doc:

https://panel.holoviz.org/reference/panes/Image.html

The Image pane embeds any known image format file in panel if provided a local path, or will link to a remote image if provided with a URL.

jpg_pane = pn.pane.Image('https://assets.holoviz.org/panel/samples/jpeg_sample.jpeg') png_pane = pn.pane.Image('https://assets.holoviz.org/panel/samples/png_sample.png') webp_pane = pn.pane.Image('https://assets.holoviz.org/panel/samples/webp_sample.webp')

jbednar commented 1 month ago

The Image pane is a "macro" pane that select one of the other more-specific image panes to do the actual work (whichever one first recognizes this particular image). So those other panes are still necessary, as currently implemented.

If we want to reduce the visible API surface, we could probably find a way to hide those panes from the Component Gallery top-level listing, making them reachable only via the Image pane. But that could confuse anyone looking for info on e.g. the SVG pane in particular, so I'm not sure it's necessarily a net win. So I'm neutral (neither for nor against) that idea.

Coderambling commented 1 month ago

Hm I see. That makes sense. Maybe add your sentence below to the Image pane doc for clarity?

"The Image pane is a "macro" pane that selects one of the other more-specific image panes to do the actual work (whichever one first recognizes this particular image)."

Coderambling commented 1 month ago

Made PR to add that sentence to docs:

https://github.com/holoviz/panel/pull/6904