Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

dcc Graphs reset their relayout on tab change #1007

Open
@matt-sd-watson

Description

@matt-sd-watson

I have a few dcc.Graphs that render histograms in my Dash app. In one instance, I have a callback that will update a shape on the histogram if the proper data exists in dcc.Loading.

Upon updating the callback, the relayout of the graph will look something like this:

{'shapes': [{'editable': True, 'label': {'text': ''}, 'xref': 'x', 'yref': 'y', 'layer': 'above', 'opacity': 1, 'line': {'color': '#444', 'width': 4, 'dash': 'solid'}, 'fillcolor': 'rgba(0,0,0,0)', 'fillrule': 'evenodd', 'type': 'rect', 'x0': 10.060903897849462, 'y0': 44456.17081925675, 'x1': 23.7705813172043, 'y1': -804.9102618243243}]}

however, on a tab change within the app, upon returning to the tab with the histogram, the relayout of the histogram has updated to:

{'autosize': True}

despite having no logic within the callbacks to allow a callback on a tab change. This continues to occur even by limiting callbacks to no include certain actions such as:

ctx.triggered_id != "tabs"

where tabs is the id of the tab set.

This is odd because the shape that is declared in the callback is not removed or modified in any way, but the change to the relayout affects a number of other linked callbacks erroneously.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions