Hi. Could you help me with this problem?. Thank you.
The treemap works if we donโt use the layout ,We tried other library but it seems the problem with just treemap. We need to use different layout template like plotly_dark
import dash
import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objs as go
bggolor = '#24252A'
default_layout = {
'margin': {'r': 5, 't': 20, 'l': 5, 'b': 30},
'paper_bgcolor': bggolor,
'plot_bgcolor': bggolor,
}
fig = go.Figure(go.Treemap(
labels = ["Eve","Cain", "Seth", "Enos", "Noam", "Abel", "Awan", "Enoch", "Azura"],
parents = ["", "Eve", "Eve", "Seth", "Seth", "Eve", "Eve", "Awan", "Eve"]
))
layout= go.Layout(
**default_layout,
template='plotly_dark',
)
figure = {
'data': fig,
'layout': layout, }
#DASH LAYOUT
app = dash.Dash(__name__
)
app.layout =html.Div([
dcc.Graph(figure=figure,id='mytree')
,html.Div(id='place4')
])
@app.callback(dash.dependencies.Output('place4','children')
,[dash.dependencies.Input('mytree','hoverData')
,dash.dependencies.Input('mytree','clickData')]
)
def industry_selection(hov,click):
return('HOVER DATA IS {0}~~~~~~~~~~~~~~~~CLICK DATA IS {1}'.format(hov,click))
app.run_server(debug = False)