MakieThemes
The idea of this package is to create a collection of themes for Makie to customize the size and look of plot elements and colors. It will initially focus on porting themes from existing plotting packages.
Currently, we have the following theme libraries:
GGThemr, that emulates the themes at https://github.com/cttobin/ggthemr. Accessed byggthemr(:colorscheme).BBC, that emulates the bbplot R package released by the BBC. (Note that this does not include the lower bar with logo/label, though that may come in time as a utility). Accessed bytheme_bbc().Gruvbox, color-only themes based on Gruvbox. Accessed bycolor_gruvbox(:light)/color_gruvbox(:dark)(ortheme_gruvbox).Flexoki, color-only themes based on Flexoki. Accessed bycolor_flexoki(:light)/color_flexoki(:dark)(ortheme_flexoki).
Theme pages live in the sidebar (GGThemr, BBC, Gruvbox, Flexoki).
There are two main ways to visualize themes which MakieThemes provides, the demofigure and demoscatter functions. These are visualized below with Makie's default theme, as a baseline:
MakieThemes.demofigure() # can also take a theme as input
MakieThemes.demoscatter() # can also take a theme as input
The concept of MakieThemes
In MakieThemes, we try to maintain a separation between color themes (dark v/s light theme, background colors, palettes, etc) and style themes (fonts, grid styles, title alignments, etc).
This provides a lot of flexibility - you might mix the BBC's style with GGThemr's flat color scheme, simply using merge(style_bbc(), color_ggthemr(:fresh))!
The way this is implemented is simple: each theme is implemented internally as separate color and style themes. Take the example of GGThemr's structure below:
color_ggthemr(:colortheme) # implemented as color theme
style_ggthemr() # implemented as style theme
theme_ggthemr(:colortheme) = merge(color_ggthemr(:colortheme), style_ggthemr())Color-only themes such as Gruvbox and Flexoki expose color_* / theme_* entry points and compose the same way — put the color theme first in merge so its colors win.
In this way, you can stitch together various colour and style themes with ease.
MakieThemes.demofigure(merge(style_bbc(), color_ggthemr(:fresh)))