Skip to content

Commit 91d33aa

Browse files
committed
fix: 修改 lint 问题
1 parent 25a74d0 commit 91d33aa

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

__tests__/bugs/issue-2755-spec.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe('sankey', () => {
2121

2222
const dom = createDiv();
2323
const sankey = new Sankey(dom, {
24-
data: data.map(d => ({ ...d, append: 'hello' })),
24+
data: data.map((d) => ({ ...d, append: 'hello' })),
2525
sourceField: 'source',
2626
targetField: 'target',
2727
weightField: 'value',
@@ -33,20 +33,20 @@ describe('sankey', () => {
3333

3434
sankey.render();
3535

36-
it('label', () => {
36+
it('label', () => {
3737
sankey.update({ label: { formatter: () => 'HELLO' } });
3838
expect(sankey.chart.views[1].geometries[0].labelsContainer.getChildByIndex(0).cfg.children[0].attr('text')).toBe(
39-
"HELLO"
39+
'HELLO'
4040
);
4141
// with rawFields
4242
sankey.update({ label: { formatter: ({ append }) => append } });
4343
expect(sankey.chart.views[1].geometries[0].labelsContainer.getChildByIndex(0).cfg.children[0].attr('text')).toBe(
44-
"hello"
44+
'hello'
4545
);
4646
});
4747

4848
afterAll(() => {
4949
sankey.destroy();
5050
removeDom(dom);
51-
})
52-
});
51+
});
52+
});

src/plots/sankey/adaptor.ts

+13-9
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,20 @@ function defaultOptions(params: Params<SankeyOptions>): Params<SankeyOptions> {
1515
const { options } = params;
1616
const { rawFields = [] } = options;
1717

18-
return deepAssign({}, {
19-
options: {
20-
tooltip: {
21-
fields: uniq(['name', 'source', 'target', 'value', 'isNode', ...rawFields]),
22-
},
23-
label: {
24-
fields: uniq(['x', 'name', ...rawFields]),
18+
return deepAssign(
19+
{},
20+
{
21+
options: {
22+
tooltip: {
23+
fields: uniq(['name', 'source', 'target', 'value', 'isNode', ...rawFields]),
24+
},
25+
label: {
26+
fields: uniq(['x', 'name', ...rawFields]),
27+
},
2528
},
26-
}
27-
}, params);
29+
},
30+
params
31+
);
2832
}
2933

3034
/**

0 commit comments

Comments
 (0)