Skip to content

Commit cc15e46

Browse files
authored
Merge pull request #1140 from xcube-dev/xcube-prepare_v1.9.0
Preparing v1.9.0
2 parents 58df677 + 3454fc6 commit cc15e46

18 files changed

+4192
-4061
lines changed

CHANGES.md

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1-
## Changes in 1.8.4 (in development)
1+
## Changes in 1.9.0
22

33
### Enhancements
44

5+
* Bundled [xcube Viewer 1.5.0](https://github.com/xcube-dev/xcube-viewer/releases/tag/v1.5.0)
6+
with an updated UI/UX regarding side panel management including
7+
server-side panel extensions.
8+
9+
* Added a new server-side panel extension to the `examples/serve/panels-demo`
10+
for demonstration. It shows spectrum plots for a selected map point.
11+
12+
### Other changes
13+
514
* Extension panels for xcube Viewer of type `xcube.webapi.viewer.contrib.panel.Panel`
615
now have two more properties:
716
- `icon`: name of a [Material Design Icon](https://fonts.google.com/icons)
@@ -10,8 +19,6 @@
1019
- `position`: to set the position of the respective icon button
1120
in the viewer's sidebar.
1221

13-
### Other changes
14-
1522
* Added a new abstract class `PreloadedDataStore` that defines the return type of the
1623
`preload_data` method in `xcube.core.store.DataStore`. The `PreloadedDataStore` is a
1724
data store containing a `preload_handle` field, which holds the handle

examples/serve/panels-demo/config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Viewer:
22
Augmentation:
33
Path: ""
44
Extensions:
5-
- my_viewer_ext.ext
5+
- demo_panels.ext
66
Persistence:
77
Path: memory://states
88

examples/serve/panels-demo/my_viewer_ext/__init__.py renamed to examples/serve/panels-demo/demo_panels/__init__.py

+6-9
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,11 @@
44

55
from chartlets import Extension
66

7-
from .my_panel_1 import panel as my_panel_1
8-
9-
# from .my_panel_2 import panel as my_panel_2
10-
11-
from .my_panel_3 import panel as my_panel_3
7+
from .panel_histo2d import panel as histo2d_panel
8+
from .panel_spectrum import panel as spectrum_panel
9+
from .panel_demo import panel as demo_panel
1210

1311
ext = Extension(__name__)
14-
ext.add(my_panel_1)
15-
# ext.add(my_panel_2)
16-
17-
ext.add(my_panel_3)
12+
ext.add(histo2d_panel)
13+
ext.add(spectrum_panel)
14+
ext.add(demo_panel)

examples/serve/panels-demo/my_viewer_ext/my_panel_2.py renamed to examples/serve/panels-demo/demo_panels/panel_demo.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from xcube.server.api import Context
99
from xcube.webapi.viewer.contrib import Panel, get_datasets_ctx
1010

11-
panel = Panel(__name__, title="Panel B")
11+
panel = Panel(__name__, title="Demo Panel", position=5)
1212

1313

1414
COLORS = [(0, "red"), (1, "green"), (2, "blue"), (3, "yellow")]
@@ -50,7 +50,13 @@ def render_panel(
5050
"height": "100%",
5151
"gap": "6px",
5252
},
53-
children=[opaque_checkbox, color_select, info_text],
53+
children=[
54+
"This panel just demonstrates how server-side extensions work. "
55+
"It has no useful functionality.",
56+
opaque_checkbox,
57+
color_select,
58+
info_text
59+
],
5460
)
5561

5662

examples/serve/panels-demo/my_viewer_ext/my_panel_1.py renamed to examples/serve/panels-demo/demo_panels/panel_histo2d.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,24 @@ def render_panel(ctx: Context, dataset_id: str | None = None) -> Component:
5151
"flexDirection": "row",
5252
"alignItems": "center",
5353
"gap": 6,
54-
"padding": 6,
5554
},
5655
)
5756

5857
return Box(
59-
children=[controls, plot],
58+
children=[
59+
"Create or select a region shape in the map, then select two "
60+
"variables from the dropdowns, and press 'Update' to create "
61+
"a 2D histogram plot.",
62+
controls,
63+
plot
64+
],
6065
style={
6166
"display": "flex",
6267
"flexDirection": "column",
6368
"alignItems": "center",
6469
"width": "100%",
6570
"height": "100%",
6671
"gap": 6,
67-
"padding": 6,
6872
},
6973
)
7074

