vellumplot 0.5.0
-
Rich
md()legend titles no longer clip. A legend built from a rich title
(scale_color_continuous(name = md("Power (hp m^2^)")),labs(color = md(...)))
measured the title as zero width, so the legend reserved no room for it and the
drawn title spilled off the page. Titles are now measured through vellum's rich
text path (vl_strwidth()), reserving the space they actually occupy. -
Secondary axes. Continuous position scales gain a
sec.axisargument fed by
the newsec_axis()/dup_axis(): a second set of ticks and labels on the
opposite edge (top forx, right fory), computed as a 1:1 monotonic
transform of the primary axis — e.g.
scale_x_continuous(sec.axis = sec_axis(~ . * 1.8 + 32, name = "°F"))for a
unit conversion, ordup_axis()to duplicate an axis on a wide plot. The
transform is a formula, function, orscales::transform_*()object. Scoped to
the default Cartesian system with shared facet scales; combining it with
coord_flip()/coord_polar()/coord_trans(), free facet scales, or
add_marginal()raises a clear error, and it is not drawn inside a plot
composition. A plot without asec.axisis byte-for-byte unchanged. -
Datashading now covers dense lines and large-graph edges.
mark_line(),
mark_step(),mark_segment(), andmark_edges()gain anauto = TRUE
switch (parallel tomark_point(auto = TRUE)): past a row threshold the layer
rasterises into a line- / segment-density field viavellum::datashade_lines()
/vellum::datashade_segments()instead of emitting one vector per element, so
overplotted timeseries stacks and graph "hairballs" render fast and honestly.
The fallback is skipped under a warped coordinate system (coord_polar()/
coord_trans()), which keeps the vector path. (Area / ribbon datashading is not
yet available, pending area-fill support in vellum.) -
mark_datashade(spread = )exposes vellum's post-aggregation spreading:
NULL(default, raw output), a positive integer for a fixed pixel radius
(vellum::spread()), or"auto"for density-adaptive dilation
(vellum::dynspread()). Datashaded lines and segments default to"auto"so
single-pixel marks stay visible. -
Continuous and binned colour scales now interpolate perceptually (Oklab) by
default. A colour ramp built from a plain colour vector (e.g.
scale_color_gradient(low, high)orscale_color_continuous(palette = c(...)))
is blended in the perceptually-uniform Oklab space instead of sRGB, so it no
longer passes through muddy, over-dark midtones or drifts in hue — the ramp and
its legend colourbar read evenly. Designed perceptual palettes (thebatlow
default,hcl.colors()names) are already uniform and are unchanged. Set
options(vellumplot.color.interpolation = "srgb")(or"lab") to restore the
old behaviour. Gradient fills opt in per gradient with
linear_gradient(..., interpolation = "oklab")(passed through to vellum). -
Error bars and line ranges are now interactive.
mark_errorbar()and
mark_linerange()thread a declareddata_id/tooltip/hover_groupthrough to
their drawn segments, so each bar is keyed to its datum — it appears in
scene_model()andplot_provenance()and carries adata-keyin the SVG,
ready for hover/click/select in a widget (a bar's cap segments share the bar's
key).mark_boxplot()already keyed each box by its category; this completes the
statistical marks. A mark with no interactivity declared is unchanged. -
Two more shapes in
scale_shape(). Theshapeaesthetic's default palette
now extends to"triangle_down"(a downward triangle) and"star"(a
five-pointed star) after the original six, so a mappedshapecovers up to eight
levels without an explicit scale, and both are accepted asscale_shape(values=).
Requires the accompanyingvellumdev version. (A constantshape = "star"on a
mark already worked once vellum gained the shape.)