holoviz / holoviz/hvplot

Consistent return type from .hvplot()

Open
#532 0 comments 0 reactions 1 assignee Claimed by @philippjfr View on GitHub
Dominant language
Python
Stars
1.4k
Forks
124
Avg merge
1d 18h
Merged PRs (30d)
1

Description

`.hvplot()` always returns a viewable object that displays itself in Jupyter, but the actual type of what's returned differs depending on the arguments to the `.hvplot()` call in ways that can be surprising to users. E.g. see [discourse 1485/4](https://discourse.holoviz.org/t/simple-panel-example-of-map-time-series-interaction-for-data-cube/1485/4), where code that works fine at first stops working when the user wants to control the type of widget used. This issue comes up very often just for `+`, which works fine for calls returning HoloViews objects, but fails as soon as something forces it to be a Panel object.

I think there are two ways to improve this situation:

1. Continue returning different types depending on the arguments, but make those types behave more similarly (e.g. supporting `+` and other typical operations) wherever possible so that users don't have to worry much about the type differences.
2. Try to return a consistent type whenever possible, presumably a HoloViews object. Making that work may require storing some "hints" on the HoloViews object so that when Panel encounters it in the actual display machinery, it performs the steps (e.g. substituting the widget type or choosing a different widget location) that are currently done before the object is returned. In this case we should try to make HoloViews layouts more powerful as discussed in https://github.com/holoviz/holoviews/issues/91, e.g. by adding a `/` operator to make a column, so that people will rarely need to use a Panel layout directly.

I'm not sure which of these is easier; they both seem difficult!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.