-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: legend support string itemMarker
- Loading branch information
Showing
18 changed files
with
343 additions
and
23 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
__tests__/integration/components/legend/category-marker.ts
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,29 @@ | ||
import { Group } from '@antv/g'; | ||
import { Category, createItemData } from './utils'; | ||
import { colors } from './data'; | ||
|
||
export const CategoryMarker = () => { | ||
const group = new Group(); | ||
|
||
const g1 = group.appendChild(new Group()); | ||
|
||
g1.appendChild( | ||
new Category({ | ||
style: { | ||
data: createItemData(1), | ||
layout: 'grid', | ||
titleText: 'Legend Title', | ||
width: 455, | ||
height: 50, | ||
gridCol: 4, | ||
gridRow: 1, | ||
itemMarker: 'square', | ||
click: () => console.log('click'), | ||
itemMarkerFill: (_: any, i: number) => colors[i % colors.length], | ||
}, | ||
}) | ||
); | ||
return group; | ||
}; | ||
|
||
CategoryMarker.tags = ['分类图例', '图例位置', '无偏移']; |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './marker-1'; | ||
export * from './marker-update'; |
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,23 @@ | ||
import { Group } from '@antv/g'; | ||
import { Marker } from '../../../../src'; | ||
|
||
export const MarkerUpdate = () => { | ||
const group = new Group(); | ||
|
||
const marker = group.appendChild( | ||
new Marker({ | ||
style: { | ||
x: 50, | ||
y: 50, | ||
symbol: 'circle', | ||
size: 16, | ||
stroke: 'blue', | ||
lineWidth: 2, | ||
}, | ||
}) | ||
); | ||
|
||
marker.update({ symbol: 'square' }); | ||
|
||
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.
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.