@flowgram.ai/free-auto-layout-plugin 1.0.0 → 1.0.2
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 +4 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/esm/index.js
CHANGED
|
@@ -2615,7 +2615,9 @@ var AutoLayoutService = class {
|
|
|
2615
2615
|
const blocks = node.blocks.filter(
|
|
2616
2616
|
(blockNode) => options.filterNode ? options.filterNode?.({ node: blockNode, parent: node.parent }) : true
|
|
2617
2617
|
);
|
|
2618
|
-
const edges = this.getNodesAllLines(blocks)
|
|
2618
|
+
const edges = this.getNodesAllLines(blocks).filter(
|
|
2619
|
+
(edge) => options.filterLine ? options.filterLine?.({ line: edge }) : true
|
|
2620
|
+
);
|
|
2619
2621
|
const layoutNodes = this.createLayoutNodes(blocks, options);
|
|
2620
2622
|
const layoutEdges = this.createLayoutEdges(edges);
|
|
2621
2623
|
const { bounds, padding } = node.transform;
|
|
@@ -2646,7 +2648,7 @@ var AutoLayoutService = class {
|
|
|
2646
2648
|
/** 创建线条布局数据 */
|
|
2647
2649
|
createLayoutEdge(edge) {
|
|
2648
2650
|
const { from, to } = edge.info;
|
|
2649
|
-
if (!from || !to
|
|
2651
|
+
if (!from || !to) {
|
|
2650
2652
|
return;
|
|
2651
2653
|
}
|
|
2652
2654
|
const layoutEdge = {
|