1919 RadioGroup ,
2020)
2121
22+ from xcube .webapi .viewer .components import Markdown
2223from xcube .webapi .viewer .contrib import Panel , get_dataset
2324from xcube .server .api import Context
2425from xcube .constants import CRS_CRS84
@@ -61,15 +62,14 @@ def render_panel(
6162
6263 exploration_radio_group = RadioGroup (
6364 id = "exploration_radio_group" ,
64- children = [update_radio , add_radio ],
65+ children = [add_radio , update_radio ],
6566 label = "Exploration Mode" ,
6667 style = {
6768 "display" : "flex" ,
6869 "flexDirection" : "row" ,
6970 },
70- tooltip = "'Update': Clear the chart but the current selection if any. "
71- "'Add': Current spectrum is added and new point selections will be "
72- "added as new spectra" ,
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. " ,
7373 )
7474
7575 control_bar = Box (
@@ -88,19 +88,28 @@ def render_panel(
8888 id = "error_message" , style = {"color" : "red" }, children = ["" ]
8989 )
9090
91- note = Typography (
92- id = "note " ,
91+ instructions = Typography (
92+ id = "instructions " ,
9393 children = [
94- "NOTE: Only add a maximum of 10 spectrum plots at a time as older "
95- "ones are removed. When switching from 'Add' to 'Update' mode, "
96- "the existing bar plots will be cleared if any."
94+ "Choose an exploration mode and select points to visualize their spectral "
95+ "reflectance across available wavelengths in this highly dynamic Spectrum View." ,
9796 ],
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" ,
98108 )
99109
100110 return Box (
101111 children = [
102- "Choose an exploration mode and select points to visualize their spectral "
103- "reflectance across available wavelengths in this highly dynamic Spectrum View." ,
112+ instructions ,
104113 note ,
105114 control_bar ,
106115 error_message ,
@@ -354,6 +363,7 @@ def create_chart_from_data(data: pd.DataFrame) -> alt.Chart:
354363 color = "Legend:N" ,
355364 tooltip = ["places" , "variable" , "wavelength" , "reflectance" ],
356365 )
366+ .configure_legend (orient = "bottom" , columns = 2 )
357367 .properties (width = "container" , height = "container" )
358368 )
359369
@@ -367,7 +377,9 @@ def create_chart_from_data(data: pd.DataFrame) -> alt.Chart:
367377 color = "Legend:N" ,
368378 tooltip = ["places" , "variable" , "wavelength" , "reflectance" ],
369379 )
370- ).properties (width = "container" , height = "container" )
380+ .configure_legend (orient = "bottom" , columns = 2 )
381+ .properties (width = "container" , height = "container" )
382+ )
371383
372384
373385def add_place_data_to_existing (
0 commit comments