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

unmounting/remounting dcc.Graphs > 16 times with WebGL children results in WebGL contexts warning #535

Open
wbrgss opened this issue Apr 19, 2019 · 1 comment

Comments

@wbrgss
Copy link
Contributor

wbrgss commented Apr 19, 2019

Console warning: WARNING: Too many active WebGL contexts. Oldest context will be lost.

The "oldest" WebGL graph will be un-rendered:

webgl-contexts

Dash app used to demo this bug (same as in #534)
  • Using Chromium Version 73.0.3683.86 (Official Build) Built on Ubuntu , running on Ubuntu 18.04 (64-bit)
  • Using Dash 0.41.0
import dash
import dash_html_components as html
import dash_core_components as dcc

app = dash.Dash(__name__)

app.layout = html.Div(children=[
    html.Div([
        # without the fix in this PR, this graph will disappear after clicking
        # graphs back and forth ~8 times
        dcc.Graph(
            id='example-graph-ex',
            figure={
                'data': [
                    {'x': [1, 2, 3], 'y': [4, 1, 2],
                        'type': 'scattergl', 'name': 'SF'},
                    {'x': [1, 2, 3], 'y': [2, 4, 5],
                     'type': 'scattergl', 'name': u'Montréal'},
                ]
            }
        )
    ]),
    dcc.Tabs(id="tabs", children=[
        dcc.Tab(label='Tab one', children=[
            html.Div([
                dcc.Graph(
                    id='example-graph',
                    figure={
                        'data': [
                            {'x': [1, 2, 3], 'y': [4, 1, 2],
                                'type': 'scattergl', 'name': 'SF'},
                            {'x': [1, 2, 3], 'y': [2, 4, 5],
                             'type': 'scattergl', 'name': u'Montréal'},
                        ]
                    }
                )
            ])
        ]),
        dcc.Tab(label='Tab two', children=[
                dcc.Graph(
                    id='example-graph-1',
                    figure={
                        'data': [
                            {'x': [1, 2, 3], 'y': [1, 4, 1],
                                'type': 'scattergl', 'name': 'SF'},
                            {'x': [1, 2, 3], 'y': [1, 2, 3],
                             'type': 'scattergl', 'name': u'Montréal'},
                        ]
                    }
                )
        ]),
        dcc.Tab(label='Tab three', children=[
                dcc.Graph(
                    id='example-graph-2',
                    figure={
                        'data': [
                            {'x': [1, 2, 3], 'y': [2, 4, 3],
                                'type': 'scattergl', 'name': 'SF'},
                            {'x': [1, 2, 3], 'y': [5, 4, 3],
                             'type': 'scattergl', 'name': u'Montréal'},
                        ]
                    }
                )
        ]),
    ])
])


if __name__ == '__main__':
    app.run_server(debug=True)
@wbrgss wbrgss changed the title unmounting/remounting dcc.Graphs with WebGL children results in WebGL contexts warning unmounting/remounting dcc.Graphs > 16 times with WebGL children results in WebGL contexts warning Apr 19, 2019
@wbrgss
Copy link
Contributor Author

wbrgss commented Apr 24, 2019

Seems to be fixed as of dash==0.43.0rc3 — keeping this open until it's released & I can confirm

@wbrgss wbrgss closed this as completed Jun 25, 2019
@wbrgss wbrgss reopened this Jun 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant