Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ WebAssembly, Python, and Rust.
## Examples

<!-- Examples -->
<table><tbody><tr><td>editable</td><td>file</td><td>duckdb</td></tr><tr><td><a href="https://perspective-dev.github.io/block?example=editable"><img height="125" src="https://perspective-dev.github.io/blocks/editable/preview.png?" /></a></td><td><a href="https://perspective-dev.github.io/block?example=file"><img height="125" src="https://perspective-dev.github.io/blocks/file/preview.png?" /></a></td><td><a href="https://perspective-dev.github.io/block?example=duckdb"><img height="125" src="https://perspective-dev.github.io/blocks/duckdb/preview.png?" /></a></td></tr><tr><td>fractal</td><td>market</td><td>raycasting</td></tr><tr><td><a href="https://perspective-dev.github.io/block?example=fractal"><img height="125" src="https://perspective-dev.github.io/blocks/fractal/preview.png?" /></a></td><td><a href="https://perspective-dev.github.io/block?example=market"><img height="125" src="https://perspective-dev.github.io/blocks/market/preview.png?" /></a></td><td><a href="https://perspective-dev.github.io/block?example=raycasting"><img height="125" src="https://perspective-dev.github.io/blocks/raycasting/preview.png?" /></a></td></tr><tr><td>evictions</td><td>nypd</td><td>streaming</td></tr><tr><td><a href="https://perspective-dev.github.io/block?example=evictions"><img height="125" src="https://perspective-dev.github.io/blocks/evictions/preview.png?" /></a></td><td><a href="https://perspective-dev.github.io/block?example=nypd"><img height="125" src="https://perspective-dev.github.io/blocks/nypd/preview.png?" /></a></td><td><a href="https://perspective-dev.github.io/block?example=streaming"><img height="125" src="https://perspective-dev.github.io/blocks/streaming/preview.png?" /></a></td></tr><tr><td>covid</td><td>webcam</td><td>movies</td></tr><tr><td><a href="https://perspective-dev.github.io/block?example=covid"><img height="125" src="https://perspective-dev.github.io/blocks/covid/preview.png?" /></a></td><td><a href="https://perspective-dev.github.io/block?example=webcam"><img height="125" src="https://perspective-dev.github.io/blocks/webcam/preview.png?" /></a></td><td><a href="https://perspective-dev.github.io/block?example=movies"><img height="125" src="https://perspective-dev.github.io/blocks/movies/preview.png?" /></a></td></tr><tr><td>superstore</td><td>citibike</td><td>olympics</td></tr><tr><td><a href="https://perspective-dev.github.io/block?example=superstore"><img height="125" src="https://perspective-dev.github.io/blocks/superstore/preview.png?" /></a></td><td><a href="https://perspective-dev.github.io/block?example=citibike"><img height="125" src="https://perspective-dev.github.io/blocks/citibike/preview.png?" /></a></td><td><a href="https://perspective-dev.github.io/block?example=olympics"><img height="125" src="https://perspective-dev.github.io/blocks/olympics/preview.png?" /></a></td></tr><tr><td>dataset</td></tr><tr><td><a href="https://perspective-dev.github.io/block?example=dataset"><img height="125" src="https://perspective-dev.github.io/blocks/dataset/preview.png?" /></a></td></tr></tbody></table>
<table><tbody><tr><td>editable</td><td>file</td><td>duckdb</td></tr><tr><td><a href="https://perspective-dev.github.io/block?example=editable"><img height="125" src="https://perspective-dev.github.io/blocks/editable/preview.png?" /></a></td><td><a href="https://perspective-dev.github.io/block?example=file"><img height="125" src="https://perspective-dev.github.io/blocks/file/preview.png?" /></a></td><td><a href="https://perspective-dev.github.io/block?example=duckdb"><img height="125" src="https://perspective-dev.github.io/blocks/duckdb/preview.png?" /></a></td></tr><tr><td>fractal</td><td>market</td><td>raycasting</td></tr><tr><td><a href="https://perspective-dev.github.io/block?example=fractal"><img height="125" src="https://perspective-dev.github.io/blocks/fractal/preview.png?" /></a></td><td><a href="https://perspective-dev.github.io/block?example=market"><img height="125" src="https://perspective-dev.github.io/blocks/market/preview.png?" /></a></td><td><a href="https://perspective-dev.github.io/block?example=raycasting"><img height="125" src="https://perspective-dev.github.io/blocks/raycasting/preview.png?" /></a></td></tr><tr><td>evictions</td><td>nypd</td><td>streaming</td></tr><tr><td><a href="https://perspective-dev.github.io/block?example=evictions"><img height="125" src="https://perspective-dev.github.io/blocks/evictions/preview.png?" /></a></td><td><a href="https://perspective-dev.github.io/block?example=nypd"><img height="125" src="https://perspective-dev.github.io/blocks/nypd/preview.png?" /></a></td><td><a href="https://perspective-dev.github.io/block?example=streaming"><img height="125" src="https://perspective-dev.github.io/blocks/streaming/preview.png?" /></a></td></tr><tr><td>covid</td><td>webcam</td><td>movies</td></tr><tr><td><a href="https://perspective-dev.github.io/block?example=covid"><img height="125" src="https://perspective-dev.github.io/blocks/covid/preview.png?" /></a></td><td><a href="https://perspective-dev.github.io/block?example=webcam"><img height="125" src="https://perspective-dev.github.io/blocks/webcam/preview.png?" /></a></td><td><a href="https://perspective-dev.github.io/block?example=movies"><img height="125" src="https://perspective-dev.github.io/blocks/movies/preview.png?" /></a></td></tr><tr><td>superstore</td><td>olympics</td><td>dataset</td></tr><tr><td><a href="https://perspective-dev.github.io/block?example=superstore"><img height="125" src="https://perspective-dev.github.io/blocks/superstore/preview.png?" /></a></td><td><a href="https://perspective-dev.github.io/block?example=olympics"><img height="125" src="https://perspective-dev.github.io/blocks/olympics/preview.png?" /></a></td><td><a href="https://perspective-dev.github.io/block?example=dataset"><img height="125" src="https://perspective-dev.github.io/blocks/dataset/preview.png?" /></a></td></tr></tbody></table>
<!-- Examples -->

