Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Stein <steinlink@gmail.com>
  • Loading branch information
texodus committed Jan 14, 2025
1 parent 7c134b3 commit c678ebc
Show file tree
Hide file tree
Showing 169 changed files with 7,894 additions and 3,809 deletions.
1 change: 0 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ rustflags = ["-C", "target-feature=+crt-static", "--cfg=web_sys_unstable_apis"]
[target.x86_64-pc-windows-msvc]
rustflags = ["-C", "target-feature=+crt-static", "--cfg=web_sys_unstable_apis"]


[future-incompat-report]
frequency = 'never'

Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,6 @@ jobs:
packages/perspective-viewer-d3fc/dist
packages/perspective-viewer-datagrid/dist
packages/perspective-viewer-openlayers/dist
packages/perspective-esbuild-plugin/dist
packages/perspective-webpack-plugin/dist
packages/perspective-cli/dist
packages/perspective-workspace/dist
Expand Down Expand Up @@ -947,12 +945,6 @@ jobs:
- run: pnpm pack --pack-destination=../..
working-directory: ./packages/perspective-cli

- run: pnpm pack --pack-destination=../..
working-directory: ./packages/perspective-webpack-plugin

- run: pnpm pack --pack-destination=../..
working-directory: ./packages/perspective-esbuild-plugin

- run: pnpm pack --pack-destination=../..
working-directory: ./packages/perspective-jupyterlab

Expand Down
20 changes: 18 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,9 @@ strip = true

[patch.crates-io]
simd-adler32 = { git = "https://github.com/mcountryman/simd-adler32.git", rev = "140cde033e8b9a12d4de840648c65ccd5320bcc5" }
perspective-client = { path = "rust/perspective-client" }
perspective-server = { path = "rust/perspective-server" }
perspective-js = { path = "rust/perspective-js" }
perspective = { path = "rust/perspective" }
perspective-viewer = { path = "rust/perspective-viewer" }
perspective-python = { path = "rust/perspective-python" }
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<br />
<a href="https://github.com/finos/perspective/blob/master/docs/static/svg/perspective-logo-light.svg?raw=true#gh-light-mode-only"><img src="https://github.com/finos/perspective/raw/master/docs/static/svg/perspective-logo-light.svg?raw=true#gh-light-mode-only" alt="Perspective" width="260"></a>
<a href="https://github.com/finos/perspective/blob/master/docs/static/svg/perspective-logo-dark.svg?raw=true#gh-dark-mode-only"><img src="https://github.com/finos/perspective/raw/master/docs/static/svg/perspective-logo-dark.svg?raw=true#gh-dark-mode-only" alt="Perspective" width="260"></a>
<a href="https://perspective.finos.org">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/finos/perspective/raw/master/docs/static/svg/perspective-logo-dark.svg?raw=true">
<img width="260" src="https://github.com/finos/perspective/raw/master/docs/static/svg/perspective-logo-light.svg?raw=true">
</picture>
</a>
<br/><br/>

