import streamlit as st from app.utils.map_utils import plot_map from app.utils.legends_utils import get_stat_unit from app.pipelines.import_data import pipeline_data from app.pipelines.import_config import pipeline_config from app.pipelines.import_map import pipeline_map from app.pipelines.import_scatter import pipeline_scatter from app.utils.show_info import show_info_data, show_info_metric st.set_page_config(layout="wide", page_title="Analyse interactive des précipitations en France (1959–2022)", page_icon="🌧️") st.markdown(""" """, unsafe_allow_html=True) st.markdown(""" """, unsafe_allow_html=True) css = """ """ st.markdown(css, unsafe_allow_html=True) def show( config_path: dict, height: int=600 ): # Chargement des config params_config = pipeline_config(config_path, type="stat") config = params_config["config"] stat_choice = params_config["stat_choice"] season_choice = params_config["season_choice"] stat_choice_key = params_config["stat_choice_key"] scale_choice_key = params_config["scale_choice_key"] min_year_choice = params_config["min_year_choice"] max_year_choice = params_config["max_year_choice"] season_choice_key = params_config["season_choice_key"] missing_rate = params_config["missing_rate"] quantile_choice = params_config["quantile_choice"] scale_choice = params_config["scale_choice"] show_relief = params_config["show_relief"] show_stations = params_config["show_stations"] # Préparation des paramètres pour pipeline_data params_load = ( stat_choice_key, scale_choice_key, min_year_choice, max_year_choice, season_choice_key, missing_rate, quantile_choice, scale_choice ) # Obtention des données result = pipeline_data(params_load, config, use_cache=True) # Chargement des affichages graphiques unit_label = get_stat_unit(stat_choice_key, scale_choice_key) params_map = ( stat_choice_key, result, unit_label, height ) layer, scatter_layer, tooltip, view_state, html_legend = pipeline_map(params_map) col1, col2, col3 = st.columns([1, 0.15, 1]) with col1: scatter_layer = None if not show_stations else scatter_layer deck = plot_map([layer, scatter_layer], view_state, tooltip, activate_relief=show_relief) st.markdown( f"""