diff --git a/assets/style.css b/assets/style.css index 6be0e97a0a549687b992e73dc9226fef26427e19..40f7ad727f012c8f1bc0810965e88ae3cc6ed745 100644 --- a/assets/style.css +++ b/assets/style.css @@ -610,8 +610,17 @@ div.dropdown-menu.show { padding: 0 !important; } +.info { + padding: .15rem .15rem !important; + max-width: 79%; +} + .info>p { + white-space: nowrap; margin-bottom: 0; + overflow: hidden; + text-overflow: ellipsis; + font-size: 0.8vw; } .popup-map-point { @@ -723,9 +732,6 @@ div.dropdown-menu.show { margin-right: 10px; } -.vis-legend-label { -} - .vis-legend { position: absolute; top: 60px; @@ -741,7 +747,8 @@ div.dropdown-menu.show { } .leaflet-control-colorbar { - font-size: 10px !important; + top: 42px !important; + font-size: .8em !important; } .leaflet-control-zoom-fullscreen { diff --git a/data_handler.py b/data_handler.py index 6232007bf6feafa94ae88586fe1cb1b9c2e45763..d48a43a84f691a6a12b61d4a6dd6abb8765f225e 100644 --- a/data_handler.py +++ b/data_handler.py @@ -1064,7 +1064,8 @@ class FigureHandler(object): if zoom is None: zoom = 3.5 -(aspect[0]-aspect[0]*0.4) if colorbar is not None: - colorbar.width = 320 - 25 * aspect[0] + colorbar.width = 320 - 30 * aspect[0] + colorbar.height = 8 if DEBUG: print("ZOOM", zoom) if DEBUG: print("CENTER", center) @@ -1090,7 +1091,7 @@ class FigureHandler(object): if self.model is not None: CUR_INFO_STYLE = INFO_STYLE.copy() if aspect[0] > 2: - CUR_INFO_STYLE['fontSize'] = "{}px".format(int(INFO_STYLE['fontSize'][:-2])-aspect[0]+1) + CUR_INFO_STYLE['fontSize'] = "{}px".format(int(INFO_STYLE['fontSize'][:-2])-aspect[0]+ 0.3) info = html.Div( children=fig_title, id="{}-info".format(self.model), diff --git a/tests/test_evaluation_callbacks.py b/tests/test_evaluation_callbacks.py index c8ab7bcfa28ed5162738e022df339f398b42037a..2d0353b1cb4d68116350964f3deb899a04f71bcb 100644 --- a/tests/test_evaluation_callbacks.py +++ b/tests/test_evaluation_callbacks.py @@ -76,7 +76,7 @@ def test_modis_scores_tables_retrieve_median_202206(): ctx = copy_context() output = ctx.run(run_callback) - assert output == ([{'id': 'model', 'name': ''}, {'id': 'bias', 'name': 'BIAS'}], [{'bias': '-0.09', 'model': 'MULTI-MODEL'}], {'display': 'block'}) + assert output == ([{'id': 'model', 'name': ''}, {'id': 'bias', 'name': 'MBE'}], [{'bias': '-0.09', 'model': 'MULTI-MODEL'}], {'display': 'block'}) def test_modis_scores_tables_retrieve_no_data(): def run_callback(): @@ -123,7 +123,7 @@ def test_aeronet_scores_tables_retrieve_median_202206(): return code.aeronet_scores_tables_retrieve(1, None, None, None, None, None, ['median'], ['bias'], 'aeronet', 'monthly', '202208', [], [], None, [], [], None, [], [], None, [], [], None,[], [], None) ctx = copy_context() output = ctx.run(run_callback) - assert output[0] == [{'id': 'station', 'name': ['BIAS', '']}, {'id': 'median', 'name': ['BIAS', 'MULTI-MODEL']}] + assert output[0] == [{'id': 'station', 'name': ['MBE', '']}, {'id': 'median', 'name': ['MBE', 'MULTI-MODEL']}] assert output[1] == [{'median': '-0.17', 'station': 'Europe'}, {'median': '-0.11', 'station': 'Mediterranean'}, {'median': '-0.31', 'station': 'MiddleEast'}, {'median': '-0.03', 'station': 'NAfrica'}, {'median': '-0.11', 'station': 'Total'}] diff --git a/tests/test_observations_callbacks.py b/tests/test_observations_callbacks.py index a91b16502a2ac1b9bd79ffb4f19627026c63aa81..2a2ce1d8366a43ef13d63a02c5d2b9c195def72d 100644 --- a/tests/test_observations_callbacks.py +++ b/tests/test_observations_callbacks.py @@ -16,7 +16,7 @@ def test_render_observations_tab(): ctx = copy_context() output = ctx.run(run_callback) - assert "All observations are kindly offered by Partners of the WMO Barcelona Dust Regional Center. RGB is a qualitative satellite product that indicates desert dust in the entire atmospheric column (represented by pink colour).']), className='description-body'), Div(children=[Button(children='HEMISPHERIC', id='btn-fulldisc', active=True), Button(children='MIDDLE EAST', id='btn-middleeast', active=False)], id='rgb-buttons'), Div(children=[Img(id='rgb-image', alt='EUMETSAT RGB - NOT AVAILABLE', src='./assets/eumetsat/FullDiscHD/archive/20220831/FRAME_OIS_RGB-dust-all_202208310000.gif'), Div(children=Div(children=[Span(children=DatePickerSingle(date='20220831', min_date_allowed=datetime.datetime(2012, 1, 20, 0, 0), max_date_allowed=datetime.datetime(2022, 8, 31, 0, 0), placeholder='DD MON YYYY', initial_visible_month=datetime.datetime(2022, 8, 31, 0, 0), clearable=True, reopen_calendar_on_clear=True, display_format='DD MMM YYYY', id='obs-date-picker'), className='timesliderline'), Span(children=[Button(id='btn-obs-play', className='fa fa-play', n_clicks=0, title='Play'), Button(id='btn-obs-stop', className='fa fa-pause', n_clicks=0, title='Stop')], className='timesliderline anim-buttons'), Span(children=Slider(min=0, max=23, step=1, marks={0: '0', 1: '1', 2: '2', 3: '3', 4: '4', 5: '5', 6: '6', 7: '7', 8: '8', 9: '9', 10: '10', 11: '11', 12: '12', 13: '13', 14: '14', 15: '15', 16: '16', 17: '17', 18: '18', 19: '19', 20: '20', 21: '21', 22: '22', 23: '23'}, value=0, id='obs-slider-graph'), className='timesliderline')], className='timeslider'), className='layout-dropdown')], className='centered-image'), Div(Interval(id='obs-slider-interval', disabled=True, interval=1000, n_intervals=0))], id='observations-tab', className='horizontal-menu', label='Observations', value='observations-tab')" in str(output[0]) + assert "' All observations are kindly offered by Partners of the WMO Barcelona Dust Regional Center. RGB is a qualitative satellite product that indicates desert dust in the entire atmospheric column (represented by pink colour).']), className='description-body'), Div(children=[Button(children='HEMISPHERIC', id='btn-fulldisc', active=True), Button(children='MIDDLE EAST', id='btn-middleeast', active=False)], id='rgb-buttons'), Div(children=[Img(id='rgb-image', alt='EUMETSAT RGB - NOT AVAILABLE', src='./assets/eumetsat/FullDiscHD/archive/20220831/FRAME_OIS_RGB-dust-all_202208310000.gif'), Div(children=NavbarSimple(children=[Div(children=[Span(children=DatePickerSingle(date='20220831', min_date_allowed=datetime.datetime(2012, 1, 20, 0, 0), max_date_allowed=datetime.datetime(2022, 8, 31, 0, 0), placeholder='DD MON YYYY', initial_visible_month=datetime.datetime(2022, 8, 31, 0, 0), clearable=True, reopen_calendar_on_clear=True, display_format='DD MMM YYYY', id='obs-date-picker'), className='timesliderline'), Span(children=[Button(id='btn-obs-play', className='fa fa-play', n_clicks=0, title='Play')], className='timesliderline anim-buttons'), Span(children=Slider(min=0, max=23, step=1, marks={0: '0', 1: '1', 2: '2', 3: '3', 4: '4', 5: '5', 6: '6', 7: '7', 8: '8', 9: '9', 10: '10', 11: '11', 12: '12', 13: '13', 14: '14', 15: '15', 16: '16', 17: '17', 18: '18', 19: '19', 20: '20', 21: '21', 22: '22', 23: '23'}, value=0, id='obs-slider-graph'), className='timesliderline')], className='timeslider')], id='rgb-navbar', className='fixed-bottom navbar-timebar', dark=True, expand='lg', fixed='bottom', fluid=True), className='layout-dropdown')], className='centered-image'), Div(Interval(id='obs-slider-interval', disabled=True, interval=1000, n_intervals=0))], id='observations-tab', className='horizontal-menu', label='Observations', value='observations-tab')" in str(output[0]) assert output[1:] == ({ 'font-weight': 'bold' }, { 'font-weight': 'normal' }, 'rgb') @@ -28,7 +28,7 @@ def test_render_observations_tab_visibility(): ctx = copy_context() output = ctx.run(run_callback) - assert "All observations are kindly offered by Partners of the WMO Barcelona Dust Regional Center. RGB is a qualitative satellite product that indicates desert dust in the entire atmospheric column (represented by pink colour).']), className='description-body'), Div(children=[Button(children='HEMISPHERIC', id='btn-fulldisc', active=True), Button(children='MIDDLE EAST', id='btn-middleeast', active=False)], id='rgb-buttons'), Div(children=[Img(id='rgb-image', alt='EUMETSAT RGB - NOT AVAILABLE', src='./assets/eumetsat/FullDiscHD/archive/20220831/FRAME_OIS_RGB-dust-all_202208310000.gif'), Div(children=Div(children=[Span(children=DatePickerSingle(date='20220831', min_date_allowed=datetime.datetime(2012, 1, 20, 0, 0), max_date_allowed=datetime.datetime(2022, 8, 31, 0, 0), placeholder='DD MON YYYY', initial_visible_month=datetime.datetime(2022, 8, 31, 0, 0), clearable=True, reopen_calendar_on_clear=True, display_format='DD MMM YYYY', id='obs-date-picker'), className='timesliderline'), Span(children=[Button(id='btn-obs-play', className='fa fa-play', n_clicks=0, title='Play'), Button(id='btn-obs-stop', className='fa fa-pause', n_clicks=0, title='Stop')], className='timesliderline anim-buttons'), Span(children=Slider(min=0, max=23, step=1, marks={0: '0', 1: '1', 2: '2', 3: '3', 4: '4', 5: '5', 6: '6', 7: '7', 8: '8', 9: '9', 10: '10', 11: '11', 12: '12', 13: '13', 14: '14', 15: '15', 16: '16', 17: '17', 18: '18', 19: '19', 20: '20', 21: '21', 22: '22', 23: '23'}, value=0, id='obs-slider-graph'), className='timesliderline')], className='timeslider'), className='layout-dropdown')], className='centered-image'), Div(Interval(id='obs-slider-interval', disabled=True, interval=1000, n_intervals=0))], id='observations-tab', className='horizontal-menu', label='Observations', value='observations-tab')" in str(output[0]) + assert "' All observations are kindly offered by Partners of the WMO Barcelona Dust Regional Center. RGB is a qualitative satellite product that indicates desert dust in the entire atmospheric column (represented by pink colour).']), className='description-body'), Div(children=[Button(children='HEMISPHERIC', id='btn-fulldisc', active=True), Button(children='MIDDLE EAST', id='btn-middleeast', active=False)], id='rgb-buttons'), Div(children=[Img(id='rgb-image', alt='EUMETSAT RGB - NOT AVAILABLE', src='./assets/eumetsat/FullDiscHD/archive/20220831/FRAME_OIS_RGB-dust-all_202208310000.gif'), Div(children=NavbarSimple(children=[Div(children=[Span(children=DatePickerSingle(date='20220831', min_date_allowed=datetime.datetime(2012, 1, 20, 0, 0), max_date_allowed=datetime.datetime(2022, 8, 31, 0, 0), placeholder='DD MON YYYY', initial_visible_month=datetime.datetime(2022, 8, 31, 0, 0), clearable=True, reopen_calendar_on_clear=True, display_format='DD MMM YYYY', id='obs-date-picker'), className='timesliderline'), Span(children=[Button(id='btn-obs-play', className='fa fa-play', n_clicks=0, title='Play')], className='timesliderline anim-buttons'), Span(children=Slider(min=0, max=23, step=1, marks={0: '0', 1: '1', 2: '2', 3: '3', 4: '4', 5: '5', 6: '6', 7: '7', 8: '8', 9: '9', 10: '10', 11: '11', 12: '12', 13: '13', 14: '14', 15: '15', 16: '16', 17: '17', 18: '18', 19: '19', 20: '20', 21: '21', 22: '22', 23: '23'}, value=0, id='obs-slider-graph'), className='timesliderline')], className='timeslider')], id='rgb-navbar', className='fixed-bottom navbar-timebar', dark=True, expand='lg', fixed='bottom', fluid=True), className='layout-dropdown')], className='centered-image'), Div(Interval(id='obs-slider-interval', disabled=True, interval=1000, n_intervals=0))], id='observations-tab', className='horizontal-menu', label='Observations', value='observations-tab')" in str(output[0]) assert output[1:] == ({ 'font-weight': 'bold' }, { 'font-weight': 'normal' }, 'rgb')