venndir | R Documentation |
Directional Venn diagram
venndir(
setlist,
overlap_type = c("detect", "concordance", "each", "overlap", "agreement"),
sets = NULL,
set_colors = NULL,
setlist_labels = NULL,
legend_labels = NULL,
proportional = FALSE,
show_labels = "Ncs",
main = NULL,
return_items = TRUE,
show_items = c(NA, "none", "sign item", "sign", "item"),
max_items = 3000,
show_zero = FALSE,
font_cex = c(1, 1, 0.8),
show_label = NA,
display_counts = TRUE,
poly_alpha = 0.6,
alpha_by_counts = FALSE,
label_style = c("basic", "fill", "shaded", "shaded_box", "lite", "lite_box"),
label_preset = "none",
template = c("wide", "tall"),
unicode = TRUE,
big.mark = ",",
curate_df = NULL,
venn_jp = NULL,
inside_percent_threshold = 0,
item_cex = NULL,
item_style = c("default", "text", "gridtext"),
item_buffer = -0.15,
sign_count_delim = ": ",
padding = c(3, 2),
r = 2,
center = c(0, -0.15),
segment_distance = 0.1,
sep = "&",
do_plot = TRUE,
verbose = FALSE,
debug = 0,
circle_nudge = NULL,
lwd = 1,
rotate_degrees = 0,
...
)
setlist |
|
overlap_type |
|
sets |
|
set_colors |
|
setlist_labels |
|
legend_labels |
|
proportional |
|
show_labels |
The label types are defined below:
|
main |
|
return_items |
|
show_items |
|
max_items |
|
show_zero |
|
font_cex |
The default |
poly_alpha |
|
alpha_by_counts |
|
label_style |
|
label_preset |
|
template |
|
unicode |
|
big.mark |
|
curate_df |
|
venn_jp |
|
inside_percent_threshold |
|
item_cex |
|
item_style |
|
item_buffer |
|
sign_count_delim |
|
padding |
|
r |
|
center |
|
segment_distance |
|
sep |
|
do_plot |
'logical (default TRUE) indicating whether to generate the the figure.
|
verbose |
|
debug |
|
circle_nudge |
|
rotate_degrees |
|
... |
additional arguments are passed to |
Venndir
object with slots:
"jps"
: JamPolygon
which contains each set polygon, and each
overlap polygon defined for the Venn diagram.
"label_df"
: data.frame
which contains the coordinates for each
Venn set, and Venn overlap label.
"setlist"
: list
as input to venndir()
. This entry may be empty.
When do_plot=TRUE
this function also calls render_venndir()
,
and returns the grid
graphical objects (grobs) in the attributes:
"gtree"
: a grid::gTree
object suitable for drawing
with grid::grid.draw(attr(vo, "gtre"))
"grob_list"
: a list
of grid
object components used to build
the complete diagram, they can be plotted individually, or
assembled with do.call(grid::gList, grob_list)
.
The grid::gList
can be assembled into a gTree
with:
grid::grobTree(gList=do.call(grid::gList, grob_list)
"viewport"
: the grid::viewport
that holds important context
for the graphical objects, specifically the use of coordinate
grid::unit
measure "snpc"
, which maintains a fixed aspect ratio.
Other venndir core:
render_venndir()
,
signed_overlaps()
,
textvenn()
,
venn_meme()
setlist <- make_venn_test(100, 3, do_signed=FALSE);
setlist <- make_venn_test(100, 3, do_signed=TRUE);
vo <- venndir(setlist)
jamba::sdim(vo);
# custom set labels
vo <- venndir(setlist,
setlist_labels=paste("set", LETTERS[1:3]))
# custom set labels with Markdown custom colors
vo <- venndir(setlist,
setlist_labels=paste0("Set <span style='color:blue'>", LETTERS[1:3], "</span>"))
# custom set and legend labels
vo <- venndir(setlist,
setlist_labels=paste0("set<br>", LETTERS[1:3]),
legend_labels=paste("Set", LETTERS[1:3]))
# custom set and legend labels
# proportional
# Set Name is inside with show_labels having lowercase "n"
vo <- venndir(setlist,
proportional=TRUE,
show_labels="ncs",
label_style="lite box",
setlist_labels=paste0("Set: ", LETTERS[1:3]),
legend_labels=paste("Set", LETTERS[1:3]))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.