---
title: "UpSet.js Karnaugh Map"
author: "Samuel Gratzl"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{UpSet.js Karnaugh Map}
  %\VignetteEngine{knitr::rmarkdown}
  \usepackage[utf8]{inputenc}
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

# UpSet.js R Widget - Karnaugh Map

UpSet.js has a basic support for adapted version of Karnaugh Maps.

```{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 <- upsetjsKarnaughMap() %>% fromList(listInput) %>% interactiveChart()
w
```

## 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: `chartKarnaughMapLabels`

```{r, fig.width=9, fig.height=5, out.width="850px", tidy=TRUE, fig.align='center'}
upsetjsKarnaughMap() %>%
  fromList(listInput) %>%
  chartKarnaughMapLabels(title = "Chart Title", description = "this is a long chart description")
```

