Skip to content

Commit b23b469

Browse files
committed
fix: lint
1 parent 3b7b5da commit b23b469

File tree

15 files changed

+24
-65
lines changed

15 files changed

+24
-65
lines changed

__tests__/bugs/issue-1754-spec.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { TooltipCfg } from '@antv/g2/lib/interface';
21
import { WordCloud } from '../../src';
32
import { CountryEconomy } from '../data/country-economy';
43
import { createDiv } from '../utils/dom';

__tests__/unit/core/index-spec.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import LineAnnotation from '@antv/component/lib/annotation/line';
21
import { deepMix, isEqual, clone } from '@antv/util';
3-
import { Line, G2, Pie, line } from '../../../src';
2+
import { Line, G2, Pie } from '../../../src';
43
import { partySupport } from '../../data/party-support';
54
import { salesByArea } from '../../data/sales';
65
import { createDiv } from '../../utils/dom';

__tests__/unit/plots/column/percent-spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ describe('column percent', () => {
3939
fill: '#fff',
4040
},
4141
},
42+
animation: false,
4243
});
4344

4445
column.render();

__tests__/unit/utils/transform/histogram-spec.ts

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import DataSet from '@antv/data-set';
22
import { binHistogram } from '../../../../src/utils/transform/histogram';
33
import { histogramData, histogramStackData } from '../../../data/histogram-data';
44

5-
const { DataView } = DataSet;
6-
75
const ds = new DataSet();
86
const dv = ds.createView().source(histogramData);
97

src/adaptor/geometries/line.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { deepMix, get } from '@antv/util';
1+
import { deepMix } from '@antv/util';
22
import { Params } from '../../core/adaptor';
33
import { ColorAttr, StyleAttr, SizeAttr } from '../../types';
44
import { getTooltipMapping } from '../../utils/tooltip';

src/constant.ts

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44
export const AXIS_META_CONFIG_KEYS = [
55
'type',
6+
'alias',
67
'tickCount',
78
'tickInterval',
89
'min',

src/plots/gauge/adaptor.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { isString, isArray, isFunction, clamp } from '@antv/util';
1+
import { isString, isFunction, clamp } from '@antv/util';
22
import { interaction, animation, theme, scale } from '../../adaptor/common';
33
import { Params } from '../../core/adaptor';
44
import { Data } from '../../types';

src/plots/heatmap/index.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { deepMix, isBoolean } from '@antv/util';
1+
import { deepMix } from '@antv/util';
22
import { Plot } from '../../core/plot';
33
import { Adaptor } from '../../core/adaptor';
44
import { HeatmapOptions } from './types';
@@ -20,8 +20,7 @@ export class Heatmap extends Plot<HeatmapOptions> {
2020
return adaptor;
2121
}
2222

23-
protected getDefaultOptions(options: HeatmapOptions) {
24-
const { type } = options;
23+
protected getDefaultOptions() {
2524
return deepMix({}, super.getDefaultOptions(), {
2625
type: 'polygon',
2726
legend: false,

src/plots/line/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { deepMix, size, reduce, get } from '@antv/util';
1+
import { deepMix } from '@antv/util';
22
import { Plot } from '../../core/plot';
33
import { Adaptor } from '../../core/adaptor';
44
import { adjustYMetaByZero } from '../../utils/data';

src/plots/sunburst/adaptor.ts

+1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ function scale(params: Params<SunburstOptions>): Params<SunburstOptions> {
110110
const { meta } = options;
111111

112112
if (meta) {
113+
// @ts-ignore
113114
chart.scale(meta);
114115
}
115116

src/plots/tiny-area/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export class TinyArea extends Plot<TinyAreaOptions> {
1010
/** 图表类型 */
1111
public type: string = 'tiny-area';
1212

13-
protected getDefaultOptions(options: TinyAreaOptions) {
13+
protected getDefaultOptions() {
1414
return {
1515
appendPadding: 2,
1616
tooltip: {

src/types/axis.ts

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

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

src/types/meta.ts

+11-48
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,18 @@
1+
import { ScaleConfig } from '@antv/g2/lib/dependents';
2+
13
/** scale 元信息,取名为 meta */
2-
export type Meta = {
4+
export type Meta = ScaleConfig & {
35
/**
4-
* 坐标轴类型
6+
* scale 的 type 类型
7+
* 对于连续的,一般是 linear,对于分类一般为 cat。
8+
* 当然也有 log, pow, time 等类型,或者通过 tickMethod 自定义自己的 scale
59
*/
610
readonly type?: string;
711
/**
8-
* 是否美化
12+
* 是否进行 scale 的同步。
13+
* - 设置为 false 则不同步
14+
* - 设置为 true 则以 field 为 key 进行同步
15+
* - 设置为 string,则以这个 string 为 key 进行同步
916
*/
10-
readonly nice?: boolean;
11-
/**
12-
* 坐标轴最小值
13-
*/
14-
readonly min?: number;
15-
/**
16-
* 坐标轴最大值
17-
*/
18-
readonly max?: number;
19-
/**
20-
* min limit
21-
*/
22-
readonly minLimit?: number;
23-
/**
24-
* max limit
25-
*/
26-
readonly maxLimit?: number;
27-
/**
28-
* 期望的坐标轴刻度数量,非最终结果
29-
*/
30-
readonly tickCount?: number;
31-
/**
32-
* 坐标轴刻度间隔
33-
*/
34-
readonly tickInterval?: number;
35-
/**
36-
* 指定 tick 计算方法或自定义计算 tick 的方法
37-
*/
38-
readonly tickMethod?: string | ((scale: any) => any[]);
39-
/**
40-
* 字段别名
41-
*/
42-
readonly alias?: string;
43-
/**
44-
* 指定 scale 中的 values 信息
45-
*/
46-
readonly values?: string[];
47-
/**
48-
* scale 转换的范围,0 ~ 1 的数组,表示开始和结束的位置
49-
*/
50-
readonly range?: number[];
51-
/**
52-
* 格式化 tick 值
53-
*/
54-
readonly formatter?: (v: any) => string;
17+
readonly sync?: boolean | string;
5518
};

src/utils/data.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { get, size } from '@antv/util';
2-
import sizeSensor from 'size-sensor';
1+
import { get } from '@antv/util';
32
import { Data, Datum, Meta } from '../types';
43

54
/**

src/utils/transform/percent.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { Datum } from '@antv/g2/lib/interface';
21
import { groupBy, map, reduce, each } from '@antv/util';
32
import { Data } from '../../types';
43

0 commit comments

Comments
 (0)