From 9c0a9c9ff32c53212d2d43e0ae3cc664137315e6 Mon Sep 17 00:00:00 2001 From: Octavian Date: Tue, 26 Dec 2017 15:01:20 +0100 Subject: [PATCH] Sankey tooltip: if link value passed as string, don't round to integer (#217) --- inst/htmlwidgets/sankeyNetwork.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/inst/htmlwidgets/sankeyNetwork.js b/inst/htmlwidgets/sankeyNetwork.js index f5cac1e0..8fded80a 100755 --- a/inst/htmlwidgets/sankeyNetwork.js +++ b/inst/htmlwidgets/sankeyNetwork.js @@ -94,7 +94,10 @@ HTMLWidgets.widget({ var formatNumber = d3.format(",.0f"), - format = function(d) { return formatNumber(d); } + format = function(d) { + if (typeof d === "string") return d; + return formatNumber(d); + } // create d3 sankey layout sankey