MCPcopy Create free account
hub / github.com/1Panel-dev/MaxKB / getDefaultAnchor

Method getDefaultAnchor

ui/src/workflow/common/app-node.ts:449–494  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

447 })
448 }
449 getDefaultAnchor() {
450 const { id, x, y, width } = this
451 const showNode = this.properties.showNode === undefined ? true : this.properties.showNode
452 const anchors: any = []
453 if (
454 ![
455 WorkflowType.Base as string,
456 WorkflowType.KnowledgeBase as string,
457 WorkflowType.ToolBaseNode as string,
458 ].includes(this.type)
459 ) {
460 if (
461 ![
462 WorkflowType.Start,
463 WorkflowType.LoopStartNode.toString(),
464 WorkflowType.ToolStartNode,
465 ].includes(this.type) &&
466 this.properties.kind != WorkflowKind.DataSource
467 ) {
468 anchors.push({
469 x: x - width / 2 + 10,
470 y: showNode ? y : y - 15,
471 id: `${id}_left`,
472 edgeAddable: false,
473 type: 'left',
474 })
475 }
476
477 if (this.properties.enableException) {
478 anchors.push({
479 x: x + width / 2 - 10,
480 y: y + this.height / 2 - 80,
481 id: `${id}_exception_right`,
482 type: 'right',
483 })
484 }
485 anchors.push({
486 x: x + width / 2 - 10,
487 y: showNode ? y : y - 15,
488 id: `${id}_right`,
489 type: 'right',
490 })
491 }
492
493 return anchors
494 }
495}
496export { AppNodeModel, AppNode }

Callers 2

updatePathByAnchorMethod · 0.45
updatePathByAnchorMethod · 0.45

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected