@joint/react
    Preparing search index...

    Type Alias CellVisibility

    CellVisibility: (context: CellVisibilityParams) => boolean

    Decides whether a cell is rendered on the paper. Return false to skip rendering it (handy for viewport culling or hiding cells by state), true to render it. Pass it to the cellVisibility prop of <Paper>; the callback receives a structured CellVisibilityParams context instead of the native positional arguments.

    Type Declaration

      • (context: CellVisibilityParams): boolean
      • Parameters

        • context: CellVisibilityParams

          Context handed to a CellVisibility callback each time the paper decides whether to render a cell.

          Context handed to a CellVisibility callback each time the paper decides whether to render a cell.

          • Readonlygraph: Graph

            The graph the cell belongs to.

          • ReadonlyisMounted: boolean

            Whether the cell currently has a view mounted in the paper.

          • Readonlymodel: Cell

            The cell whose visibility is being decided.

          • Readonlypaper: Paper

            The paper rendering the cell.

        Returns boolean

    import { GraphProvider, Paper } from '@joint/react';
    import type { CellVisibility } from '@joint/react';

    // Hide every cell flagged as collapsed.
    const cellVisibility: CellVisibility = ({ model }) => !model.get('collapsed');

    <GraphProvider>
    <Paper cellVisibility={cellVisibility} renderElement={() => <rect width={80} height={40} />} />
    </GraphProvider>;