Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modified Graph.react.js to include restyle event #483

Merged
merged 9 commits into from Mar 18, 2019
8 changes: 6 additions & 2 deletions test/test_integration.py
Expand Up @@ -640,7 +640,11 @@ def on_click(n_clicks):
'x': [1, 2, 3, 4],
'y': [4, 3, 2, 1]
}
]
],
'layout': {
'width': 700,
'height': 450
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what to say about this one... I'm tempted to consider it a bug, but I don't know what we'd do to fix it. The issue - and I still don't understand why it's triggered intermittently here, but it's a real issue users will face - is that if you have an autosized graph that's initially drawn in a display: none container, it gets the default size. It keeps that default size when the container is displayed, because no redraw is triggered. But if the window is resized at all, THEN the graph gets sized correctly.

This seems to sometimes happen on CI - see eg https://percy.io/plotly/dash-core-components/builds/1576352?utm_campaign=plotly&utm_content=dash-core-components&utm_source=github_status - so I'm just locking down the size here.

}

self.startServer(app=app)
Expand Down Expand Up @@ -1196,8 +1200,8 @@ def _on_confirmed(submit_n_clicks, cancel_n_clicks,
return 'canceled'

self.startServer(app)
self.snapshot(test_name + ' -> initial')
button = self.wait_for_element_by_css_selector('#button')
self.snapshot(test_name + ' -> initial')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

take the snapshot after we know the button exists


button.click()
time.sleep(1)
Expand Down