get_display_color | R Documentation |
Always reflect the current displayed color.
get_display_color(color, selected)
color |
the |
selected |
the selected states |
In loon
, each element (i.e. point, bin, line) has a "temporary" color and
a "permanent" color. If one element is selected, the color is switched to the "temporary" color to highlight it.
If the selection state is eliminated, the "permanent" color of this element will be displayed.
Our function always gives the "temporary" displayed color.
The color shown on the plot
if(interactive()) {
p <- l_plot(1:10)
p['selected'][c(1,3,5)] <- TRUE
displayedColor <- get_display_color(p['color'], p['selected'])
plot(1:10, bg = as_hex6color(displayedColor), pch = 21)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.