@@ -195,7 +199,7 @@ def update_plot(
195199
color=alt.Color("z:Q", scale=alt.Scale(scheme="viridis"), title="Density"),
196200
tooltip=[var_1_name, var_2_name, "z:Q"],
197201
)
198-
).properties(width=360, height=360)
202+
).properties(width=300, height=300)
199203

200204
return chart
201205

examples/serve/panels-demo/my_viewer_ext/my_panel_3.py renamed to examples/serve/panels-demo/demo_panels/panel_spectrum.py

+8-5
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from xcube.core.extract import get_cube_values_for_points
1919
from xcube.core.gridmapping import GridMapping
2020

21-
panel = Panel(__name__, title="Spectral View", icon="light")
21+
panel = Panel(__name__, title="Spectrum View (Demo)", icon="light", position=4)
2222

2323

2424
@panel.layout(
@@ -73,20 +73,23 @@ def render_panel(
7373
"justifyContent": "space-between",
7474
"width": "100%",
7575
"gap": 6,
76-
"padding": 6,
7776
},
7877
)
7978

8079
return Box(
81-
children=[control_bar, plot],
80+
children=[
81+
"Select a map point from the dropdown and press 'Update' "
82+
"to create a spectrum plot for that point and the selected time.",
83+
control_bar,
84+
plot,
85+
],
8286
style={
8387
"display": "flex",
8488
"flexDirection": "column",
8589
"alignItems": "center",
8690
"width": "100%",
8791
"height": "100%",
8892
"gap": 6,
89-
"padding": 6,
9093
},
9194
)
9295

@@ -228,7 +231,7 @@ def update_plot(
228231
color="places:N",
229232
tooltip=["variable", "wavelength", "reflectance"],
230233
)
231-
).properties(width=560, height=260)
234+
).properties(width=300, height=200)
232235

233236
return chart
234237

xcube/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# Permissions are hereby granted under the terms of the MIT License:
33
# https://opensource.org/licenses/MIT.
44

5-
version = "1.8.4.dev0"
5+
version = "1.9.0"

xcube/webapi/viewer/dist/assets/appReducer-DjbLKPde.css

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

xcube/webapi/viewer/dist/assets/appReducer-vlRVeAB-.js

+4,131
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

xcube/webapi/viewer/dist/assets/html-BvONBtLL.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

xcube/webapi/viewer/dist/assets/index-DH-K2gae.js

-4,027
This file was deleted.

xcube/webapi/viewer/dist/assets/index-DJNsTand.css

-1
This file was deleted.

xcube/webapi/viewer/dist/assets/main-ByTyqWHG.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.
Binary file not shown.

xcube/webapi/viewer/dist/docs/dev-reference.en.md

+13-6
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,18 @@ ${extensions}
2121

2222
## Available State Properties
2323

24-
In the following, xcube Viewer's state properties are listed.
25-
These properties can be accessed in the input and state channels you pass
26-
to the `layout()` and `callback()` decorators. To trigger a callback
27-
call when a state property changes use the input syntax
28-
`Input("@app", <property>)`. To just read a property from the state use
29-
`State("@app", <property>)`.
24+
xcube Viewer exposes some of its application state properties to Python
25+
extension components, e.g., `panel = Panel(...)`. The current values of state
26+
properties can be accessed via `Input` and `State` channels you define for your
27+
extension component decorators, i.e., `@panel.layout(...)` and/or `@panel.callback(...)`.
28+
29+
- To trigger a callback call when a state property changes use the input syntax
30+
`Input("@app", "<property>")`.
31+
- To just read a property from the state use `State("@app", "<property>")`. This
32+
will not trigger a call to your callback.
33+
34+
The following state properties of xcube Viewer's are made available
35+
to extensions:
36+
3037

3138
${derivedState}

xcube/webapi/viewer/dist/index.html

+3-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@
2020
<link rel="apple-touch-icon" href="./images/logo192.png"/>
2121
<link rel="manifest" href="./manifest.json"/>
2222
<title>xcube Viewer</title>
23-
<script type="module" crossorigin src="./assets/index-DH-K2gae.js"></script>
24-
<link rel="stylesheet" crossorigin href="./assets/index-DJNsTand.css">
23+
<script type="module" crossorigin src="./assets/html-BvONBtLL.js"></script>
24+
<link rel="modulepreload" crossorigin href="./assets/appReducer-vlRVeAB-.js">
25+
<link rel="stylesheet" crossorigin href="./assets/appReducer-DjbLKPde.css">
2526
</head>
2627
<body>
2728
<noscript>You need to enable JavaScript to run this app.</noscript>

0 commit comments

Comments
 (0)