antvis / XFlow

React component for building interactive diagrams.
https://x6.antv.antgroup.com/xflow/guide/introduction
MIT License
573 stars 235 forks source link

我该如何获取到边的数据 #280

Closed yhwtest closed 2 years ago

yhwtest commented 2 years ago

Describe the feature you'd like to request

我点击边的时候 怎么获取到边(edge)的数据 这样可以获取到点的数据 commandService.executeCommand( XFlowGraphCommands.SAVE_GRAPH_DATA.id, { saveGraphDataService: async (meta, graph) => { console.log(meta,'meta');

      /** 当前选中节点数据 */
      const nodes = await MODELS.SELECTED_NODES.useValue(modelService);
      nodes[0].data.data = data;
      return { err: null, data: graph, meta };
    },
  }
);

Describe the solution you'd like

commandService.executeCommand<NsGraphCmd.SaveGraphData.IArgs>(
  XFlowGraphCommands.SAVE_GRAPH_DATA.id,
  {
    saveGraphDataService: async (meta, graph) => {
      console.log(meta,'meta');

      /** 当前选中节点数据 */
      const nodes = await MODELS.SELECTED_NODES.useValue(modelService);
      nodes[0].data.data = data;
      return { err: null, data: graph, meta };
    },
  }
);

Describe alternatives you've considered

none。。。。。。

Your Example Website or App

No response

Screenshots or Videos

No response

yhwtest commented 2 years ago

none

xflow-bot[bot] commented 1 year ago

This thread has been automatically locked because it has not had recent activity.

Please open a new issue for related bugs and link to relevant comments in this thread.