Skip to contents

maison 0.3.0

The first version prepared for CRAN.

Breaking changes

  • register_maison_fonts() is now find_maison_fonts(). It reports which fonts the session can use and never registered anything, so the old name misled. There is no alias.
  • use_maison() is now set_maison(). It sets session state, like ggplot2::theme_set(); the use_ prefix is kept for functions that write files. It takes base_family, not family, to match theme_maison().
  • Three color names use underscores, like the palette names: warm_white, rust_light and green_light were warm-white, rust-light and green-light.
  • palette is the first argument of every scale. scale_*_maison_div() was (midpoint, reverse, palette) and scale_fill_maison_likert() was (reverse, drop, palette); calls that passed those by position need names.
  • The "sequential" palette alias is gone. Use "seq_purple".
  • categorical_dark has six colors, not four, in a new order: honey, lilac #A99AAF, leaf, rust, light blue #5884AC, mauve. The second color of a dark chart was leaf and is now lilac, so dark charts with two or more groups change color. Every color keeps at least 3:1 contrast on charcoal.
  • The neutral step of the quiet palette is light gray #DADADA, where it was warm_white and vanished on the background. This changes scale_fill_maison_likert("quiet") and scale_*_maison_div("quiet").
  • geom_segment(), geom_curve() and an unmapped geom_tile() are plum under the theme, where they were the text color and gray.

New

  • House defaults for more chart types, all carried by the theme: reference lines (geom_hline(), geom_vline(), geom_abline()), shaded periods (geom_rect(), annotate("rect")), boxplots, error bars, line ranges and point ranges, ribbons, areas and densities, smooths, and segments. See “House defaults by chart type” in ?theme_maison, which also lists what a theme cannot set: boxplot outliers, error bar caps and the translucency of mapped fills.
  • theme_maison(void = TRUE) removes axes, axis text and grid lines for donuts and other axis-free charts, and keeps the type scale.
  • maison_label_color() returns ink or warm_white for each fill, whichever reads better, for labels inside bars.
  • maison_colors gains indigo #264884 and petrol #2D7F9A, extras for one-off use. They are in no palette.
  • ?theme_maison documents grid = "X" for horizontal bars, and recipes for ggrepel and patchwork.
  • theme_maison() gains legend_location. "panel" starts a top or bottom legend where the bars start, for charts with long y-axis labels such as Likert stacks. The default, "plot", is unchanged.
  • set_maison() gains plot_margin, passed to theme_maison(), to give every chart in a document an outer margin. The default is still none.
  • A gallery vignette, vignette("gallery", package = "maison"): fifteen chart recipes on simulated data, each with a snapshot test.

Renamed package

maison 0.2.0

Breaking changes

  • The categorical palette is now eight colors, in a new order: plum, honey, cobalt, leaf, rust, berry, mauve, charcoal. It was red, plum, mauve, honey, charcoal. Every chart that takes its colors from the theme or from scale_*_maison_d() changes color, and the limit is eight groups, not five.
  • Red is no longer a categorical color. It is reserved for maison_highlight() and emphasis.
  • theme_maison(dark = TRUE) uses the new categorical_dark palette: honey, leaf, rust, mauve. These are the categorical colors with at least 3:1 contrast against charcoal, so a dark chart now stops at four groups.
  • The default sequential palette is the seq_purple ramp, which ends at plum. It ended at charcoal. "sequential" still works, as an alias for "seq_purple"; "seq_neutral" is the ramp that ends at charcoal.
  • theme_maison() has no outer margin by default: plot_margin is margin(0, 0, 0, 0), where it was 30 pt on every side. Pass plot_margin to get the room back.
  • A font family that is not available now falls back to "sans", with one warning per session. Before, the family was kept and grid warned for every piece of text. fallback = FALSE restores the old behavior.

New

  • maison_colors gains cobalt, leaf, berry and olive. Olive is a context color for highlight charts: maison_highlight(base = "olive").
  • Sequential ramps, each seven steps from warm-white: seq_purple, seq_neutral, seq_gray, seq_red, seq_honey, seq_green, seq_rust and seq_cobalt. The first seven are hand-tuned; seq_cobalt is generated to match their step spacing (dev/seq-cobalt.R).
  • diverging_green, a plum to green diverging palette, and the quiet family (quiet, quiet_purple, quiet_sage) for scales with no good or bad direction.
  • scale_fill_maison_div() and its colour versions gain palette: "diverging", "diverging_green" or "quiet".
  • scale_fill_maison_likert() gains palette: "likert" or "quiet".
  • theme_maison() and use_maison() gain background (NULL, "transparent" or a color) and fallback.

maison 0.1.0

First version. maison replaces the styling code that lived in twill.R, R/tweed.R and new-palette.R.

  • theme_maison() is a complete ggplot2 theme built on theme_minimal(). It carries the type scale, the warm-white (or, with dark = TRUE, charcoal) background, per-geom defaults for text, labels, bars, points and lines, and the default discrete and continuous palettes. The legend sits above the chart, flush left with the plot edge and untitled; legend_position moves it. It needs ggplot2 4.0.0 or later and changes no global state.
  • maison_colors holds the brand colors. maison_pal() returns the categorical, sequential, diverging and Likert palettes as functions of n.
  • scale_fill_maison_d(), scale_fill_maison_c() and scale_fill_maison_div(), with colour and color versions, are explicit scales for when a chart needs something other than the theme default.
  • scale_fill_maison_likert() colors agreement scales of 2 to 11 points. Ordered factors bypass theme palettes, so Likert charts need it.
  • maison_highlight() builds the values for a highlight chart.
  • register_maison_fonts() and check_maison_fonts() find the house fonts (Hanken Grotesk, Newsreader, IBM Plex Mono) and say how to install any that are missing.
  • theme_maison_tt() is the house tinytable theme.
  • use_maison() sets the ggplot2 theme and the tinytable theme for a document in one call.