Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
^.*\.Rproj$
^\.Rproj\.user$
^\.github$
13 changes: 6 additions & 7 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
Package: rhtmlDendrogram
Type: Package
Title: What the Package Does (Title Case)
Version: 1.0.0
Author: Who wrote it
Maintainer: The package maintainer <yourself@somewhere.net>
Description: More about what it does (maybe more than one line)
Use four spaces when indenting paragraphs within the Description.
License: What license is it under?
Title: R htmlwidget package for creating interactive dendrograms
Version: 1.0.1
Author: Displayr <opensource@displayr.com>
Maintainer: Displayr <opensource@displayr.com>
Description: R htmlwidget package for creating interactive dendrograms.
License: GPL-3
Imports: htmlwidgets
Encoding: UTF-8
LazyData: true
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![Coverage Status](https://coveralls.io/repos/github/Displayr/rhtmlDendrogram/badge.svg?branch=master)](https://coveralls.io/github/Displayr/rhtmlDendrogram?branch=master)
# rhtmlDendrogram

What the Package Does (Title Case)
R htmlwidget package for creating interactive dendrograms

## Installation

Expand Down
14 changes: 11 additions & 3 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 + ";'>";
t = t + "Name: " + d.data.name + "<br>" + "<table class='tipTable'>";
t = t + "<div class='tipTableContainer' style='white-space:nowrap;" + "font-size:" + ft_s + "px;font-family:" + escapeTipHtml(ft_f) + ";'>";
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:" + escapeTipHtml(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
14 changes: 11 additions & 3 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 + "<div class='tipTableContainer' style='white-space:nowrap;" + "font-size:" + ft_s + "px;font-family:" + escapeTipHtml(ft_f) + ";'>";
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:" + escapeTipHtml(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