-
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 part of element lost when set visibility in animation
- Loading branch information
antv
committed
Aug 19, 2024
1 parent
ab97b6a
commit 596d024
Showing
9 changed files
with
174 additions
and
9 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,35 @@ | ||
import { createGraph } from '@@/utils'; | ||
|
||
describe('bug: utils-set-visibility', () => { | ||
it('should set correct', async () => { | ||
const graph = createGraph({ | ||
animation: true, | ||
data: { | ||
nodes: [ | ||
{ | ||
id: 'node-0', | ||
style: { | ||
x: 100, | ||
y: 100, | ||
labelText: 'label', | ||
iconText: 'icon', | ||
badges: [{ text: 'b1', placement: 'right-top' }], | ||
}, | ||
}, | ||
], | ||
}, | ||
}); | ||
|
||
await graph.render(); | ||
|
||
await expect(graph).toMatchSnapshot(__filename); | ||
|
||
await graph.hideElement('node-0'); | ||
|
||
await expect(graph).toMatchSnapshot(__filename, 'hidden'); | ||
|
||
await graph.showElement('node-0'); | ||
|
||
await expect(graph).toMatchSnapshot(__filename, 'visible'); | ||
}); | ||
}); |
40 changes: 40 additions & 0 deletions
40
packages/g6/__tests__/snapshots/bugs/utils-set-visibility/default.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions
40
packages/g6/__tests__/snapshots/bugs/utils-set-visibility/hidden.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions
40
packages/g6/__tests__/snapshots/bugs/utils-set-visibility/visible.svg
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