Skip to content

Commit

Permalink
feat(geometry): add data process (#3383)
Browse files Browse the repository at this point in the history
* feat(geometry): add data process

* chore: start paint

* chore: fix lint

* chore: fix lint

Co-authored-by: 逍为 <xiaowei.wzw@antgroup.com>
  • Loading branch information
hustcc and 逍为 committed Apr 25, 2021
1 parent c3b1e3a commit 5af9a5a
Show file tree
Hide file tree
Showing 38 changed files with 788 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .prettierrc
Expand Up @@ -3,6 +3,6 @@
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": true,
"printWidth": 120,
"printWidth": 100,
"arrowParens": "always"
}
2 changes: 1 addition & 1 deletion src/chart/view.ts
@@ -1,5 +1,5 @@
import EE from '@antv/event-emitter';
import { Geometry } from '../geometry/geometry';
import { Geometry } from '../geometry';
import { Data } from '../types';

/**
Expand Down
8 changes: 8 additions & 0 deletions src/constant.ts
@@ -0,0 +1,8 @@
import { AttributeKey } from './types';

/**
* 作为分组的视觉属性
*/
export const GROUP_ATTR_KEYS = ['color', 'shape', 'size'] as Partial<AttributeKey>[];

export const ORIGINAL_FIELD = Symbol('ORIGINAL_FIELD');
3 changes: 3 additions & 0 deletions src/geometry/adjust/adjust.ts
@@ -0,0 +1,3 @@
export class Adjust {
public process() {}
}
1 change: 1 addition & 0 deletions src/geometry/adjust/index.ts
@@ -0,0 +1 @@
export { Stack } from './stack';
3 changes: 3 additions & 0 deletions src/geometry/adjust/stack.ts
@@ -0,0 +1,3 @@
import { Adjust } from './adjust';

export class Stack extends Adjust {}
3 changes: 3 additions & 0 deletions src/geometry/attribute/README.md
@@ -0,0 +1,3 @@
# Attribute

> 将数据映射到视觉属性的实例方法。
18 changes: 18 additions & 0 deletions src/geometry/attribute/attribute.ts
@@ -0,0 +1,18 @@
export type AttributeCfg = {};

export class Attribute {
/**
* 类型
*/
public type: string;

/**
* 属性中包含的 scale 类
*/
public scales: any[];

/**
* 映射数据
*/
public mapping(...params: any) {}
}
5 changes: 5 additions & 0 deletions src/geometry/attribute/color.ts
@@ -0,0 +1,5 @@
import { Attribute, AttributeCfg } from './attribute';

export type ColorAttributeCfg = AttributeCfg & {};

export class Color extends Attribute {}
5 changes: 5 additions & 0 deletions src/geometry/attribute/indentity.ts
@@ -0,0 +1,5 @@
import { Attribute, AttributeCfg } from './attribute';

export type IndentityAttributeCfg = AttributeCfg & {};

export class Indentity extends Attribute {}
9 changes: 9 additions & 0 deletions src/geometry/attribute/index.ts
@@ -0,0 +1,9 @@
/**
* 视觉属性映射的实例
*/

export { Color, ColorAttributeCfg } from './color';
export { Indentity, IndentityAttributeCfg } from './indentity';
export { Position, PositionAttributeCfg } from './position';
export { Shape, ShapeAttributeCfg } from './shape';
export { Size, SizeAttributeCfg } from './size';
5 changes: 5 additions & 0 deletions src/geometry/attribute/position.ts
@@ -0,0 +1,5 @@
import { Attribute, AttributeCfg } from './attribute';

export type PositionAttributeCfg = AttributeCfg & {};

export class Position extends Attribute {}
5 changes: 5 additions & 0 deletions src/geometry/attribute/shape.ts
@@ -0,0 +1,5 @@
import { Attribute, AttributeCfg } from './attribute';

export type ShapeAttributeCfg = AttributeCfg & {};

export class Shape extends Attribute {}
5 changes: 5 additions & 0 deletions src/geometry/attribute/size.ts
@@ -0,0 +1,5 @@
import { Attribute, AttributeCfg } from './attribute';

export type SizeAttributeCfg = AttributeCfg & {};

export class Size extends Attribute {}
49 changes: 0 additions & 49 deletions src/geometry/geometry.ts

This file was deleted.

File renamed without changes.
File renamed without changes.

0 comments on commit 5af9a5a

Please sign in to comment.