holoviz / holoviz/hvplot

dynamic=False not work if I change the widget_location

Open
#1,241 2 comments 0 reactions 0 assignees View on GitHub
needs info
Dominant language
Python
Stars
1.4k
Forks
124
Avg merge
1d 18h
Merged PRs (30d)
1

Description

I'm playing around with Quarto. I would like to test how I can embed hvPlot plots.

I believe this issue has nothing to do with quarto. I just think that when you change the `widget_location` the `dynamic=False` or `HoloMap` is not working.

## Does not work

````qmd
---
title: hvPlot in Quarto Examples
format: html
---

This is a hvPlot embedded in a Quarto document.

```{python}
import hvplot.pandas
import numpy as np
import pandas as pd

hvplot.extension("bokeh") # Needed for 'quarto preview' to work
frequencies = [0.5, 0.75, 1.0, 1.25]

def sine_curve(phase, freq):
xvals = np.arange(100)
yvals = np.sin(phase+freq*xvals)
return pd.DataFrame({'x': xvals, 'y': yvals, 'phase': phase, 'freq': freq}, columns=['x', 'y', 'phase', 'freq'])

df = pd.concat([sine_curve(0, f) for f in frequencies])

df.hvplot.line('x', 'y', groupby='freq', dynamic=False, responsive=True, height=400, widget_location='top_left')
```
````

```bash
quarto preview script.qmd --port 5008
```

https://github.com/holoviz/hvplot/assets/42288570/61d0640e-01d5-4df7-9bce-3cc67a92c705

## Works

Here I don't change the `widget_location`.

````qmd
---
title: hvPlot in Quarto Examples
format: html
---

This is a hvPlot embedded in a Quarto document.

```{python}
import hvplot.pandas
import numpy as np
import pandas as pd

hvplot.extension("bokeh") # Needed for 'quarto preview' to work
frequencies = [0.5, 0.75, 1.0, 1.25]

def sine_curve(phase, freq):
xvals = np.arange(100)
yvals = np.sin(phase+freq*xvals)
return pd.DataFrame({'x': xvals, 'y': yvals, 'phase': phase, 'freq': freq}, columns=['x', 'y', 'phase', 'freq'])

df = pd.concat([sine_curve(0, f) for f in frequencies])

df.hvplot.line('x', 'y', groupby='freq', dynamic=False, responsive=True, height=400)
```
````

https://github.com/holoviz/hvplot/assets/42288570/a5a12e98-bf73-4994-948d-ce728e82cfcc

## Versions

panel==1.3.5 bokeh==3.3.2 holoviews==1.18.1 hvplot==0.9.1

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.