Skip to content

Commit 10ac991

Browse files
authored
Merge pull request #48 from m-jahn/dev
various fixes for CRAN release 0.1.2
2 parents 25774d9 + 5ead5dc commit 10ac991

18 files changed

+263
-257
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: WeightedTreemaps
22
Title: Generate and Plot Voronoi or Sunburst Treemaps from Hierarchical
33
Data
4-
Version: 0.1.1
4+
Version: 0.1.2
55
Authors@R: c(
66
person("Michael", "Jahn", , "[email protected]", role = c("aut", "cre"),
77
comment = c(ORCID = "0000-0002-3913-153X")),

NEWS.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
# WeightedTreemaps 0.1.2
2+
13
# WeightedTreemaps 0.1.1
24

35
- The package was prepared for release on CRAN
46
- A Shiny app for generating treemaps from custom data is now
5-
available at [Shinyapps.io](https://m-jahn.shinyapps.io/ShinyTreemaps/)
7+
available at [Shinyapps.io](https://m-jahn.shinyapps.io/ShinyTreemaps/)

R/drawTreemap.R

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -75,41 +75,44 @@
7575
#' the input for the drawing function
7676
#'
7777
#' @examples
78-
#' # load example data
79-
#' data(mtcars)
80-
#' mtcars$car_name = gsub(" ", "\n", row.names(mtcars))
78+
#' # load package
79+
#' library(WeightedTreemaps)
8180
#'
82-
#' # generate treemap; set seed to obtain same pattern every time
81+
#' # generate dummy data
82+
#' df <- data.frame(
83+
#' A = rep(c("abcd", "efgh"), each = 4),
84+
#' B = letters[1:8],
85+
#' size = c(37, 52, 58, 27, 49, 44, 34, 45)
86+
#' )
87+
#'
88+
#' # compute treemap
8389
#' tm <- voronoiTreemap(
84-
#' data = mtcars,
85-
#' levels = c("gear", "car_name"),
86-
#' cell_size = "wt",
87-
#' shape = "rounded_rect",
90+
#' data = df,
91+
#' levels = c("B"),
92+
#' cell_size = "size",
93+
#' shape = "circle",
94+
#' positioning = "regular",
8895
#' seed = 123
8996
#' )
9097
#'
91-
#' # draw treemap
92-
#' drawTreemap(tm, label_size = 2)
98+
#' # plot treemap with each cell colored by name (default)
99+
#' drawTreemap(tm, label_size = 1, color_type = "categorical")
93100
#'
94-
#' # draw different variants of the same treemap on one page using
95-
#' # the 'layout' and 'position' arguments (indicating rows and columns)
96-
#' drawTreemap(tm, title = "treemap 1", label_size = 2,
97-
#' color_type = "categorical", color_level = 1,
98-
#' layout = c(1,3), position = c(1, 1))
101+
#' # plot treemap with each cell colored by name, but larger cells
102+
#' # lighter and smaller cells darker
103+
#' drawTreemap(tm, label_size = 1, color_type = "both")
99104
#'
100-
#' drawTreemap(tm, title = "treemap 2", label_size = 2,
101-
#' color_type = "categorical", color_level = 2, border_size = 3,
102-
#' add = TRUE, layout = c(1,3), position = c(1, 2))
103-
#'
104-
#' drawTreemap(tm, title = "treemap 3", label_size = 2,
105-
#' color_type = "cell_size", color_level = 2,
106-
#' color_palette = heat.colors(10),
107-
#' border_color = grey(0.4), label_color = grey(0.4),
108-
#' add = TRUE, layout = c(1,3), position = c(1, 3),
109-
#' title_color = "black")
105+
#' # plot treemap with different color palette and style
106+
#' drawTreemap(tm, label_size = 1, label_color = grey(0.3),
107+
#' border_color = grey(0.3), color_palette = heat.colors(6)
108+
#' )
110109
#'
111110
#' # ---------------------------------------------
112111
#'
112+
#' # load example data
113+
#' data(mtcars)
114+
#' mtcars$car_name = gsub(" ", "\n", row.names(mtcars))
115+
#'
113116
#' # generate sunburst treemap
114117
#' tm <- sunburstTreemap(
115118
#' data = mtcars,

R/voronoiTreemap.R

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -81,38 +81,37 @@
8181
#' @seealso \code{\link{drawTreemap}} for drawing the treemap.
8282
#'
8383
#' @examples
84-
#' # load example data
85-
#' data(mtcars)
86-
#' mtcars$car_name = gsub(" ", "\n", row.names(mtcars))
84+
#' # load package
85+
#' library(WeightedTreemaps)
8786
#'
88-
#' # generate treemap; set seed to obtain same pattern every time
87+
#' # generate dummy data
88+
#' df <- data.frame(
89+
#' A = rep(c("abcd", "efgh"), each = 4),
90+
#' B = letters[1:8],
91+
#' size = c(37, 52, 58, 27, 49, 44, 34, 45)
92+
#' )
93+
#'
94+
#' # compute treemap
8995
#' tm <- voronoiTreemap(
90-
#' data = mtcars,
91-
#' levels = c("gear", "car_name"),
92-
#' cell_size = "wt",
93-
#' shape = "rounded_rect",
96+
#' data = df,
97+
#' levels = c("B"),
98+
#' cell_size = "size",
99+
#' shape = "circle",
100+
#' positioning = "regular",
94101
#' seed = 123
95102
#' )
96103
#'
97-
#' # draw treemap
98-
#' drawTreemap(tm, label_size = 2)
104+
#' # plot treemap with each cell colored by name (default)
105+
#' drawTreemap(tm, label_size = 1, color_type = "categorical")
99106
#'
100-
#' # draw different variants of the same treemap on one page using
101-
#' # the 'layout' and 'position' arguments (indicating rows and columns)
102-
#' drawTreemap(tm, title = "treemap 1", label_size = 2,
103-
#' color_type = "categorical", color_level = 1,
104-
#' layout = c(1,3), position = c(1, 1))
107+
#' # plot treemap with each cell colored by name, but larger cells
108+
#' # lighter and smaller cells darker
109+
#' drawTreemap(tm, label_size = 1, color_type = "both")
105110
#'
106-
#' drawTreemap(tm, title = "treemap 2", label_size = 2,
107-
#' color_type = "categorical", color_level = 2, border_size = 3,
108-
#' add = TRUE, layout = c(1,3), position = c(1, 2))
109-
#'
110-
#' drawTreemap(tm, title = "treemap 3", label_size = 2,
111-
#' color_type = "cell_size", color_level = 2,
112-
#' color_palette = heat.colors(10),
113-
#' border_color = grey(0.4), label_color = grey(0.4),
114-
#' add = TRUE, layout = c(1,3), position = c(1, 3),
115-
#' title_color = "black")
111+
#' # plot treemap with different color palette and style
112+
#' drawTreemap(tm, label_size = 1, label_color = grey(0.3),
113+
#' border_color = grey(0.3), color_palette = heat.colors(6)
114+
#' )
116115
#'
117116
#' @importFrom Rcpp evalCpp
118117
#' @importFrom grid grid.newpage

README.Rmd

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
output: github_document
33
title: "WeightedTreemaps"
4-
author: "Michael Jahn, David Leslie, Ahmadou Dicko"
4+
author: "Michael Jahn, David Leslie, Ahmadou Dicko, Paul Murrell"
55
date: "`r Sys.Date()`"
66
vignette: >
77
%\VignetteIndexEntry{WeightedTreemaps}
@@ -21,7 +21,8 @@ knitr::opts_chunk$set(
2121
<img src="images/logo.png" align="right" />
2222

2323
<!-- badges start -->
24-
[![R build status](https://github.com/m-jahn/WeightedTreemaps/workflows/R-CMD-check/badge.svg)](https://github.com/m-jahn/WeightedTreemaps/actions)
24+
[![CRAN status](https://www.r-pkg.org/badges/version/WeightedTreemaps)](https://CRAN.R-project.org/package=WeightedTreemaps)
25+
[![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)
2526
![GitHub issues](https://img.shields.io/github/issues/m-jahn/WeightedTreemaps)
2627
![GitHub last commit](https://img.shields.io/github/last-commit/m-jahn/WeightedTreemaps)
2728
![Platform](https://img.shields.io/badge/platform-all-green)
@@ -57,6 +58,12 @@ drawTreemap(tm, label_size = 2.5, label_color = "white", title = "An example")
5758

5859
## News
5960

61+
*14 December 2023*
62+
63+
The package was finally released on CRAN!
64+
Prerequisite was testing and troubleshooting of C++ related compilation problems,
65+
and re-release of the CGAL dependency package `RcppCGAL` with latest version.
66+
6067
*25 March 2021*
6168

6269
A **Shiny app** for generating treemaps from custom data is now available on **[Shinyapps.io](https://m-jahn.shinyapps.io/ShinyTreemaps/)!**
@@ -76,11 +83,17 @@ The **Sunburst treemap** is a computationally less demanding treemap that does n
7683

7784
The C++ code computing the actual Voronoi tesselation requires the [CGAL](https://www.cgal.org/download.html) library headers. Thanks to [Ahmadou Dicko](https://github.com/dickoa), installing the complete CGAL library locally is no longer necessary. Instead, the package depends on the CGAL headers that are available as R packages on CRAN. The package was using CGAL 4 (package `cgal4h`), but now moved to the latest CGAL 5.5+ version available as package `RcppCGAL`. The dependencies are usually installed automatically and manual installation of CGAL (headers) should not be necessary.
7885

79-
**NOTE**: The `RcppCGAL` package is currently (September 2023) not available on CRAN! Please install it [manually from Github](https://github.com/ericdunipace/RcppCGAL).
86+
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).
8087

8188
## Installation
8289

83-
To install the package directly from github, use the following function from the `devtools` package in your R session:
90+
To install the package from CRAN, use:
91+
92+
```{r, eval = FALSE}
93+
install.packages("WeightedTreemaps")
94+
```
95+
96+
To install the package directly from github, use the following function from the `devtools` package:
8497

8598
```{r, eval = FALSE}
8699
devtools::install_github("m-jahn/WeightedTreemaps")

README.md

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
WeightedTreemaps
22
================
3-
Michael Jahn, David Leslie, Ahmadou Dicko
4-
2023-12-12
3+
Michael Jahn, David Leslie, Ahmadou Dicko, Paul Murrell
4+
2024-01-07
55

66
<!-- include logo-->
77

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

1010
<!-- badges start -->
1111

12-
[![R build
13-
status](https://github.com/m-jahn/WeightedTreemaps/workflows/R-CMD-check/badge.svg)](https://github.com/m-jahn/WeightedTreemaps/actions)
12+
[![CRAN
13+
status](https://www.r-pkg.org/badges/version/WeightedTreemaps)](https://CRAN.R-project.org/package=WeightedTreemaps)
14+
[![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)
1415
![GitHub
1516
issues](https://img.shields.io/github/issues/m-jahn/WeightedTreemaps)
1617
![GitHub last
@@ -28,6 +29,12 @@ hierarchical data.
2829

2930
## News
3031

32+
*14 December 2023*
33+
34+
The package was finally released on CRAN! Prerequisite was testing and
35+
troubleshooting of C++ related compilation problems, and re-release of
36+
the CGAL dependency package `RcppCGAL` with latest version.
37+
3138
*25 March 2021*
3239

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

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

9097
## Installation
9198

99+
To install the package from CRAN, use:
100+
101+
``` r
102+
install.packages("WeightedTreemaps")
103+
```
104+
92105
To install the package directly from github, use the following function
93-
from the `devtools` package in your R session:
106+
from the `devtools` package:
94107

95108
``` r
96109
devtools::install_github("m-jahn/WeightedTreemaps")
@@ -135,7 +148,7 @@ Draw the treemap.
135148
drawTreemap(tm, label_size = 2.5, label_color = "white")
136149
```
137150

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

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

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

175188
### Positioning of cells
176189

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

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

228241
### Custom initial shapes
229242

@@ -271,7 +284,7 @@ drawTreemap(tm2, add = TRUE, layout = c(1,3), position = c(1, 2))
271284
drawTreemap(tm3, add = TRUE, layout = c(1,3), position = c(1, 3))
272285
```
273286

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

276289
### Advanced example for Voronoi treemaps
277290

@@ -546,7 +559,7 @@ drawTreemap(tm,
546559
)
547560
```
548561

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

551564
## References and other treemap packages
552565

cran-comments.md

Lines changed: 6 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,4 @@
1-
## Resubmission
2-
3-
This package was submitted previously, but returned with the following comments:
4-
5-
1. "If there are references describing the methods in your package, please
6-
add these in the description field of your DESCRIPTION file ..."
7-
8-
-> one reference was added to the DESCRIPTION.
9-
10-
2. "Please add \value to .Rd files regarding exported methods and explain
11-
the functions results in the documentation. Please write about the
12-
structure of the output (class) ... Missing Rd-tags: poly_sortpoints.Rd: \value"
13-
14-
-> the documentation in \value fields was extended for several functions.
15-
The function with a missing \value was removed.
16-
17-
3. "You write information messages to the console that cannot be easily
18-
suppressed. It is more R like to generate objects that can be used to extract the
19-
information a user is interested in, and then print() that object.
20-
Instead of print()/cat() rather use message()/warning() ..."
21-
22-
-> all cat() and print() statements were replaced by message(). Messages are
23-
now only printed when the user specifies verbose = TRUE.
1+
## Update
242

253
## Test environments
264

@@ -32,33 +10,19 @@ now only printed when the user specifies verbose = TRUE.
3210
- ubuntu-latest (release)
3311
- ubuntu-latest (oldrel-1)
3412

35-
3613
### with `rhub::check_for_cran()`
3714

3815
- Fedora Linux, R-devel, clang, gfortran
3916
- Debian Linux, R-release, GCC
4017
- Windows Server 2022, R-devel, 64 bit
4118
- Ubuntu Linux 20.04.1 LTS, R-release, GCC
19+
- Debian Linux, R-devel, GCC ASAN/UBSAN
4220

4321
## R CMD check results
4422

4523
There were no ERRORs or WARNINGs.
4624

47-
There were 2 NOTEs:
48-
49-
1. Note:
50-
51-
```
52-
File ‘WeightedTreemaps/libs/WeightedTreemaps.so’:
53-
Found ‘__ZNSt3__14cerrE’, possibly from ‘std::cerr’ (C++)
54-
Object: ‘voronoiDiagram.o’. Compiled code should not call entry
55-
points which might terminate R nor write to stdout/stderr instead
56-
of to the console, nor use Fortran I/O nor system RNGs.
57-
```
58-
59-
The C++ function `voronoiDiagram.cpp` does not contain any such entry points. This Note occasionally turns up on Mac OS tests, probably caused by the upstream dependency CGAL headers (R package `RcppCGAL`) or boost headers (`BH`).
60-
61-
2. Note:
25+
There was 1 NOTE:
6226

6327
```
6428
checking installed package size ... NOTE
@@ -70,6 +34,9 @@ checking installed package size ... NOTE
7034

7135
Installed package size exceeding 5 MB is caused by the compiled function `voronoiDiagram.o`. The size of this file can not be reduced.
7236

37+
There were "additional issues" brought up with from ASAN/UBSAN sanitizer checks.
38+
These were fixed in the current version.
39+
7340
## Downstream dependencies
7441

7542
- There are currently no downstream dependencies for this package
File renamed without changes.
File renamed without changes.
File renamed without changes.

images/unnamed-chunk-6-1.png

-78.5 KB
Binary file not shown.

images/unnamed-chunk-7-1.png

-211 KB
Loading

images/unnamed-chunk-8-1.png

290 KB
Loading

0 commit comments

Comments
 (0)