Venn: 'Venn'

View source: R/venn.R

VennR Documentation

Venn

Description

Venn diagram (also known as Euler diagram). Minimizes sum of squared residuals to find the best overlap. Where no diagram appears, it is likely that there is a problem with the inputs. This is a wrapper for http://www.buildingwidgets.com/blog/2015/6/5/week-22-d3vennr, which in turn is a wrapper for http://www.benfrederickson.com/venn-diagrams-with-d3.js/.

Usage

Venn(
  x = NULL,
  weights = NULL,
  colors = c("#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd", "#8c564b", "#e377c2",
    "#7f7f7f", "#bcbd22", "#17becf"),
  opacity = NULL,
  global.font.family = "Arial",
  data.label.font.autocolor = TRUE,
  data.label.font.color = "#FFFFFF",
  data.label.font.family = global.font.family,
  data.label.font.size = 14,
  hovertext.font.family = global.font.family,
  hovertext.font.size = 14,
  values.hovertext.format = ""
)

Arguments

x

A data.frame logical (converted to logical using >= 1 if not) or a JSON-like list.

weights

An optional vector of weights, or, the name or, the name of a variable in x. It may not be an expression.

colors

A character vector specifying the color of each circle.

opacity

Numeric; Opacity of circles as an alpha value (0 to 1).

global.font.family

Font family of all text elements. These can be overriden for individual text elements.

data.label.font.autocolor

Logical; Whether font color should be automatically set to the same as the circle color. When this is true, data.label.font.color is ignored.

data.label.font.color

Font color of data labels (ignored if data.label.font.autocolor).

data.label.font.family

Font family of data labels.

data.label.font.size

The font size of the labels. Defaults to 20.

hovertext.font.family

Font family of hovertext (i.e tooltips).

hovertext.font.size

Font size of hovertext in pixels.

values.hovertext.format

A string representing a d3 formatting code. See https://github.com/mbostock/d3/wiki/Formatting#numbers. This option only applies when x is a data.frame.

Examples

Venn(list(
   list("sets"= list(0), "label"= "Like", "size"= 100),
   list("sets"= list(1), "label"= "Love", "size"= 50),
   list("sets"= list(2), "label"= "Dislike", "size"= 100),
   list("sets"= list(3), "label"= "Hate", "size"= 50),
   list("sets"= list(0, 1), "size"= 50),
   list("sets"= list(0, 2), "size"= 0),
   list("sets"= list(2, 3), "size"= 50)))

Displayr/flipStandardCharts documentation built on Feb. 26, 2024, 12:42 a.m.