Skip to content

Saving the gene.plot locally as svg file #1

@Yatros

Description

@Yatros

Hello,

I downloaded your package, because I would like to make high resolution figures with your package for publication purposes. I would like to have the output plot not only in png format but also as a vectorial figure.

Is there a way of modifying the code of the geneplots.R file so that I do not only get the png format of the plot, but that I can also save the plot locally in svg format?

I have been able to add the Download Data and Download Plot to the web browser by adding this code to the ui.R file:

[...]
actionButton("plot", label = "Plot"),
downloadButton('downloadData', 'Download Table'),
downloadButton('downloadPlot', 'Download Plot')
). 
[...]

and by adding the following code to the server.R file:

[...]
return(plot.table)
    
    output$downloadData <- downloadHandler(
            filename = function() { paste(input$gene, '.csv', sep='') },
            content = function(file) {
                    write.csv(datatasetInput(), file)
            })
    
    output$downloadPlot <- downloadHandler(
            filename = function() { paste(input$gene, '.svg', sep='') },
            content = function(gene.plot) {
                    device <- function(gene.plot, width, height) {
                            grDevices::svg(gene.plot, width = width, height = height,
                                           res = 300, units = "in")
                    }
                    ggsave(Test, plot = gene.plot, device = device)
            })
[...]

The problem is that I don't know how to redirect the Table content and the plot content to these two buttons so that I can download them.

Can you please add this feature to your code?

Thank you very much,

Best,

Yatros

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions