NEWS.md
PR #143
cmap_fill_race
and cmap_color_race
have been updated to remove unused race/ethnicity categories from chart legend (see issue #142)PR #123
This is a version-level update that includes many fixes and new features and introduces new dependencies, most significantly RStudio 1.4 or greater.
finalize_plot
now rely on the new raster drawing package ragg. These changes improve font accuracy and consistency across platforms. Note that this improvement does not yet extend to svg outputs, but may in the future (#134).abbr_years
allows the conversion of specific years to 2-digit abbreviations, as is common on some designed CMAP graphics.cmapplot_globals
, which contains key package constants, is now an internal environment rather than an exported list. It can be accessed via new functions get_cmapplot_globals
and get_cmapplot_global
. Constants can now be overridden by the user for the current session by using set_cmapplot_global
. Note that this does not yet apply to geom aesthetics set by the package, but may in the future (issue #117).cmapplot_globals$palettes
. A new function fetch_pal
can be used to get details about any specific palette.cmap_color_discrete
and cmap_fill_discrete
can now call gradients as well as discrete palettes (see #70 and #119)recessions
has been updated to include the business cycle contraction that began in Feb 202 (no end date for this cycle yet).geom_recessions
and related update_recessions
have been updated to allow for ongoing recessions, improve NBER source for recessions table, and decrease likelihood of data fetch errors.finalize_plot
’s window
mode has been disabled for now, due to inability to use ragg drivers in independent window devices. Use mode = "plot"
and click the “Zoom” button in the plot window instead.cmapplot_globals
, the exported list of package constants, has been removed (See new features set_cmapplot_global
etc)cmap_palettes
and cmap_gradients
have been removed (This information has been moved to cmapplot_globals$palettes
. To access palette colors directly, use, say fetch_pal("reds")
rather than cmap_gradients$reds
.viz_palette
and viz_gradient
now take as a first argument either the name of a palette (e.g. "reds"
) or the color palette itself (e.g. fetch_pal("reds")
). viz_palette(cmap_gradient$reds)
no longer works.integer_breaks
removed from packagePR #111 | February 24, 2021
PR #115 | March 2, 2021
This pair of updates primarily makes many changes to finalize_plot()
to enable printing plots without the left-hand “sidebar” – the area that contains the title and the caption. Most but not all changes are under the hood and should not impact the user. Those that will impact the user include:
inherit
, that allows the user to specify whether cmapplot should attempt to inherit titles and/or captions from the underlying ggplot object.title_width
has been renamed sidebar_width
to better reflect its function.sidebar_width = 0
now has the effect of shifting the title above the topline and shifting the caption from the title column to directly below the plot. If the user does not want a title on the vertical layout graphic, this can be achieved by leaving title = ""
, the default, and (if relevant) specifying that finalize_plot()
should not attempt to inherit a title from the underlying ggplot object.caption_align
, which takes numeric range 0 to 1. 0
, the default, aligns the caption bottom or left (in title-column and below-plot captions, respectively). 1
aligns the caption top or right. 0.5
centers. The argument caption_valign
has been deprecated.margin_title_l
has been replaced with margin_sidebar_l
, which only affects horizontal layout graphics. The margin for titles and captions in the vertical layout is based on margin_plot_l
.NEWS.md
file for the pkgdown website.Under-the-hood changes to finalize_plot()
are documented in PR #111, specifically here.
Users who have written code with previous versions of cmapplot should note these known compatibility issues: * In finalize_plot()
, the argument caption_valign
has been deprecated and will now issue a message alert (but will still work, for now). Please update your code to use the new argument caption_align
. * In finalize_plot()
, the argument title_width
has been deprecated and will now issue a message alert (but will still work, for now). Please update your code to use the new argument sidebar_width
. * Any overrides using the deprecated value margin_title_l
will no longer have any affect. Use margin_sidebar_l
instead.
PR #110 | February 3, 2021
geom_label
is now added to the list of geoms for which text aesthetics are automatically updated to CMAP style (ie to Whitney fonts). Previously, only geom_text
and the custom geom_text_last
were available in CMAP style.PR #107 | February 2, 2021
finalize_plot()
to accept title_width = 0
without causing a fuss. This is a short-term fix, with more improvements coming.cmapplot_globals$consts
, eliminated margin_title_r
, which created space between the title/caption and plotbox inside the title column. Replaced it with margin_plot_l
, which creates the same buffer but does so in the plot column, not the title column. This was necessary to keep an active left-hand margin in situations where title_width = 0
.Users who have written code with previous versions of cmapplot should note these known compatibility issues: * margin_title_r
no longer exists. Code that overrides this in finalize_plot()
should not error, but will also have no effect on your plot. Change to margin_plot_l
. * Titles and captions will be a bit wider (the width of the title and caption grobs are no longer modified by margin_title_r
). * Plots will be a bit narrower (the width of the plotbox is now modified by margin_plot_l
).
PR #103 | January 11, 2021
cmap_fill_continuous()
etc) did not allow for passing other arguments on to ggplot2’s scale
functions (see issue #102).PR #100 | December 9, 2020
axisticks
argument in theme_cmap()
and new length_ticks
default value in cmapplot_globals$consts
.theme_cmap()
generates theme objects (not of substantial significance to users).