Unexpected Behavior (overlap and not disappear)
- Dominant language
- R
- Stars
- 63
- Forks
- 15
- PR merge metrics
- No merged PRs in 30d
Description
Hi Joshua: thanks for your great community effort!
The problem in my application is that if the number of words is decreased, the words does not disappear but overlay with the existing ones. This looks like:

A minimal example:
````
#devtools::install_github("jbkunst/d3wordcloud")
library(shiny)
library(d3wordcloud)
library(dplyr)
### demo data
df <- tibble(
word = c("#btc", "#Bitcoin", "#BTC", "#Airdrop",
"#bitcoin", "#blockchain", "#cryptocurrency", "#eth", "#cr",
"#crypto", "#Cryptocurrency", "#dgb", "#digibyte", "#Digitize",
"#Eth", "#Ethereum", "#ico", "#ICO", "#LTC", "#usd"),
n = c(10L, 5L, 5L, 4L, 4L, 4L, 3L, 3L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L)
)
ui <- fluidPage(
titlePanel("Beautiful Wordcloud with Bug"),
sidebarLayout(
sidebarPanel(
sliderInput(inputId = "n_cloud", label = "", min = 5, max = 20, value = 10)
),
mainPanel(
d3wordcloud::d3wordcloudOutput("wordcloud")
)
)
)
# Define server logic required to draw a histogram
server <- function(input, output) {
toks <- reactive({
toks <- df %>%
dplyr::slice(1:as.numeric(input$n_cloud)) %>%
dplyr::arrange(dplyr::desc(n))
})
output$wordcloud <- d3wordcloud::renderD3wordcloud({
d3wordcloud(toks()$word, toks()$n, padding = 4, rotate.min = 0, rotate.max = 45, font = "Impact")
})
}
shinyApp(ui = ui, server = server)
````
This bug reproduced on Mac, Windows and Shiny Server. Thanks for your effort! Best, Simon
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.