Skip to content

Commit

Permalink
Merge pull request #1183 from VisActor/release/0.18.17
Browse files Browse the repository at this point in the history
[Auto release] release 0.18.17
  • Loading branch information
neuqzxy authored Apr 30, 2024
2 parents ee1cd29 + e3d9278 commit 224c9da
Show file tree
Hide file tree
Showing 32 changed files with 245 additions and 100 deletions.
26 changes: 13 additions & 13 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 common/config/rush/version-policies.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"definitionName":"lockStepVersion","policyName":"vrenderMain","version":"0.18.16","nextBump":"patch"}]
[{"definitionName":"lockStepVersion","policyName":"vrenderMain","version":"0.18.17","nextBump":"patch"}]
14 changes: 14 additions & 0 deletions docs/assets/changelog/en/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# v0.18.16

2024-04-29


**🐛 Bug fix**

- **@visactor/vrender-components**: theme should not support 3d graphics
- **@visactor/vrender-core**: theme should not support 3d graphics



[more detail about v0.18.16](https://github.com/VisActor/VRender/releases/tag/v0.18.16)

# v0.18.15

2024-04-28
Expand Down
14 changes: 14 additions & 0 deletions docs/assets/changelog/zh/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# v0.18.16

2024-04-29


**🐛 功能修复**

- **@visactor/vrender-components**: theme should not support 3d graphics
- **@visactor/vrender-core**: theme should not support 3d graphics



[更多详情请查看 v0.18.16](https://github.com/VisActor/VRender/releases/tag/v0.18.16)

# v0.18.15

2024-04-28
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@visactor/vchart": "1.3.0",
"@visactor/vutils": "~0.18.1",
"@visactor/vgrammar": "~0.5.7",
"@visactor/vrender": "workspace:0.18.16",
"@visactor/vrender": "workspace:0.18.17",
"markdown-it": "^13.0.0",
"highlight.js": "^11.8.0",
"axios": "^1.4.0",
Expand Down
6 changes: 6 additions & 0 deletions packages/react-vrender-utils/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"name": "@visactor/react-vrender-utils",
"entries": [
{
"version": "0.18.17",
"tag": "@visactor/react-vrender-utils_v0.18.17",
"date": "Tue, 30 Apr 2024 07:48:41 GMT",
"comments": {}
},
{
"version": "0.18.16",
"tag": "@visactor/react-vrender-utils_v0.18.16",
Expand Down
7 changes: 6 additions & 1 deletion packages/react-vrender-utils/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @visactor/react-vrender-utils

This log was last generated on Mon, 29 Apr 2024 07:40:31 GMT and should not be manually modified.
This log was last generated on Tue, 30 Apr 2024 07:48:41 GMT and should not be manually modified.

## 0.18.17
Tue, 30 Apr 2024 07:48:41 GMT

_Version update only_

## 0.18.16
Mon, 29 Apr 2024 07:40:31 GMT
Expand Down
6 changes: 3 additions & 3 deletions packages/react-vrender-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visactor/react-vrender-utils",
"version": "0.18.16",
"version": "0.18.17",
"description": "",
"sideEffects": false,
"main": "cjs/index.js",
Expand All @@ -24,8 +24,8 @@
"react-dom": "^18.2.0"
},
"dependencies": {
"@visactor/vrender": "workspace:0.18.16",
"@visactor/react-vrender": "workspace:0.18.16",
"@visactor/vrender": "workspace:0.18.17",
"@visactor/react-vrender": "workspace:0.18.17",
"@visactor/vutils": "~0.18.1",
"react-reconciler": "^0.29.0",
"tslib": "^2.3.1"
Expand Down
6 changes: 6 additions & 0 deletions packages/react-vrender/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"name": "@visactor/react-vrender",
"entries": [
{
"version": "0.18.17",
"tag": "@visactor/react-vrender_v0.18.17",
"date": "Tue, 30 Apr 2024 07:48:41 GMT",
"comments": {}
},
{
"version": "0.18.16",
"tag": "@visactor/react-vrender_v0.18.16",
Expand Down
7 changes: 6 additions & 1 deletion packages/react-vrender/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @visactor/react-vrender

This log was last generated on Mon, 29 Apr 2024 07:40:31 GMT and should not be manually modified.
This log was last generated on Tue, 30 Apr 2024 07:48:41 GMT and should not be manually modified.

## 0.18.17
Tue, 30 Apr 2024 07:48:41 GMT

_Version update only_

## 0.18.16
Mon, 29 Apr 2024 07:40:31 GMT
Expand Down
4 changes: 2 additions & 2 deletions packages/react-vrender/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visactor/react-vrender",
"version": "0.18.16",
"version": "0.18.17",
"description": "",
"sideEffects": false,
"main": "cjs/index.js",
Expand All @@ -23,7 +23,7 @@
"react": "^18.2.0"
},
"dependencies": {
"@visactor/vrender": "workspace:0.18.16",
"@visactor/vrender": "workspace:0.18.17",
"@visactor/vutils": "~0.18.1",
"react-reconciler": "^0.29.0",
"tslib": "^2.3.1"
Expand Down
12 changes: 12 additions & 0 deletions packages/vrender-components/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
{
"name": "@visactor/vrender-components",
"entries": [
{
"version": "0.18.17",
"tag": "@visactor/vrender-components_v0.18.17",
"date": "Tue, 30 Apr 2024 07:48:41 GMT",
"comments": {
"none": [
{
"comment": "fix: fix error of label when all the labels are cleared\n\n"
}
]
}
},
{
"version": "0.18.16",
"tag": "@visactor/vrender-components_v0.18.16",
Expand Down
11 changes: 10 additions & 1 deletion packages/vrender-components/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# Change Log - @visactor/vrender-components

This log was last generated on Mon, 29 Apr 2024 07:40:31 GMT and should not be manually modified.
This log was last generated on Tue, 30 Apr 2024 07:48:41 GMT and should not be manually modified.

## 0.18.17
Tue, 30 Apr 2024 07:48:41 GMT

### Updates

- fix: fix error of label when all the labels are cleared



## 0.18.16
Mon, 29 Apr 2024 07:40:31 GMT
Expand Down
6 changes: 3 additions & 3 deletions packages/vrender-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visactor/vrender-components",
"version": "0.18.16",
"version": "0.18.17",
"description": "components library for dp visualization",
"sideEffects": false,
"main": "cjs/index.js",
Expand All @@ -24,8 +24,8 @@
"analysis-core": "bundle -f umd -a -i core.ts"
},
"dependencies": {
"@visactor/vrender-core": "workspace:0.18.16",
"@visactor/vrender-kits": "workspace:0.18.16",
"@visactor/vrender-core": "workspace:0.18.17",
"@visactor/vrender-kits": "workspace:0.18.17",
"@visactor/vutils": "~0.18.1",
"@visactor/vscale": "~0.17.3"
},
Expand Down
4 changes: 4 additions & 0 deletions packages/vrender-components/src/label/arc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ export class ArcLabel extends LabelBase<ArcLabelAttrs> {
}

protected _layout(texts: (IText | IRichText)[]) {
if (!texts || !texts.length) {
return;
}

const labels = super._layout(texts);
const textBoundsArray = labels.map(label => this.getGraphicBounds(label as any));
const ellipsisLabelAttribute = {
Expand Down
103 changes: 52 additions & 51 deletions packages/vrender-components/src/label/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -639,60 +639,61 @@ export class LabelBase<T extends BaseLabelAttrs> extends AbstractComponent<T> {
const labelLines = [] as ILine[];
const { visible: showLabelLine } = this.attribute.line ?? {};

labels.forEach((text, index) => {
const relatedGraphic = this.getRelatedGraphic(text.attribute);
const textId = (text.attribute as LabelItem).id;
const textKey = this._isCollectionBase ? textId : relatedGraphic;
const state = prevTextMap?.get(textKey) ? 'update' : 'enter';
let labelLine: ILine;
if (showLabelLine) {
labelLine = this._createLabelLine(text as IText, relatedGraphic);
}
// TODO: add animate
if (state === 'enter') {
texts.push(text);
currentTextMap.set(textKey, labelLine ? { text, labelLine } : { text });
if (relatedGraphic) {
const { from, to } = getAnimationAttributes(text.attribute, 'fadeIn');
this.add(text);
labels &&
labels.forEach((text, index) => {
const relatedGraphic = this.getRelatedGraphic(text.attribute);
const textId = (text.attribute as LabelItem).id;
const textKey = this._isCollectionBase ? textId : relatedGraphic;
const state = prevTextMap?.get(textKey) ? 'update' : 'enter';
let labelLine: ILine;
if (showLabelLine) {
labelLine = this._createLabelLine(text as IText, relatedGraphic);
}
// TODO: add animate
if (state === 'enter') {
texts.push(text);
currentTextMap.set(textKey, labelLine ? { text, labelLine } : { text });
if (relatedGraphic) {
const { from, to } = getAnimationAttributes(text.attribute, 'fadeIn');
this.add(text);

if (labelLine) {
labelLines.push(labelLine);
this.add(labelLine);
}

if (labelLine) {
labelLines.push(labelLine);
this.add(labelLine);
this._syncStateWithRelatedGraphic(relatedGraphic);
// enter的时长如果不是大于0,那么直接跳过动画
this._animationConfig.enter.duration > 0 &&
relatedGraphic.once('animate-bind', a => {
// text和labelLine共用一个from
text.setAttributes(from);
labelLine && labelLine.setAttributes(from);
const listener = this._afterRelatedGraphicAttributeUpdate(
text,
texts,
labelLine,
labelLines,
index,
relatedGraphic,
to,
this._animationConfig.enter
);
relatedGraphic.on('afterAttributeUpdate', listener);
});
}
} else if (state === 'update') {
const prevLabel = prevTextMap.get(textKey);
prevTextMap.delete(textKey);
currentTextMap.set(textKey, prevLabel);
const prevText = prevLabel.text;
const { duration, easing } = this._animationConfig.update;
updateAnimation(prevText as Text, text as Text, this._animationConfig.update);
if (prevLabel.labelLine && labelLine) {
prevLabel.labelLine.animate().to(labelLine.attribute, duration, easing);
}

this._syncStateWithRelatedGraphic(relatedGraphic);
// enter的时长如果不是大于0,那么直接跳过动画
this._animationConfig.enter.duration > 0 &&
relatedGraphic.once('animate-bind', a => {
// text和labelLine共用一个from
text.setAttributes(from);
labelLine && labelLine.setAttributes(from);
const listener = this._afterRelatedGraphicAttributeUpdate(
text,
texts,
labelLine,
labelLines,
index,
relatedGraphic,
to,
this._animationConfig.enter
);
relatedGraphic.on('afterAttributeUpdate', listener);
});
}
} else if (state === 'update') {
const prevLabel = prevTextMap.get(textKey);
prevTextMap.delete(textKey);
currentTextMap.set(textKey, prevLabel);
const prevText = prevLabel.text;
const { duration, easing } = this._animationConfig.update;
updateAnimation(prevText as Text, text as Text, this._animationConfig.update);
if (prevLabel.labelLine && labelLine) {
prevLabel.labelLine.animate().to(labelLine.attribute, duration, easing);
}
}
});
});
prevTextMap.forEach(label => {
label.text
?.animate()
Expand Down
Loading

0 comments on commit 224c9da

Please sign in to comment.