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

[WIP] feat: upgrade vrender to 0.21.6 #3605

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
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
6 changes: 5 additions & 1 deletion common/config/rush/pnpm-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@
// "@visactor/vgrammar-sankey": "0.14.0-alpha.2",
// "@visactor/vgrammar-venn": "0.14.0-alpha.2",
// "@visactor/vgrammar-util": "0.14.0-alpha.2"
"@visactor/vrender": "0.21.6",
"@visactor/vrender-core": "0.21.6",
"@visactor/vrender-kits": "0.21.6",
"@visactor/vrender-components": "0.21.6"
},
/**
* The `globalPeerDependencyRules` setting provides various settings for suppressing validation errors
Expand Down Expand Up @@ -198,4 +202,4 @@
// },
// "pnpm": { "futurePnpmFeature": true }
}
}
}
93 changes: 59 additions & 34 deletions common/config/rush/pnpm-lock.yaml

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

4 changes: 2 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"@visactor/vchart-theme": "~1.6.6",
"@visactor/vmind": "1.2.4-alpha.5",
"@visactor/vutils": "~0.19.2",
"@visactor/vrender": "0.21.4",
"@visactor/vrender-kits": "0.21.4",
"@visactor/vrender": "0.21.6",
"@visactor/vrender-kits": "0.21.6",
"@visactor/vgrammar": "0.15.2",
"@visactor/vtable": "1.12.0",
"@visactor/vtable-editors": "1.12.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/openinula-vchart/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"dependencies": {
"@visactor/vchart": "workspace:1.13.2",
"@visactor/vutils": "~0.19.2",
"@visactor/vrender-core": "0.21.4",
"@visactor/vrender-kits": "0.21.4",
"@visactor/vrender-core": "0.21.6",
"@visactor/vrender-kits": "0.21.6",
"@visactor/vgrammar-core": "0.15.2",
"react-is": "^18.2.0"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/react-vchart/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"dependencies": {
"@visactor/vchart": "workspace:1.13.2",
"@visactor/vutils": "~0.19.2",
"@visactor/vrender-core": "0.21.4",
"@visactor/vrender-kits": "0.21.4",
"@visactor/vrender-core": "0.21.6",
"@visactor/vrender-kits": "0.21.6",
"@visactor/vgrammar-core": "0.15.2",
"react-is": "^18.2.0"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/vchart-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
"start": "ts-node __tests__/runtime/browser/scripts/initVite.ts && vite serve __tests__/runtime/browser"
},
"dependencies": {
"@visactor/vrender-core": "0.21.4",
"@visactor/vrender-kits": "0.21.4",
"@visactor/vrender-components": "0.21.4",
"@visactor/vrender-core": "0.21.6",
"@visactor/vrender-kits": "0.21.6",
"@visactor/vrender-components": "0.21.6",
"@visactor/vgrammar-core": "0.15.2",
"@visactor/vutils": "~0.19.2",
"@visactor/vdataset": "~0.19.2",
Expand Down
6 changes: 3 additions & 3 deletions packages/vchart/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@
"@visactor/vutils": "~0.19.2",
"@visactor/vdataset": "~0.19.2",
"@visactor/vscale": "~0.19.2",
"@visactor/vrender-core": "0.21.4",
"@visactor/vrender-kits": "0.21.4",
"@visactor/vrender-components": "0.21.4",
"@visactor/vrender-core": "0.21.6",
"@visactor/vrender-kits": "0.21.6",
"@visactor/vrender-components": "0.21.6",
"@visactor/vgrammar-core": "0.15.2",
"@visactor/vgrammar-projection": "0.15.2",
"@visactor/vgrammar-wordcloud": "0.15.2",
Expand Down
9 changes: 9 additions & 0 deletions packages/vchart/src/component/axis/base-axis.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { IGroup } from '@visactor/vrender-core';
// eslint-disable-next-line no-duplicate-imports
import type { ITickDataOpt } from '@visactor/vrender-components';
import type { IBaseScale } from '@visactor/vscale';
Expand Down Expand Up @@ -25,6 +26,7 @@ import { ChartEvent } from '../../constant/event';
import { LayoutZIndex } from '../../constant/layout';
import { animationConfig } from '../../animation/utils';
// eslint-disable-next-line no-duplicate-imports
import type { LooseFunction } from '@visactor/vutils';
import {
degreeToRadian,
pickWithout,
Expand Down Expand Up @@ -704,6 +706,13 @@ export abstract class AxisComponent<T extends ICommonAxisSpec & Record<string, a
dataToPosition(values: any[]): number {
return this._scale.scale(values);
}

protected _delegateAxisContainerEvent(component: IGroup) {
if (component.listenerCount('*') === 0) {
component.addEventListener('*', ((event: any, type: string) =>
this._delegateEvent(component as unknown as IGraphic, event, type)) as LooseFunction);
}
}
}

export const registerAxis = () => {
Expand Down
2 changes: 2 additions & 0 deletions packages/vchart/src/component/axis/cartesian/axis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,8 @@ export abstract class CartesianAxis<T extends ICartesianAxisCommonSpec = ICartes

this._unitText.setAttributes(pos);
}

this._delegateAxisContainerEvent(product.getGroupGraphicItem());
}
});
}
Expand Down
12 changes: 12 additions & 0 deletions packages/vchart/src/component/axis/polar/axis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import { computeLayoutRadius, getPolarAxisInfo } from './util';
// eslint-disable-next-line no-duplicate-imports
import { mergeSpec } from '@visactor/vutils-extension';
import { calcLayoutNumber } from '../../../util/space';
import { HOOK_EVENT } from '@visactor/vgrammar-core';

export abstract class PolarAxis<T extends IPolarAxisCommonSpec = IPolarAxisCommonSpec>
extends AxisComponent<T>
Expand Down Expand Up @@ -606,4 +607,15 @@ export abstract class PolarAxis<T extends IPolarAxisCommonSpec = IPolarAxisCommo

return this._scale.invert(value);
}
afterCompile() {
const product = this._axisMark?.getProduct();
if (product) {
product.addEventListener(HOOK_EVENT.AFTER_ELEMENT_ENCODE, () => {
if (this._isLayout === false) {
// 布局结束之后再进行插件的调用
this._delegateAxisContainerEvent(product.getGroupGraphicItem());
}
});
}
}
}
8 changes: 4 additions & 4 deletions packages/vstory/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
},
"dependencies": {
"@visactor/vchart": "workspace:1.11.0",
"@visactor/vrender-core": "0.21.4",
"@visactor/vrender-kits": "0.21.4",
"@visactor/vrender-components": "0.21.4",
"@visactor/vrender-core": "0.21.6",
"@visactor/vrender-kits": "0.21.6",
"@visactor/vrender-components": "0.21.6",
"@visactor/vutils": "~0.19.2"
},
"devDependencies": {
Expand All @@ -42,4 +42,4 @@
"vite": "3.2.6",
"typescript": "4.9.5"
}
}
}
6 changes: 3 additions & 3 deletions tools/story-player/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@
"vite": "3.2.6"
},
"dependencies": {
"@visactor/vrender-core": "0.21.4",
"@visactor/vrender-kits": "0.21.4",
"@visactor/vrender-core": "0.21.6",
"@visactor/vrender-kits": "0.21.6",
"@visactor/vchart": "workspace:1.13.2",
"@visactor/vrender": "0.21.4",
"@visactor/vrender": "0.21.6",
"@visactor/vutils": "~0.19.2"
}
}
Loading