Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report]: DynamicGroup 组内元素连线折叠bug #2042

Open
Niko-Mata opened this issue Jan 15, 2025 · 0 comments
Open

[Bug Report]: DynamicGroup 组内元素连线折叠bug #2042

Niko-Mata opened this issue Jan 15, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@Niko-Mata
Copy link

Niko-Mata commented Jan 15, 2025

发生了什么?

我使用DynamicGroup的addChild api 创建了两个元素后,我将这两个元素连接在了一起,当我点击折叠按钮后出现了一条异常的连线,但是如果这个dynamicGroup被移动过后却不会出现异常连线
Video_20250115114700

完整代码如下

<script>
import LogicFlow from "@logicflow/core";
import "@logicflow/core/lib/style/index.css";
import { DynamicGroup } from "@logicflow/extension";

export default {
  data: () => ({
    lf: null,
  }),
  mounted() {
    this.lf = new LogicFlow({
      container: this.$refs.container,
      grid: true,
      plugins: [DynamicGroup],
      pluginsOptions: {

      },
    });
    this.lf.render({
      nodes: [
        {
          id: 'circle_1',
          type: 'circle',
          x: 502,
          y: 170,
          text: {
            value: 'circle_1',
            x: 502,
            y: 170,
            draggable: true,
          },
        },
        {
          id: 'circle_2',
          type: 'circle',
          x: 680,
          y: 170,
          text: {
            value: 'circle_2',
            x: 680,
            y: 170,
            draggable: true,
          },
        },
        {
          id: 'dynamic-group_1',
          type: 'dynamic-group',
          x: 542,
          y: 189,
          text: 'dynamic-group_1',
          resizable: true,
          properties: {
            width: 420,
            height: 250,
            radius: 5,
          },
        },
      ]
    });
    const groupModel = this.lf.getNodeModelById('dynamic-group_1')
    groupModel.addChild('circle_1')
    groupModel.addChild('circle_2')
  },
};
</script>

<template>
  <div class="container" ref="container"></div>
</template>
<style>
.container {
  width: 1000px;
  height: 500px;
}
</style>

logicflow/core版本

2.0.10

logicflow/extension版本

2.0.14

logicflow/engine版本

No response

浏览器&环境

Chrome

@Niko-Mata Niko-Mata added the bug Something isn't working label Jan 15, 2025
ZivvW added a commit to ZivvW/LogicFlow that referenced this issue Jan 17, 2025
通过 addChild 添加的节点没有在 nodeGroupMap 中建立映射关系,导致相关逻辑异常。改为在 addChild触发的事件中建立映射

close didi#2041,didi#2042
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant