Skip to content

vellumwidget 0.1.0

Choose a tag to compare

@schochastics schochastics released this 08 Jul 07:53
· 83 commits to main since this release

vellumwidget 0.1.0

First release. vellumwidget turns a vellum scene or a vellumplot plot into a
self-contained, client-side interactive HTML widget via a single terminal
as_widget() pipe — no Shiny, no server round-trip. Everything below ships in
this first release.

Features

  • as_widget() compiles a vellumplot plot or a raw vellum scene and bundles its
    SVG + scene_model() element table into an htmlwidget.
  • Hover — tooltip (from the declared tooltip, falling back to the key) and
    highlight with inverse-dim; a hovered element's hover_group highlights the
    whole group. Hover snaps to the nearest mark when the cursor isn't directly
    over one.
  • Click — select (single / multiple modes); every element sharing a key
    toggles together.
  • Brush — drag a rectangle to select every element it covers.
  • Pan / zoom — mouse wheel and pan-mode drag reframe the SVG viewBox, plus
    zoom-to-selection and reset.
  • Toolbar (on hover) — brush/pan mode toggle, zoom-to-selection, reset zoom,
    download SVG, download PNG, fullscreen.
  • Everything is opt-outable via as_widget() arguments
    (tooltip/hover/select/brush/zoom/toolbar/nearest).
  • Legend interaction. For a discrete color/shape scale on an interactive
    plot, each legend swatch drives its whole data series: hovering a swatch
    highlights the series (the swatch stays lit), clicking it selects the series
    (and links across views / crosstalk). Automatic — no extra arguments.
  • Linked views. as_widget(group=) links vellumwidget widgets client-side (no
    dependency): selecting/brushing in one highlights the same data keys in the
    others, projecting by hover_group (select one, select the series).
    as_widget(crosstalk = SharedData) bridges to the crosstalk ecosystem
    (plotly / leaflet / DT and filter_* inputs) via a SelectionHandle +
    FilterHandle; a crosstalk filter hides the non-matching marks (display-tier
    cross-filter). crosstalk is a Suggests, loaded only when used.
  • Customisable interaction styling, at two composing levels:
    • Widget themeas_widget(hover_color=, selected_color=, dim_opacity=)
      sets the look for the whole plot (any R or CSS colour).
    • Per-element grammarvellumplot marks' hover_color/selected_color
      (constant or column-mapped) style each element individually and override the
      theme. Both use CSS variables with a defaults ← theme ← per-element cascade.

The JS runtime is TypeScript in srcts/, bundled by esbuild into the committed
inst/htmlwidgets/vellumwidget.js (so the R package installs with no Node).