christophergandrud / christophergandrud/networkD3
<br> in Node tooltips should be \n instead to render correctly in Chrome and Edge
- Dominant language
- R
- Stars
- 659
- Forks
- 259
- PR merge metrics
- No merged PRs in 30d
Description
This is a new issue for an old problem: how text displays in tooltips. For "links", the two lines are separated by a newline character `\n`. For "nodes", the two lines are separated by a `
` tag.
While this works in Safari, it does not appear to work in Chrome or Edge. The `
` tag is just ignored and the two lines run together.
I believe the answer is simple. In the line below, just replace `
` with `\n` (like the way links are handled) to fix the problem. I've edited my local copy of sankeyNetwork.js and this now works on Safari, Chrome and Edge.
https://github.com/christophergandrud/networkD3/blob/9c0a9c9ff32c53212d2d43e0ae3cc664137315e6/inst/htmlwidgets/sankeyNetwork.js#L187
As an aside, I believe using `
` _should work_ in Chrome and Edge. I've posted a question on StackOverflow to ask this [question](https://stackoverflow.com/questions/54848306/br-inside-pre-works-in-safari-but-not-chrome-or-edge)
Do you want me to make this change via pull request?
Contributor guide
No contributing guide indexed for this repository
Research direction
Open inst/htmlwidgets/sankeyNetwork.js around line 187 and compare how node and link tooltip text separators are handled. Reproduce the tooltip behavior in Chrome or Edge, then verify that node labels display on separate lines in Chrome, Edge, and Safari.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- d3js, javascript, r
- Domain
- data-visualization, frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100