Empty figure#
Sometimes you need to have an empty dashboard, in case there is no data or when you start the dashboard. By default, Plotly displays only axes with no data and a grid. To get rid of this ugly element, you can simply set the element to be completely transparent.
So in the following example you can compare the default and fully transparent initial graph for dash.
from dash import dcc, html
from jupyter_dash import JupyterDash
from plotly import graph_objects as go
from IPython.display import clear_output
app = JupyterDash(__name__)
options = list(range(0,20))
value = [1,5]
lst_val_to_slider_marks = lambda value: {val:str(val) for val in value}
app.layout = html.Div(
[
dcc.Graph(),
dcc.Graph(
figure = go.Figure(
layout = dict(
xaxis = {"visible" : False},
yaxis = {"visible" : False},
paper_bgcolor = 'rgba(0, 0, 0, 0)',
plot_bgcolor = 'rgba(0, 0, 0, 0)',
dragmode = False
)
)
)
]
)
app.run_server(debug=True)
clear_output()
