perspective 4.4.1

A data visualization and analytics component, especially well-suited for large and/or streaming datasets.
Documentation

The Rust language bindings for Perspective, a high performance data-visualization and analytics component for the web browser.

Examples

A simple example which loads an Apache Arrow and computes a "Group By" operation, returning a new Arrow.

use perspective::client::config::ViewConfigUpdate;
use perspective::client::{TableInitOptions, UpdateData, ViewWindow};
use perspective::server::{LocalClient, Server};

# async fn example() -> Result<(), Box<dyn std::error::Error>> {
let server = Server::new(None);
let client = LocalClient::new(&server);
let arrow_data: Vec<u8> = vec![];
let data = UpdateData::Arrow(arrow_data.into());
let options = TableInitOptions::default();
let table = client.table(data.into(), options).await?;
let mut view_config = ViewConfigUpdate::default();
view_config.group_by = ["CounterParty", "Security"]
    .iter()
    .map(|x| Some(x.to_string()))
    .collect();

let view = table.view(Some(view_config)).await?;
let arrow = view.to_arrow(ViewWindow::default()).await?;
# Ok(())
# }

See also