Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HoloMap not working inside Panel Column in Quarto document #6131

Open
MarcSkovMadsen opened this issue Dec 27, 2023 · 0 comments
Open

HoloMap not working inside Panel Column in Quarto document #6131

MarcSkovMadsen opened this issue Dec 27, 2023 · 0 comments
Labels
type: bug Something isn't correct or isn't working
Milestone

Comments

@MarcSkovMadsen
Copy link
Collaborator

I'm trying to describe how the HoloViz ecosystem can be used with Quarto. Right now how to get interactivity without a python server.

Does not work

# Does not Work

```{python}
import numpy as np
import holoviews as hv
import panel as pn

hv.extension("bokeh")
# pn.extension()

def sine_curve(phase, freq):
    xvals = [0.1* i for i in range(100)]
    return hv.Curve((xvals, [np.sin(phase+freq*x) for x in xvals]))

frequencies = [0.5, 0.75, 1.0, 1.25]
phases      = [0, np.pi/2, np.pi, 3*np.pi/2]

curve_dict_2D = {(p,f):sine_curve(p,f) for p in phases for f in frequencies}

pn.Column(hv.HoloMap(curve_dict_2D, kdims=['phase', 'frequency']))
```
holomap-not-working.mp4
quarto preview script.qmd --port 5008

Works

If I don't put the HoloMap in a Panel Column it works.

# Works

```{python}
import numpy as np
import holoviews as hv
import panel as pn

hv.extension("bokeh")
# pn.extension()

def sine_curve(phase, freq):
    xvals = [0.1* i for i in range(100)]
    return hv.Curve((xvals, [np.sin(phase+freq*x) for x in xvals]))

frequencies = [0.5, 0.75, 1.0, 1.25]
phases      = [0, np.pi/2, np.pi, 3*np.pi/2]

curve_dict_2D = {(p,f):sine_curve(p,f) for p in phases for f in frequencies}

hv.HoloMap(curve_dict_2D, kdims=['phase', 'frequency'])
```
holomap-works.mp4

Versions

panel==1.3.6 bokeh==3.3.2 holoviews==1.18.1

conda create -n quarto-holoviz -c conda-forge python=3.11 r-quarto perl hvplot matplotlib panel jupyter
@MarcSkovMadsen MarcSkovMadsen added the type: bug Something isn't correct or isn't working label Dec 27, 2023
@MarcSkovMadsen MarcSkovMadsen added this to the next milestone Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't correct or isn't working
Projects
None yet
Development

No branches or pull requests

1 participant