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: GraphThe graph the cell belongs to.
ReadonlyisMounted: booleanWhether the cell currently has a view mounted in the paper.
Readonlymodel: CellThe cell whose visibility is being decided.
Readonlypaper: PaperThe paper rendering the cell.
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>;
Decides whether a cell is rendered on the paper. Return
falseto skip rendering it (handy for viewport culling or hiding cells by state),trueto render it. Pass it to thecellVisibilityprop of<Paper>; the callback receives a structured CellVisibilityParams context instead of the native positional arguments.