Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: rhtmlDendrogram
Type: Package
Title: What the Package Does (Title Case)
Version: 1.0.0
Version: 1.0.1
Author: Who wrote it
Maintainer: The package maintainer <yourself@somewhere.net>
Description: More about what it does (maybe more than one line)
Expand Down
12 changes: 10 additions & 2 deletions inst/htmlwidgets/lib/dendroNetwork/dendroNetwork.js
Original file line number Diff line number Diff line change
Expand Up @@ -523,17 +523,25 @@ function DendroNetwork() {

var maxBarLength = 50;
var tipBarScale = d3.scaleLinear().domain([tipMin/2, tipMax]).range([0, maxBarLength])
var escapeTipHtml = function (value) {
return String(value)
.replace(/&/g, "&amp;")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&#39;");
};
node.each(function(d) {
if (d.data.tips) {
var ft_s = options.tooltipsFontSize;
var ft_f = options.tooltipsFontFamily;
var t = "";
var nval = d.data.tips.length;
t = t + "<div class='tipTableContainer' style='white-space:nowrap;" + "font-size:" + ft_s + "px;font-family:" + ft_f + ";'>";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

t = t + "Name: " + d.data.name + "<br>" + "<table class='tipTable'>";
t = t + "Name: " + escapeTipHtml(d.data.name) + "<br>" + "<table class='tipTable'>";
for (var i = 0; i < nval; i++) {
t = t + "<tr>";
t = t + "<td class='tipDClassification' style='white-space:nowrap;" + "font-size:" + ft_s + "px;font-family:" + ft_f + ";'>" + options.colnames[i] + "</td>";
t = t + "<td class='tipDClassification' style='white-space:nowrap;" + "font-size:" + ft_s + "px;font-family:" + ft_f + ";'>" + escapeTipHtml(options.colnames[i]) + "</td>";
t = t + "<td class='tipDClassification' style='white-space:nowrap;'>";
t = t + "<div style='width:" + tipBarScale(d.data.tips[i]) + "px;height:8px;background-color:steelblue'></div>" + "</td>";
t = t + "</tr>";
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"engines": {
"node": ">=6.9.5"
},
"overrides": {
"graceful-fs": "^4.2.11"
},
"devDependencies": {
"babel-plugin-array-includes": "^2.0.3",
"babel-plugin-transform-object-assign": "^6.22.0",
Expand Down
12 changes: 10 additions & 2 deletions theSrc/scripts/lib/dendroNetwork/dendroNetwork.js
Original file line number Diff line number Diff line change
Expand Up @@ -523,17 +523,25 @@ function DendroNetwork() {

var maxBarLength = 50;
var tipBarScale = d3.scaleLinear().domain([tipMin/2, tipMax]).range([0, maxBarLength])
var escapeTipHtml = function (value) {
return String(value)
.replace(/&/g, "&amp;")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&#39;");
};
node.each(function(d) {
if (d.data.tips) {
var ft_s = options.tooltipsFontSize;
var ft_f = options.tooltipsFontFamily;
var t = "";
var nval = d.data.tips.length;
t = t + "<div class='tipTableContainer' style='white-space:nowrap;" + "font-size:" + ft_s + "px;font-family:" + ft_f + ";'>";
t = t + "Name: " + d.data.name + "<br>" + "<table class='tipTable'>";
t = t + "Name: " + escapeTipHtml(d.data.name) + "<br>" + "<table class='tipTable'>";
for (var i = 0; i < nval; i++) {
t = t + "<tr>";
t = t + "<td class='tipDClassification' style='white-space:nowrap;" + "font-size:" + ft_s + "px;font-family:" + ft_f + ";'>" + options.colnames[i] + "</td>";
t = t + "<td class='tipDClassification' style='white-space:nowrap;" + "font-size:" + ft_s + "px;font-family:" + ft_f + ";'>" + escapeTipHtml(options.colnames[i]) + "</td>";
t = t + "<td class='tipDClassification' style='white-space:nowrap;'>";
t = t + "<div style='width:" + tipBarScale(d.data.tips[i]) + "px;height:8px;background-color:steelblue'></div>" + "</td>";
t = t + "</tr>";
Expand Down
Loading