@perspective-dev/react
    Preparing search index...

    Interface PerspectiveViewerProps

    Props for the PerspectiveViewer component.

    interface PerspectiveViewerProps {
        className?: string;
        client?: Client | Promise<Client> | Table | Promise<Table>;
        config?: ViewerConfigUpdate | WorkspaceConfigUpdate;
        hidden?: boolean;
        id?: string;
        onClick?: (data: PerspectiveClickEventDetail) => void;
        onConfigUpdate?: (config: ViewerConfigUpdate) => void;
        onSelect?: (data: PerspectiveSelectEventDetail) => void;
        slot?: string;
        style?: CSSProperties;
        tabIndex?: number;
        title?: string;
    }
    Index

    Properties

    className?: string

    Forwarded to the element's class attribute.

    client?: Client | Promise<Client> | Table | Promise<Table>

    The viewer's data source, forwarded to the element's load() method whenever it changes.

    • A Table (or Promise<Table>) displays that table directly.
    • A Client (e.g. from perspective.worker() or a WebSocket connection to a remote server) connects the viewer to every table hosted by that client; the table each panel displays is chosen by PerspectiveViewerProps.config or interactively by the user.
    • undefined calls eject(), returning the viewer to an unloaded state without unmounting it.

    The component does not take ownership of the Table — delete it yourself when it is no longer needed, e.g. table.delete({ lazy: true }).

    config?: ViewerConfigUpdate | WorkspaceConfigUpdate

    Declarative viewer state — group-bys, splits, filters, sorts, expressions, plugin and plugin config — applied with the element's restore() method whenever it (or PerspectiveViewerProps.client) changes. A config with a panels property is treated as a multi-panel workspace layout and applied with restoreWorkspace() instead.

    Configs are compared structurally, so passing a fresh-but-equal object literal on each render does not re-apply. Combine with PerspectiveViewerProps.onConfigUpdate to use the viewer as a controlled component.

    hidden?: boolean

    Forwarded to the element's hidden attribute.

    id?: string

    Forwarded to the element's id attribute.

    onClick?: (data: PerspectiveClickEventDetail) => void

    Called when the user clicks a datapoint (the element's "perspective-click" Custom Event), with the clicked row's data and a filter config which would select it.

    onConfigUpdate?: (config: ViewerConfigUpdate) => void

    Called with the viewer's complete configuration whenever the user reconfigures it through its UI (the element's "perspective-config-update" Custom Event). Use this to persist the user's view or reflect it back through PerspectiveViewerProps.config.

    onSelect?: (data: PerspectiveSelectEventDetail) => void

    Called when the user selects or deselects a datapoint or row (the element's "perspective-select" Custom Event).

    slot?: string

    Forwarded to the element's slot attribute.

    style?: CSSProperties

    Forwarded to the element's inline style.

    tabIndex?: number

    Forwarded to the element's tabindex attribute.

    title?: string

    Forwarded to the element's title attribute.