Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
gaospecial committed Dec 19, 2023
1 parent 6cabfaf commit 1ef3d11
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 47 deletions.
40 changes: 14 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,20 @@

[![](http://cranlogs.r-pkg.org/badges/grand-total/ggVennDiagram)](https://cran.r-project.org/package=ggVennDiagram)
[![](http://cranlogs.r-pkg.org/badges/last-month/ggVennDiagram)](https://cran.r-project.org/package=ggVennDiagram)
[![](http://cranlogs.r-pkg.org/badges/last-week/ggVennDiagram)](https://cran.r-project.org/package=ggVennDiagram)
[![](https://img.shields.io/badge/doi-10.3389/fgene.2021.706907-blue.svg)](https://doi.org/10.3389/fgene.2021.706907)
[![](https://www.r-pkg.org/badges/version/ggVennDiagram?color=green)](https://cran.r-project.org/package=ggVennDiagram)
[![](https://img.shields.io/badge/devel%20version-1.4.6-green.svg)](https://github.com/gaospecial/ggVennDiagram)
[![](https://img.shields.io/badge/devel%20version-1.4.7-green.svg)](https://github.com/gaospecial/ggVennDiagram)
[![](https://codecov.io/gh/gaospecial/ggVennDiagram/branch/master/graph/badge.svg?token=c365345d-e34c-40f6-b2c0-881b5b2841e7)](https://codecov.io/gh/gaospecial/ggVennDiagram)
<!-- badges: end -->

`ggVennDiagram`’ enables fancy Venn plot with 2-7 sets and generates
publication quality figure.
publication quality figure. It also support upset plot with unlimited
number of sets from version 1.4.4.

## Installation

You can install the released version of ggVennDiagram from
[CRAN](https://CRAN.R-project.org) with (under evaluation in CRAN):
[CRAN](https://CRAN.R-project.org) with:

``` r
install.packages("ggVennDiagram")
Expand Down Expand Up @@ -74,10 +75,10 @@ ggVennDiagram(x) + scale_color_brewer(palette = "Paired")

<img src="man/figures/README-unnamed-chunk-3-2.png" width="90%" />

`ggVennDiagram` now support 2-7 dimension Venn plot. The generated
figure is generally ready for publish. The main function
`ggVennDiagram()` will check how many items in the first parameter and
call corresponding function automatically.
`ggVennDiagram` support 2-7 dimension Venn plot. The generated figure is
generally ready for publish. The main function `ggVennDiagram()` will
check how many items in the first parameter and call corresponding
function automatically.

The parameter `category.names` is set names. And the parameter `label`
can label how many items are included in each parts.
Expand All @@ -95,7 +96,7 @@ ggVennDiagram(x,category.names = c("Stage 1","Stage 2","Stage 3", "Stage4"), lab

<img src="man/figures/README-unnamed-chunk-4-2.png" width="90%" />

Set `label_alpha = 0` to remove label background
Set `label_alpha = 0` to remove label background.

``` r
ggVennDiagram(x, label_alpha=0)
Expand Down Expand Up @@ -154,22 +155,16 @@ In web browser or RStudio, you will get:
# Customizing your plot

There are three components in a Venn plot: 1) the set labels; 2) the
edge of sets; and 3) the filling regions of each parts. We separately
stored these data in a structured S4 class `VennPlotData` object, in
which labels, edges and regions are stored as simple features.

Simple features or simple feature access refers to a formal standard
(ISO 19125-1:2004) that describes how objects in the real world can be
represented in computers, with emphasis on the spatial geometry of these
objects. But here we employed this to describe the coordinates of Venn
components.
edge of sets; and 3) the filling regions and labels (optional) of each
parts. We separately stored these data in a structured `VennPlotData`
object, in which labels, edges and regions are stored as data frames.

In general, `ggVennDiagram()` plot a Venn in three steps:

- get the coordinates of a applicable shape from internal `shapes`
datasets.
- calculate sub regions of sets, including both the shape regions and
sets members, and return a `PlotDataVenn` object that includes all
sets members, and return a `VennPlotData` object that includes all
necessary definitions. We implement a number of set operations
functions to do this job.
- plot using `ggplot2` functions.
Expand Down Expand Up @@ -260,13 +255,6 @@ upset_plot(venn, nintersects = 30, relative_height = 2, relative_width = 0.3)

# Futher information

## Venn Diagram cookbook in R

I have released a online book to introduce the development of
`ggVennDiagram`, it contains a chapter that compare many different R
packages in plotting a Venn. Refer to [Venn Diagram cookbook in
R](https://venn.bio-spring.top).

## 公众号文章

*@GuangchuangYu* 的公众号下面,我投稿了两篇文章,介绍了
Expand Down
28 changes: 7 additions & 21 deletions README.rmd
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ library("badger")
<!-- badges: start -->
`r badge_cran_download("ggVennDiagram", type = "grand-total")`
`r badge_cran_download("ggVennDiagram", type = "last-month")`
`r badge_cran_download("ggVennDiagram", type = "last-week")`
`r badge_doi("10.3389/fgene.2021.706907", "blue")`
`r badge_cran_release("ggVennDiagram","green")`
`r badge_devel(color = "green")`
`r badge_codecov(token = "c365345d-e34c-40f6-b2c0-881b5b2841e7")`
<!-- badges: end -->

'`ggVennDiagram`' enables fancy Venn plot with 2-7 sets and generates publication quality figure.
'`ggVennDiagram`' enables fancy Venn plot with 2-7 sets and generates publication quality figure. It also support upset plot with unlimited number of sets from version 1.4.4.

## Installation

You can install the released version of ggVennDiagram from [CRAN](https://CRAN.R-project.org) with (under evaluation in CRAN):
You can install the released version of ggVennDiagram from [CRAN](https://CRAN.R-project.org) with:

``` r
install.packages("ggVennDiagram")
Expand Down Expand Up @@ -66,8 +66,6 @@ x <- list(A=sample(genes,300),
```




`ggVennDiagram` return a `ggplot` object, the fill/edge colors can be further modified with `ggplot` functions.

```{r}
Expand All @@ -77,7 +75,7 @@ ggVennDiagram(x) + scale_fill_gradient(low="blue",high = "red")
ggVennDiagram(x) + scale_color_brewer(palette = "Paired")
```

`ggVennDiagram` now support 2-7 dimension Venn plot. The generated figure is generally ready for publish. The main function `ggVennDiagram()` will check how many items in the first parameter and call corresponding function automatically.
`ggVennDiagram` support 2-7 dimension Venn plot. The generated figure is generally ready for publish. The main function `ggVennDiagram()` will check how many items in the first parameter and call corresponding function automatically.

The parameter `category.names` is set names. And the parameter `label` can label how many items are included in each parts.

Expand All @@ -87,7 +85,7 @@ ggVennDiagram(x,category.names = c("Stage 1","Stage 2","Stage 3", "Stage4"))
ggVennDiagram(x,category.names = c("Stage 1","Stage 2","Stage 3", "Stage4"), label = "none")
```

Set `label_alpha = 0` to remove label background
Set `label_alpha = 0` to remove label background.

```{r}
ggVennDiagram(x, label_alpha=0)
Expand Down Expand Up @@ -117,8 +115,6 @@ If only several items were included, intersections may also be viewed interactiv
ggVennDiagram(y, show_intersect = TRUE)
```



In web browser or RStudio, you will get:

```{r echo=FALSE}
Expand All @@ -128,17 +124,13 @@ knitr::include_graphics("https://vnote-1251564393.cos.ap-chengdu.myqcloud.com/ty
# Customizing your plot

There are three components in a Venn plot: 1) the set labels; 2) the edge of sets;
and 3) the filling regions of each parts. We separately stored these data in a structured S4 class
`VennPlotData` object, in which labels, edges and regions are stored as simple features.

Simple features or simple feature access refers to a formal standard (ISO 19125-1:2004) that describes how objects in the real world can be represented in computers, with emphasis on the spatial geometry of these objects. But here we employed this to describe the coordinates of Venn
components.
and 3) the filling regions and labels (optional) of each parts. We separately stored these data in a structured `VennPlotData` object, in which labels, edges and regions are stored as data frames.

In general, `ggVennDiagram()` plot a Venn in three steps:

- get the coordinates of a applicable shape from internal `shapes` datasets.
- calculate sub regions of sets, including both the shape regions and sets members,
and return a `PlotDataVenn` object that includes all necessary definitions.
and return a `VennPlotData` object that includes all necessary definitions.
We implement a number of set operations functions to do this job.
- plot using `ggplot2` functions.

Expand Down Expand Up @@ -229,12 +221,6 @@ upset_plot(venn, nintersects = 30, relative_height = 2, relative_width = 0.3)

# Futher information

## Venn Diagram cookbook in R

I have released a online book to introduce the development of `ggVennDiagram`,
it contains a chapter that compare many different R packages in plotting a Venn.
Refer to [Venn Diagram cookbook in R](https://venn.bio-spring.top).

## 公众号文章

*@GuangchuangYu* 的公众号下面,我投稿了两篇文章,介绍了 "`ggVennDiagram`" 包开发的始末。
Expand Down

0 comments on commit 1ef3d11

Please sign in to comment.