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 <br> tag.
While this works in Safari, it does not appear to work in Chrome or Edge. The <br> tag is just ignored and the two lines run together.
I believe the answer is simple. In the line below, just replace <br> 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.
|
.html(function(d) { return "<pre>" + d.name + "<br>" + format(d.value) + |
As an aside, I believe using <br> should work in Chrome and Edge. I've posted a question on StackOverflow to ask this question
Do you want me to make this change via pull request?
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<br>tag.While this works in Safari, it does not appear to work in Chrome or Edge. The
<br>tag is just ignored and the two lines run together.I believe the answer is simple. In the line below, just replace
<br>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.networkD3/inst/htmlwidgets/sankeyNetwork.js
Line 187 in 9c0a9c9
As an aside, I believe using
<br>should work in Chrome and Edge. I've posted a question on StackOverflow to ask this questionDo you want me to make this change via pull request?