Closed DrDevSecOps closed 3 years ago
Thanks for reporting this @DrDevSecOps! This issue has been fixed in version 2.5.4 which I have just released on CRAN:
library(treemapify)
packageVersion("treemapify")
#> [1] '2.5.4'
library(ggplot2)
Id <- c('A','B','C','D')
Value <- c(10,5,1,100)
df <- data.frame(Id, Value)
ggplot(df, aes(area = Value, fill = Id, label = Value)) +
geom_treemap() +
geom_treemap_text(place = "center")
Created on 2020-11-20 by the reprex package (v0.3.0)
In geom_treemap_text(), place = "center" no longer works (it used to work). It puts all the text in the center of the graphic, rather than centered in each rectangle. place = "centre" does work
This broke a bunch of existing code.
Sample code to replicate the bug:
library(treemapify) library(ggplot2) Id <- c('A','B','C','D') Value <- c(10,5,1,100) df <- data.frame(Id, Value)
ggplot(df, aes(area = Value, fill = Id, label = Value)) + geom_treemap() + geom_treemap_text(place = "center")