Skip to content

vellumplot 0.8.0

Choose a tag to compare

@schochastics schochastics released this 27 Jul 07:46
· 117 commits to main since this release
  • Flow maps: mark_flow_map(). A one-to-many flow map on a vgraph() plot:
    a single root fans out to every destination along smooth, merging branches
    whose width tracks the flow volume (the Minard / migration-map idiom).
    type = "spiral" (default) builds an angle-restricted spiral tree from the
    \pkg{edgebundle} package; type = "steiner" builds an approximate Steiner tree
    (additionally needs \pkg{interp}). Edge weight drives the flow, which is
    mapped onto width_range. Needs the suggested \pkg{edgebundle} package.

  • Edge bundling: mark_edge_bundle(). A drop-in alternative to mark_edges()
    that routes a graph's edges as bundled curves instead of straight lines, so a
    dense node-link hairball collapses into a few legible trunks. type selects the
    algorithm ("force", "divided", "stub", "path", "hammer", "mingle")
    and params passes tuning through to the \pkg{edgebundle} package, which
    computes the geometry; vellumplot draws the returned paths with the usual edge
    aesthetics (faint by default so overlapping trunks read as density). Needs the
    suggested \pkg{edgebundle} package (>= 1.0.0).

  • Chord diagrams: vchord(). Wraps a weighted flow (a from/to/value
    list or a square flow matrix) onto a circle -- one arc per node, one ribbon per
    flow through the centre. Directed: each node's arc splits into an outgoing then
    an incoming block, so a -> b and b -> a are distinct ribbons and self-flows
    loop within a node's sector. direction shows a ribbon's direction by fading
    it from source to target ("gradient", default), stopping it short of the
    target ("gap"), or "both". sort, gap, and link_color echo
    vsankey(); mark_chord() is the exported layer.

  • Removed the unused max_overlaps argument from mark_text(),
    mark_label(), and mark_node_text(). It was reserved for a never-implemented
    overlap cap and did nothing; drop it from any call.

  • More robust handling of degenerate and extreme inputs. A single distinct
    value on an axis under coord_fixed() / coord_sf() no longer collapses the
    panel to nothing; a map centred on a pole no longer gets a runaway aspect
    ratio; a circle-pack of collinear equal-value leaves no longer produces NaN
    coordinates; and a pathologically deep hierarchy or dendrogram aborts with a
    clear "too deep" message instead of overflowing the call stack.

  • mark_line(window = ) requires a positive integer k. A zero, negative,
    or fractional window size now errors clearly instead of silently producing a
    wrong (or empty) result.

  • A computed-constant if_false in condition() is carried into the
    interaction model.
    A negative literal (e.g. -0.5) or a computed constant
    (e.g. grey(0.5)) was previously dropped; only genuine per-row column
    references are now excluded (and carried per element instead).

  • A faceted layer whose own data lacks the facet variable still draws on every
    panel
    , but a genuine evaluation error there is no longer silently swallowed
    into that fallback.

  • mark_point(auto = TRUE) no longer datashades under a warped coordinate
    system.
    Under coord_polar() / coord_trans() the >50000-row datashade
    fallback — which bins in linear data space — would rasterise into the wrong
    place; it is now skipped and the vector path draws, matching the documented
    behaviour and the other auto marks (line/step/segment/edges).

  • A sankey column with too many nodes errors clearly. When a column has more
    nodes than its inter-node gaps can fit, the node/ribbon heights previously went
    negative and spilled outside the panel; vsankey() / mark_sankey() now abort
    with a message pointing at node_gap.

  • Aggregating stats drop missing summaries consistently, with a warning. For
    a value-summarising bar (mark_bar(y = , fun = ) and friends), a category
    whose summary is NA (an empty group, or a summary of data containing NA
    when the function does not remove it) is now dropped with a warning on both
    the grouped and ungrouped paths, which previously treated NA differently. A
    layer mapping both color and fill also keeps both aligned after
    aggregation (fill could previously be left at the wrong length).

  • Clearer errors for malformed scale bounds. scale_x_continuous(),
    scale_y_continuous(), scale_size(), scale_size_area(), scale_alpha(),
    scale_edge_width(), and scale_edge_alpha() now reject a limits (or output
    range) that is not a length-2 vector — and, for the size/alpha/edge scales, a
    non-numeric one — with a clear message, instead of failing later with a cryptic
    low-level error (e.g. 'length = 2' in coercion to 'logical(1)'). scale_size_area()
    also validates max_size.

  • add_marginal() rejects a non-numeric mapping. A factor x/y previously
    slipped through and the marginal was computed over the integer level codes
    rather than the data; it now errors clearly, as a character column already did.

  • Stricter validation of interactivity and layout arguments.
    select_point()/select_interval() reject a non-logical toggle/empty (it
    was silently coerced to FALSE); vgraph() validates width/height like
    vsankey()/vhierarchy(); and area() rejects a non-numeric or non-integer
    cell index instead of aborting with an opaque "missing value where TRUE/FALSE
    needed".

  • mark_text() honours hjust/vjust passed as a variable. They were only
    read as constant params, so a value routed through a variable (as
    vdendrogram() does per direction) silently fell back to centred, letting leaf
    labels run over the edges. .emit_text() now reads them value-first, like
    angle. vdendrogram() leaf labels also get a larger default gap.

  • Dendrograms and unrooted trees. vgraph() now accepts a base
    hclust/dendrogram and gains a height-aware "dendrogram" layout plus an
    "unrooted" layout (via graphlayouts::layout_as_tree_unrooted(), needs
    graphlayouts >= 1.2.5). mark_edges(routing = "elbow") gained elbow_at /
    elbow_axis so the elbow can be the dendrogram bracket (corner at the
    parent's level) rather than only the midpoint S-bend. vdendrogram() is a
    one-line preset: bracket edges, leaf labels, direction, and k to cut the
    tree and colour clusters. Also fixes mark_node_text(label = ) so an explicit
    label mapping overrides the default vertex name (it was previously ignored).

  • vhierarchy() respects scale_fill_*(). By default nodes are still
    coloured by their depth-1 branch and lightened with depth, but the branch is
    now an ordinary discrete fill scale, so scale_fill_manual() /
    scale_fill_discrete() recolour the branches and a lighten argument controls
    the depth fade (0 = flat colour per branch). Mapping fill to a node column
    instead colours every node by that variable (discrete or continuous, with the
    matching scale_fill_*()), with no depth fade.