This is my code:
import dash
import dash_bootstrap_components as dbc
import dash_html_components as html
from dash.dependencies import Input, Output, State
import dash_core_components as dcc
import base64
import pandas as pd
import plotly.express as px
app = dash.Dash(name,external_stylesheets=[dbc.themes.JOURNAL])
app.layout = html.Div(
[
dbc.Button(
“Click to toggle popover”, id=“popover-target”, color=“danger”
),
dbc.Popover(
[
dbc.PopoverHeader(“Popover header”),
dbc.PopoverBody(“And here’s some amazing content. Cool!”),
],
id=“popover”,
is_open=False,
target=“popover-target”,
),
]
)
@app.callback(
Output(“popover”, “is_open”),
[Input(“popover-target”, “n_clicks”)],
[State(“popover”, “is_open”)],
)
def toggle_popover(n, is_open):
if n:
return not is_open
return is_open
if name == ‘main’:
app.run_server(port=3004)
1 post - 1 participant