Skip to content

Commit

Permalink
version 0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
m-jahn authored and cran-robot committed Jan 10, 2024
1 parent 7953211 commit f885744
Show file tree
Hide file tree
Showing 12 changed files with 267 additions and 235 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
@@ -1,7 +1,7 @@
Package: WeightedTreemaps
Title: Generate and Plot Voronoi or Sunburst Treemaps from Hierarchical
Data
Version: 0.1.1
Version: 0.1.2
Authors@R: c(
person("Michael", "Jahn", , "jahn@mpusp.mpg.de", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-3913-153X")),
Expand Down Expand Up @@ -40,11 +40,11 @@ LazyData: true
RoxygenNote: 7.2.3
SystemRequirements: C++17
NeedsCompilation: yes
Packaged: 2023-12-13 15:31:30 UTC; michael
Packaged: 2024-01-08 07:58:02 UTC; michael
Author: Michael Jahn [aut, cre] (<https://orcid.org/0000-0002-3913-153X>),
David Leslie [aut],
Ahmadou Dicko [aut] (<https://orcid.org/0000-0002-9654-7582>),
Paul Murrell [aut, cph] (<https://orcid.org/0000-0002-3224-8858>)
Maintainer: Michael Jahn <jahn@mpusp.mpg.de>
Repository: CRAN
Date/Publication: 2023-12-13 18:00:02 UTC
Date/Publication: 2024-01-09 10:20:09 UTC
22 changes: 11 additions & 11 deletions MD5
@@ -1,33 +1,33 @@
3b57a936b67e0e7bcbcf3ba1790c64c4 *DESCRIPTION
d6657bcdcc1cc631b359d325de959d13 *DESCRIPTION
737c1fe3bbfb8d532ad6b2e8fa6d8dfd *NAMESPACE
3b63a1097b2b4261a5091d35e966b329 *NEWS.md
0f4349d9e3c72c860e6427f8ce4cda09 *NEWS.md
908bab554451d574963038deca51531e *R/RcppExports.R
a29e50d4126e7b67094c9f2513f04124 *R/allocate.R
c7d1d4c29aefa306a7bcb78df38695a5 *R/class_definitions.R
52dbfb177b5be13c281e8fb7b25073ab *R/data.R
830a474195be9f01dc79b4dfc938c03f *R/drawTreemap.R
5a7d1da88eb621826521c176f19ba5aa *R/drawTreemap.R
350b75f14e5ebca95445c12bdfe99573 *R/drawUtils.R
63919927e38764dd0fe1cc6cb7c0be78 *R/polygon_centroids.R
6f18d7779faf6bb3b26286d0a62bdd47 *R/sunburst.R
dc68b558572eba63eefc7a03ea2a6441 *R/sysdata.rda
47065497a728d5532edd0e3e694fc997 *R/tesselation.R
db8372eaf4a1633ab6992a84bfd7ba01 *R/validate_input.R
9d68028a9e7bf943da9e90226e77486d *R/validate_treemap.R
f9874939e27c2fb31c47b8d070abc384 *R/voronoiTreemap.R
fe148db7c757c4a90d770de1145cb5f2 *README.md
c1fd295113984474878017f87b22699f *R/voronoiTreemap.R
3f4151ddb09a4a867884bbcafe337429 *README.md
a4a7b759fd1f5a298c48c3a1c77bd87f *build/vignette.rds
9d2961b621753764a1dca9f9732771bd *data/Jahn_CellReports_2018.RData
4a33690b9407929307cce0296eb87207 *data/Jahn_CellReports_2018.csv
7f28cbd4fce924248bbe30c4a149c36e *data/rounded_rect.RData
74f32a7f16fa611912076d90759ffd35 *data/rounded_rect.csv
a8c06edb4adbaf1b988252978f2814a8 *inst/doc/WeightedTreemaps.R
5462dbbddc6148e0f78bef22d41a5f1f *inst/doc/WeightedTreemaps.Rmd
826612b2718dfccad3896f3d50c6e6da *inst/doc/WeightedTreemaps.html
5422fcb6fcb79cb6454a1a8b55846552 *inst/doc/WeightedTreemaps.R
72bcb86cd29e6d6c88f5d86f5a918e0e *inst/doc/WeightedTreemaps.Rmd
4b57411dad134c9a21be0ed1ee335995 *inst/doc/WeightedTreemaps.html
39a00b14e2f7f755894824ff5c4a4801 *man/Jahn_CellReports_2018.Rd
199746ae0514d90c26f45fc8d1ea0969 *man/as.data.frame.sunburstResult.Rd
555268f55eabb196eb8afe099b2777ba *man/as.data.frame.voronoiResult.Rd
478f1dbecb2faaf12e1e960f7dc87fe3 *man/cropped_voronoi.Rd
26b7c14d1c92618ab11acace7c28dfeb *man/drawTreemap.Rd
b16cb15f31f111437326212ec31af310 *man/drawTreemap.Rd
eba674a4a3901cc592e14afe74bf00a3 *man/get_polygons.Rd
beb99f56dd98a1bb256f9d039b2b977a *man/poly_area.Rd
7c511153ae524d7a99a2deaddca98f15 *man/poly_centroid.Rd
Expand All @@ -38,11 +38,11 @@ efac6c8c9527ab516b97cecd2bf75e9e *man/print.voronoiResult.Rd
626f68268a68fd27990b8181e16b8103 *man/summary.sunburstResult.Rd
85c3c0e62bdd7ff1c991fa1c870d9466 *man/summary.voronoiResult.Rd
a004dfa8b1914a96db4fb0f4df028768 *man/sunburstTreemap.Rd
0483fd6741b01c4bd617c2cc6103d6ab *man/voronoiTreemap.Rd
328ed296c3eb1e7432e58d95e0e2a13f *man/voronoiTreemap.Rd
187c8080a0a21071f9f12a8e1f70f2bc *src/Makevars
4aceda9fb68aa66fb99422b9da58230d *src/RcppExports.cpp
0cd4345bfeaa460fda8eef0d241e39f3 *src/voronoiDiagram.cpp
5462dbbddc6148e0f78bef22d41a5f1f *vignettes/WeightedTreemaps.Rmd
72bcb86cd29e6d6c88f5d86f5a918e0e *vignettes/WeightedTreemaps.Rmd
8345eb7416ad08e45f72d7f3d27d8b3f *vignettes/png/unnamed-chunk-10-1.png
a91cdab76cd93a1eba662a1f6c001bfc *vignettes/png/unnamed-chunk-13-1.png
343b1fd0548ce57ea1015a56c16be63e *vignettes/png/unnamed-chunk-4-1.png
Expand Down
4 changes: 3 additions & 1 deletion NEWS.md
@@ -1,5 +1,7 @@
# WeightedTreemaps 0.1.2

# WeightedTreemaps 0.1.1

- The package was prepared for release on CRAN
- A Shiny app for generating treemaps from custom data is now
available at [Shinyapps.io](https://m-jahn.shinyapps.io/ShinyTreemaps/)
available at [Shinyapps.io](https://m-jahn.shinyapps.io/ShinyTreemaps/)
53 changes: 28 additions & 25 deletions R/drawTreemap.R
Expand Up @@ -75,41 +75,44 @@
#' the input for the drawing function
#'
#' @examples
#' # load example data
#' data(mtcars)
#' mtcars$car_name = gsub(" ", "\n", row.names(mtcars))
#' # load package
#' library(WeightedTreemaps)
#'
#' # generate treemap; set seed to obtain same pattern every time
#' # generate dummy data
#' df <- data.frame(
#' A = rep(c("abcd", "efgh"), each = 4),
#' B = letters[1:8],
#' size = c(37, 52, 58, 27, 49, 44, 34, 45)
#' )
#'
#' # compute treemap
#' tm <- voronoiTreemap(
#' data = mtcars,
#' levels = c("gear", "car_name"),
#' cell_size = "wt",
#' shape = "rounded_rect",
#' data = df,
#' levels = c("B"),
#' cell_size = "size",
#' shape = "circle",
#' positioning = "regular",
#' seed = 123
#' )
#'
#' # draw treemap
#' drawTreemap(tm, label_size = 2)
#' # plot treemap with each cell colored by name (default)
#' drawTreemap(tm, label_size = 1, color_type = "categorical")
#'
#' # draw different variants of the same treemap on one page using
#' # the 'layout' and 'position' arguments (indicating rows and columns)
#' drawTreemap(tm, title = "treemap 1", label_size = 2,
#' color_type = "categorical", color_level = 1,
#' layout = c(1,3), position = c(1, 1))
#' # plot treemap with each cell colored by name, but larger cells
#' # lighter and smaller cells darker
#' drawTreemap(tm, label_size = 1, color_type = "both")
#'
#' drawTreemap(tm, title = "treemap 2", label_size = 2,
#' color_type = "categorical", color_level = 2, border_size = 3,
#' add = TRUE, layout = c(1,3), position = c(1, 2))
#'
#' drawTreemap(tm, title = "treemap 3", label_size = 2,
#' color_type = "cell_size", color_level = 2,
#' color_palette = heat.colors(10),
#' border_color = grey(0.4), label_color = grey(0.4),
#' add = TRUE, layout = c(1,3), position = c(1, 3),
#' title_color = "black")
#' # plot treemap with different color palette and style
#' drawTreemap(tm, label_size = 1, label_color = grey(0.3),
#' border_color = grey(0.3), color_palette = heat.colors(6)
#' )
#'
#' # ---------------------------------------------
#'
#' # load example data
#' data(mtcars)
#' mtcars$car_name = gsub(" ", "\n", row.names(mtcars))
#'
#' # generate sunburst treemap
#' tm <- sunburstTreemap(
#' data = mtcars,
Expand Down
49 changes: 24 additions & 25 deletions R/voronoiTreemap.R
Expand Up @@ -81,38 +81,37 @@
#' @seealso \code{\link{drawTreemap}} for drawing the treemap.
#'
#' @examples
#' # load example data
#' data(mtcars)
#' mtcars$car_name = gsub(" ", "\n", row.names(mtcars))
#' # load package
#' library(WeightedTreemaps)
#'
#' # generate treemap; set seed to obtain same pattern every time
#' # generate dummy data
#' df <- data.frame(
#' A = rep(c("abcd", "efgh"), each = 4),
#' B = letters[1:8],
#' size = c(37, 52, 58, 27, 49, 44, 34, 45)
#' )
#'
#' # compute treemap
#' tm <- voronoiTreemap(
#' data = mtcars,
#' levels = c("gear", "car_name"),
#' cell_size = "wt",
#' shape = "rounded_rect",
#' data = df,
#' levels = c("B"),
#' cell_size = "size",
#' shape = "circle",
#' positioning = "regular",
#' seed = 123
#' )
#'
#' # draw treemap
#' drawTreemap(tm, label_size = 2)
#' # plot treemap with each cell colored by name (default)
#' drawTreemap(tm, label_size = 1, color_type = "categorical")
#'
#' # draw different variants of the same treemap on one page using
#' # the 'layout' and 'position' arguments (indicating rows and columns)
#' drawTreemap(tm, title = "treemap 1", label_size = 2,
#' color_type = "categorical", color_level = 1,
#' layout = c(1,3), position = c(1, 1))
#' # plot treemap with each cell colored by name, but larger cells
#' # lighter and smaller cells darker
#' drawTreemap(tm, label_size = 1, color_type = "both")
#'
#' drawTreemap(tm, title = "treemap 2", label_size = 2,
#' color_type = "categorical", color_level = 2, border_size = 3,
#' add = TRUE, layout = c(1,3), position = c(1, 2))
#'
#' drawTreemap(tm, title = "treemap 3", label_size = 2,
#' color_type = "cell_size", color_level = 2,
#' color_palette = heat.colors(10),
#' border_color = grey(0.4), label_color = grey(0.4),
#' add = TRUE, layout = c(1,3), position = c(1, 3),
#' title_color = "black")
#' # plot treemap with different color palette and style
#' drawTreemap(tm, label_size = 1, label_color = grey(0.3),
#' border_color = grey(0.3), color_palette = heat.colors(6)
#' )
#'
#' @importFrom Rcpp evalCpp
#' @importFrom grid grid.newpage
Expand Down
37 changes: 25 additions & 12 deletions README.md
@@ -1,16 +1,17 @@
WeightedTreemaps
================
Michael Jahn, David Leslie, Ahmadou Dicko
2023-12-12
Michael Jahn, David Leslie, Ahmadou Dicko, Paul Murrell
2024-01-07

<!-- include logo-->

<img src="images/logo.png" align="right" />

<!-- badges start -->

[![R build
status](https://github.com/m-jahn/WeightedTreemaps/workflows/R-CMD-check/badge.svg)](https://github.com/m-jahn/WeightedTreemaps/actions)
[![CRAN
status](https://www.r-pkg.org/badges/version/WeightedTreemaps)](https://CRAN.R-project.org/package=WeightedTreemaps)
[![R-CMD-check](https://github.com/m-jahn/WeightedTreemaps/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/m-jahn/WeightedTreemaps/actions/workflows/R-CMD-check.yaml)
![GitHub
issues](https://img.shields.io/github/issues/m-jahn/WeightedTreemaps)
![GitHub last
Expand All @@ -28,6 +29,12 @@ hierarchical data.

## News

*14 December 2023*

The package was finally released on CRAN! Prerequisite was testing and
troubleshooting of C++ related compilation problems, and re-release of
the CGAL dependency package `RcppCGAL` with latest version.

*25 March 2021*

A **Shiny app** for generating treemaps from custom data is now
Expand Down Expand Up @@ -83,14 +90,20 @@ was using CGAL 4 (package `cgal4h`), but now moved to the latest CGAL
usually installed automatically and manual installation of CGAL
(headers) should not be necessary.

**NOTE**: The `RcppCGAL` package is currently (September 2023) not
available on CRAN! Please install it [manually from
Note: If the `RcppCGAL` package is temporarily not available on CRAN (as
happened 2023), please install it [manually from
Github](https://github.com/ericdunipace/RcppCGAL).

## Installation

To install the package from CRAN, use:

``` r
install.packages("WeightedTreemaps")
```

To install the package directly from github, use the following function
from the `devtools` package in your R session:
from the `devtools` package:

``` r
devtools::install_github("m-jahn/WeightedTreemaps")
Expand Down Expand Up @@ -135,7 +148,7 @@ Draw the treemap.
drawTreemap(tm, label_size = 2.5, label_color = "white")
```

<img src="images/unnamed-chunk-6-1.png" width="50%" style="display: block; margin: auto;" />
<img src="images/unnamed-chunk-7-1.png" width="50%" style="display: block; margin: auto;" />

The `voronoiTreemap()` and `drawTreemap()` functions are separated in
order to allow drawing of the same treemap object in different ways.
Expand Down Expand Up @@ -170,7 +183,7 @@ drawTreemap(tm, title = "treemap 4", label_size = 2,
title_color = "black", legend = TRUE)
```

<img src="images/unnamed-chunk-7-1.png" width="100%" style="display: block; margin: auto;" />
<img src="images/unnamed-chunk-8-1.png" width="100%" style="display: block; margin: auto;" />

### Positioning of cells

Expand Down Expand Up @@ -223,7 +236,7 @@ drawTreemap(tm3, title = "positioning = 'clustered'", border_size = 3,
add = TRUE, layout = c(1,3), position = c(1, 3))
```

<img src="images/unnamed-chunk-9-1.png" width="100%" style="display: block; margin: auto;" />
<img src="images/unnamed-chunk-10-1.png" width="100%" style="display: block; margin: auto;" />

### Custom initial shapes

Expand Down Expand Up @@ -271,7 +284,7 @@ drawTreemap(tm2, add = TRUE, layout = c(1,3), position = c(1, 2))
drawTreemap(tm3, add = TRUE, layout = c(1,3), position = c(1, 3))
```

<img src="images/unnamed-chunk-12-1.png" width="100%" style="display: block; margin: auto;" />
<img src="images/unnamed-chunk-13-1.png" width="100%" style="display: block; margin: auto;" />

### Advanced example for Voronoi treemaps

Expand Down Expand Up @@ -546,7 +559,7 @@ drawTreemap(tm,
)
```

<img src="images/unnamed-chunk-22-1.png" width="100%" style="display: block; margin: auto;" />
<img src="images/unnamed-chunk-23-1.png" width="100%" style="display: block; margin: auto;" />

## References and other treemap packages

Expand Down

0 comments on commit f885744

Please sign in to comment.