File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 137
137
import altair as alt
138
138
import panel as pn
139
139
import pandas as pd
140
+ import param
140
141
141
142
from sklearn.cluster import KMeans
142
143
from pyodide.http import open_url
170
171
y=alt.Y(y, scale=alt.Scale(zero=False)),
171
172
shape='labels',
172
173
color='species'
173
- ).add_selection (brush).properties(width=800) +
174
+ ).add_params (brush).properties(width=800) +
174
175
alt.Chart(centers)
175
176
.mark_point(size=250, shape='cross', color='black')
176
177
.encode(x=x+':Q', y=y+':Q')
197
198
@pn.depends(x, y, n_clusters, watch=True)
198
199
def update_chart(*events):
199
200
chart.object = get_chart(x.value, y.value, table.value)
200
- chart.selection.param.watch(update_filters, 'brush')
201
201
202
+ @param.depends('brush', watch=True)
202
203
def update_filters(event=None):
203
204
filters = []
204
205
for k, v in (getattr(event, 'new') or {}).items():
You can’t perform that action at this time.
0 commit comments