Skip to content

Commit

Permalink
adjust Plot -> VegaChart
Browse files Browse the repository at this point in the history
  • Loading branch information
forman committed Dec 18, 2024
1 parent d3f0b6c commit 63726b9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/serve/panels-demo/my_viewer_ext/my_panel_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import shapely
import shapely.ops
from chartlets import Component, Input, State, Output
from chartlets.components import Box, Button, CircularProgress, Plot, Select
from chartlets.components import Box, Button, CircularProgress, VegaChart, Select

from xcube.constants import CRS_CRS84
from xcube.core.geom import mask_dataset_by_geometry, normalize_geometry
Expand All @@ -28,7 +28,7 @@
def render_panel(ctx: Context, dataset_id: str | None = None) -> Component:
dataset = get_dataset(ctx, dataset_id)

plot = Plot(id="plot", chart=None, style={"paddingTop": 6})
chart_comp = VegaChart(id="histo_2d", chart=None, style={"paddingTop": 6})

var_names, var_name_1, var_name_2 = get_var_select_options(dataset)

Expand All @@ -53,7 +53,7 @@ def render_panel(ctx: Context, dataset_id: str | None = None) -> Component:
)

return Box(
children=[plot, controls],
children=[chart_comp, controls],
style={
"display": "flex",
"flexDirection": "column",
Expand All @@ -73,7 +73,7 @@ def render_panel(ctx: Context, dataset_id: str | None = None) -> Component:
State("select_var_1"),
State("select_var_2"),
Input("button", "clicked"),
Output("plot", "chart"),
Output("histo_2d", "chart"),
)
def update_plot(
ctx: Context,
Expand Down

0 comments on commit 63726b9

Please sign in to comment.