render_venndir | R Documentation |
Render venndir output
render_venndir(
venndir_output = NULL,
expand_fraction = NULL,
font_cex = 1,
main = NULL,
item_cex = NULL,
item_cex_factor = 1,
plot_warning = FALSE,
show_labels = NULL,
show_items = NULL,
item_degrees = NULL,
max_items = 100,
show_zero = TRUE,
show_segments = NULL,
segment_buffer = NULL,
label_preset = c("none"),
label_style = c("custom", "basic", "fill", "shaded", "shaded_box", "lite", "lite_box"),
fontfamily = NULL,
inside_percent_threshold = 0,
item_style = NULL,
item_buffer = NULL,
group_labels = TRUE,
template = NULL,
adjust_center = FALSE,
draw_legend = NULL,
legend_x = "bottomright",
legend_font_cex = NULL,
show_label = NA,
display_counts = TRUE,
do_newpage = TRUE,
do_draw = TRUE,
draw_buffer = FALSE,
verbose = FALSE,
debug = FALSE,
...
)
venndir_output |
|
expand_fraction |
|
font_cex |
|
main |
|
item_cex |
|
item_cex_factor |
|
plot_warning |
|
show_labels |
The label types are defined below:
|
show_items |
|
item_degrees |
|
max_items |
|
show_zero |
|
show_segments |
|
segment_buffer |
|
label_preset |
|
label_style |
|
fontfamily |
|
inside_percent_threshold |
|
item_style |
|
item_buffer |
|
group_labels |
|
template |
|
adjust_center |
|
draw_legend |
|
legend_x |
|
legend_font_cex |
|
do_newpage |
|
do_draw |
|
verbose |
|
debug |
|
... |
additional arguments are passed to internal functions. |
R handles unicode symbols for each graphics device somewhat independently. Creating a PNG uses a different set of fonts than creating a PDF. Not all fonts used for PNG are compatible with PDF, and vice versa. (It is not solely an R problem.)
For the most part, users should not have to care about these details...
How this affects venndir:
Not every font registered in R supports extended unicode characters
upArrow
and downArrow
, which causes it to draw blank boxes like []
.
The quick options:
Try a different fontfamily
that may support the characters of interest.
Try a different grob type, see text_grob_type="marquee"
below.
Install extrafont
, which may be useful for installing consistent
fonts to be used with PNG and PDF output formats.
Several options are passed through ...
(ellipses) to internal
functions, documented below:
L_threshold
is passed to make_color_contrast()
and controls
the _L_uminance at which text is either dark or light.
text_grob_type
is passed to assemble_venndir_labels()
and controls
the text grid
graphical object (grob) type used.
Note that "marquee"
requires the marquee
package, which implicitly
requires R-4.3 or newer, though somehow that is not a formal dependency.
R-4.3 adds glyph rendering, which is required by marquee
.
text_grob_type="textGrob"
(default) uses grid::textGrob()
which only handles text, and no markdown. It is also fastest.
text_grob_type="richtext_grob"
uses gridtext::richtext_grob()
,
and requires the gridtext
package.
It handles a subset of markdown (bold, italics, but not bullets),
and a subset of HTML markup such as inline CSS styles.
It sometimes produces visual glitches, where whitespace between
words can be inconsistent, otherwise it would have been the default.
text_grob_type="marquee"
uses marquee::marquee_grob()
, which
requires the marquee
package. It may rarely cause a full R crash
on MacOS, apparently due to font handling subsystems, otherwise it
would have been the default. Its rendering of Unicode is outstanding,
since it uses systemfonts
to substitute any missing glyphs per font,
for example the upArrow/downArrow symbols.
It handles full markdown, including bullets, but not tables, nor HTML.
It does not support table format, through version 0.1.0, however.
fontfamilies
is passed to assemble_venndir_label()
, as a list
with three named elements: "overlap"
, "count"
, "signed"
.
The fontfamily can be customized for each element, which may be useful for a custom font for the overlap label, and a different font (e.g. one that contains upArrow/downArrow unicode characters) for the count and signed count labels.
The custom font is also accepted by venndir_legender()
for
consistency.
outerborder
,outerborder.lwd
,innerborder
,innerborder.lwd
,
border
,border.lwd
- these arguments are passed to plot.JamPolygon()
and override internal values when defined. They can be used to produce
interesting visual variations of the Venn diagram. For example:
outerborder.lwd=0, innerborder.lwd=0, border="white", border.lwd=3
will use a white border.
outerborder.lwd=0, innerborder.lwd=4, border="white", border.lwd=1
will use a wide internal border, and thin white line between overlaps.
Venndir
object with attributes that contain underlying
grid
graphical objects (grobs):
"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:
signed_overlaps()
,
textvenn()
,
venn_meme()
,
venndir()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.