main
parent
a4c16662db
commit
1ceea5c614
|
@ -97,6 +97,14 @@ app.layout = html.Div(
|
|||
),
|
||||
]
|
||||
),
|
||||
dbc.Row(
|
||||
[
|
||||
dbc.Col(width=6),
|
||||
dbc.Col(
|
||||
[dcc.Graph(id="graph_69")], width=6
|
||||
),
|
||||
]
|
||||
),
|
||||
],
|
||||
className="tab_content",
|
||||
),
|
||||
|
@ -165,6 +173,24 @@ def update_graph_2(min_value):
|
|||
return fig
|
||||
|
||||
|
||||
@app.callback(Output("graph_69", "figure"), Input("graph_2", "relayoutData"))
|
||||
def update_graph_2(selected_data):
|
||||
if selected_data is None or (
|
||||
isinstance(selected_data, dict) and "xaxis.range[0]" not in selected_data
|
||||
):
|
||||
dff = df
|
||||
else:
|
||||
dff = df[
|
||||
(df["x"] >= selected_data.get("xaxis.range[0]"))
|
||||
& (df["x"] <= selected_data.get("xaxis.range[1]"))
|
||||
& (df["y"] >= selected_data.get("yaxis.range[0]"))
|
||||
& (df["y"] <= selected_data.get("yaxis.range[1]"))
|
||||
]
|
||||
fig = px.scatter(dff, x="x", y="y")
|
||||
fig.update_layout(template="plotly_white")
|
||||
return fig
|
||||
|
||||
|
||||
@app.callback(
|
||||
Output("graph_3", "figure"),
|
||||
Output("graph_4", "figure"),
|
||||
|
|
Loading…
Reference in New Issue