1313def render_panel (ctx : Context ) -> Component :
1414 selected_dataset : int = 0
1515 plot = Plot (
16- id = "plot" , figure = make_figure (ctx , selected_dataset ), style = {"flexGrow" : 1 }
16+ id = "plot" , chart = make_figure (ctx , selected_dataset ), style = {"flexGrow" : 1 }
1717 )
1818 dropdown = Dropdown (
1919 id = "selected_dataset" ,
@@ -45,7 +45,7 @@ def render_panel(ctx: Context) -> Component:
4545
4646@panel .callback (
4747 Input ("selected_dataset" ),
48- Output ("plot" , "figure " ),
48+ Output ("plot" , "chart " ),
4949)
5050def make_figure (ctx : Context , selected_dataset : int = 0 ) -> alt .Chart :
5151 dataset = ctx .datasets [selected_dataset ]
@@ -60,7 +60,7 @@ def make_figure(ctx: Context, selected_dataset: int = 0) -> alt.Chart:
6060 fields = ["a" , "b" ])
6161 # Create a chart type using mark_* where * could be any kind of chart
6262 # supported by Vega. We can add properties and parameters as shown below.
63- fig = alt .Chart (dataset ).mark_bar (cornerRadius = corner_var ).encode (
63+ chart = alt .Chart (dataset ).mark_bar (cornerRadius = corner_var ).encode (
6464 x = alt .X ('a:N' , title = 'a' ),
6565 y = alt .Y ('b:Q' , title = 'b' ),
6666 tooltip = [
@@ -74,4 +74,4 @@ def make_figure(ctx: Context, selected_dataset: int = 0) -> alt.Chart:
7474 title = "Vega charts"
7575 ).add_params (corner_var , click_param )
7676
77- return fig
77+ return chart
0 commit comments