The theme of the chart can be customised with the motif
function.
Out-of-the-box G2.js comes with two themes (light), and dark.
You can also customise the motif with the various element*
functions.
library(g2r)
data(penguins, package = "palmerpenguins")
g2(penguins, asp(bill_length_mm, bill_depth_mm)) %>%
fig_point(asp(color = island, shape = "circle")) %>%
motif(
backgroundColor = "lightgrey",
colors10 = scales::hue_pal()(3),
padding = 20,
elementPoint(
shape = "circle",
stroke = 0,
opacity = 1
)
)
g2(cars, asp(speed, dist)) %>%
fig_point(asp(shape = "circle")) %>%
fig_smooth() %>%
motif(
padding = 30,
brandColor = "orange",
backgroundColor = "#363636"
)
gauge_color_viridis
gauge_color_plasma
gauge_color_inferno
gauge_color_magma
gauge_color_neon
gauge_color_lime
gauge_color_orange
gauge_color_pink
gauge_color_std
gauge_color_g2rc
gauge_color_blue
gauge_color_red