armish / coffeewheel

D3 Coffee Wheel visualization ported to R via htmlwidgets framework
30 stars 8 forks source link

renderCoffeewheel is frozen by renderMetabologram #6

Closed kmezhoud closed 9 years ago

kmezhoud commented 9 years ago

HI, In this screenshot I set in radiobuttons "zoom" for renderCoffeewheel and "static" for renderMetabologram to get the same wheel with legend but when static radioButton is active I get a frozen Coffeewhell: https://drive.google.com/file/d/0B9NOY9eukkEeUFdPYllKby15TlE/view?usp=sharing Please see bellow the two renders.

maybe a Third issue to download coffeewheel as gif file, can avoid the use of metabologram in my case. I am trying to save the coffeewheel as gif file. I need maybe ImageMagic... Thanks

get Wheel for Profiles Data

output$getCoffeeWheel <- renderCoffeewheel({ withProgress(message = 'Creating Wheel. Waiting...', value = 0.1, { Sys.sleep(0.25)

Open graph in Browser and not in Viewer

options(viewer = NULL)

getListProfData()

Shiny.unbindAll()

CoffeewheelTreeProfData <- reStrDimension(r_data$ListProfData)

title<- paste("Profiles Data: CNA, Exp, RPPA, miRNA")

coffeewheel(CoffeewheelTreeProfData, width=600, height=600, partitionAttribute="value") # main=title })

})

output$metabologram <- renderMetabologram({

CoffeewheelTreeData <- reStrDimension(r_data$ListProfData)

get Legend for static coffewheel

#devtools::install_github("armish/metabologram")
#library("metabologram")
title<- paste("Wheel with selected Studies")
metabologram(CoffeewheelTreeData, width=600, height=600, main=title, showLegend = TRUE, fontSize = 12, legendBreaks=c("NA","Min","Negative", "0", "Positive", "Max"), legendColors=c("black","blue","cyan","white","yellow","red") , legendText="Legend")

})

armish commented 9 years ago

Hi Karim,

I am a little bit confused: are you using the metabologram or the coffeewheel? We should be able to resolve this, but just wanted to make sure I commit the changes to the proper repository.

Thanks, -- Arman

kmezhoud commented 9 years ago

Hi Arman, I am using CoffeeWheel and also Metabologram for the Legend. His font/style is better than CoffeeWheel. If CoffeeWheel has the same Style, smaller font and legend, I stop to use Metabologram. Thanks

armish commented 9 years ago

Hi Karim,

I think you should use one of them at the same time as they will simply over-draw things. Is there a particular reason why you are not using only the metabologram? Do you need arbitrary levels of depth for your code? If so, I think it is better if you draw the legends with another plotting function in a multi-panel manner.

I don't have any experience about combining interactive plots together with core R plots, but it should be doable within Shiny, right?

And sorry that I don't have the time to move the legend functionally over to the original coffeewheel implementation. But if you can do that, I will be more than happy to merge your changes into the default branch.

kmezhoud commented 9 years ago

:) 1- Metabologram does not have zooming option. 2- No need for arbitrary levels of depth for code. 3- Yes, drawing legend in sidebarPanel for example is possible. 4- The combining interactive plots is doable. In my App, Coffeewheel updates Wheel when I change Study. 5- I will think about CoffeeWheel and Legend.

And How about saving Gif file?

Thanks

armish commented 9 years ago

Hi Karim,

I see -- then it makes sense you are using both of them.

The GIF is tricky: do you want to take a snapshot of it (if so you should be able to extract an SVG file from the D3 drawing) or do you need the animated form (which I don't think you will able to do without any external tool)

kmezhoud commented 9 years ago

Hi Arman, How to extract an SVG file from D3 coffeeWheel? I need to code with JS? example: http://d3export.housegordon.org/ thanks

armish commented 9 years ago

Yeah, unfortunately you have to do that via JS.