Skip to content

Conversation

@antoinerg
Copy link
Contributor

This makes for more robust tests since a style attribute can override the width and height attribute of a DOM element. We now check for both to be safe.

@plotly/core-contributors

describe('responsive figure', function() {
var gd;
var data = [{x: [1, 2, 3, 4], y: [5, 10, 2, 8]}];
var data = [{type: 'scatter', x: [1, 2, 3, 4], y: [5, 10, 2, 8]}];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is scatter by default, but it is clearer if we make it explicit.

var mainSvgs = document.getElementsByClassName('main-svg');
checkElementsSize(mainSvgs, elWidth / 2, elHeight / 2);

var canvases = document.getElementsByTagName('canvas');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Checking the size of the canvas elements sandwiched between the SVG elements is also very important.

@VeraZab
Copy link

VeraZab commented Jan 25, 2019

@antoinerg , maybe use @plotly/plotly_js ? @plotly/core-contributors notifies a lot more people, who don't necessarily work with plotly.js :)

@etpinard
Copy link
Contributor

💃 thanks!

Next time though:

@antoinerg antoinerg merged commit e94ee3d into master Jan 25, 2019
@antoinerg antoinerg deleted the improve-responsive-tests branch January 30, 2019 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants