Skip to content

feat(theme): add theme and colourblind-safe palette presets - #64

Merged
oss6 merged 1 commit into
develfrom
feature/60/theme-and-palette-presets
Oct 26, 2026
Merged

oss6 merged 1 commit into
develfrom
feature/60/theme-and-palette-presets

Conversation

@oss6

@oss6 oss6 commented Oct 26, 2026

Copy link
Copy Markdown
Member

Every plot hard-coded theme_minimal() and ggplot2's default hues, so styling could only happen after lp_get_plot(). The new lp_theme() layer styles every plot type and every panel of a patchwork layout from the pipeline: preset is "minimal" (default), "classic", "publication" (white background, axis lines, no minor grid, 8 pt base size), or any ggplot2 theme; palette is "okabe_ito", "viridis", "ggplot2", or a named or unnamed vector of colours; base_size and line_width scale the text and the lines. lp_get_plot() + theme(...) still overrides it.

Discrete colours now default to Okabe-Ito, falling back to viridis beyond 8 groups. The series colours are resolved once in plot_data() over every dataset, so a group keeps its colour in every panel, and each plot function applies them itself: a global & colour scale would have replaced the purity overlay gradient and the continuous and density scales, which stay unchanged. highlight_peaks_factor now defaults to the group_by column, so highlighted peaks take the colour of their trace.

The Shiny Options panel exposes the preset, palette and base font size. Tests and a vignette section cover the presets; the plot-data baselines are unaffected. Closes #60.

Every plot hard-coded theme_minimal() and ggplot2's default hues, so
styling could only happen after lp_get_plot(). The new lp_theme() layer
styles every plot type and every panel of a patchwork layout from the
pipeline: `preset` is "minimal" (default), "classic", "publication"
(white background, axis lines, no minor grid, 8 pt base size), or any
ggplot2 theme; `palette` is "okabe_ito", "viridis", "ggplot2", or a named
or unnamed vector of colours; `base_size` and `line_width` scale the
text and the lines. lp_get_plot() + theme(...) still overrides it.

Discrete colours now default to Okabe-Ito, falling back to viridis
beyond 8 groups. The series colours are resolved once in plot_data()
over every dataset, so a group keeps its colour in every panel, and each
plot function applies them itself: a global `&` colour scale would have
replaced the purity overlay gradient and the continuous and density
scales, which stay unchanged. highlight_peaks_factor now defaults to the
group_by column, so highlighted peaks take the colour of their trace.

The Shiny Options panel exposes the preset, palette and base font size.
Tests and a vignette section cover the presets; the plot-data baselines
are unaffected. Closes #60.
@oss6
oss6 merged commit 26fe7cd into devel Oct 26, 2026
1 check passed
@oss6
oss6 deleted the feature/60/theme-and-palette-presets branch October 29, 2026 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add theme and colourblind-safe palette presets

1 participant