vellumwidget 0.7.0
-
Bug fix: hover snapped to the wrong mark on a scaled plot. When the svg was
rendered at a different size than its viewBox implies (the widget's
max-width:100%, the RStudio Viewer pane, an embedded/saveWidgetpage), hover
highlighted a mark offset from the cursor (usually up-and-left); click was
unaffected because it uses the DOM target. The client→scene hit-test mapping
relied ongetScreenCTM()/ viewBox math, which can disagree with how the
content is actually laid out when the svg carrieswidth/heightattributes.
Hit-testing (hover, brush, lasso) now calibrates the transform from the real
rendered positions of the marks themselves versus their known scene bboxes —
exact under any viewBox / attribute / CSS-scale / zoom combination. Tooltip
anchoring uses the mark's own rendered position. -
Breaking: interaction is now declared in the plot, not on
as_widget().
The interaction-intent arguments have been removed —hover_color,
selected_color,dim_opacity(nowvellumplot::condition()), and the
hover/select/brush/lasso/tooltip/nearest/zoom/axis_zoom/
zoom_markstoggles (now on by default — interactive-by-default). The
signature drops from ~36 to 24 arguments. Per-plot interaction (highlight,
filter, cross-filter) travels with the spec via
vellumplot::select_point()/select_interval()/condition()/filter_by().
Requiresvellumplot (>= 0.6.0.9000). (hover_mode,crosshair,
legend_click,select_mode, and the tooltip-appearance args remain until
their spec equivalents land.) -
Declarative interactivity: cross-view filtering. A selection defined on one
cell of a composition and referenced byfilter_by()on another now
cross-filters — brush/select the source cell and the linked cell narrows to the
matching rows, matched by a cross-viewjoinid. The source cell stays fully
visible; only the target cell hides (scoped by per-cell-unique keys). All in
one widget runtime, no server round-trip. -
Declarative interactivity: filters. A
vellumplotplot that declares
filter_by(selection)now hides everything outside the selection when that
selection's gesture fires — reusing the cross-filter path. Driven entirely by
the plot spec (noas_widget()argument). Single-view for now; the cross-view
form (brush one panel, filter another) follows. -
Declarative interactivity: conditional encodings.
as_widget()now reads
the interaction model avellumplotplot declares (select_point()/
condition()) off the compiled spec and enacts it on the frozen scene. A
hover- or click-driven selection with acondition()on an aesthetic keeps
selection members at theirif_truestyle and appliesif_falseto
non-members (an explicit colour, or the theme dim as a spotlight) — reverting
when the selection empties. No newas_widget()argument: the behaviour
travels with the plot. (Filters, cross-view, and scale binds follow.)