GithubHelp home page GithubHelp logo

alanocallaghan / d3heatmap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from talgalili/d3heatmap

2.0 2.0 3.0 461 KB

A D3.js-based heatmap htmlwidget for R

License: Other

R 20.89% CSS 3.34% HTML 69.44% JavaScript 6.33%

d3heatmap's Introduction

I work on statistical models and their applications for biomedical data. At the moment I am working on Bayesian modelling of eQTLs using allele specific expression in celltype-specific studies of immune-mediated diseases. Previously I worked on quantifying expression heterogeneity in single cell RNAseq data using a Bayesian approach.

I maintain some R packages:

I currently maintain two parts of the Bioconductor book ecosystem:

Book/Chapter Devel Release Issues Pull requests
OSCA devel release GitHub issues GitHub pulls
OSCA.multisample devel release GitHub issues GitHub pulls

I also contribute to:

  • CRAN packages:
  • Bioc:
    Package Devel Release Issues Pull requests
    BASiCS GitHub issues GitHub pulls

Some other stuff:

d3heatmap's People

Contributors

alanocallaghan avatar jcheng5 avatar talgalili avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

d3heatmap's Issues

Plot not showing when NAs in matrix

Hi Alan,

I noticed that for cases where I have a matrix with some Na values the heatmap does not get displayed.

I was looking at your code and I think it has to do with the scalecolors not having an na.color attached like in the original version but I cannot confirm this. (around line 380)

Here is some code to replicate the error:

library(shiny)
library(d3heatmap)

x <- matrix( c(2, 4, NA, 8,5 ,9 ,3 ,5 ,7 ,9 ,NA ,5 ,3 ,6 ,7 , 1, 5, 7, 6, 1),
             nrow=4, ncol=5)

ui <- fluidPage(
  titlePanel("d3heatmap example"),  
  d3heatmapOutput("multiHeatmap", height = "800px") 
)

server <- function(input, output) {
  output$multiHeatmap <- renderD3heatmap({
    d3heatmap(x, 
              main = "TEST",
              show_color_legend = TRUE,
              scale = "column",
              na.color = 'grey'
    )           
  })
}

shinyApp(ui = ui, server = server)

Thanks,

Julio

Color legend not showing

Hi Alan,

I am trying to generate the heatmap with the color legend and as mentioned I have a issue with the color legend not showing.
After some research I found that part of the legend is being displayed on the top-left corner but the size is so small that I can only see a letter from the legend title.

Looking into the generated code I noticed that all the width and height of the "class=bar" elements is set to 0. Same for the Y values.

On the console log I got the following error:
d3heatmap.js:48
Uncaught TypeError: self.getId is not a function(anonymous function) @ d3heatmap.js:48
img.onload @ d3heatmap.js:98

Here is a simple code I used for the test:
library(shiny)
library(d3heatmap)

Create a data matrix

x <- matrix( c(2, 4, 3, 8,5 ,9 ,3 ,5 ,7 ,9 ,7 ,5 ,3 ,6 ,7 , 1, 5, 7, 6, 1),
nrow=4, ncol=5)

UI with title and heatmap

ui <- fluidPage(
titlePanel("d3heatmap example"),

d3heatmapOutput("multiHeatmap", height = "800px")
)

Call to server to generate the heatmap with color legend enabled.

server <- function(input, output) {
output$multiHeatmap <- renderD3heatmap({
d3heatmap(x,
main = "TEST",
show_color_legend = TRUE,
scale = "column"
)
})
}
shinyApp(ui = ui, server = server)

heatmap_test

xaxis.style not a function error when running in Shiny app.

Hi Alan,

All of a sudden my heatmap have stop working when using them in Shiny.
The error I got when inspecting the console is

xaxis.style is not a function at heatmapcore.js line 276

The same code seem to work fine is I just run it outside of shiny in R-studio.

It may be that something in D3 have changed that is breaking the code?
I will investigate the issue but not very familiar with D3 and javascript so may take a while but was wondering if you have noticed a similar issue.

I will let you know of any findings.

Thanks,

Julio

Legend on the heatmap

Hi,

I tried to use your package in order to add a legend on my heatmap. Here my code :

d3heatmap(data_to_plot_heatmap_MANUAL_samples_log,show_color_legend=TRUE, colors = colorRampPalette(rev(brewer.pal(n = 7, name = "RdYlBu")))(100),cexCol=1,cexRow=1, labCol=colnames(data_to_plot_heatmap_MANUAL_samples_log))

Here my output :
image

I see a "legend" but, I have no idea of the numerical value assigned at each color. In your example you have :
image

With values assigned.

Do you know what's wrong with my code?

Thank you.
Best,
Amandine

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.