}, xaxis=xaxis_format) return fig select_prestation_type = dcc.Dropdown(id="select-prestation_type", options=[{ "label": "Train", "value": "T" }, { "label": "Avion", "value": "A" }]) cards = dbc.CardDeck([ build_card_indicateur("Nombre de trajets", "Nombre de trajets", "2 300"), build_card_indicateur("Emissions (eCO2)", "Emissions (eCO2)", "2M"), build_card_indicateur("Indicateur X", "Indicateur X", "XX"), build_card_indicateur("Indicateur Y", "Indicateur Y", "YY"), ]) layout = html.Div( [ dbc.Row(html.P("", id="values-selected")), # Cards row dbc.Row([ dbc.Col([ dbc.Card( dbc.CardBody([ html.H3("Filtres"), html.Br(),
select_travel_year = dbc.Checklist( options=ch.year_options, value=[p["value"] for p in ch.year_options], id="select-travel-year", inline=True, ) select_unreliable = dbc.Checklist( options=[{"label": "Inclure les trajets peu fiables", "value": False},], value=[True], id="select-unreliable", switch=True, ) cards = dbc.CardDeck( [ build_card_indicateur("Émissions (kg eqCO2)", "0", "kpi-emissions"), build_card_indicateur("Nombre de trajets", "0", "kpi-trips"), build_card_indicateur("Distance totale (km)", "0", "kpi-distance"), ] ) layout = html.Div( [ dbc.Row( [ dbc.Col( [ dbc.Jumbotron( [ html.P( "Les émissions des trajets sont obtenues en croisant le facteur d'émission du "
go.Pie(labels=prestation_df["Entité 3"], values=prestation_df["Emissions (g/an)"], hole=0.3) ]) fig.update_layout(plot_bgcolor="white", template="plotly_white", margin={ "t": 30, "r": 30, "l": 30 }) return fig cards = dbc.CardDeck([ build_card_indicateur("Nombre de véhicules", "XX"), build_card_indicateur("Emissions (CO2)", "YY"), build_card_indicateur("Indicateur X", "XX"), build_card_indicateur("Indicateur Y", "YY"), ]) select_odrive_vehicle_type = dcc.Dropdown( id="select_odrive_vehicle_type", options=[ { "label": "Electrique", "value": "E" }, { "label": "Essence", "value": "F"
odrive_df = ov.get_structure_data() motors = list(set(odrive_df["Motorisation"])) options = [] value = [] for m in motors: if m is not None and m is not np.nan: options.append({"label": m, "value": m}) value.append(m) return dcc.Checklist(id="odrive_select_vehicle_type", options=options, value=value, labelStyle={"display": "block"}) cards = dbc.CardDeck([ build_card_indicateur("Emissions en CO2 par an (kg)", "0", "odrive_total_emissions"), build_card_indicateur("Nombre de véhicules", "0", "odrive_fleet_vehicle_number_odrive"), build_card_indicateur("Distance parcourue par an (km)", "0", "odrive_kilometers_total"), build_card_indicateur("Distance par mois par véhicule (km)", "0", "odrive_montly_kilometer"), ]) layout = html.Div( [ # Cards row dbc.Row([ dbc.Col([ html.B("", id="selected-odrive-vehicle_type"), dbc.Jumbotron([