-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
from chartlets import Extension | ||
from .my_panel_1 import panel as my_panel_1 | ||
from .my_panel_2 import panel as my_panel_2 | ||
from .my_panel_3 import panel as my_panel_3 | ||
|
||
ext = Extension(__name__) | ||
ext.add(my_panel_1) | ||
ext.add(my_panel_2) | ||
ext.add(my_panel_3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
from chartlets import Component, Input, State, Output | ||
from chartlets.components import Box, Button, CircularProgress, Plot, Select, Typography | ||
|
||
from xcube.webapi.viewer.contrib import Panel | ||
from xcube.webapi.viewer.contrib import get_dataset | ||
from xcube.server.api import Context | ||
|
||
|
||
panel = Panel(__name__, title="Spectral") | ||
|
||
|
||
@panel.layout( | ||
State("@app", "selectedDatasetId",), | ||
State("@app", "selectedTimeLabel"), | ||
State("@app", "selectedPlace"), | ||
) | ||
def render_panel( | ||
ctx: Context, | ||
dataset_id: str, | ||
time_label: float, | ||
place_geometry: str, | ||
) -> Component: | ||
dataset = get_dataset(ctx, dataset_id) | ||
# plot = Plot(id="plot", chart=None, style={"paddingTop": 6}) | ||
|
||
place_text = Typography(id="text", children=[f"selected place_{type(place_geometry)}"], color='pink') | ||
button = Button(id="button", text="ADD", style={"maxWidth": 100}) | ||
|
||
controls = Box( | ||
children=[button], | ||
style={ | ||
"display": "flex", | ||
"flexDirection": "row", | ||
"alignItems": "center", | ||
"gap": 6, | ||
"padding": 6, | ||
}, | ||
) | ||
|
||
return Box( | ||
children=[place_text, controls], | ||
style={ | ||
"display": "flex", | ||
"flexDirection": "column", | ||
"alignItems": "center", | ||
"width": "100%", | ||
"height": "100%", | ||
"gap": 6, | ||
"padding": 6, | ||
}, | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters