feature added: layer_symbol() supports "freetext", and add color, size options
Add freetext, color, and size to the layer_symbol() function. Then the layer_symbol() function is much more customizable. It can display values (char) in one column of the data tibble or any other freetext (char) instead of the predefined symbols. Besides, the color and size can be customized.
Here are some examples.
mtcars_tidy %>%
mutate(label = sprintf("%.1f", Value),
color_label = ifelse(Value > 0, "darkred", "white")) %>%
heatmap(`Car name`, Property, Value,
palette_value = colorRamp2(c(-3, 0, 3), c("blue", "white", "red"))) %>%
layer_symbol(Value > 1 | Value < -1,
symbol = "freetext",
freetext = label,
color = color_label,
size = 10)

mtcars_tidy %>%
heatmap(`Car name`, Property, Value,
palette_value = colorRamp2(c(-3, 0, 3), c("blue", "white", "red"))) %>%
layer_symbol(Value > 1,
symbol = "freetext",
freetext = "+",
size = 10) %>%
layer_symbol(Value < -1,
symbol = "freetext",
freetext = "-",
size = 15)

mtcars_tidy %>%
heatmap(`Car name`, Property, Value,
palette_value = colorRamp2(c(-3, 0, 3), c("blue", "white", "red"))) %>%
layer_point(Value < -1, color = "yellow")

I am glad that you are interested in the additional functions. Thank you for your great guides and suggestions.
I will follow your suggestions to modify the code and reorganize the branches.
Hello @frankyan, any luck with the process? The layer size might have come in handy for me already :)
Hello. I just returned back from Chinese New Year vacation. I will try to finish it this week.
Hello. I just returned back from Chinese New Year vacation. I will try to finish it this week.
I hope you enjoyed. No stress of course.
Any news by any chance?
I have started a pull request of my own inspired by yours
https://github.com/stemangiola/tidyHeatmap/pull/111
FYI, from my pull request, compared with yours, I missed two features
- size for the non-text other layers
- colour for text and non-text layers