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

fix: fix edges which connect to combo were filtered in layout stage #6698

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

Aarebecca
Copy link
Contributor

  • 修复布局时,连接到组合的边被过滤的问题

Fix edges which connect to combo were filtered in layout stage

Copy link

Walkthrough

This pull request addresses an issue where edges connecting to combos were being filtered out during the layout stage. The changes ensure that both nodes and combos are considered when determining which edges to include in the layout.

Changes

File Summary
packages/g6/src/runtime/layout.ts Modified the logic to include combos in the map used for filtering edges, ensuring edges connected to combos are not filtered out.

@@ -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]));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable name nodeLikeIdsMap is more descriptive and accurately reflects its purpose of mapping both nodes and combos, which helps in filtering edges correctly.

@Aarebecca Aarebecca merged commit 9b21901 into v5 Jan 7, 2025
2 checks passed
@Aarebecca Aarebecca deleted the fix/layout-data branch January 7, 2025 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants