Skip to content

Commit 2dce1b8

Browse files
committed
code cleanup
1 parent 8ede98e commit 2dce1b8

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

R/lineup.R

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
#' LineUp module
22
#'
3-
#' <Add Description>
3+
#' a htmlwidget wrapper around LineUp (http://lineup.caleydo.org)
44
#'
55
#' @import htmlwidgets
66
#'
77
#' @export
88
lineup <- function(data, width = NULL, height = NULL, elementId = NULL) {
9+
# escape remove .
10+
colnames(data) <- gsub("[.]", "_", colnames(data))
11+
912
toDescription <- function(col, colname) {
1013
clazz <- class(col)
14+
# print(paste(colname, clazz))
1115
if (clazz == 'numeric') {
1216
list(type='number',column=colname, domain=c(min(col),max(col)))
1317
} else if (clazz == 'factor') {

inst/htmlwidgets/lineup.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ HTMLWidgets.widget({
55
type: 'output',
66

77
factory: function(el, width, height) {
8-
9-
var data = LineUpJS.createLocalStorage([], []);
10-
// TODO: define shared variables for this instance
118
el.style.width = width;
129
el.style.height = height;
1310
el.style.position = 'relative';
1411
el.style.overflow = 'auto';
12+
13+
var data = LineUpJS.createLocalStorage([], []);
1514
var lineup = LineUpJS.create(data, el, { body: { renderer: 'canvas'}});
1615

1716
return {

0 commit comments

Comments
 (0)