ggalign 1.2.0
CRAN release: 2025-10-18
Fixed alignment of absolute panel dimensions when using
theme(panel.widths, panel.heights)in ggplot2 v4.0.0.’alignpatch-*’ scripts have been fully refactored with S7 classes, with more informative and consistent naming.
Improved
align_plots()to properly handle strips with different placements.Renamed the original
alignpatch()topatch()for clearer and more consistent naming.The
Patchobject is now exported for external use.Refactored
patch_titlesto the new S7-basedpatch_titleclass (soft-deprecated the old version).
ggalign 1.1.0
CRAN release: 2025-09-11
The internal structure has been fully refactored, with more informative and consistent naming.
remove
element_polygon()/element_curve(), to be implemented upstream in ggplot2new
layout_theme()to control layout theming.Deprecated the
themeargument inlayout_annotation().Migrated all internal objects to the S7 class system.
replace
with_quad()withquad_scope()and deprecate old name.new
layout_tags(): add support for tagging plots and nested layouts.&operator now can work foralign_plots().new
geom_magick()object to draw images as point shapes using magickThe
sector_spacingargument infacet_sector()can be a multi-value numeric (#73)new argument
splitinalign_phylo()to support splitting phylo objects into multiple trees (#74)The
fortify_matrix()method forphyloobject is removednew
plot_ideogram()function to add an aligned cytoband ideogram plot
ggalign 1.0.2
CRAN release: 2025-05-14
align_plots(): Always ensure that plots placed in a border collect their guides, if any guides are to be collected in that border. This prevents overlap, unless the guides will be collected by the parent layout.new scale for z aesthetic: scale_z_continuous, scale_z_binned, scale_z_discrete, scale_z_ordinal, scale_z_datetime, scale_z_date
geom_subrect()andgeom_subtile()gainnrowandncolarguments to control the layout, and deprecatedirectionargumentggoncoplot()gains a new argumentremove_duplicatesto control whether to remove duplicated variants within the same cell.fortify_data_frame.matrix()gains a new argumentlvls, allowing matrix values to be converted into a factor.circle_layout(): fix wrongsector_spacingdue to the operator precedence when building.circle_layout(): renamespacing_thetaargument tosector_spacingargument, and deprecatespacing_thetaargument.circle_continous: gainsspacing_thetaargument to control the sector spacing for all plots.facet_sector(): deprecateradialargument, user should add thecoord_radial()orcoord_circle()directly to the plot.new
magickGrob()to construct grob withmagickprocessing.
ggalign 1.0.1
CRAN release: 2025-04-10
fix R CMD check error for the updated version of ggplot2 3.5.2.
new grob
channelGrob()used to create grobs across different facet.fix
patch.gListmethod.
ggalign 1.0.0
CRAN release: 2025-03-15
This is a major release. While not many new features have been added, this marks the first release where the entire layout system has been completed.
Breaking changes
align_reorder() has been renamed to align_order2().
geom_draw2() has been renamed to geom_gshape().
New features
Now
circle_layout()support multiple facets.new
facet_sector()function to add Facet support for polar coordinatesnew
coord_circle()function to provide additional customization options for coord_radial()new
tune()method shape (“oncoplot”) for matrix
ggalign 0.1.0
CRAN release: 2025-02-06
Breaking changes
- Now, all
*_free()layouts have been removed, all layout has been splitted into two type: align discrete or continous vairables.
New features
new helper function
memo_order()to reorder the oncoplot samples.new
geom_subrect()andgeom_subtile()to subdivide rectangles with shared borders into a grid.new
cross_linkfunction to reset the layout ordering index or layout panel group, and add plot to connect selected observations.new
cross_markfunction to reset the layout ordering index or layout panel group, and add plot to annotate observations.new
pair_links()function to create pairs of observation groups.new
mark_draw(),mark_line(),mark_tetragon()to define the links to connect the marked observations.new
link_draw(),link_line(),link_tetragon()to define the links to connect a pair of observationsnew
ggmark()to add a plot to annotate selected observations.new
element_vec()functions to apply function to the vectorized fields of the theme element object.new
no_expansion()function to remove scale expansion.new layout
circle_layout()to arrange plot in a circular.new
raster_magick()function to post-processing the image raster withmagickpackage was added.new
fortify_matrix.GISTIC()method forGISTICobject frommaftoolspackage (#24).+operator now will respectwith_quad().new
ggalign_attr_set()andggalign_attr_get()for basic operations of attached attribute.new
geom_draw()function to draw ggplot2 layer with customized draw function.
Bug fixes
fix breaks and labels not work well in discrete scale (#30, #32)
fix wrong results of
fortify_matrix.MAF()method
Improvements
Now,
with_quad()wraps the object into a list with the classwith_quad. This approach offers greater flexibility in defining the actions associated withwith_quad, allowing for more customizable behavior (#26, @Yunuuuu).Now, we always set as.table = FALSE when using ggplot2
facet_*()functions, we don’t need to reorder thepanelwhen drawing.free_gg,alignand the newcross_linkobjects have been collapsed to one classggalign_plot
ggalign 0.0.5
CRAN release: 2024-11-14
Breaking changes
directionargument instack_layout()/ggstack()is soft-deprecated now, user must provide it manually.set_context,order, andnamearguments inalign_*()andggheatmap()are soft-deprecated, which is advised to useactiveargument.guides,free_guides,free_spaces,free_labs, andplot_dataarguments inalign_*()andggheatmap()are deprecated, which is advised to usescheme_alignfunction instead.themeargument inalign_*()andggheatmap()is deprecated, which is advised to useplot_themefunction.whatargument instack_active()is soft-deprecated, user is advised to usestack_switch()to change the active plot withwhat.align_panel()/ggpanel()is deprecated, user is advised to useggalign(data = NULL)instead.
New features
new
quad_layout()to create layout allowing free from alignment.new
quad_alignv(),quad_alignh(),quad_free()/ggside(),quad_alignb()alias forquad_layout().stack_layout()now gains atypeargument to control whether the layout should align observations.new
ggoncoplot()function to draw oncoprint.new
ggfree()function to add ggplot to the layout.new
fortify_matrix()function to convert any objects to a matrix, and addfortify_matrix()method forMAFobject.new
fortify_data_frame()function to convert any objects to a data frame.now, a special attribute
ggaligncan be used to pass additional informations across the building process, and a new functionggalign_attr()can be used to extract the data from the attribute.new
plot_theme()function to control the default theme of the plot in layout.new
plot_data()function to control the data transformation of the plot in layout.new
scheme_align()function to control specifications of the plot in layout.new
with_quad()function to control the-operator context.new
quad_init()function to initialize the annotation with self-provided data.new
stack_switch()andquad_switch()to switch active plots forstack_layout()andquad_layout().new
anno_top(),anno_left(),anno_bottom()andanno_right()alias for add annotation inquad_layout().align_dendro()gain a new argumentcutreeto customize the process of tree cutting.reorder_dendrogramargument inalign_dendro()function now can accept a function to reorder the tree.new
layer_order()function to change the ggplot2 layer adding order.new
theme_no_axes()function to remove axis elements.new
geom_pie()function to draw pie charts.
Bug fixes
fix bug when apply
free_borderinalignpatchesobject.fix bug when provide a function in
distanceargument ofalign_dendro()fix bug when provide
hclustordendrogramin method argument ofalign_dendro()fix bug of
coord_ggalign()for discrete scale
Improvements
mergefunction has been implemented withvctrsfor performancefor large matrix (> 20000 cells), automatically use
geom_raster(){data.table} is now removed from the dependency
ggalign 0.0.4
CRAN release: 2024-10-12
layout_heatmap()/ggheatmap()arguments width/height have been renamed.width/.heightto helps avoid conflicts with arguments fromgeom_tile().the nestet alignpatches theme by default will inherit from the parent alignpatches
new
layout_title()function, nowlayout_annotation()only control the layout themeadd
ggrastr::rasterizemethod for bothggheatmap()andggstack()set_contextargument inalign_dendro()now depends onplot_dendrogramby defaultalign_dendro()gain a new argumentreorder_dendrogramto control whether to reorder the generated dendrogram based on the mean values.align_order2()now splitted into two functionalign_order()andalign_order2()dendrogram_data()gain a new argumentreorder_branchesto control whether to reorder the inputleaf_brachesbased on the tree.align_dendro()gain new argumentmerge_dendrogramto control whether the dendrograms in multiple groups should be mergeddendrogram height axis will be automatically reversed in bottom and left annotation stack
heatmap fill color scale now default use
scale_fill_gradient2(low = "blue", high = "red")for continuous values.Coordis used to set limits instead ofScaleall
free_*arguments now accept the same argument of the correspondingfree_*functions.new
theme_ggalign()function for the default theme of ggalign packageexport option
ggalign.default_themeallow user to change the global default themenew
free_guide()function, to override the layout guides argument for single plotgeom_draw()now utilizepatch()function to convert objects into grobinternal changes: all vectors have been operated with
vctrspackagestack_layout(): gainsizesargument to control the relative sizes of the stackalign_()*: noworderargument only control the plot area.align_order2()now can accept an ordering character names.export
order2()functionalign_order2(): fun argument has been renamed toorderargument, and it can now accept the ordering integer index directlyfuninalign_order2()now can return any statistics which can be handled byorder2()fix
ggheatmap()order not work when put in a stack layoutmethodinhclust2()can now return any objects which can be coerced into hclust, or you can provide such object directly inmethod.hclust2()now can acceptdistance = NULLhmanno(),stack_active(), andalign_*()functions gain a new argumentthemeto control the theme for the plot.new
layout_annotation()andlayout_theme()to modify the layout componentsbordersargument infree_space()has been renamed tospaces{tibble} is now removed from the dependency
align_plots()now can acceptgList,function,recordedplot,trellis,pheatmap,Heatmap,HeatmapAnnotation, andHeatmapList, we have addedalignpatchmethod for these objects.add
patchmethod forgList,function,recordedplot,trellis,pheatmap,Heatmap,HeatmapAnnotation, andHeatmapListfix a bug in
wrap()function where duplicated names in gtable cause some grobs missingnew
free_vp()function to customize the viewport when aligning.StackLayoutandHeatmapLayoutmethods have been collapsed into one method forLayoutclassNew
Patchclass, now we can extend the alignment process of any object and customize the building process withggproto.fix missing variable
labsin thefree_spacemethod ofPatchAlignpatches
ggalign 0.0.3
CRAN release: 2024-09-15
Add package logo
new
inset()functionadd package quotes in DESCRIPTION
add return value docs for exported function or methods
ggalign 0.0.1
Features
ggalign pacakge provides two layout to arrange ggplot objects:
heatmap_layout()/ggheatmap(): Arrange ggplot into a Heatmap layout. Seevignette("heatmap-layout")for details.stack_layout()/ggstack(): Arrange ggplot vertically or horizontally. Seevignette("stack-layout")for details.
To further customize these layouts, we offer following functions:
-
align_group(): Group layout axis into panel with a group variable. -
align_kmeans(): Group layout axis into panel by kmeans -
align_order2(): Reorders layout observations based on weights or summary statistics. -
align_dendro(): Reorder or Group layout based on hierarchical clustering
For more detailed instructions on customizing layouts, see the vignette: vignette("layout-customize").
Additionally, plots can be added in the layout with following functions:
-
align_gg()/ggalign(): Create ggplot object with a customized data. -
align_panel()/ggpanel(): Create ggplot object with the layout panel data.
For more information on adding plots, refer to the vignette: vignette("layout-plot").
