Skip to content

[Bug Report]: 使用插件 Dagre 后,连接线上的文字没有重新进行布局 #2282

@xingwei07

Description

@xingwei07

发生了什么?

使用插件 Dagre 后,节点进行了重新排布,但是连接线上的文字还显示在原来的位置。

Image
<script>
import LogicFlow from "@logicflow/core";
import { Dagre } from "@logicflow/layout";
import "@logicflow/core/lib/style/index.css";

export default {
  name: "lf-Demo",
  data() {
    return {
      renderData: {
        // 节点数据
        nodes: [
          {
            id: "start",
            type: "rect",
            text: "开始",
            x: 100,
            y: 100,
          },
          {
            id: "end",
            type: "rect",
            text: "条件21",
            x: 400,
            y: 100,
          },
        ],
        // 边数据
        edges: [
          {
            id: "edge1",
            type: "line",
            sourceNodeId: "start",
            targetNodeId: "end",
            text: "文字",
          },
        ],
      },
    };
  },
  mounted() {
    this.lf = new LogicFlow({
      container: this.$refs.container,
      plugins: [Dagre],
      stopScrollGraph: true, // 禁止鼠标滚动画布
      isSilentMode: true, // 静默模式
      nodeTextEdit: false, // 禁止节点文本编辑
    });
    this.lf.render(this.renderData);
    this.lf.extension.dagre.layout({
      rankdiz: "LR",
      align: "DR",
    });
  },
};
</script>
"@logicflow/core": "^2.1.2",
"@logicflow/extension": "^2.1.4",
"@logicflow/layout": "^2.0.2",

logicflow/core版本

2.1.2

logicflow/extension版本

2.1.4

logicflow/engine版本

No response

浏览器&环境

Chrome

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions