Skip to content

vellumwidget 0.7.0

Choose a tag to compare

@schochastics schochastics released this 27 Jul 07:48
· 12 commits to main since this release
  • 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/saveWidget page), 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 on getScreenCTM() / viewBox math, which can disagree with how the
    content is actually laid out when the svg carries width/height attributes.
    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 (now vellumplot::condition()), and the
    hover/select/brush/lasso/tooltip/nearest/zoom/axis_zoom/
    zoom_marks toggles (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().
    Requires vellumplot (>= 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 by filter_by() on another now
    cross-filters — brush/select the source cell and the linked cell narrows to the
    matching rows, matched by a cross-view join id. 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 vellumplot plot 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 (no as_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 a vellumplot plot declares (select_point() /
    condition()) off the compiled spec and enacts it on the frozen scene. A
    hover- or click-driven selection with a condition() on an aesthetic keeps
    selection members at their if_true style and applies if_false to
    non-members (an explicit colour, or the theme dim as a spotlight) — reverting
    when the selection empties. No new as_widget() argument: the behaviour
    travels with the plot. (Filters, cross-view, and scale binds follow.)