I am adding a Dash-Leaflet map to a callback and want to know how to setup up the app layout. Below are the modules and datasets used.
import dash
import plotly.express as px
from dash import Dash, dcc, html, Input, Output, State, dash_table
from dash.exceptions import PreventUpdate
import plotly.graph_objs as go
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from jupyter_dash import JupyterDash
import dash_bootstrap_components as dbc
import dash_leaflet as dl
import dash_leaflet.express as dlx
import geopandas as gpd
import json
df = df[["Analysis","LGA", "SMA","AVLU", "Address","Locality", "AREA(HA)","Sale Date"]]
gdf1 = gdf[["ANALYSISID","geometry"]]
sales =gdf1.merge(dfb, left_on='ANALYSISID', right_on='Analysis')
app = dash.Dash(__name__, external_stylesheets=[dbc.themes.FLATLY])
app.layout = html.Div([
####app layout code for 4 dropdowns, a radio button, a table, 2 graphs, and 2 statistical ouputs.####
Below is a snippet of the app layout code I have been writing but have not been successful in connecting to a callback and returning a figure.
############################################################################### map layout
dbc.Row(
[
dbc.Col(
dl.Map([
dl.TileLayer(), # <-- default basemap
geojson,
id="map", style={'width': '100%', 'height': '80vh', 'margin': "auto", "display": "block"},
])
),
],
)
@app.callback(
Output('graph-container1', 'children'),
Output('graph-container', 'children'),
Output('table-container', 'data'),
Output('my_output', 'children'),
Output('my_output1', 'children'),
Output('map', 'children'),
Input('factor2', 'value'),
Input('factor1', 'value'),
Input('radio_items', 'value'),
Input('SMA-dpdn', 'value'),
Input('LGA-dpdn', 'value'),
prevent_initial_call=True