gaospecial / ggVennDiagram

A 'ggplot2' implement of Venn Diagram.
https://gaospecial.github.io/ggVennDiagram/
GNU General Public License v3.0
282 stars 38 forks source link

Create Clickable R shiny Venn Diagram #25

Closed larry1995 closed 3 years ago

larry1995 commented 3 years ago

Hi Mr. Gao,

I am currently using your ggVennDiagram package. It's a great package for me to discover the relationship between my data. However, I wonder if there is any way that I can click on the Venn plot and return the exact gene list. E.g. I click on the intersection part and I will get a table of those genes. image

Thank you for your help.

Sincerely, Hao

gaospecial commented 3 years ago

I currently can't give a solution as you expected.

However, you may show intersections with hovertext like this:

genes <- paste0("gene",1:1000)
gene_list <- list(A = sample(genes,100),
    B = sample(genes,200),
    C = sample(genes,300),
    D = sample(genes,200))
library(ggVennDiagram)
ggVennDiagram(gene_list, show_intersect = TRUE)

or use the function get_region_items() like this:

venn = Venn(gene_list)
get_region_items(venn)