MyNixOS website logo
Description

Interactive Pivot Tables and Visualizations with 'Perspective'.

An 'htmlwidgets' binding for the 'FINOS Perspective' <https://perspective-dev.github.io/> library, a high-performance 'WebAssembly'-powered data visualization engine. Provides interactive pivot tables, cross-tabulations, and multiple chart types (bar, line, scatter, heatmap, and more) that run entirely in the browser. Supports self-service analytics with drag-and-drop column selection, group-by/split-by pivoting, filtering, sorting, aggregation, and computed expressions. Works in 'RStudio' Viewer, 'R Markdown', 'Quarto', and 'Shiny' with streaming data updates via proxy interface.
perspectiveR logo

perspectiveR

R-CMD-check Codecov test coverage Lifecycle: experimental

R htmlwidgets binding for the FINOS Perspective library -- a high-performance WebAssembly-powered data visualization engine with interactive pivot tables and multiple chart types.

Installation

# Install from GitHub
remotes::install_github("EydlinIlya/perspectiveR")

# Or using pak
pak::pak("EydlinIlya/perspectiveR")

# Or using devtools
devtools::install_github("EydlinIlya/perspectiveR")

Quick Start

library(perspectiveR)

# Interactive data grid with full self-service UI
perspective(mtcars)

# Bar chart grouped by cylinder count
perspective(mtcars, group_by = "cyl", plugin = "Y Bar")

# Filtered scatter plot
perspective(iris,
  columns = c("Sepal.Length", "Sepal.Width", "Species"),
  filter = list(c("Species", "==", "setosa")),
  plugin = "Y Scatter"
)

Features

  • Multiple visualization types: Datagrid, bar, line, area, scatter, heatmap, treemap, sunburst, and more
  • Self-service interactive UI: Drag-and-drop columns, switch chart types, add filters/sorts/pivots, create computed expressions
  • High performance: WebAssembly-powered compute engine runs entirely in the browser
  • Shiny integration: Output/render bindings plus proxy interface for streaming data updates, indexed/keyed tables, rolling-window tables (limit), data export, table metadata queries, and state save/restore
  • Filter operator: Combine multiple filters with filter_op = "and" or filter_op = "or"
  • Arrow IPC support: Optional arrow package integration for efficient serialization of large datasets
  • Works everywhere: RStudio Viewer, R Markdown, Quarto, and Shiny

Shiny Demos

Two interactive demos are bundled with the package:

library(perspectiveR)
run_example()             # list all available demos
run_example("shiny-basic")
run_example("crud-table")
  • shiny-basic — Streaming stock market line chart (DAX, SMI, CAC, FTSE 1991-1998) with a 100-row sliding window, Arrow IPC toggle, computed columns, and named state save/restore.
  • crud-table — Editable indexed CRUD table with click events, add/update/delete rows by key, downloadable CSV/JSON export, and an update activity log.

Shiny Usage

library(shiny)
library(perspectiveR)

ui <- fluidPage(
  selectInput("dataset", "Dataset:",
    choices = c("mtcars", "iris", "airquality")
  ),
  perspectiveOutput("viewer", height = "600px")
)

server <- function(input, output, session) {
  output$viewer <- renderPerspective({
    data <- switch(input$dataset,
      "mtcars" = mtcars,
      "iris" = iris,
      "airquality" = airquality
    )
    perspective(data)
  })
}

shinyApp(ui, server)

Proxy Functions

  • psp_update(proxy, data) — append new rows (upserts when table has an index)
  • psp_replace(proxy, data) — replace all data
  • psp_clear(proxy) — clear all rows
  • psp_restore(proxy, config) — apply a saved config
  • psp_reset(proxy) — reset viewer to defaults
  • psp_remove(proxy, keys) — remove rows by primary key (indexed tables)
  • psp_export(proxy, format) — export data (JSON, CSV, columns, or Arrow); supports windowed export with start_row/end_row/start_col/end_col
  • psp_save(proxy) — retrieve current viewer state
  • psp_on_update(proxy, enable) — subscribe to data change events
  • psp_schema(proxy) — get table schema (column names and types)
  • psp_size(proxy) — get table row count
  • psp_columns(proxy) — get table column names
  • psp_validate_expressions(proxy, expressions) — validate expression strings

Related Projects

  • Perspective — the upstream WebAssembly data visualization engine this package wraps
  • GWalkR — interactive data exploration widget powered by Graphic Walker
  • esquisse — drag-and-drop ggplot2 builder as a Shiny module

Building the JS Bundle

The pre-built JS bundle is included. To rebuild from source:

cd tools
npm install
npm run build
npm run copy-themes

License

Apache License 2.0

'Perspective' is a project of the OpenJS Foundation. perspectiveR is an independent community package and is not affiliated with or endorsed by the OpenJS Foundation.

Metadata

Version

0.3.0

License

Unknown

Platforms (80)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • sh4-linux
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows