vellumwidget 0.1.0
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 avellumplotplot or a rawvellumscene 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'shover_grouphighlights 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/shapescale 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 byhover_group(select one, select the series).
as_widget(crosstalk = SharedData)bridges to the crosstalk ecosystem
(plotly / leaflet / DT andfilter_*inputs) via aSelectionHandle+
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 theme —
as_widget(hover_color=, selected_color=, dim_opacity=)
sets the look for the whole plot (any R or CSS colour). - Per-element grammar —
vellumplotmarks'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.
- Widget theme —
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).