Closed ChrisWoodsSays closed 2 years ago
Hi Chris,
I just pushed an update to dev that should fix this. Here are the two examples you provided that appear to be working correctly now:
# zero value example
library(reactablefmtr)
areas <- data.frame(name = c("One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten"))
areas$responseCount <- 0
reactable(
areas,
columns = list(
responseCount = colDef(name = "Responses",
cell = icon_assign(areas,
show_values = "left")
)
)
)
# stackoverflow example
library(reactablefmtr)
areas <- data.frame(name = c("One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten"))
areas$responseCount <- round(runif(nrow(areas), min = 0, max = 1) * 4)
reactable(
areas,
columns = list(
responseCount = colDef(name = "Responses",
cell = icon_assign(areas,
show_values = "left")
)
)
)
Brilliant, thank you Kyle, that works perfectly. Thanks for the speedy response.
I have a reactable with nested values. In some of the nested data, the values to be represented by icons using icon_assign are all zero.
When this is the case, it fails with the error
Error in seq.default(1, max_value, by = seq_by) : wrong sign in 'by' argument
The code below shows this (I haven't included the nesting as this isn't actually the problem). See https://stackoverflow.com/questions/71428577/incorrect-no-of-icons-assigned-in-reactablefmtr-icon-assign