-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
venn.Rmd
83 lines (54 loc) · 1.92 KB
/
venn.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
---
title: "UpSet.js Venn and Euler Diagrams"
author: "Samuel Gratzl"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{UpSet.js Venn and Euler Diagrams}
%\VignetteEngine{knitr::rmarkdown}
\usepackage[utf8]{inputenc}
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# UpSet.js R Widget - Venn Diagrams
UpSet.js has a basic support for classical Venn and Euler diagrams for two or three sets.
```{r libraries}
# devtools::install_url("https://github.com/upsetjs/upsetjs_r/releases/latest/download/upsetjs.tar.gz")
library(upsetjs)
```
## Basic User Interface
```{r, fig.width=9, fig.height=5, out.width="850px", tidy=TRUE, fig.align='center'}
listInput <- list(one = c('a', 'b', 'c', 'e', 'g', 'h', 'k', 'l', 'm'), two = c('a', 'b', 'd', 'e', 'j'), three = c('a', 'e', 'f', 'g', 'h', 'i', 'j', 'l', 'm'))
w <- upsetjsVennDiagram() %>% fromList(listInput) %>% interactiveChart()
w
```
Euler diagrams are based on [venn.js](https://github.com/upsetjs/venn.js)
thus supporting more than three sets but might result in unexpected results
```{r, fig.width=9, fig.height=5, out.width="850px", tidy=TRUE, fig.align='center'}
we <- upsetjsEulerDiagram() %>% fromList(listInput) %>% interactiveChart()
we
```
## Input Formats
same as for `upsetjs`: `fromList`, `fromDataFrame`, and `fromExpression`
## Data Intersections
not possible to define since the number of sections in the Venn diagrams are fixed
## Interaction
### Interactivity
same as `upsetjs`
### Selection
same as `upsetjs`
## Queries
same as `upsetjs`
## Attributes
not supported
## Styling
### Theme
same as `upsetjs`
### Title
provided as a different function: `chartVennLabels`
```{r, fig.width=9, fig.height=5, out.width="850px", tidy=TRUE, fig.align='center'}
upsetjsVennDiagram() %>%
fromList(listInput) %>%
chartVennLabels(title = "Chart Title", description = "this is a long chart description")
```