Releases: CMAP-REPOS/cmapplot
cmapplot 1.2.3
What's Changed
- new dummy data,
geom_recessions()update,geom_text_lastonly_repel()formalized with docs by @sean-connelly-cmap - update to R 4.5, graphics backend for Positron fix by @itendswells in #163
New Contributors
- @itendswells made their first contribution in #163
Full Changelog: v1.2.1...v1.2.3
cmapplot 1.2.1
This release updates the cmap_race_palette functions to only show race and ethnicity categories that are present in the data. It also makes under-the-hood changes to GitHub actions which will not have an impact on the end user.
Backward compatibility notes
This update should not introduce any backward compatibility issues.
cmapplot 1.2.0
This is version-level update that includes many fixes and new features and introduces new dependencies, most significantly requiring RStudio 1.4 or greater.
New features
- cmapplot now utilizes the new systemfonts package for custom font rendering, rather than sysfonts on Windows and X11fonts on Mac and other Unix-based machines. In addition, raster exports from
finalize_plotnow 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). - When an axis breaks are 4-digit years, new function
abbr_yearsallows 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 functionsget_cmapplot_globalsandget_cmapplot_global. Constants can now be overridden by the user for the current session by usingset_cmapplot_global. Note that this does not yet apply to geom aesthetics set by the package, but may in the future (issue #117).- All palettes programmed into the package have been moved into a tibble at
cmapplot_globals$palettes. A new functionfetch_palcan be used to get details about any specific palette.
Bug fixes
- Continuous color gradients can now be used on discrete color scales. E.g.
cmap_color_discreteandcmap_fill_discretecan now call gradients as well as discrete palettes (see #70 and #119) - Nomenclature in help files (e.g. "palette" vs "scale") has been adjusted for clarity.
- internal table
recessionshas been updated to include the business cycle contraction that began in Feb 202 (no end date for this cycle yet). geom_recessionsand relatedupdate_recessionshave been updated to allow for ongoing recessions, improve NBER source for recessions table, and decrease likelihood of data fetch errors.
Backend changes
- pkgdown site now correctly displays Whitney fonts and margin description images
- backend script reorganization
- improvements to pkgdown build github action, including ability to publish a test site
Backward compatibility notes
- This package will now only render Whitney Fonts in RStudio when RStudio version >= 1.4
finalize_plot'swindowmode has been disabled for now, due to inability to use ragg drivers in independent window devices. Usemode = "plot"and click the "Zoom" button in the plot window instead.cmapplot_globals, the exported list of package constants, has been removed (See new featuresset_cmapplot_globaletc)- Color lists
cmap_palettesandcmap_gradientshave been removed (This information has been moved tocmapplot_globals$palettes. To access palette colors directly, use, sayfetch_pal("reds")rather thancmap_gradients$reds. viz_paletteandviz_gradientnow 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_breaksremoved from package
cmapplot 1.1.0
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:
- There is a new argument,
inherit, that allows the user to specify whether cmapplot should attempt to inherit titles and/or captions from the underlying ggplot object. - The argument
title_widthhas been renamedsidebar_widthto better reflect its function. - Setting
sidebar_width = 0now 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 leavingtitle = "", the default, and (if relevant) specifying thatfinalize_plot()should not attempt to inherit a title from the underlying ggplot object. - There is a new argument,
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).1aligns the caption top or right.0.5centers. The argumentcaption_valignhas been deprecated. - The value
margin_title_lhas been replaced withmargin_sidebar_l, which only affects horizontal layout graphics. The margin for titles and captions in the vertical layout is based onmargin_plot_l. - Separately, this version also creates this
NEWS.mdfile for the pkgdown website.
Under-the-hood changes to finalize_plot() are documented in PR #111, specifically here.
Backward compatibility notes
Users who have written code with previous versions of cmapplot should note these known compatibility issues:
- In
finalize_plot(), the argumentcaption_valignhas been deprecated and will now issue a message alert (but will still work, for now). Please update your code to use the new argumentcaption_align. - In
finalize_plot(), the argumenttitle_widthhas been deprecated and will now issue a message alert (but will still work, for now). Please update your code to use the new argumentsidebar_width. - Any overrides using the deprecated value
margin_title_lwill no longer have any affect. Usemargin_sidebar_linstead.
cmapplot 1.0.4
- The ggplot2 geom
geom_labelis now added to the list of geoms for which text aesthetics are automatically updated to CMAP style (ie to Whitney fonts). Previously, onlygeom_textand the customgeom_text_lastwere available in CMAP style.
cmapplot 1.0.3
- Modified
finalize_plot()to accepttitle_width = 0without causing a fuss. This is a short-term fix, with more improvements coming. - In
cmapplot_globals$consts, eliminatedmargin_title_r, which created space between the title/caption and plotbox inside the title column. Replaced it withmargin_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 wheretitle_width = 0.
Backward compatibility notes
Users who have written code with previous versions of cmapplot should note these known compatibility issues:
margin_title_rno longer exists. Code that overrides this infinalize_plot()should not error, but will also have no effect on your plot. Change tomargin_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).
cmapplot 1.0.2
- Fixed bug where custom color functions (e.g.
cmap_fill_continuous()etc) did not allow for passing other arguments on to ggplot2'sscalefunctions (see issue #102).
cmapplot 1.0.1
- Improvement of tickmark handling via addition of
axisticksargument intheme_cmap()and newlength_ticksdefault value incmapplot_globals$consts. - Substantial backend simplification of how
theme_cmap()generates theme objects (not of substantial significance to users).
cmapplot 1.0.0
Initial package release!