@flowgram.ai/free-auto-layout-plugin 0.5.2 → 0.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -2101,6 +2101,7 @@ var DefaultLayoutConfig = {
2101
2101
  ranker: "network-simplex"
2102
2102
  };
2103
2103
  var DefaultLayoutOptions = {
2104
+ filterNode: void 0,
2104
2105
  getFollowNode: void 0,
2105
2106
  disableFitView: false,
2106
2107
  enableAnimation: false,
@@ -2607,7 +2608,9 @@ var AutoLayoutService = class {
2607
2608
  }
2608
2609
  /** 创建节点布局数据 */
2609
2610
  createLayoutNode(node, options) {
2610
- const { blocks } = node;
2611
+ const blocks = node.blocks.filter(
2612
+ (blockNode) => options.filterNode ? options.filterNode?.({ node: blockNode, parent: node.parent }) : true
2613
+ );
2611
2614
  const edges = this.getNodesAllLines(blocks);
2612
2615
  const layoutNodes = this.createLayoutNodes(blocks, options);
2613
2616
  const layoutEdges = this.createLayoutEdges(edges);