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

Fix image exports for new #4386 mocks with SVG gradients #4441

Merged
merged 2 commits into from
Dec 24, 2019

Conversation

etpinard
Copy link
Contributor

fixes #4438 - a follow-up from #4386.

Please note that exporting those new mocks worked fine in our (old) imagetest container, the problem was only noticed during a ./tasks/noci_test.sh run.


Commit b4ac79e is the bare-bone fix and test 🔒

Commit 55d76b2 introduces a more robust way of handling gradient URL strings during image exports. Let me know what you think!

cc @archmoj

... during image exports, instead of having hard-coded list
    of query-selectors in toSVG routine.
@etpinard etpinard added bug something broken type: maintenance labels Dec 24, 2019
var svgDOM = parser.parseFromString(svg, 'image/svg+xml');

var fillItems = svgDOM.getElementsByClassName('legend3dandfriends');
expect(fillItems.length).toBe(4, '# of legend items');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Before this PR, fillItems.length was 0

};
var k = className2query(d3.select(sel.node().parentNode)) +
'>' + className2query(sel);
fullLayout._gradientUrlQueryParts[k] = 1;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could go further by trying to construct a full xpath for each nodes with a gradient url, but I think this here is good enough for now.

@archmoj
Copy link
Contributor

archmoj commented Dec 24, 2019

@etpinard
Thanks very much for the fix.
💃 💃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Recent toImage problems
2 participants