Skip to content

Does perspective-python support multi-pane workspace with chart plugins? #3101

@Turdot

Description

@Turdot

Question

I'm using perspective-python (v4.0.1) and trying to create a multi-pane dashboard with charts (Y Line, Y Bar, Y Area) using perspective-workspace.

What works:

  • PerspectiveWidget in JupyterLab with single charts (Y Bar, Y Line, etc.)
  • perspective-workspace with Datagrid plugin via Python Tornado server + HTML

What doesn't work:

  • perspective-workspace with chart plugins (Y Line, Y Bar, Y Area) - throws error:
Error: Cannot read properties of null (reading 'opacity')
TypeError: Cannot read properties of null (reading 'opacity')
    at colorStyles.ts:63:26
    at mc (colorStyles.ts:42:26)
    at pc.update (plugin.ts:481:9)
    at async pc.draw (plugin.ts:312:9)

My setup:

  • Python server (Tornado) serving data via WebSocket
  • HTML page loading from CDN (@finos/perspective-* or @perspective-dev/*)
  • Both CDN sources produce the same error

Code example:

server.py

import perspective
import perspective.handlers.tornado

server = perspective.Server()
client = server.new_local_client()
table = client.table(data, name="pnl")

app = tornado.web.Application([
    (r"/websocket", perspective.handlers.tornado.PerspectiveTornadoHandler,
     {"perspective_server": server}),
])

index.html

<perspective-workspace id="workspace"></perspective-workspace>
<script type="module">
    import perspective from "https://cdn.jsdelivr.net/npm/@finos/perspective/dist/cdn/perspective.js";
    // ... other imports

    const client = await perspective.websocket("ws://localhost:8083/websocket");
    const table = await client.open_table("pnl");
    
    workspace.tables.set("pnl", table);
    workspace.restore({
        viewers: {
            "chart": {
                plugin: "Y Line",  // Error occurs here
                group_by: ["Date"],
                columns: ["Value"],
                table: "pnl"
            }
        }
    });
</script>

Questions:

  1. Is multi-pane workspace with chart plugins supported when using Python backend?
  2. Is this a known CSS/theme compatibility issue between Python server and JS frontend?
  3. Are there plans to provide a native Python widget for multi-pane workspace (like PerspectiveWorkspaceWidget)?

Environment:

  • perspective-python: 4.0.1
  • Python: 3.12
  • OS: macOS
  • Browser: Chrome

Thanks!

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