-
Notifications
You must be signed in to change notification settings - Fork 605
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Chord): 修复弦图label 样式不能修改的问题 (#3270)
Co-authored-by: ai-qing-hai <wb-xcf804241@antgroup.com>
- Loading branch information
1 parent
c15b9c2
commit bc5b2cf
Showing
2 changed files
with
48 additions
and
4 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,44 @@ | ||
import { Chord } from '../../src'; | ||
import { createDiv } from '../utils/dom'; | ||
import { delay } from '../utils/delay'; | ||
|
||
describe('#3200', () => { | ||
const DATA = [ | ||
{ source: '北京', target: '天津', value: 30 }, | ||
{ source: '北京', target: '上海', value: 80 }, | ||
{ source: '北京', target: '河北', value: 46 }, | ||
{ source: '北京', target: '辽宁', value: 49 }, | ||
{ source: '北京', target: '黑龙江', value: 69 }, | ||
{ source: '北京', target: '吉林', value: 19 }, | ||
{ source: '天津', target: '河北', value: 62 }, | ||
{ source: '天津', target: '辽宁', value: 82 }, | ||
{ source: '天津', target: '上海', value: 16 }, | ||
{ source: '上海', target: '黑龙江', value: 16 }, | ||
{ source: '河北', target: '黑龙江', value: 76 }, | ||
{ source: '河北', target: '内蒙古', value: 24 }, | ||
{ source: '内蒙古', target: '北京', value: 32 }, | ||
]; | ||
|
||
const chord = new Chord(createDiv(), { | ||
data: DATA, | ||
sourceField: 'source', | ||
targetField: 'target', | ||
weightField: 'value', | ||
label: { | ||
style: { | ||
fill: 'red', | ||
}, | ||
}, | ||
}); | ||
|
||
chord.render(); | ||
|
||
it('Chord label ', async () => { | ||
await delay(200); | ||
const fill = chord.chart.canvas.findAllByName('label')[0]?.cfg?.children[0].attr('fill'); | ||
|
||
expect(fill).toEqual('red'); | ||
|
||
chord.destroy(); | ||
}); | ||
}); |
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