render_venndir: Render venndir output

render_venndirR Documentation

Render venndir output

Description

Render venndir output

Usage

render_venndir(
  venndir_output = NULL,
  expand_fraction = 0,
  font_cex = 1,
  item_cex = NULL,
  item_cex_factor = 4,
  plot_warning = TRUE,
  show_labels = NULL,
  show_items = c(NA, "none", "sign item", "item", "sign"),
  item_degrees = 0,
  max_items = 100,
  show_zero = TRUE,
  show_segments = TRUE,
  segment_buffer = -0.1,
  label_preset = c("none"),
  label_style = c("custom", "basic", "fill", "shaded", "shaded_box", "lite", "lite_box"),
  fontfamily = "Arial",
  inside_percent_threshold = 0,
  item_style = c("text", "gridtext"),
  item_buffer = -0.15,
  group_labels = TRUE,
  adjust_center = FALSE,
  draw_legend = TRUE,
  legend_x = "bottomright",
  legend_font_cex = 1,
  show_label = NA,
  display_counts = TRUE,
  draw_buffer = FALSE,
  ...
)

Arguments

venndir_output

Venndir output from venndir()

expand_fraction

numeric value indicating how much to expand the figure range beyond the default calculated for the Venn diagram. Values above zero cause the Venn diagram to be slighly smaller.

font_cex

numeric vector recycled and applied in order:

  1. Set label

  2. Overlap count label

  3. Signed count label

The default c(1, 1, 0.8) defines the signed count label slightly smaller than other labels.

item_cex

numeric value (default NULL) used to resize item labels.

  • When item_cex is a single value or NULL, auto-scaling is performed based upon the number of items in each overlap polygon, and the relative polygon areas. Any single numeric value for item_cex is multiplied by the auto-scaled value for each overlap region.

  • When two or more values are supplied as a vector, the values are recycled and applied across all Venn overlap regions, in the order they appear in signed_overlaps().

item_cex_factor

numeric value used to adjust pre-calculated item fontsizes.

plot_warning

logical indicating whether to include a warning when one or more non-zero overlap counts cannot be displayed in the figure. Not yet re-implemented for version 0.0.30.900.

show_labels

character string to define the labels to display, and where they should be displayed. The definition uses a single letter to indicate each type of label to display, using UPPERCASE to display the label outside the Venn shape, and lowercase to display the label inside the Venn shape. The default "Ncs" displays _N_ame (outside), _c_ount (inside), and _s_igned count (inside).

The label types are defined below:

  • _N_ame: "n" or "N" - the set name, by default it is displayed.

  • _O_verlap: "o" or "O" - the overlap name, by default it is hidden, because these labels can be very long, also the overlap should be evident in the Venn diagram already.

  • _c_ount: "c" or "C" - overlap count, independent of the sign

  • _p_ercentage: "p" or "P" - overlap percentage, by default hidden, but available as an option

  • _s_igned count: "s" or "S" - the signed overlap count, tabulated based upon overlap_type ("each", "concordant", "agreement", etc/)

  • _i_tems: "i" only, by default hidden. When enabled, item labels defined by show_items are spread across the specific Venn overlap region.

show_items

character used to define the item label, only used when the show_label entry includes "i" which enables item display inside the Venn diagram.

  • "item": shows only the item labels

  • "sign": shows only the sign of each item

  • "sign items": shows the sign and item together (or "item sign" will show the item, then the sign).

item_degrees

numeric angle (default 0) in degrees used to adjust item label display.

max_items

numeric (default 3000) indicating the maximum number of item labels to display when enabled.

show_zero

logical (default FALSE) indicating whether empty overlaps are labeled with count zero 0. When show_zero=TRUE the count zero label is displayed, otherwise no count label is shown.

show_segments

logical (default TRUE) indicating whether to draw a line segment from the Venn region to any label positioned outside.

segment_buffer

numeric (default -0.1) indicating the depth inside each Venn region a line segment will be drawn, relevant only when show_segments=TRUE.

label_preset

character deprecated in favor of show_labels. This argument is passed to venndir_label_style().

label_style

character string indicating the style for labels. Label color is adjusted based upon the determined background color, determined based upon the label fill color, and either the device background color, or Venn overlap fill color. There are pre-defined label styles.

  • "basic" no background shading

  • "fill" an opaque colored background

  • "shaded" a partially transparent colored background

  • "lite" a partially transparent lite background

  • "box" adds a dark border around the label region

fontfamily

character font family

inside_percent_threshold

numeric (default 0) indicating the percent area that a Venn overlap region must contain in order for the count label to be displayed inside the region, otherwise the label is displayed outside the region. Values are expected to range from 0 to 100.

item_style

character string (default "text") indicating the style to display item labels when they are enabled.

  • "text" option is substantially faster, but does not allow markdown.

  • "gridtext": substantially slower for a large number of labels, but enables use of limited markdown by calling gridtext::richtext_grob(). Mostly useful for venn_meme().

item_buffer

numeric value (default -0.15) indicating the buffer adjustment applied to Venn overlap regions before arranging item labels. Passed to label_fill_JamPolygon() via render_venndir(). Negative values are recommended, so they shrink the region.

group_labels

logical (default TRUE) indicating whether to group label components together, therefore drawing fill and border around the group instead of each component. In most cases this setting should be TRUE.

adjust_center

logical (default TRUE) used when labels are grouped, whether the group should be re-centered on the target point. Try adjust_center=FALSE if wide label groups are adjusted so that the count label is too far left.

draw_legend

logical (default TRUE) indicating whether to draw a legend, calling venndir_legender().

legend_x

character passed to venndir_legender() to customize the position of the legend.

legend_font_cex

numeric scalar to adjust the legend font size.

...

additional arguments are passed to render_venndir().

See Also

Other venndir core: signed_overlaps(), textvenn(), venn_meme(), venndir()


jmw86069/venndir documentation built on June 15, 2024, 1:52 p.m.