Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python user guide broken #2560

Open
ekalosak opened this issue Mar 10, 2024 · 0 comments
Open

python user guide broken #2560

ekalosak opened this issue Mar 10, 2024 · 0 comments
Labels
documentation Improvements/bugs/changes to documentation

Comments

@ekalosak
Copy link

ekalosak commented Mar 10, 2024

Bug Report

See https://perspective.finos.org/docs/python/, specifically the Torando websocket example index.html:

<perspective-viewer id="viewer" editable></perspective-viewer>

<script>
    window.addEventListener("DOMContentLoaded", async function () {
        // Create a client that expects a Perspective server
        // to accept connections at the specified URL.
        const websocket = perspective.websocket(
            "ws://localhost:8888/websocket"
        );

        // Get a handle to the Table on the server
        const server_table = websocket.open_table("data_source_one");

        // Create a new view
        const server_view = await table.view();

        // Create a Table on the client using `perspective.worker()`
        const worker = perspective.worker();
        const client_table = await worker.table(view);

        // Load the client table in the `<perspective-viewer>`.
        document.getElementById("viewer").load(client_table);
    });
</script>

Of course, table is not defined.
Worse, server_table.view() is not a function.

Solution

The Tornado example works. Hard problem to keep the web guide snippets in sync with fast-moving codebase, for sure. But here's the details:

Specifics

  1. add worker in the guide
  2. await the open_table
  3. server_view from server_table, not table
  4. worker.table isn't a future
@timkpaine timkpaine added the documentation Improvements/bugs/changes to documentation label Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements/bugs/changes to documentation
Projects
None yet
Development

No branches or pull requests

2 participants