Skip to content

Error in 4.1 when calling getView() on viewer #3117

@aszenz

Description

@aszenz

Bug Report

No table set error on calling getView on hidden viewer tabs in @perspective-dev/workspace.

Steps to Reproduce:

  1. Create a perspective-workspace with multiple viewers in tabs
  2. Save the workspace config
  3. Restore it
  4. Call this js
const hiddenWidget = workspace.getAllWidgets().find(w => w.node.classList.contains('lm-mod-hidden'));
const view = await hiddenWidget.viewer.getView(); // Throws: "No table set"

Expected Result:

Calling getView() on hidden tabs worked fine in 4.0, so I would expect that to work here too or an alternative method.

My use case is to fetch data from all the views in the workspace and export them.

Actual Result:

Uncaught (in promise) Error: No table set
    at e.wbg.__wbg_new_a7442b4b19c1a356 (VM81 index-e2eY0UId.js:3:42384)
    at VM90 009971b2:1:1546462
    at VM90 009971b2:1:1128898
    at VM90 009971b2:1:1042638
    at VM90 009971b2:1:562175
    at VM90 009971b2:1:815156
    at VM90 009971b2:1:1656843
    at jF (VM81 index-e2eY0UId.js:3:1931)
    at s (VM81 index-e2eY0UId.js:3:781)
e.wbg.__wbg_new_a7442b4b19c1a356 @ VM81 index-e2eY0UId.js:3
$func4708 @ VM90 009971b2:1
$func2043 @ VM90 009971b2:1
$func1612 @ VM90 009971b2:1
$func556 @ VM90 009971b2:1
$func897 @ VM90 009971b2:1
$__wasm_bindgen_func_elem_18169 @ VM90 009971b2:1
jF @ VM81 index-e2eY0UId.js:3
s @ VM81 index-e2eY0UId.js:3

Environment:

For JavaScript (browser):

  • @perspective-dev/client version = 4.1
  • Browser and version = Chromium 144
  • OS = Linux

Additional Context:

In Perspective 4.1.0, commit d9f69fd introduced a visibility check in restore_and_render.rs that skips view creation for hidden elements:

if !presentation.is_visible() {
Ok(None)
} else {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions