-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add test case for tag, marker (#309)
- Loading branch information
Showing
10 changed files
with
95 additions
and
16 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './tag-1'; |
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,59 @@ | ||
import { Group } from '@antv/g'; | ||
import { Tag } from '../../../../src'; | ||
|
||
export const Tag1 = () => { | ||
const group = new Group(); | ||
|
||
group.appendChild( | ||
new Tag({ | ||
style: { | ||
x: 100, | ||
y: 100, | ||
text: 'G2', | ||
}, | ||
}) | ||
); | ||
|
||
group.appendChild( | ||
new Tag({ | ||
style: { | ||
x: 200, | ||
y: 100, | ||
text: 'G6', | ||
backgroundFill: '#DBF1B7', | ||
labelFill: 'red', | ||
marker: { | ||
size: 8, | ||
symbol: 'diamond', | ||
stroke: '#5B8FF9', | ||
}, | ||
}, | ||
}) | ||
); | ||
|
||
const tag = group.appendChild( | ||
new Tag({ | ||
style: { | ||
x: 300, | ||
y: 100, | ||
text: 'L7', | ||
radius: 6, | ||
padding: [6, 24], | ||
}, | ||
}) | ||
); | ||
|
||
tag.addEventListener('mouseenter', () => { | ||
tag.update({ | ||
backgroundFill: '#5B8FF9', | ||
}); | ||
}); | ||
|
||
tag.addEventListener('mouseleave', () => { | ||
tag.update({ | ||
backgroundFill: '#DBF1B7', | ||
}); | ||
}); | ||
|
||
return group; | ||
}; |
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