Yang-Tang / d3HeatmapMod

A shiny module for d3heatmap plot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

d3HeatmapMod

A shiny module for d3heatmap plot

Introduction

This is a d3heatmap packages based shiny module that provide plot control UI and heatmap output

Pre-request

This shiny module requires following packages. Please make sure they are installed.

install.package('d3heatmap')
install.package('RColorBrewer')

Usage

  1. Source the module file
source('d3HeatmapMod.R')
  1. Invoke module in server function. Make sure to set appropriate parameters.
server <- function(input, output, session) {

  callModule(d3HeatmapMod, id = 'YOU_MODULE_ID', 
             data = reactive({mtcars}), # A numeric matrix to display (wrapped as a reactive object)
             dendrogram = reactive(NULL), # One of "none"(default), "row", "column" or "both" (wrapped as a reactive object)
             scale = reactive({'column'})) # One of "none"(default), "row" or "column" (wrapped as a reactive object)

  # other codes

}
  1. Add control ui and heatmap output
ui <- fluidPage(

  sidebarLayout(

    sidebarPanel(
      width = 3,
      d3HeatmapControl('YOU_MODULE_ID')
    ),

    mainPanel(
      width = 9,
      d3HeatmapPlot('YOU_MODULE_ID')
    )
    
  )

)
  1. Run app and use control ui to adjust the appearance of the heatmap

alt text

About

A shiny module for d3heatmap plot


Languages

Language:R 100.0%