-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Conversation
... during image exports, instead of having hard-coded list of query-selectors in toSVG routine.
var svgDOM = parser.parseFromString(svg, 'image/svg+xml'); | ||
|
||
var fillItems = svgDOM.getElementsByClassName('legend3dandfriends'); | ||
expect(fillItems.length).toBe(4, '# of legend items'); |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.
@etpinard |
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