## Media
Expand Down
1 change: 0 additions & 1 deletion examples/blocks/examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const LOCAL_EXAMPLES = [
"webcam",
"movies",
"superstore",
"citibike",
"olympics",
"dataset",
];
Expand Down
2 changes: 1 addition & 1 deletion examples/blocks/server.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ const dev_template = (name) => `
`;

const gists = [
"duckdb",
"fractal",
"raycasting",
"evictions",
"streaming",
"covid",
"movies",
"superstore",
"citibike",
"olympics",
"editable",
"file",
Expand Down
1 change: 0 additions & 1 deletion examples/blocks/src/citibike/.block

This file was deleted.

13 changes: 0 additions & 13 deletions examples/blocks/src/citibike/README.md

This file was deleted.

95 changes: 0 additions & 95 deletions examples/blocks/src/citibike/citibike.js

This file was deleted.

20 changes: 0 additions & 20 deletions examples/blocks/src/citibike/index.html

This file was deleted.

74 changes: 0 additions & 74 deletions examples/blocks/src/citibike/layout.json

This file was deleted.

Binary file removed examples/blocks/src/citibike/preview.png
Binary file not shown.
Binary file removed examples/blocks/src/citibike/thumbnail.png
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export class HTMLPerspectiveViewerDatagridPluginElement
}

get group_rollups(): string[] {
return ["rollup", "flat"];
return ["rollup", "flat", "total"];
}

/**
Expand Down
15 changes: 8 additions & 7 deletions rust/perspective-client/perspective.proto
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,13 @@ message Response {
//
// Virtual API


enum GroupRollupMode {
ROLLUP = 0;
FLAT = 1;
TOTAL = 2;
}

// Informs the client of the feature set, e.g. what to expect in the
// `ViewConfig` message.
message GetFeaturesReq {}
Expand All @@ -218,6 +225,7 @@ message GetFeaturesResp {
bool sort = 5;
map<uint32, ColumnTypeOptions> filter_ops = 6;
map<uint32, AggregateOptions> aggregates = 7;
repeated GroupRollupMode group_rollup_mode = 8;

message ColumnTypeOptions {
repeated string options = 1;
Expand All @@ -233,7 +241,6 @@ message GetFeaturesResp {
}
}


// `Client::get_hosted_tables`
message GetHostedTablesReq {
bool subscribe = 1;
Expand Down Expand Up @@ -540,12 +547,6 @@ message ViewConfig {
AND = 0;
OR = 1;
}

enum GroupRollupMode {
ROLLUP = 0;
FLAT = 1;
// TOTAL = 2;
}
}

message ColumnsUpdate {
Expand Down
13 changes: 13 additions & 0 deletions rust/perspective-client/src/rust/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,19 @@ impl<U: Copy + 'static> SystemInfo<U> {
#[derive(Clone, Debug, Default)]
pub struct Features(Arc<GetFeaturesResp>);

impl Features {
pub fn get_group_rollup_modes(&self) -> Vec<crate::config::GroupRollupMode> {
self.group_rollup_mode
.iter()
.map(|x| {
crate::config::GroupRollupMode::from(
crate::proto::GroupRollupMode::try_from(*x).unwrap(),
)
})
.collect::<Vec<_>>()
}
}

impl Deref for Features {
type Target = GetFeaturesResp;

Expand Down
Loading
Loading