Skip to content

Commit

Permalink
vignette charts more examples
Browse files Browse the repository at this point in the history
  • Loading branch information
pvictor committed Sep 25, 2024
1 parent 2e0d843 commit 04c0231
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: vchartr
Title: Interactive Charts with the JavaScript 'VChart' Library
Version: 0.0.0.9100
Version: 0.1.0
Authors@R: c(
person("Victor", "Perrier", email = "[email protected]", role = c("aut", "cre")),
person("Fanny", "Meyer", role = "aut"))
Expand Down
7 changes: 7 additions & 0 deletions man/vchartr-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 53 additions & 0 deletions vignettes/articles/charts.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,56 @@ vchart(top_cran_downloads) %>%
v_wordcloud(aes(word = package, count = count, color = package))
```



## Venn Diagram

Create venn diagrams with `v_venn`:

```{r venn}
data.frame(
sets = c("A", "B", "C", "A,B", "A,C", "B,C", "A,B,C"),
value = c(8, 10, 12, 4, 4, 4, 2)
) %>%
vchart() %>%
v_venn(aes(sets = sets, value = value))
```



## Waterfall Chart

Create waterfall charts with `v_waterfall`:

```{r waterfall}
data.frame(
desc = c("Starting Cash",
"Sales", "Refunds", "Payouts", "Court Losses",
"Court Wins", "Contracts", "End Cash"),
amount = c(2000, 3400, -1100, -100, -6600, 3800, 1400, 2800)
) %>%
vchart() %>%
v_waterfall(aes(x = desc, y = amount))
```



## Sunburst Chart

Create sunburst charts with `v_sunburst`:

```{r sunburst}
vchart(countries_gdp) %>%
v_sunburst(
aes(lvl1 = REGION_UN, lvl2 = SUBREGION, lvl3 = ADMIN, value = GDP_MD),
gap = 10,
labelAutoVisible = list(
enable = TRUE
),
labelLayout = list(
align = "center",
rotate = "radial"
)
)
```

2 changes: 2 additions & 0 deletions vignettes/vchartr.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ The following graphs (and more) can be produced:

See the [JavaScript library website](https://www.visactor.io/vchart) for more examples and documentation.

Interactive examples are available here: [https://dreamrs.github.io/vchartr/articles/charts.html](https://dreamrs.github.io/vchartr/articles/charts.html).


## Usage

Expand Down

0 comments on commit 04c0231

Please sign in to comment.