-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix removing parent combo of node not effect (#6566)
* chore: update graphlib version * fix: support remove parent * docs: update docs
- Loading branch information
Showing
8 changed files
with
164 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { createGraph } from '@@/utils'; | ||
|
||
it('model remove parent', async () => { | ||
const data = { | ||
nodes: [ | ||
{ id: 'node1', combo: 'combo1', style: { x: 250, y: 150 } }, | ||
{ id: 'node2', combo: 'combo1', style: { x: 350, y: 150 } }, | ||
{ id: 'node3', combo: 'combo1', style: { x: 250, y: 300 } }, | ||
], | ||
edges: [], | ||
combos: [{ id: 'combo1' }], | ||
}; | ||
|
||
const graph = createGraph({ | ||
data, | ||
node: { | ||
style: { | ||
labelText: (d) => d.id, | ||
}, | ||
}, | ||
combo: { | ||
type: 'rect', | ||
}, | ||
}); | ||
|
||
await graph.render(); | ||
|
||
await expect(graph).toMatchSnapshot(__filename); | ||
|
||
graph.updateNodeData([{ id: 'node3', combo: null }]); | ||
await graph.draw(); | ||
|
||
await expect(graph).toMatchSnapshot(__dirname, 'remove-parent'); | ||
}); |
50 changes: 50 additions & 0 deletions
50
packages/g6/__tests__/snapshots/bugs/model-remove-parent/default.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters