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
69 changes: 40 additions & 29 deletions Cargo.lock

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

99 changes: 75 additions & 24 deletions docs/md/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,31 @@ which is too small). See

### Can I do rolling sums or cumulative calculations?

Not in Perspective's built-in engine, but as an alternative, DuckDB supports
[rolling and cumulative sums via `WINDOW` functions](https://duckdb.org/docs/stable/sql/functions/window_functions),
and DuckDB now has
[native Perspective Virtual Server support](./explanation/virtual_servers.md)
which allows arbitrary DuckDB queries (as a `TABLE` or `VIEW`) to be
`<perspective-viewer>` `Table`s.
Yes — use [Window Columns](./explanation/view/config/windows.md), the
`windows` property of a `View` config. These are ordered, partitioned rolling
computations analogous to SQL window functions, declared per-`View` like
expression columns:

<!-- _Related:
```javascript
const view = await table.view({
columns: ["Cumulative Sales"],
windows: {
"Cumulative Sales": {
column: "Sales",
aggregate: "sum",
order_by: ["Order Date", "asc"],
cumulative: true,
},
},
});
```

Window Columns are supported by Perspective's built-in engine, by the DuckDB,
ClickHouse and Polars [Virtual Servers](./explanation/virtual_servers.md), and
by the `<perspective-viewer>` UI. They update incrementally as the `Table`
updates.

<!-- _Related: [#504](https://github.com/perspective-dev/perspective/issues/504),
[#2600](https://github.com/perspective-dev/perspective/discussions/2600),
[#2624](https://github.com/perspective-dev/perspective/issues/2624)_ -->

Expand Down Expand Up @@ -191,21 +208,43 @@ Apply two filters on the same date column for a range.
[#3100](https://github.com/perspective-dev/perspective/discussions/3100),
[#2023](https://github.com/perspective-dev/perspective/issues/2023)_ -->

## JupyterLab
## Notebooks

### `PerspectiveWidget` is not loading

### `PerspectiveWidget` is not loading in JupyterLab
`PerspectiveWidget` is an [AnyWidget](https://anywidget.dev), shipped entirely
inside the `perspective-python` wheel. There is no separate JupyterLab
extension to install or version-match for the widget, so
`jupyter labextension list` is not where to look.

See the [`PerspectiveWidget` guide](./how_to/python/jupyterlab.md) for full
setup details. Ensure the JupyterLab extension version matches your
`perspective-python` version. Make sure you are using a compatible JupyterLab
for your Perspective version (JupyterLab 4+ currently).
Install the `jupyter` extra, which pulls in `anywidget`:

```bash
pip install "perspective-python[jupyter]"
```

Check that the extension is enabled with `jupyter labextension list`.
Then restart the kernel — and, for JupyterLab, reload the browser page. See
the [`PerspectiveWidget` guide](./how_to/python/jupyterlab.md).

<!-- _Related: [#1392](https://github.com/perspective-dev/perspective/issues/1392),
[#2059](https://github.com/perspective-dev/perspective/issues/2059),
[#2307](https://github.com/perspective-dev/perspective/issues/2307)_ -->

### Does `PerspectiveWidget` work outside JupyterLab?

Yes. Because the widget is an AnyWidget bundled into the wheel rather than a
JupyterLab labextension, it runs in any AnyWidget-compatible host —
JupyterLab, classic Jupyter Notebook, **VSCode notebooks**, Google Colab and
Marimo — with no per-host install step.

The separate `@perspective-dev/jupyterlab` package is now _optional_ and
provides only the "Open With → Perspective" file renderers for `csv`, `json`
and `arrow` files in JupyterLab.

<!-- _Related: [#2783](https://github.com/perspective-dev/perspective/issues/2783),
[#3042](https://github.com/perspective-dev/perspective/issues/3042),
[#3056](https://github.com/perspective-dev/perspective/issues/3056)_ -->

## Memory and Performance

### Perspective has a memory leak
Expand Down Expand Up @@ -446,9 +485,10 @@ update failures.

### Can I export the viewer to HTML, PNG or PDF?

HTML and PNG exports are available via `viewer.export("html")` and
`viewer.export("png")`, respectively. For PDF, render the viewer and use browser
or headless browser screenshot capabilities.
HTML export is available via `viewer.export({ method: "html" })`. For an
image, use `{ method: "plugin" }`, which asks the plugin to render itself —
this produces a PNG for chart plugins (and text for the datagrid). For PDF,
render the viewer and use browser or headless browser screenshot capabilities.

<!-- _Related: [#2836](https://github.com/perspective-dev/perspective/issues/2836),
[#2770](https://github.com/perspective-dev/perspective/discussions/2770),
Expand All @@ -466,8 +506,15 @@ using a library like `xlsx` (JavaScript) or `openpyxl` (Python).

### How do I copy data from a cell or row?

Use the `"text"` export mode when data is selected:
`await viewer.export("text")`.
Use one of the `-selected` export methods, which operate on the current
selection. To place it on the clipboard:

```javascript
await viewer.copy({ method: "csv-selected" });
```

... or to get it as a string, `await viewer.export({ method: "csv-selected" })`.
`json-selected` and `arrow-selected` are also available.

<!-- _Related: [#2765](https://github.com/perspective-dev/perspective/issues/2765),
[#2356](https://github.com/perspective-dev/perspective/discussions/2356)_ -->
Expand Down Expand Up @@ -552,12 +599,16 @@ server-side data processing without any UI. Use

### Can I use Perspective in Pyodide?

There is an emscripten wheel
[published via Releases](https://github.com/perspective-dev/perspective/releases),
but it must be downloaded and hosted manually and is only built for specific
pyodide versions.
Yes. Perspective publishes Emscripten wheels to PyPI under
[PEP 783](https://peps.python.org/pep-0783/), so `perspective-python` can be
installed by Pyodide's own package resolution — there is no need to download
and host a wheel yourself.

<!-- _Related:
Emscripten wheels are ABI-tied to a specific Emscripten version, and thus to
the Pyodide versions built against it. If resolution fails, check that your
Pyodide version matches a published wheel tag.

<!-- _Related: [#3186](https://github.com/perspective-dev/perspective/issues/3186),
[#2880](https://github.com/perspective-dev/perspective/discussions/2880)_ -->

### How do I handle row selection events?
Expand Down
2 changes: 2 additions & 0 deletions docs/md/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- [Grouping and Pivots](./explanation/view/config/grouping_and_pivots.md)
- [Selection and Ordering](./explanation/view/config/selection_and_ordering.md)
- [`expressions`](./explanation/view/config/expressions.md)
- [Window Columns](./explanation/view/config/windows.md)
- [Advanced View Operations](./explanation/view/advanced.md)
- [`Join`](./explanation/join.md)
- [Join Types](./explanation/join/join_types.md)
Expand All @@ -43,6 +44,7 @@
- [Saving and restoring UI state](./how_to/javascript/save_restore.md)
- [Listening for events](./how_to/javascript/events.md)
- [Plugin render limits](./how_to/javascript/plugin_settings.md)
- [Configuring the LLM agent](./how_to/javascript/agent.md)
- [Virtual Servers](./how_to/javascript/virtual_server.md)
- [DuckDB](./how_to/javascript/virtual_server/duckdb.md)
- [ClickHouse](./how_to/javascript/virtual_server/clickhouse.md)
Expand Down
35 changes: 20 additions & 15 deletions docs/md/explanation/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,23 @@ via the API), this runtime mode allows large datasets without the need to copy
them entirely to the Browser, at the expense of network latency on UI
interaction/API calls.

### Jupyterlab

`PerspectiveWidget` is a JupyterLab widget that implements the same API as
`<perspective-viewer>`, allows running such a viewer in
[JupyterLab](https://jupyterlab.readthedocs.io/en/stable/) in either server or
client (via WebAssembly) mode. `PerspectiveWidget` is compatible with Jupyterlab
3 and Jupyter Notebook 6 via a
[prebuilt extension](https://jupyterlab.readthedocs.io/en/stable/extension/extension_dev.html#prebuilt-extensions).
To use it, simply install `perspective-python` and the extensions should be
available.

`perspective-python`'s JupyterLab extension also provides convenient builtin
viewers for `csv`, `json`, or `arrow` files. Simply right-click on a file with
this extension and choose the appropriate `Perpective` option from the context
menu.
### Notebooks

`PerspectiveWidget` is an [AnyWidget](https://anywidget.dev) that implements
the same API as `<perspective-viewer>`, and runs such a viewer in either
server or client (via WebAssembly) mode.

The widget is bundled entirely inside the `perspective-python` wheel, so
there is no per-host extension to install. It runs identically in
[JupyterLab](https://jupyterlab.readthedocs.io/en/stable/), classic Jupyter
Notebook, VSCode notebooks, Google Colab and Marimo. Install the `jupyter`
extra to pull in `anywidget`:

```bash
pip install "perspective-python[jupyter]"
```

Separately, the _optional_ `@perspective-dev/jupyterlab` package provides
convenient builtin viewers for `csv`, `json`, or `arrow` files in JupyterLab.
With it installed, right-click a file of one of these types and choose the
appropriate `Perspective` option from the context menu.
Loading
Loading