[![Build Status](https://img.shields.io/github/actions/workflow/status/finos/perspective/build.yaml?event=push&style=for-the-badge)](https://github.com/finos/perspective/actions/workflows/build.yaml)
Expand Down
5 changes: 2 additions & 3 deletions cpp/perspective/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,9 @@ if(PSP_WASM_BUILD)
")
endif()
else()
set(OPT_FLAGS " -O3 -g0 -flto --emit-tsd=perspective-server.d.ts ")
set(OPT_FLAGS " -O3 -g0 ")
if (PSP_WASM_EXCEPTIONS)
set(OPT_FLAGS "${OPT_FLAGS} -fwasm-exceptions ")
set(OPT_FLAGS "${OPT_FLAGS} -fwasm-exceptions -flto --emit-tsd=perspective-server.d.ts ")
endif()
endif()
elseif(PSP_CPP_BUILD OR PSP_PYTHON_BUILD)
Expand Down Expand Up @@ -523,7 +523,6 @@ else()
-s DYNAMIC_EXECUTION=0 \
-s POLYFILL=0 \
-s EXPORT_NAME=\"load_perspective\" \
-s MAXIMUM_MEMORY=16gb \
-s ERROR_ON_UNDEFINED_SYMBOLS=0 \
-s NODEJS_CATCH_EXIT=0 \
-s NODEJS_CATCH_REJECTION=0 \
Expand Down
26 changes: 13 additions & 13 deletions cpp/perspective/src/cpp/table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ Table::update_cols(const std::string_view& data, std::uint32_t port_id) {
}

t_uindex nrows = 0;
for (const auto& it : document.GetObject()) {
for (const auto& it : document.GetObj()) {
if (!it.value.IsArray()) {
PSP_COMPLAIN_AND_ABORT("Malformed column")
}
Expand Down Expand Up @@ -940,14 +940,14 @@ Table::update_cols(const std::string_view& data, std::uint32_t port_id) {

auto schema = data_table.get_schema();

if (is_implicit && !document.GetObject().HasMember("__INDEX__")) {
if (is_implicit && !document.GetObj().HasMember("__INDEX__")) {
for (std::uint32_t ii = 0; ii < nrows; ii++) {
psp_pkey_col->set_nth<std::uint32_t>(ii, (m_offset + ii) % m_limit);
}
}

// 3.) Fill table
for (const auto& column : document.GetObject()) {
for (const auto& column : document.GetObj()) {
t_uindex ii = 0;
std::string_view col_name = column.name.GetString();
if (std::string_view{column.name.GetString()} == "__INDEX__") {
Expand Down Expand Up @@ -1001,7 +1001,7 @@ Table::from_cols(
t_uindex nrows = 0;

// https://github.com/Tencent/rapidjson/issues/1994
for (const auto& it : document.GetObject()) {
for (const auto& it : document.GetObj()) {
if (!it.value.IsArray()) {
PSP_COMPLAIN_AND_ABORT("Malformed column")
}
Expand Down Expand Up @@ -1052,7 +1052,7 @@ Table::from_cols(
const auto& psp_okey_col = data_table.get_column("psp_okey");

// 3.) Fill table
for (const auto& col : document.GetObject()) {
for (const auto& col : document.GetObj()) {
t_uindex ii = 0;
const auto& col_name = col.name.GetString();
LOG_DEBUG(
Expand Down Expand Up @@ -1153,7 +1153,7 @@ Table::update_rows(const std::string_view& data, std::uint32_t port_id) {
}

// col_count = m_column_names.size();
for (const auto& it : row.GetObject()) {
for (const auto& it : row.GetObj()) {
std::shared_ptr<t_column> col;
std::string_view col_name = it.name.GetString();
if (std::string_view{it.name.GetString()} == "__INDEX__") {
Expand Down Expand Up @@ -1246,12 +1246,12 @@ Table::from_rows(

[&]() {
for (const auto& row : document.GetArray()) {
for (const auto& col : row.GetObject()) {
for (const auto& col : row.GetObj()) {
columns_seen.insert(col.name.GetString());
}

// https://github.com/Tencent/rapidjson/issues/1994
for (const auto& col : row.GetObject()) {
for (const auto& col : row.GetObj()) {
if (col.name.GetString() == index) {
is_implicit = false;
}
Expand Down Expand Up @@ -1307,7 +1307,7 @@ Table::from_rows(

// 3.) Fill table
for (const auto& row : document.GetArray()) {
for (const auto& it : row.GetObject()) {
for (const auto& it : row.GetObj()) {
auto col = data_table.get_column(it.name.GetString());
const auto* col_name = it.name.GetString();
const auto& cell = it.value;
Expand Down Expand Up @@ -1399,7 +1399,7 @@ Table::update_ndjson(const std::string_view& data, std::uint32_t port_id) {
psp_pkey_col->set_nth<std::uint32_t>(ii, (ii + m_offset) % m_limit);
}

for (const auto& it : document.GetObject()) {
for (const auto& it : document.GetObj()) {
std::shared_ptr<t_column> col;
std::string_view col_name = it.name.GetString();
if (std::string_view{it.name.GetString()} == "__INDEX__") {
Expand Down Expand Up @@ -1486,12 +1486,12 @@ Table::from_ndjson(
// enhancement we do for regular JSON. For now this only checks the first
// row.
[&]() {
for (const auto& col : document.GetObject()) {
for (const auto& col : document.GetObj()) {
columns_seen.insert(col.name.GetString());
}

// https://github.com/Tencent/rapidjson/issues/1994
for (const auto& col : document.GetObject()) {
for (const auto& col : document.GetObj()) {
if (col.name.GetString() == index) {
is_implicit = false;
}
Expand Down Expand Up @@ -1555,7 +1555,7 @@ Table::from_ndjson(
// 3.) Fill table
bool is_finished = false;
while (!is_finished) {
for (const auto& it : document.GetObject()) {
for (const auto& it : document.GetObj()) {
auto col = data_table.get_column(it.name.GetString());
const auto* col_name = it.name.GetString();
const auto& cell = it.value;
Expand Down
42 changes: 42 additions & 0 deletions docs/book.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
# ┃ ██████ ██████ ██████ █ █ █ █ █ █▄ ▀███ █ ┃
# ┃ ▄▄▄▄▄█ █▄▄▄▄▄ ▄▄▄▄▄█ ▀▀▀▀▀█▀▀▀▀▀ █ ▀▀▀▀▀█ ████████▌▐███ ███▄ ▀█ █ ▀▀▀▀▀ ┃
# ┃ █▀▀▀▀▀ █▀▀▀▀▀ █▀██▀▀ ▄▄▄▄▄ █ ▄▄▄▄▄█ ▄▄▄▄▄█ ████████▌▐███ █████▄ █ ▄▄▄▄▄ ┃
# ┃ █ ██████ █ ▀█▄ █ ██████ █ ███▌▐███ ███████▄ █ ┃
# ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
# ┃ Copyright (c) 2017, the Perspective Authors. ┃
# ┃ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ ┃
# ┃ This file is part of the Perspective library, distributed under the terms ┃
# ┃ of the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). ┃
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

[book]
authors = ["Andrew Stein"]
language = "en"
multilingual = false
src = "md"
title = "Perspective"

[build]
build-dir = "static/guide"

[output.html]
# theme = "my-theme"
# default-theme = "light"
# preferred-dark-theme = "navy"
# smart-punctuation = true
# mathjax-support = false
copy-fonts = true
git-repository-url = "https://github.com/finos/perspective"
git-repository-icon = "fa-github"
site-url = "https://perspective.finos.org/guide/"
additional-css = [
"md/perspective.css",
"node_modules/@finos/perspective-viewer/dist/css/themes.css",
]
# additional-js = []
# no-section-label = false
# edit-url-template = "https://github.com/rust-lang/mdBook/edit/master/guide/{path}"
# site-url = "/guide/"
# cname = "myproject.rs"
# input-404 = "not-found.md"
60 changes: 60 additions & 0 deletions docs/md/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Summary

[What is Perspective](./perspective.md)

# Overview

- [Data Architecture](./explanation/architecture.md)
- [Client-only](./explanation/architecture/client_only.md)
- [Client/Server replicated](./explanation/architecture/client_server.md)
- [Server only](./explanation/architecture/server_only.md)
- [`Table`](./explanation/table.md)
- [Construct an empty `Table` from a schema](./explanation/table/constructing_schema.md)
- [Schema and column types](./explanation/table/schema.md)
- [Loading data](./explanation/table/loading_data.md)
- [`index` and `limit` options](./explanation/table/options.md)
- [`update()` and `remove()` streaming methods](./explanation/table/update_and_remove.md)
- [`clear()` and `replace()` start-over methods](./explanation/table/clear_and_replace.md)
- [`View`](./explanation/view.md)
- [Querying data](./explanation/view/querying.md)
- [`group_by`](./explanation/view/config/group_by.md)
- [`split_by`](./explanation/view/config/split_by.md)
- [`aggregates`](./explanation/view/config/aggregates.md)
- [`columns`](./explanation/view/config/columns.md)
- [`sort`](./explanation/view/config/sort.md)
- [`filter`](./explanation/view/config/filter.md)
- [`expressions`](./explanation/view/config/expressions.md)
- [Flattening a View into a Table](./explanation/view/config/flattening.md)
- [JavaScript](./explanation/javascript.md)
- [Module Structure](./explanation/javascript_module_structure.md)
- [Build options](./explanation/javascript_builds.md)
- [Python](./explanation/python.md)

# Getting Started

- [Rust](./how_to/rust.md)
- [JavaScript](./how_to/javascript.md)
- [Installation via NPM](./how_to/javascript/installation.md)
- [Importing with or without a bundler](./how_to/javascript/importing.md)
- [`perspective` data engine library](./how_to/javascript/worker.md)
- [Serializing data](./how_to/javascript/serializing.md)
- [Cleaning up resources](./how_to/javascript/deleting.md)
- [Hosting a `WebSocketServer` in Node.js](./how_to/javascript/nodejs_server.md)
- [`perspective-viewer` Custom Element library](./how_to/javascript/viewer.md)
- [Theming](./how_to/javascript/theming.md)
- [Loading data from a `Table`](./how_to/javascript/loading_data.md)
- [Loading data from a virtual `Table`](./how_to/javascript/loading_virtual_data.md)
- [Saving and restoring UI state](./how_to/javascript/save_restore.md)
- [Listening for events](./how_to/javascript/events.md)
- [Python](./how_to/python.md)
- [Installation](./how_to/python/installation.md)
- [Loading data into a `Table`](./how_to/python/table.md)
- [Callbacks and events](./how_to/python/callbacks.md)
- [Multithreading](./how_to/python/multithreading.md)
- [Hosting a WebSocket server](./how_to/python/websocket.md)
- [`PerspectiveWidget` for JupyterLab](./how_to/python/jupyterlab.md)
- [Tutorial: A `tornado` server with virtual `perspective-viewer`](./tutorials/python/tornado.md)

# API

- [Crate documentation on `docs.rs` ](./api_reference.md)
9 changes: 9 additions & 0 deletions docs/md/api_reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# API Reference

Perspective's complete API is hosted on `docs.rs`:

- [`perspective-client`](https://docs.rs/perspective-client/latest/perspective_client/index.html)
covers `Table` and `View` data engine API methods common for Rust,
JavaScript and Python.
- [`perspective-rs`](https://docs.rs/perspective-client/latest/perspective_client/index.html)
adds Rust-specific documentation for the Rust crate entrypoint.
1 change: 1 addition & 0 deletions docs/md/explanation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Explanation
15 changes: 15 additions & 0 deletions docs/md/explanation/architecture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Data Architecture

Application developers can choose from
[Client (WebAssembly)](./architecture/client_only.md),
[Server (Python/Node)](./architecture/server_only.md) or
[Client/Server Replicated](./architecture/client_server.md) designs to bind
data, and a web application can use one or a mix of these designs as needed. By
serializing to Apache Arrow, tables are duplicated and synchronized across
runtimes efficiently.

Perspective is a multi-language platform. The examples in this section use
Python and JavaScript as an example, but the same general principles apply to
any `Client`/`Server` combination.

<img src="./architecture/architecture.svg" />
Loading

0 comments on commit c678ebc

Please sign in to comment.