Open mgunyho opened 3 months ago
Hi, I tested this with 0.5.2 now, and the HoloMap is displayed, but still not fully functioning: the slider does not appear.
Compare to the example in the documentation:
Or in Jupyter:
Having these sliders is the main reason for using Holoviews / HoloMap for me, and this is keeping me from using marimo as my main notebook.
For reference, here is the code for the MWE
import numpy as np
import holoviews as hv
hv.extension("bokeh")
_t = np.linspace(0, 10, 101)
hv.HoloMap(
{f: hv.Curve((_t, np.sin(f * _t))) for f in [0.5, 0.75, 1.0]},
kdims="frequency",
)
Also here's the output of marimo env
, let me know if you need some more information.
{
"marimo": "0.5.2",
"OS": "Linux",
"OS Version": "5.15.0-105-generic",
"Processor": "x86_64",
"Python Version": "3.8.10",
"Binaries": {
"Browser": "124.0.6367.207",
"Node": "--"
},
"Requirements": {
"click": "8.1.7",
"importlib-resources": "6.4.0",
"jedi": "0.19.1",
"markdown": "3.6",
"pymdown-extensions": "10.8.1",
"pygments": "2.18.0",
"tomlkit": "0.12.5",
"uvicorn": "0.29.0",
"starlette": "0.37.2",
"websocket": "missing",
"typing-extensions": "4.11.0",
"black": "24.4.2"
}
}
Right now, we render HoloMap by converting it to its backend (bokeh/plotly/matplotlib) and then rendering using those specific formatters (e.g. bokeh) to convert to HTML. I think the fix would be to render the HoloMap using panel which seems to be the one adding the slider. I am not familiar enough with that library to support rendering going from HoloMap -> HTML
using panel, but if anyone is, we would welcome a contribution.
Describe the bug
If I try to display a Holoviews
HoloMap
orDynamicMap
, I get blank/textual output instead of an interactive plot (example code taken from Holoviews docs):See here how it should look like: https://holoviews.org/reference/containers/bokeh/HoloMap.html
I would like to use Holoviews with
HoloMap
/DynamicMap
to visualize multidimensional data using sliders, which I currently do very often in Jupyter. I understand that this is a bit redundant since marimo has it's own slider widget, but I couldn't find a better way to do this kind of slicing through multidimensional data (I tried Altair, but there the sliders cannot handle values that are not evenly spaced).This can probably be fixed by adding one of the superclasses of
HoloMap
toHoloviewsFormatter._show_chart
here. Here's the inheritance hierarchy ofHoloMap
:I'm not familiar enough with the internals of holoviews to say which of these should be added to
_show_chart
.DynamicMap
is a subclass ofHoloMap
.As a bonus, if I convert the HoloMap to a layout with
hv.Layout(hv.HoloMap(...))
, the cell grows indefinitely (similar to #978):https://github.com/marimo-team/marimo/assets/20118130/3d316294-ea77-4f73-8a88-839bc65f6e02
I'm using a virtualenv with
pip install marimo matplotlib tornado holoviews
. Here's the full output ofpip list
: Click to showI am using Python 3.8 with Ubuntu 20.04 on Firefox 123.0.1
Environment
Code to reproduce