Skip to content

Commit

Permalink
Merge pull request #3616 from VisActor/fix/3d-wordcloud-rotate-animation
Browse files Browse the repository at this point in the history
Fix: 3d wordcloud rotate animation
  • Loading branch information
xile611 authored Dec 26, 2024
2 parents 84840db + 3c92c38 commit a51bc2e
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vchart",
"comment": "fix: fix the issue of animation in 3d wordcloud not work",
"type": "none"
}
],
"packageName": "@visactor/vchart"
}
2 changes: 1 addition & 1 deletion docs/assets/examples/en/chart-3d/wordcloud3d.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ group: chart-3d
title: 3D Shape Word Cloud
keywords: space
order: 23-6
cover: https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/vchart/preview/chart-3d/wordcloud3d.gif
cover: /vchart/preview/wordcloud3d_1.13.3.gif
option: wordCloud3dChart
---

Expand Down
2 changes: 1 addition & 1 deletion docs/assets/examples/zh/chart-3d/wordcloud3d.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ group: chart-3d
title: 3D 形状词云图
keywords: space
order: 23-6
cover: https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/vchart/preview/chart-3d/wordcloud3d.gif
cover: /vchart/preview/wordcloud3d_1.13.3.gif
option: wordCloud3dChart
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ option: wordCloudChart
```javascript livedemo
const spec = {
type: 'wordCloud',
// 待申请新外网可访问的存储空间后更换
maskShape: 'https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/log.jpeg',
nameField: 'challenge_name',
valueField: 'sum_count',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ option: wordCloudChart
```javascript livedemo
const spec = {
type: 'wordCloud',
// 待申请新外网可访问的存储空间后更换
maskShape: `https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/shape_logo.png`,
colorList: ['#325AB4'],
wordCloudShapeConfig: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ Code demo
```javascript livedemo
const spec = {
type: 'wordCloud3d',
// 待申请新外网可访问的存储空间后更换
maskShape: `https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/log.jpeg`,
nameField: 'challenge_name',
valueField: 'sum_count',
Expand Down
2 changes: 0 additions & 2 deletions docs/assets/guide/en/tutorial_docs/Chart_Types/WordCloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,6 @@ const dataWordCloudShape = await response.json();

const spec = {
type: 'wordCloud',
// 待申请新外网可访问的存储空间后更换
maskShape: `https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/log.jpeg`,
nameField: 'challenge_name',
valueField: 'sum_count',
Expand All @@ -355,7 +354,6 @@ The random color arrays of core words and filling words can be specified in `wor
```javascript livedemo
const spec = {
type: 'wordCloud',
// 待申请新外网可访问的存储空间后更换
maskShape: `https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/shape_logo.png`,
colorList: ['#325AB4'],
wordCloudShapeConfig: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
```javascript livedemo
const spec = {
type: 'wordCloud3d',
// 待申请新外网可访问的存储空间后更换
maskShape: `https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/log.jpeg`,
nameField: 'challenge_name',
valueField: 'sum_count',
Expand Down
2 changes: 0 additions & 2 deletions docs/assets/guide/zh/tutorial_docs/Chart_Types/WordCloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,6 @@ const dataWordCloudShape = await response.json();

const spec = {
type: 'wordCloud',
// 待申请新外网可访问的存储空间后更换
maskShape: `https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/log.jpeg`,
nameField: 'challenge_name',
valueField: 'sum_count',
Expand All @@ -356,7 +355,6 @@ window['vchart'] = vchart;
```javascript livedemo
const spec = {
type: 'wordCloud',
// 待申请新外网可访问的存储空间后更换
maskShape: `https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/shape_logo.png`,
colorList: ['#325AB4'],
wordCloudShapeConfig: {
Expand Down
Binary file added docs/public/vchart/preview/wordcloud3d_1.13.3.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 2 additions & 5 deletions packages/vchart/src/series/word-cloud/animation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ import type { IWordcloud3dAnimationParams, IWordcloudAnimationParams, WordcloudA
export const WordCloud3dAnimation = (params: IWordcloud3dAnimationParams | (() => any)): IAnimationTypeConfig => {
return {
custom: RotateBySphereAnimate,
customParameters: (datum: any, element: IElement) => {
return params;
// return { center: { x: params.radius, y: params.radius, z: params.depth_3d }, r: params.radius };
},
customParameters: (datum: any, element: IElement) => params,
easing: 'linear',
loop: Infinity,
duration: 6000
Expand Down Expand Up @@ -70,6 +67,6 @@ export const registerWordCloudAnimation = () => {

export const registerWordCloud3dAnimation = () => {
Factory.registerAnimation('wordCloud3d', (params: IWordcloud3dAnimationParams) => ({
appear: WordCloud3dAnimation(params)
enter: WordCloud3dAnimation(params)
}));
};

0 comments on commit a51bc2e

Please sign in to comment.