Skip to content

Commit 8f035d8

Browse files
authored
fix: type define of legend, axis (#1842)
* fix: type define of legend, axis * fix: type define of animate * fix: ci
1 parent 2ae9c9e commit 8f035d8

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

__tests__/unit/core/index-spec.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -195,18 +195,19 @@ describe('core', () => {
195195
data: partySupport.filter((o) => o.type === 'FF'),
196196
xField: 'date',
197197
yField: 'value',
198+
animation: false,
198199
});
199200

200201
// @ts-ignore
201202
line.triggerResize = jest.fn();
202203
line.render();
203204

204-
await delay(500);
205+
await delay(200);
205206
// @ts-ignore
206207
expect(line.triggerResize).toHaveBeenCalledTimes(0);
207208

208209
container.style.width = `${container.clientWidth + 10}px`;
209-
await delay(500);
210+
await delay(200);
210211
// @ts-ignore
211212
expect(line.triggerResize).toHaveBeenCalledTimes(1);
212213
});

__tests__/unit/plots/scatter/legend-spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ describe('scatter', () => {
3939
xAxis: {
4040
nice: true,
4141
},
42-
legend: true,
42+
legend: {},
4343
});
4444

4545
scatter.render();

src/types/animation.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
import { AnimateOption } from '@antv/g2/lib/interface';
22

3-
export type Animation = AnimateOption | boolean;
3+
export type Animation = false | AnimateOption;

src/types/axis.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import { AxisCfg } from '@antv/g2/lib/interface';
22
import { Meta } from './meta';
33

4-
export type Axis = (AxisCfg & Omit<Meta, 'values' | 'formatter'>) | boolean;
4+
export type Axis = false | (AxisCfg & Omit<Meta, 'values' | 'formatter'>);

src/types/legend.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
import { LegendCfg } from '@antv/g2/lib/interface';
22

3-
export type Legend = boolean | LegendCfg;
3+
export type Legend = false | LegendCfg;

0 commit comments

Comments
 (0)