MCPcopy
hub / github.com/clientIO/joint / getElement

Function getElement

packages/joint-react/src/utils/cell/get-cell.ts:30–45  ·  view source on GitHub ↗
(
  cell: dia.Cell<JointAttributes>
)

Source from the content-addressed store, hash-verified

28 * ```
29 */
30export function getElement<Element extends GraphElement = GraphElement>(
31 cell: dia.Cell<JointAttributes>
32): Element {
33 const { size, position, ...attributes } = cell.attributes;
34 return {
35 ...attributes,
36 ...position,
37 ...size,
38 id: cell.id,
39 isElement: true,
40 isLink: false,
41 data: cell.attributes.data,
42 type: cell.attributes.type,
43 ports: cell.get('ports'),
44 };
45}
46
47/**
48 * Get link via cell

Callers 3

get-cell.test.tsFile · 0.90
updateStoreFunction · 0.90
getCellFunction · 0.70

Calls 1

getMethod · 0.45

Tested by

no test coverage detected