How can I delete/hide graph

Hi there! I have some question.

I am doing something new style graph. It`s utilize clickedData with multiple outputs

I want change new graph in same space as click one factor

my plan is like this:

  1. generate main graph (id = main_graph)

  2. select one factor from main graph

  3. execute callback function and generate new graph that is detail about selected data
    (id = sub_graph)

  4. hide or delete main_graph and show new graph same space

I tried some way but duplicate id is unavailable and also I have no idea how can I do for delete or hide graph

maybe you need callback like this

app.layout = html.Div([
    html.Div(
        dcc.Graph(id = 'main_graph'),
        id = 'parent'
    )
])
           
@app.callback(
    Output('parent', 'children'),
    [Input('main_graph', 'clickedData')])
def myfun(x): 
    ...
    return dcc.Graph(id = 'main_graph')
1 Like