Skip to content
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

Fix/radar label #1410

Merged
merged 4 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "fix: fix bug of label in radarchart triggered by aniamtion\n\n",
"type": "none",
"packageName": "@visactor/vrender-core"
}
],
"packageName": "@visactor/vrender-core",
"email": "dingling112@gmail.com"
}
42 changes: 21 additions & 21 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/demos/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"@internal/eslint-config": "workspace:*",
"@internal/ts-config": "workspace:*",
"@visactor/vrender-kits": "workspace:0.14.8",
"@visactor/vutils": "~0.18.14",
"@visactor/vutils": "~0.18.15",
"d3-scale-chromatic": "^3.0.0",
"lodash": "4.17.21",
"dat.gui": "^0.7.9",
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"dependencies": {
"@arco-design/web-react": "2.46.1",
"@visactor/vchart": "1.3.0",
"@visactor/vutils": "~0.18.14",
"@visactor/vutils": "~0.18.15",
"@visactor/vgrammar": "~0.5.7",
"@visactor/vrender": "workspace:0.20.0",
"markdown-it": "^13.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-vrender-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"dependencies": {
"@visactor/vrender": "workspace:0.20.0",
"@visactor/react-vrender": "workspace:0.20.0",
"@visactor/vutils": "~0.18.14",
"@visactor/vutils": "~0.18.15",
"react-reconciler": "^0.29.0",
"tslib": "^2.3.1"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/react-vrender/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"dependencies": {
"@visactor/vrender": "workspace:0.20.0",
"@visactor/vutils": "~0.18.14",
"@visactor/vutils": "~0.18.15",
"react-reconciler": "^0.29.0",
"tslib": "^2.3.1"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/vrender-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
"dependencies": {
"@visactor/vrender-core": "workspace:0.20.0",
"@visactor/vrender-kits": "workspace:0.20.0",
"@visactor/vutils": "~0.18.14",
"@visactor/vscale": "~0.18.14"
"@visactor/vutils": "~0.18.15",
"@visactor/vscale": "~0.18.15"
},
"devDependencies": {
"@internal/bundler": "workspace:*",
"@internal/eslint-config": "workspace:*",
"@internal/ts-config": "workspace:*",
"@rushstack/eslint-patch": "~1.1.4",
"@visactor/vscale": "~0.18.14",
"@visactor/vscale": "~0.18.15",
"@types/jest": "^26.0.0",
"jest": "^26.0.0",
"jest-electron": "^0.1.12",
Expand Down
2 changes: 1 addition & 1 deletion packages/vrender-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"dependencies": {
"color-convert": "2.0.1",
"@visactor/vutils": "~0.18.14"
"@visactor/vutils": "~0.18.15"
},
"devDependencies": {
"@internal/bundler": "workspace:*",
Expand Down
10 changes: 8 additions & 2 deletions packages/vrender-core/src/animate/animate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,13 @@ export class Animate implements IAnimate {
declare _onRemove?: (() => void)[];
declare _preventAttrs?: Set<string>;
static interpolateMap: Map<string, InterpolateFunc> = new Map();
slience?: boolean;

constructor(id: string | number = Generator.GenAutoIncrementId(), timeline: ITimeline = defaultTimeline) {
constructor(
id: string | number = Generator.GenAutoIncrementId(),
timeline: ITimeline = defaultTimeline,
slience?: boolean
) {
this.id = id;
this.timeline = timeline;
this.status = AnimateStatus.INITIAL;
Expand All @@ -204,6 +209,7 @@ export class Animate implements IAnimate {
this._startTime = 0;
this._duringTime = 0;
this.timeline.addAnimate(this);
this.slience = slience;
}

setTimeline(timeline: ITimeline) {
Expand Down Expand Up @@ -420,7 +426,7 @@ export class Animate implements IAnimate {
bind(target: IAnimateTarget) {
this.target = target;

if (this.target.onAnimateBind) {
if (this.target.onAnimateBind && !this.slience) {
this.target.onAnimateBind(this);
}

Expand Down
6 changes: 4 additions & 2 deletions packages/vrender-core/src/graphic/graphic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,9 @@ export abstract class Graphic<T extends Partial<IGraphicAttribute> = Partial<IGr
if (!this.animates) {
this.animates = new Map();
}
const animate = new Animate(params?.id, this.stage && this.stage.getTimeline()).bind(this);
const animate = new Animate(params?.id, this.stage && this.stage.getTimeline(), params?.slience);

animate.bind(this);
if (params) {
const { onStart, onFrame, onEnd, onRemove } = params;
onStart != null && animate.onStart(onStart);
Expand Down Expand Up @@ -830,7 +832,7 @@ export abstract class Graphic<T extends Partial<IGraphicAttribute> = Partial<IGr
}
});

const animate = this.animate();
const animate = this.animate({ slience: true });
(animate as any).stateNames = stateNames;
animate.to(
animateAttrs,
Expand Down
1 change: 1 addition & 0 deletions packages/vrender-core/src/interface/graphic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ export type ISetAttributeContext = {
};

export type IGraphicAnimateParams = {
slience?: boolean;
id?: number | string;
onStart?: () => void;
onFrame?: (step: IStep, ratio: number) => void;
Expand Down
2 changes: 1 addition & 1 deletion packages/vrender-kits/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"dependencies": {
"@visactor/vrender-core": "workspace:0.20.0",
"@visactor/vutils": "~0.18.14",
"@visactor/vutils": "~0.18.15",
"@resvg/resvg-js": "2.4.1",
"roughjs": "4.5.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/vrender/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@internal/eslint-config": "workspace:*",
"@internal/ts-config": "workspace:*",
"@rushstack/eslint-patch": "~1.1.4",
"@visactor/vutils": "~0.18.14",
"@visactor/vutils": "~0.18.15",
"canvas": "2.11.2",
"react": "^18.0.0",
"react-dom": "^18.0.0",
Expand Down
Loading