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

Function set

packages/joint-react/src/data/create-ports-data.ts:38–54  ·  view source on GitHub ↗
(cellId: dia.Cell.ID, portElementsCache: Record<string, PortElementsCacheEntry>)

Source from the content-addressed store, hash-verified

36
37 return {
38 set(cellId: dia.Cell.ID, portElementsCache: Record<string, PortElementsCacheEntry>) {
39 for (const portId in portElementsCache) {
40 const { portSelectors } = portElementsCache[portId];
41 const portalElement = portSelectors[PORTAL_SELECTOR];
42 if (!portalElement) {
43 throw new Error(
44 `Portal element not found for port id: ${portId} via ${PORTAL_SELECTOR} selector`
45 );
46 }
47 const element = Array.isArray(portalElement) ? portalElement[0] : portalElement;
48 const id = getId(cellId, portId);
49 if (util.isEqual(data.ports.get(id), element)) {
50 continue;
51 }
52 data.ports.set(id, element);
53 }
54 },
55 get(cellId: dia.Cell.ID, portId: string) {
56 const id = getId(cellId, portId);
57 return data.ports.get(id);

Callers 4

HookSetPositionFunction · 0.50
HookSetSizeFunction · 0.50
HookSetAngleFunction · 0.50
HookSetAnyFunction · 0.50

Calls 4

getIdFunction · 0.85
isArrayMethod · 0.80
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected