Merged
Conversation
Fil
reviewed
Jan 2, 2022
Comment on lines
153
to
156
| const a = document.createElementNS(namespaces.svg, "a"); | ||
| a.setAttributeNS(namespaces.xlink, "href", href[i]); | ||
| if (target != null) a.setAttribute("target", target); | ||
| this.parentNode.insertBefore(a, this).appendChild(this); |
Contributor
There was a problem hiding this comment.
makes we wish we could do selection.wrap("svg:a") (related: d3/d3-selection#296)
Contributor
|
wonder if we shouldn't have target: "_blank" by default? |
Member
Author
I don’t think so, no. I do wonder whether it’s possible to set the equivalent of a |
Member
Author
|
Any other changes, @Fil? Or LGTY? |
Fil
approved these changes
Jan 2, 2022
Contributor
Fil
left a comment
There was a problem hiding this comment.
it's good, we'll just have to add tests
* cheeky test plot for href * tweak test; add snapshot Co-authored-by: Mike Bostock <mbostock@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a generic href channel that wraps the specified mark elements with an A element with the appropriate xlink:href attribute. A target option is also available (e.g., “_blank”). I didn’t implement it for grouped marks (lines and areas), but maybe I should. Fixes #283.