MCPcopy
hub / github.com/markmap/markmap / findElement

Method findElement

packages/markmap-view/src/view.ts:643–661  ·  view source on GitHub ↗
(node: INode)

Source from the content-addressed store, hash-verified

641 }
642
643 findElement(node: INode) {
644 let result:
645 | {
646 data: INode;
647 g: SVGGElement;
648 }
649 | undefined;
650 this.g
651 .selectAll<SVGGElement, INode>(childSelector<SVGGElement>(SELECTOR_NODE))
652 .each(function walk(d) {
653 if (d === node) {
654 result = {
655 data: d,
656 g: this,
657 };
658 }
659 });
660 return result;
661 }
662
663 /**
664 * Pan the content to make the provided node visible in the viewport.

Callers 2

ensureVisibleMethod · 0.95
centerNodeMethod · 0.95

Calls 1

childSelectorFunction · 0.90

Tested by

no test coverage detected