Skip to content

vellumplot 0.3.0

Choose a tag to compare

@schochastics schochastics released this 10 Jul 07:12
· 248 commits to main since this release
  • Adopted vellum's renamed vl_* graphics primitives (vl_gpar(), vl_unit(),
    vl_viewport()), which no longer mask grid.

  • NA legend keys for size / shape. A mapped size or shape aesthetic
    whose data contains missing values now shows an "NA" key (as the colour scales
    already did). Also fixes a crash: NA in a shape mapping previously errored
    (Unknown point shape: NA) — it now draws as a neutral circle.

  • 2-D density contours. mark_contour() draws iso-density contour lines of a
    2-D point cloud and mark_contour_filled() fills the bands between them
    (coloured by level automatically). By default the field is a kernel density
    estimate (via MASS::kde2d()); map a z aesthetic to contour a supplied
    surface over a regular x/y grid instead. Contour tracing uses the isoband
    package (both isoband and MASS are Suggests).

  • Binned position scales. scale_x_binned() / scale_y_binned() cut a
    continuous axis into bins — ticks at the bin boundaries, each datum drawn at its
    bin centre — reusing the binned-colour classification (style/n, or explicit
    breaks). mark_bar() sizes to the bin width.

  • Rich and multi-line text labels. mark_text() now carries rich labels
    through to the renderer instead of flattening them: map label = md(<expr>) for
    a per-datum styled label (bold/italic/super-/subscript/colour), and plain labels
    may contain newlines (\n) to wrap onto stacked lines. Requires vellum's
    development version. (mark_label()'s background box does not yet support rich
    labels.)

  • Accessibility (alt text). Every compiled plot is now an accessible image
    by default. plot_alt() returns a plot's text alternative — an author-written
    string from the new labs(alt = ), or a prose summary vellumplot generates from the
    spec (chart type, x/y/colour/size mappings, observation count, faceting). At the
    compile seam the plot title becomes the scene's accessible name and this alt
    text becomes its description, so render_plot() output carries role="img" +
    <title>/<desc> in SVG and a tagged Figure with Alt in PDF (via vellum).
    See the new Accessibility article. Requires vellum's development version
    (>= 0.1.1.9000) for the accessible SVG/PDF backend.

  • British spelling. mark_*(colour = ) is now honoured as an alias for
    color (previously the mapping was silently dropped and no colour scale was
    trained). Added scale_colour_*() aliases for the scale_color_*() family.

  • Faithful alt text. The auto-generated description now matches what the plot
    actually renders: it honours scale_*(name = ) axis/legend titles, names the
    implicit "count" axis of a count bar, and describes a network graph by its node
    and edge counts instead of its (meaningless) layout x/y axes.