Skip to content

Support origin-crossing (0/2π) elements in polar coordinates #118

Description

@wilkox

Summary

Support glyphs whose along-range crosses the polar origin (0/2π) — e.g. a gene
spanning the origin of a circular genome.

Detail

The coordinate-transformations vignette notes that a geometry truly spanning the
0/2π boundary (e.g. 350°→10°) is not currently supported and would need to be
split into two geometries. The transform_to_along_away() wraparound handling
only corrects an endpoint that lands exactly on 0; it does not handle a glyph
that straddles the boundary.

This limitation is imposed by the ggplot2/grid munching approach, not by
biology — circular genomes routinely have features crossing the origin, and this
is a natural use case for polar plots. A user hitting it today gets a silently
broken glyph and no warning.

Actions (for the polar/coord_radial work)

  • Detect an along-range that crosses 0/2π and split the glyph into two arcs at
    the boundary.
  • Until then, consider a cli_warn() when a glyph would cross the origin, so
    the failure is legible rather than silent.
  • Coordinate with the coord_radial() epic (Support coord_radial() for circular genome visualizations #96) so the two share one
    boundary-splitting implementation.

Assigned to 0.9.0 to land with the other polar/radial changes.

Found during the pre-0.7.0 review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions