A hook to access a specific graph element from the Paper context.
It must be used inside a PaperProvider.
This hook returns the selected element based on its cell id. It accepts:
a selector function, which extracts the desired part from the element.
(By default, it returns the entire element.)
an optional isEqual function, used to determine if the selected value has changed.
How it works:
The hook retrieves the cell id using useCellId.
It subscribes to the graph store and fetches the element associated with the cell id.
The selector is applied to the fetched element and isEqual ensures proper re-rendering behavior.
A hook to access a specific graph element from the Paper context. It must be used inside a PaperProvider. This hook returns the selected element based on its cell id. It accepts:
isEqual
function, used to determine if the selected value has changed.How it works:
useCellId
.isEqual
ensures proper re-rendering behavior.