-
-
Notifications
You must be signed in to change notification settings - Fork 473
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
Support Altair 5 #4486
Comments
Awesome, thanks for the speedy fix! |
Guys, this still does not work - it runs without exceptions/errors but does not give the valid selection object |
@sriramvenkateshan The interactive examples will not work on the webpage, you have to download the documentation notebooks or copy the code. Here is an example from the docs that works for me locally (make sure to restart jupyterlab if you have it open since previously, and double check that you are are on the right version of the libraries): import altair as alt
import pandas as pd
import panel as pn
from vega_datasets import data
pn.extension('vega')
penguins_url = "https://raw.githubusercontent.com/vega/vega/master/docs/data/penguins.json"
df = pd.read_json(penguins_url)
brush = alt.selection_interval(name='brush') # selection of type "interval"
chart = alt.Chart(penguins_url).mark_point().encode(
x=alt.X('Beak Length (mm):Q', scale=alt.Scale(zero=False)),
y=alt.Y('Beak Depth (mm):Q', scale=alt.Scale(zero=False)),
color=alt.condition(brush, 'Species:N', alt.value('lightgray'))
).properties(
width=250,
height=250
).add_params(
brush
)
vega_pane = pn.pane.Vega(chart, debounce=10)
def filtered_table(selection):
if not selection:
return '## No selection'
query = ' & '.join(
f'{crange[0]:.3f} <= `{col}` <= {crange[1]:.3f}'
for col, crange in selection.items()
)
return pn.Column(
f'Query: {query}',
pn.pane.DataFrame(df.query(query), width=600, height=300)
)
pn.Row(vega_pane, pn.bind(filtered_table, vega_pane.selection.param.brush)) |
Is your feature request related to a problem? Please describe.
The first rc for altair 5 was just released, and the panel demos are now failing with
AttributeError: 'Selection.param' object has no attribute 'brush'
(with panel 0.14.3).Same as #4477 but more context.
The text was updated successfully, but these errors were encountered: