8000 feat: export getNoWorkAnimateAttr by neuqzxy · Pull Request #494 · VisActor/VRender · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: export getNoWorkAnimateAttr #494

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
run: node common/scripts/install-run-rush.js build --only tag:package

- name: Run bug server
working-directory: ./packages/vrender
working-directory: ./tools/bugserver-trigger
env:
BUG_SERVER_TOKEN: ${{ secrets.BUG_SERVER_TOKEN }}
run: node ../../common/scripts/install-run-rushx.js ci
Expand Down
10 changes: 7 additions & 3 deletions packages/vrender/src/graphic/arc.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { AABBBounds, OBBBounds } from '@visactor/vutils';
import { pi2, sin, epsilon, abs, asin, clampAngleByRadian, isNumber, cos, sqrt } from '@visactor/vutils';
import type { IArc, IArcGraphicAttribute } from '../interface/graphic/arc';
import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_KEY } from './graphic';
import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';
import { CustomPath2D } from '../common/custom-path2d';
import { parsePadding } from '../common/utils';
import { getTheme } from './theme';
Expand Down Expand Up @@ -45,9 +45,9 @@ const ARC_UPDATE_TAG_KEY = [
export class Arc extends Graphic<IArcGraphicAttribute> implements IArc {
type: GraphicType = 'arc';

static NOWORK_ANIMATE_KEY = {
static NOWORK_ANIMATE_ATTR = {
cap: 1,
...NOWORK_ANIMATE_KEY
...NOWORK_ANIMATE_ATTR
};

// static parseCornerRadius(r: IArcGraphicAttribute['cornerRadius']) {
Expand Down Expand Up @@ -326,6 +326,10 @@ export class Arc extends Graphic<IArcGraphicAttribute> implements IArc {
clone() {
return new Arc({ ...this.attribute });
}

getNoWorkAnimateAttr(): Record<string, number> {
return Arc.NOWORK_ANIMATE_ATTR;
}
}

// addAttributeToPrototype(DefaultCircleStyle, Circle, PURE_STYLE_KEY);
10 changes: 7 additions & 3 deletions packages/vrender/src/graphic/arc3d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import { getTheme } from './theme';
import { application } from '../application';
import { parsePadding } from '../common/utils';
import { ARC3D_NUMBER_TYPE } from './constants';
import { NOWORK_ANIMATE_KEY } from './graphic';
import { NOWORK_ANIMATE_ATTR } from './graphic';

export class Arc3d extends Arc implements IArc3d {
type: GraphicType = 'arc3d';
declare attribute: IArc3dGraphicAttribute;

static NOWORK_ANIMATE_KEY = {
static NOWORK_ANIMATE_ATTR = {
cap: 1,
...NOWORK_ANIMATE_KEY
...NOWORK_ANIMATE_ATTR
};

constructor(params: IArc3dGraphicAttribute) {
Expand Down Expand Up @@ -43,4 +43,8 @@ export class Arc3d extends Arc implements IArc3d {

return this._AABBBounds;
}

getNoWorkAnimateAttr(): Record<string, number> {
return Arc3d.NOWORK_ANIMATE_ATTR;
}
}
10 changes: 7 additions & 3 deletions packages/vrender/src/graphic/area.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AABBBounds, OBBBounds, IPointLike } from '@visactor/vutils';
import type { IArea, IAreaCacheItem, IAreaGraphicAttribute } from '../interface';
import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_KEY } from './graphic';
import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';
import { CustomPath2D } from '../common/custom-path2d';
import { parsePadding, pointsInterpolation } from '../common/utils';
import { getTheme } from './theme';
Expand All @@ -12,10 +12,10 @@ const AREA_UPDATE_TAG_KEY = ['segments', 'points', 'curveType', ...GRAPHIC_UPDAT
export class Area extends Graphic<IAreaGraphicAttribute> implements IArea {
type: 'area' = 'area';

static NOWORK_ANIMATE_KEY = {
static NOWORK_ANIMATE_ATTR = {
segments: 1,
curveType: 1,
...NOWORK_ANIMATE_KEY
...NOWORK_ANIMATE_ATTR
};

cache?: IAreaCacheItem;
Expand Down Expand Up @@ -197,4 +197,8 @@ export class Area extends Graphic<IAreaGraphicAttribute> implements IArea {
clone() {
return new Area({ ...this.attribute });
}

getNoWorkAnimateAttr(): Record<string, number> {
return Area.NOWORK_ANIMATE_ATTR;
}
}
8 changes: 6 additions & 2 deletions packages/vrender/src/graphic/circle.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { AABBBounds, OBBBounds } from '@visactor/vutils';
import { transformBounds } from '@visactor/vutils';
import type { ICircle, ICircleGraphicAttribute } from '../interface/graphic/circle';
import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_KEY } from './graphic';
import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';
import { CustomPath2D } from '../common/custom-path2d';
import { parsePadding } from '../common/utils';
import { getTheme } from './theme';
Expand All @@ -17,7 +17,7 @@ const CIRCLE_UPDATE_TAG_KEY = ['radius', 'startAngle', 'endAngle', ...GRAPHIC_UP
export class Circle extends Graphic<ICircleGraphicAttribute> implements ICircle {
type: 'circle' = 'circle';

static NOWORK_ANIMATE_KEY = NOWORK_ANIMATE_KEY;
static NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR;

constructor(params: ICircleGraphicAttribute = { radius: 1 }) {
super(params);
Expand Down Expand Up @@ -101,6 +101,10 @@ export class Circle extends Graphic<ICircleGraphicAttribute> implements ICircle
clone() {
return new Circle({ ...this.attribute });
}

getNoWorkAnimateAttr(): Record<string, number> {
return Circle.NOWORK_ANIMATE_ATTR;
}
}

// addAttributeToPrototype(DefaultCircleStyle, Circle, PURE_STYLE_KEY);
8 changes: 6 additions & 2 deletions packages/vrender/src/graphic/glyph.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { AABBBounds, IPointLike, OBBBounds } from '@visactor/vutils';
import { Graphic, NOWORK_ANIMATE_KEY } from './graphic';
import { Graphic, NOWORK_ANIMATE_ATTR } from './graphic';
import type {
GraphicType,
IGraphic,
Expand Down Expand Up @@ -32,7 +32,7 @@ export class Glyph extends Graphic<IGlyphGraphicAttribute> implements IGlyph {
};
protected declare subGraphic: IGraphic[];

static NOWORK_ANIMATE_KEY = NOWORK_ANIMATE_KEY;
static NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR;

constructor(params: Partial<IGlyphGraphicAttribute>) {
super(params);
Expand Down Expand Up @@ -239,4 +239,8 @@ export class Glyph extends Graphic<IGlyphGraphicAttribute> implements IGlyph {
glyph.setSubGraphic(this.subGraphic.map(g => g.clone()));
return glyph;
}

getNoWorkAnimateAttr(): Record<string, number> {
return Glyph.NOWORK_ANIMATE_ATTR;
}
}
4 changes: 3 additions & 1 deletion packages/vrender/src/graphic/graphic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ const tempConstantAngleKey = ['angle'];

const point = new Point();

export const NOWORK_ANIMATE_KEY = {
export const NOWORK_ANIMATE_ATTR = {
strokeSeg: 1,
boundsPadding: 2,
pickMode: 1,
Expand Down Expand Up @@ -1395,6 +1395,8 @@ export abstract class Graphic<T extends Partial<IGraphicAttribute> = Partial<IGr
}
}

abstract getNoWorkAnimateAttr(): Record<string, number>;

abstract clone(): Graphic<any>;
}

Expand Down
8 changes: 6 additions & 2 deletions packages/vrender/src/graphic/group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type {
GraphicType
} from '../interface';
import type { IGroup, IGroupGraphicAttribute } from '../interface/graphic/group';
import { Graphic, NOWORK_ANIMATE_KEY } from './graphic';
import { Graphic, NOWORK_ANIMATE_ATTR } from './graphic';
import { getTheme, Theme } from './theme';
import { parsePadding } from '../common/utils';
import { UpdateTag, IContainPointMode } from '../common/enums';
Expand All @@ -35,7 +35,7 @@ export class Group extends Graphic<IGroupGraphicAttribute> implements IGroup {

declare theme?: ITheme;

static NOWORK_ANIMATE_KEY = NOWORK_ANIMATE_KEY;
static NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR;

constructor(params: IGroupGraphicAttribute) {
super(params);
Expand Down Expand Up @@ -374,4 +374,8 @@ export class Group extends Graphic<IGroupGraphicAttribute> implements IGroup {
clone() {
return new Group({ ...this.attribute });
}

getNoWorkAnimateAttr(): Record<string, number> {
return Group.NOWORK_ANIMATE_ATTR;
}
}
10 changes: 7 additions & 3 deletions packages/vrender/src/graphic/image.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AABBBounds, OBBBounds } from '@visactor/vutils';
import type { IImage, IImageGraphicAttribute, IRepeatType } from '../interface';
import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_KEY } from './graphic';
import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';
import { DefaultImageAttribute } from './config';
import { getTheme } from './theme';
import { application } from '../application';
Expand All @@ -19,11 +19,11 @@ export class Image extends Graphic<IImageGraphicAttribute> implements IImage {
successCallback?: () => void;
failCallback?: () => void;

static NOWORK_ANIMATE_KEY = {
static NOWORK_ANIMATE_ATTR = {
image: 1,
repeatX: 1,
repeatY: 1,
...NOWORK_ANIMATE_KEY
...NOWORK_ANIMATE_ATTR
};

constructor(params: IImageGraphicAttribute) {
Expand Down Expand Up @@ -146,4 +146,8 @@ export class Image extends Graphic<IImageGraphicAttribute> implements IImage {
clone() {
return new Image({ ...this.attribute });
}

getNoWorkAnimateAttr(): Record<string, number> {
return Image.NOWORK_ANIMATE_ATTR;
}
}
10 changes: 7 additions & 3 deletions packages/vrender/src/graphic/line.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AABBBounds, OBBBounds, IPointLike } from '@visactor/vutils';
import type { ILine, ILineGraphicAttribute } from '../interface';
import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_KEY } from './graphic';
import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';
import { getTheme } from './theme';
import { application } from '../application';
import { parsePadding, pointsInterpolation } from '../common/utils';
Expand All @@ -17,10 +17,10 @@ export class Line extends Graphic<ILineGraphicAttribute> implements ILine {
this.numberType = LINE_NUMBER_TYPE;
}

static NOWORK_ANIMATE_KEY = {
static NOWORK_ANIMATE_ATTR = {
segments: 1,
curveType: 1,
...NOWORK_ANIMATE_KEY
...NOWORK_ANIMATE_ATTR
};

isValid(): boolean {
Expand Down Expand Up @@ -134,6 +134,10 @@ export class Line extends Graphic<ILineGraphicAttribute> implements ILine {
clone() {
return new Line({ ...this.attribute });
}

getNoWorkAnimateAttr(): Record<string, number> {
return Line.NOWORK_ANIMATE_ATTR;
}
}

// addAttributeToPrototype(DefaultLineStyle, Line, PURE_STYLE_KEY);
10 changes: 7 additions & 3 deletions packages/vrender/src/graphic/path.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AABBBounds, OBBBounds } from '@visactor/vutils';
import { isString, isNil } from '@visactor/vutils';
import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_KEY } from './graphic';
import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';
import type { ICustomPath2D, IPath, IPathGraphicAttribute } from '../interface';
import { parsePadding } from '../common/utils';
import { CustomPath2D } from '../common/custom-path2d';
Expand All @@ -14,10 +14,10 @@ export class Path extends Graphic<IPathGraphicAttribute> implements IPath {
type: 'path' = 'path';
cache?: ICustomPath2D;

static NOWORK_ANIMATE_KEY = {
static NOWORK_ANIMATE_ATTR = {
path: 1,
customPath: 1,
...NOWORK_ANIMATE_KEY
...NOWORK_ANIMATE_ATTR
};

constructor(params: IPathGraphicAttribute) {
Expand Down Expand Up @@ -128,4 +128,8 @@ export class Path extends Graphic<IPathGraphicAttribute> implements IPath {
clone() {
return new Path({ ...this.attribute });
}

getNoWorkAnimateAttr(): Record<string, number> {
return Path.NOWORK_ANIMATE_ATTR;
}
}
8 changes: 6 additions & 2 deletions packages/vrender/src/graphic/polygon.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { AABBBounds, OBBBounds } from '@visactor/vutils';
import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_KEY } from './graphic';
import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';
import type { IPolygon, IPolygonGraphicAttribute } from '../interface/graphic/polygon';
import { getTheme } from './theme';
import { parsePadding, pointsInterpolation } from '../common/utils';
Expand All @@ -13,7 +13,7 @@ const POLYGON_UPDATE_TAG_KEY = ['points', 'cornerRadius', ...GRAPHIC_UPDATE_TAG_
export class Polygon extends Graphic<IPolygonGraphicAttribute> implements IPolygon {
type: GraphicType = 'polygon';

static NOWORK_ANIMATE_KEY = NOWORK_ANIMATE_KEY;
static NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR;

constructor(params: IPolygonGraphicAttribute) {
super(params);
Expand Down Expand Up @@ -104,4 +104,8 @@ export class Polygon extends Graphic<IPolygonGraphicAttribute> implements IPolyg
clone() {
return new Polygon({ ...this.attribute });
}

getNoWorkAnimateAttr(): Record<string, number> {
return Polygon.NOWORK_ANIMATE_ATTR;
}
}
8 changes: 6 additions & 2 deletions packages/vrender/src/graphic/pyramid3d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import { application } from '../application';
import { Polygon } from './polygon';
import { getTheme } from './theme';
import { PYRAMID3D_NUMBER_TYPE } from './constants';
import { NOWORK_ANIMATE_KEY } from './graphic';
import { NOWORK_ANIMATE_ATTR } from './graphic';

export class Pyramid3d extends Polygon implements IPyramid3d {
type: GraphicType = 'pyramid3d';
declare attribute: IPyramid3dGraphicAttribute;

static NOWORK_ANIMATE_KEY = NOWORK_ANIMATE_KEY;
static NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR;

constructor(params: IPyramid3dGraphicAttribute) {
super(params);
Expand Down Expand Up @@ -134,4 +134,8 @@ export class Pyramid3d extends Polygon implements IPyramid3d {
protected _isValid(): boolean {
return super._isValid() && this.attribute.points.length === 4;
}

getNoWorkAnimateAttr(): Record<string, number> {
return Pyramid3d.NOWORK_ANIMATE_ATTR;
}
}
8 changes: 6 additions & 2 deletions packages/vrender/src/graphic/rect.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { AABBBounds, OBBBounds } from '@visactor/vutils';
import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_KEY } from './graphic';
import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';
import type { GraphicType, IRect, IRectGraphicAttribute } from '../interface';
import { CustomPath2D } from '../common/custom-path2d';
import { parsePadding } from '../common/utils';
Expand All @@ -12,7 +12,7 @@ const RECT_UPDATE_TAG_KEY = ['width', 'height', 'cornerRadius', ...GRAPHIC_UPDAT
export class Rect extends Graphic<IRectGraphicAttribute> implements IRect {
type: GraphicType = 'rect';

static NOWORK_ANIMATE_KEY = NOWORK_ANIMATE_KEY;
static NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR;

constructor(params: IRectGraphicAttribute) {
super(params);
Expand Down Expand Up @@ -93,4 +93,8 @@ export class Rect extends Graphic<IRectGraphicAttribute> implements IRect {
clone() {
return new Rect({ ...this.attribute });
}

getNoWorkAnimateAttr(): Record<string, number> {
return Rect.NOWORK_ANIMATE_ATTR;
}
}
8 changes: 6 additions & 2 deletions packages/vrender/src/graphic/rect3d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { GraphicType, IFace3d, IRect3d, IRect3dGraphicAttribute } from '../
import { Rect } from './rect';
import { getTheme } from './theme';
import { RECT3D_NUMBER_TYPE } from './constants';
import { NOWORK_ANIMATE_KEY } from './graphic';
import { NOWORK_ANIMATE_ATTR } from './graphic';

const CUBE_VERTICES = [
[0, 0, 0],
Expand All @@ -20,7 +20,7 @@ export class Rect3d extends Rect implements IRect3d {
type: GraphicType = 'rect3d';
declare attribute: IRect3dGraphicAttribute;

static NOWORK_ANIMATE_KEY = NOWORK_ANIMATE_KEY;
static NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR;

constructor(params: IRect3dGraphicAttribute) {
super(params);
Expand Down Expand Up @@ -70,4 +70,8 @@ export class Rect3d extends Rect implements IRect3d {

return faces;
}

getNoWorkAnimateAttr(): Record<string, number> {
return Rect3d.NOWORK_ANIMATE_ATTR;
}
}
Loading
0