Skip to content

Commit 2d02252

Browse files
committed
Adjusted demo pane styles
1 parent 4e6305f commit 2d02252

File tree

3 files changed

+33
-28
lines changed

3 files changed

+33
-28
lines changed

examples/serve/panels-demo/demo_panels/panel_demo.py

Lines changed: 3 additions & 2 deletions
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="Demo Panel", position=5)
11+
panel = Panel(__name__, title="Demo Panel", position=6)
1212

1313

1414
COLORS = [(0, "red"), (1, "green"), (2, "blue"), (3, "yellow")]
@@ -56,7 +56,8 @@ def render_panel(
5656
"This panel just demonstrates how server-side extensions work. "
5757
"It has no useful functionality.",
5858
],
59-
variant="body2",
59+
variant="caption",
60+
color="textSecondary",
6061
)
6162

6263
return Box(

examples/serve/panels-demo/demo_panels/panel_histo2d.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from xcube.webapi.viewer.contrib import Panel, get_dataset
2929
from xcube.webapi.viewer.contrib.helpers import get_place_label
3030

31-
panel = Panel(__name__, title="2D Histogram (Demo)", icon="equalizer", position=3)
31+
panel = Panel(__name__, title="2D Histogram (Demo)", icon="equalizer", position=4)
3232

3333

3434
# Number of bins in x and y directions.
@@ -108,16 +108,19 @@ def render_panel(
108108
children=[""],
109109
)
110110

111-
instructions_text = Markdown(
112-
text="Create or select a region shape in the map, then select two "
113-
"variables from the dropdowns, and press **Update** to create "
114-
"a 2D histogram plot.",
115-
)
116-
117111
instructions = Typography(
118112
id="instructions",
119-
children=[instructions_text],
120-
variant="body2",
113+
children=[
114+
Markdown(
115+
text=(
116+
"Create or select a region shape in the map, then select "
117+
"two variables from the dropdowns, and press **Update** "
118+
"to create a 2D histogram plot."
119+
),
120+
)
121+
],
122+
variant="caption",
123+
color="textSecondary",
121124
)
122125

123126
return Box(

examples/serve/panels-demo/demo_panels/panel_spectrum.py

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from xcube.core.extract import get_cube_values_for_points
2727
from xcube.core.gridmapping import GridMapping
2828

29-
panel = Panel(__name__, title="Spectrum View (Demo)", icon="light", position=4)
29+
panel = Panel(__name__, title="Spectrum View (Demo)", icon="sunny", position=5)
3030

3131
_THROTTLE_TOTAL_SPECTRUM_PLOTS = 10
3232

@@ -68,8 +68,11 @@ def render_panel(
6868
"display": "flex",
6969
"flexDirection": "row",
7070
},
71-
tooltip="Add: Current spectrum is added and new point selections will be "
72-
"added as new spectra. 'Update': Clear the chart but the current selection if any. ",
71+
tooltip=(
72+
"Add: Current spectrum is added and new point selections will be "
73+
"added as new spectra. Update: Clear the chart but the current "
74+
"selection if any. "
75+
),
7376
)
7477

7578
control_bar = Box(
@@ -91,26 +94,24 @@ def render_panel(
9194
instructions = Typography(
9295
id="instructions",
9396
children=[
94-
"Choose an exploration mode and select points to visualize their spectral "
95-
"reflectance across available wavelengths in this highly dynamic Spectrum View.",
97+
"Choose an exploration mode and select points to visualize "
98+
"their spectral reflectance across available wavelengths in "
99+
"this highly dynamic Spectrum View.",
100+
Markdown(
101+
text=(
102+
"_Note: Only 10 spectra can be added at a time as older "
103+
"ones are removed. When switching from **Add** to **Update** "
104+
"mode, the existing bar plots will be cleared if any._"
105+
)
106+
),
96107
],
97-
variant="body2",
98-
)
99-
note_text = Markdown(
100-
text="**NOTE**: Only 10 spectrum plots can be added at a time as older "
101-
"ones are removed. When switching from **Add** to **Update** "
102-
"mode, the existing bar plots will be cleared if any."
103-
)
104-
note = Typography(
105-
id="note",
106-
children=[note_text],
107-
variant="body2",
108+
variant="caption",
109+
color="textSecondary",
108110
)
109111

110112
return Box(
111113
children=[
112114
instructions,
113-
note,
114115
control_bar,
115116
error_message,
116117
plot,

0 commit comments

Comments
 (0)