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

feat: tree depth #6363

Merged
merged 2 commits into from
Sep 26, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix: fix tree test
  • Loading branch information
yvonneyx committed Sep 25, 2024
commit 3cde03aa409097e60e4372cc0964374518c58a7c
9 changes: 6 additions & 3 deletions packages/g6/__tests__/unit/utils/tree.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ describe('tree', () => {
nodes: [
{
id: 'root',
depth: 0,
children: ['child'],
},
{ id: 'child' },
{ id: 'child', depth: 1 },
],
edges: [{ source: 'root', target: 'child' }],
});
Expand All @@ -30,10 +31,11 @@ describe('tree', () => {
{
id: 'root',
children: ['child'],
depth: 0,
style: { fill: 'red' },
data: { value: 10 },
},
{ id: 'child', style: { fill: 'green' }, data: { value: 1 } },
{ id: 'child', depth: 1, style: { fill: 'green' }, data: { value: 1 } },
],
edges: [{ source: 'root', target: 'child' }],
});
Expand All @@ -59,10 +61,11 @@ describe('tree', () => {
{
id: 'root',
children: ['child'],
depth: 0,
style: { fill: 'red' },
data: { value: 10 },
},
{ id: 'child', style: { fill: 'green' }, data: { value: 1 } },
{ id: 'child', depth: 1, style: { fill: 'green' }, data: { value: 1 } },
],
edges: [{ source: 'root', target: 'child', data: { weight: 11 } }],
});
Expand Down
Loading