Skip to content

Commit

Permalink
fix: fix edges which connect to combo were filtered in layout stage
Browse files Browse the repository at this point in the history
  • Loading branch information
Aarebecca committed Jan 7, 2025
1 parent 48c5c19 commit 294072d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/g6/src/runtime/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,12 +320,11 @@ export class LayoutController {

const nodesToLayout = nodes.filter(filterFn);

const nodesIdMap = new Map<ID, NodeData>(nodesToLayout.map((node) => [idOf(node), node]));
const nodeLikeIdsMap = new Map<ID, NodeData>(nodesToLayout.map((node) => [idOf(node), node]));
combos.forEach((combo) => nodeLikeIdsMap.set(idOf(combo), combo));

const edgesToLayout = edges.filter((edge) => {
const { source, target } = edge;
if (!nodesIdMap.has(source) || !nodesIdMap.has(target)) return false;
return true;
const edgesToLayout = edges.filter(({ source, target }) => {
return nodeLikeIdsMap.has(source) && nodeLikeIdsMap.has(target);
});

return {
Expand Down

0 comments on commit 294072d

Please sign in to comment.