Repository navigation
feat(theme): add theme and colourblind-safe palette presets - #64
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
presetis "minimal" (default), "classic", "publication" (white background, axis lines, no minor grid, 8 pt base size), or any ggplot2 theme;paletteis "okabe_ito", "viridis", "ggplot2", or a named or unnamed vector of colours;base_sizeandline_widthscale 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.