From f75e47c82276e5c3d061fa7c3bb7ca2f91d79e23 Mon Sep 17 00:00:00 2001 From: xile611 Date: Fri, 19 Jan 2024 11:42:20 +0800 Subject: [PATCH 01/25] fix: fix the issue that when a inline item has height biggter than container, fix #2075 --- packages/vchart/src/layout/base-layout.ts | 9 +++++---- packages/vchart/src/layout/util.ts | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/vchart/src/layout/base-layout.ts b/packages/vchart/src/layout/base-layout.ts index 5173ba5a34..5227ca9617 100644 --- a/packages/vchart/src/layout/base-layout.ts +++ b/packages/vchart/src/layout/base-layout.ts @@ -184,15 +184,16 @@ export class Layout implements IBaseLayout { const rightItems = normalItems.filter(item => item.layoutOrient === 'right'); const topItems = normalItems.filter(item => item.layoutOrient === 'top'); const bottomItems = normalItems.filter(item => item.layoutOrient === 'bottom'); + const limitWidth = this._chartLayoutRect.width + this._chartLayoutRect.x; const limitHeight = this._chartLayoutRect.height + this._chartLayoutRect.y; // 同 normal,按照 left、top、right、bottom 的顺序进行布局 // 各个方向上再按照 position 进行分组布局,顺序为 start middle end - layoutLeftInlineItems(leftItems, this, limitHeight); - layoutTopInlineItems(topItems, this, limitWidth); - layoutRightInlineItems(rightItems, this, limitHeight); - layoutBottomInlineItems(bottomItems, this, limitWidth); + leftItems.length && layoutLeftInlineItems(leftItems, this, limitHeight); + topItems.length && layoutTopInlineItems(topItems, this, limitWidth); + rightItems.length && layoutRightInlineItems(rightItems, this, limitHeight); + bottomItems.length && layoutBottomInlineItems(bottomItems, this, limitWidth); } protected _layoutRelativeOverlap(orient: IOrientType, info: overlapInfo) { diff --git a/packages/vchart/src/layout/util.ts b/packages/vchart/src/layout/util.ts index 2ea8032f47..7b0ee7f3e6 100644 --- a/packages/vchart/src/layout/util.ts +++ b/packages/vchart/src/layout/util.ts @@ -77,7 +77,7 @@ function layoutRightStartOrMiddleItems(items: ILayoutItem[], layout: Layout, lim maxWidth = Math.max(maxWidth, itemTotalWidth); preTop += itemTotalHeight; - if (preTop > limitHeight) { + if (preTop > limitHeight && singleLineItems.length) { preRight -= maxWidth; maxWidth = itemTotalWidth; preTop = layout.topCurrent + itemTotalHeight; From 8a37e6ff44b148c0cadb1aa26df89a79b52be0c1 Mon Sep 17 00:00:00 2001 From: xile611 Date: Fri, 19 Jan 2024 11:44:40 +0800 Subject: [PATCH 02/25] fix: fix layout normal-inline of other positions --- packages/vchart/src/layout/util.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/vchart/src/layout/util.ts b/packages/vchart/src/layout/util.ts index 7b0ee7f3e6..7b0ebe935f 100644 --- a/packages/vchart/src/layout/util.ts +++ b/packages/vchart/src/layout/util.ts @@ -122,7 +122,7 @@ function layoutLeftStartOrMiddleItems(items: ILayoutItem[], layout: Layout, limi maxWidth = Math.max(maxWidth, itemTotalWidth); preTop += itemTotalHeight; - if (preTop > limitHeight) { + if (preTop > limitHeight && singleLineItems.length) { preLeft += maxWidth; maxWidth = itemTotalWidth; preTop = layout.topCurrent + itemTotalHeight; @@ -167,7 +167,7 @@ function layoutTopStartOrMiddleItems(items: ILayoutItem[], layout: Layout, limit maxHeight = Math.max(maxHeight, itemTotalHeight); preLeft += itemTotalWidth; - if (preLeft > limitWidth) { + if (preLeft > limitWidth && singleLineItems.length) { preLeft = layout.leftCurrent + itemTotalWidth; preTop += maxHeight; maxHeight = itemTotalHeight; @@ -210,7 +210,7 @@ function layoutBottomStartOrMiddleItems(items: ILayoutItem[], layout: Layout, li maxHeight = Math.max(maxHeight, itemTotalHeight); preLeft += itemTotalWidth; - if (preLeft > limitWidth) { + if (preLeft > limitWidth && singleLineItems.length) { allItems.push(singleLineItems); preLeft = layout.leftCurrent + itemTotalWidth; preBottom -= maxHeight; From 72910baacfa40effeec142e2264d7394e64218a3 Mon Sep 17 00:00:00 2001 From: xile611 Date: Fri, 19 Jan 2024 14:06:19 +0800 Subject: [PATCH 03/25] fix: optimize the repeat code of layout inline-demo --- packages/vchart/src/layout/util.ts | 146 ++++++++--------------------- 1 file changed, 38 insertions(+), 108 deletions(-) diff --git a/packages/vchart/src/layout/util.ts b/packages/vchart/src/layout/util.ts index 7b0ebe935f..3f8eb4ad0d 100644 --- a/packages/vchart/src/layout/util.ts +++ b/packages/vchart/src/layout/util.ts @@ -56,10 +56,18 @@ function adjustItemsToCenter(allItems: ILayoutItem[][], isVertical: boolean, con } } -function layoutRightStartOrMiddleItems(items: ILayoutItem[], layout: Layout, limitHeight: number, isMiddle: boolean) { +function layoutHorizontalStartOrMiddleItems( + items: ILayoutItem[], + layout: Layout, + limitHeight: number, + isMiddle: boolean, + align: 'left' | 'right' +) { if (items.length) { let maxWidth = 0; - let preRight = layout.rightCurrent; + const isRight = align === 'right'; + const xSign = isRight ? -1 : 1; + let preX = isRight ? layout.rightCurrent : layout.leftCurrent; let preTop = layout.topCurrent; const allItems: ILayoutItem[][] = []; @@ -70,65 +78,21 @@ function layoutRightStartOrMiddleItems(items: ILayoutItem[], layout: Layout, lim item.setLayoutRect(rect); const itemTotalHeight = rect.height + item.layoutPaddingTop + item.layoutPaddingBottom; const itemTotalWidth = rect.width + item.layoutPaddingLeft + item.layoutPaddingRight; + const itemOffsetX = isRight ? -rect.width - item.layoutPaddingRight : item.layoutPaddingLeft; item.setLayoutStartPosition({ - x: preRight + item.layoutOffsetX - rect.width - item.layoutPaddingRight, + x: preX + item.layoutOffsetX + itemOffsetX, y: preTop + item.layoutOffsetY + item.layoutPaddingTop }); maxWidth = Math.max(maxWidth, itemTotalWidth); preTop += itemTotalHeight; if (preTop > limitHeight && singleLineItems.length) { - preRight -= maxWidth; + preX += xSign * maxWidth; maxWidth = itemTotalWidth; preTop = layout.topCurrent + itemTotalHeight; item.setLayoutStartPosition({ - x: preRight + item.layoutOffsetX - rect.width - item.layoutPaddingRight, - y: layout.topCurrent + item.layoutOffsetY + item.layoutPaddingTop - }); - allItems.push(singleLineItems); - singleLineItems = [item]; - } else { - singleLineItems.push(item); - } - }); - allItems.push(singleLineItems); - - if (isMiddle) { - adjustItemsToCenter(allItems, true, limitHeight); - } - - layout.rightCurrent = preRight - maxWidth; - } -} - -function layoutLeftStartOrMiddleItems(items: ILayoutItem[], layout: Layout, limitHeight: number, isMiddle: boolean) { - if (items.length) { - let maxWidth = 0; - let preLeft = layout.leftCurrent; - let preTop = layout.topCurrent; - const allItems: ILayoutItem[][] = []; - let singleLineItems: ILayoutItem[] = []; - items.forEach(item => { - const layoutRect = layout.getItemComputeLayoutRect(item); - const rect = item.computeBoundsInRect(layoutRect); - item.setLayoutRect(rect); - const itemTotalHeight = rect.height + item.layoutPaddingTop + item.layoutPaddingBottom; - const itemTotalWidth = rect.width + item.layoutPaddingLeft + item.layoutPaddingRight; - item.setLayoutStartPosition({ - x: preLeft + item.layoutOffsetX + item.layoutPaddingLeft, - y: preTop + item.layoutOffsetY + item.layoutPaddingTop - }); - - maxWidth = Math.max(maxWidth, itemTotalWidth); - preTop += itemTotalHeight; - if (preTop > limitHeight && singleLineItems.length) { - preLeft += maxWidth; - maxWidth = itemTotalWidth; - preTop = layout.topCurrent + itemTotalHeight; - - item.setLayoutStartPosition({ - x: preLeft + item.layoutOffsetX + item.layoutPaddingLeft, + x: preX + item.layoutOffsetX + itemOffsetX, y: layout.topCurrent + item.layoutOffsetY + item.layoutPaddingTop }); allItems.push(singleLineItems); @@ -143,15 +107,23 @@ function layoutLeftStartOrMiddleItems(items: ILayoutItem[], layout: Layout, limi adjustItemsToCenter(allItems, true, limitHeight); } - layout.leftCurrent = preLeft + maxWidth; + layout.rightCurrent = preX + xSign * maxWidth; } } -function layoutTopStartOrMiddleItems(items: ILayoutItem[], layout: Layout, limitWidth: number, isMiddle: boolean) { +function layoutVerticalStartOrMiddleItems( + items: ILayoutItem[], + layout: Layout, + limitWidth: number, + isMiddle: boolean, + align: 'top' | 'bottom' +) { if (items.length) { + const isTop = align === 'top'; + const ySign = isTop ? 1 : -1; let maxHeight = 0; let preLeft = layout.leftCurrent; - let preTop = layout.topCurrent; + let preY = isTop ? layout.topCurrent : layout.bottomCurrent; const allItems: ILayoutItem[][] = []; let singleLineItems: ILayoutItem[] = []; items.forEach(item => { @@ -160,20 +132,21 @@ function layoutTopStartOrMiddleItems(items: ILayoutItem[], layout: Layout, limit item.setLayoutRect(rect); const itemTotalHeight = rect.height + item.layoutPaddingTop + item.layoutPaddingBottom; const itemTotalWidth = rect.width + item.layoutPaddingLeft + item.layoutPaddingRight; + const itemOffsetY = isTop ? item.layoutPaddingTop : -rect.height - item.layoutPaddingBottom; item.setLayoutStartPosition({ x: preLeft + item.layoutOffsetX + item.layoutPaddingLeft, - y: preTop + item.layoutOffsetY + item.layoutPaddingTop + y: preY + item.layoutOffsetY + itemOffsetY }); maxHeight = Math.max(maxHeight, itemTotalHeight); preLeft += itemTotalWidth; if (preLeft > limitWidth && singleLineItems.length) { preLeft = layout.leftCurrent + itemTotalWidth; - preTop += maxHeight; + preY += ySign * maxHeight; maxHeight = itemTotalHeight; item.setLayoutStartPosition({ x: layout.leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft, - y: preTop + item.layoutOffsetY + item.layoutPaddingTop + y: preY + item.layoutOffsetY + itemOffsetY }); allItems.push(singleLineItems); singleLineItems = [item]; @@ -186,61 +159,18 @@ function layoutTopStartOrMiddleItems(items: ILayoutItem[], layout: Layout, limit adjustItemsToCenter(allItems, false, limitWidth); } - layout.topCurrent = preTop + maxHeight; - } -} - -function layoutBottomStartOrMiddleItems(items: ILayoutItem[], layout: Layout, limitWidth: number, isMiddle: boolean) { - if (items.length) { - let maxHeight = 0; - let preLeft = layout.leftCurrent; - let preBottom = layout.bottomCurrent; - const allItems: ILayoutItem[][] = []; - let singleLineItems: ILayoutItem[] = []; - items.forEach(item => { - const layoutRect = layout.getItemComputeLayoutRect(item); - const rect = item.computeBoundsInRect(layoutRect); - item.setLayoutRect(rect); - const itemTotalHeight = rect.height + item.layoutPaddingTop + item.layoutPaddingBottom; - const itemTotalWidth = rect.width + item.layoutPaddingLeft + item.layoutPaddingRight; - item.setLayoutStartPosition({ - x: preLeft + item.layoutOffsetX + item.layoutPaddingLeft, - y: preBottom + item.layoutOffsetY - rect.height - item.layoutPaddingBottom - }); - - maxHeight = Math.max(maxHeight, itemTotalHeight); - preLeft += itemTotalWidth; - if (preLeft > limitWidth && singleLineItems.length) { - allItems.push(singleLineItems); - preLeft = layout.leftCurrent + itemTotalWidth; - preBottom -= maxHeight; - maxHeight = itemTotalHeight; - item.setLayoutStartPosition({ - x: layout.leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft, - y: preBottom + item.layoutOffsetY - rect.height - item.layoutPaddingBottom - }); - singleLineItems = [item]; - } else { - singleLineItems.push(item); - } - }); - allItems.push(singleLineItems); - if (isMiddle) { - adjustItemsToCenter(allItems, false, limitWidth); - } - - layout.bottomCurrent = preBottom - maxHeight; + layout.topCurrent = preLeft + ySign * maxHeight; } } export function layoutLeftInlineItems(items: ILayoutItem[], layout: Layout, limitHeight: number) { const { startItems, middleItems, endItems } = getPositionItems(items); if (startItems.length) { - layoutLeftStartOrMiddleItems(startItems, layout, limitHeight, false); + layoutHorizontalStartOrMiddleItems(startItems, layout, limitHeight, false, 'left'); } if (middleItems.length) { - layoutLeftStartOrMiddleItems(middleItems, layout, limitHeight, true); + layoutHorizontalStartOrMiddleItems(middleItems, layout, limitHeight, true, 'left'); } if (endItems.length) { @@ -279,11 +209,11 @@ export function layoutRightInlineItems(items: ILayoutItem[], layout: Layout, lim const { startItems, middleItems, endItems } = getPositionItems(items); if (startItems.length) { - layoutRightStartOrMiddleItems(startItems, layout, limitHeight, false); + layoutHorizontalStartOrMiddleItems(startItems, layout, limitHeight, false, 'right'); } if (middleItems.length) { - layoutRightStartOrMiddleItems(middleItems, layout, limitHeight, true); + layoutHorizontalStartOrMiddleItems(middleItems, layout, limitHeight, true, 'right'); } if (endItems.length) { @@ -321,11 +251,11 @@ export function layoutTopInlineItems(items: ILayoutItem[], layout: Layout, limit const { startItems, middleItems, endItems } = getPositionItems(items); if (startItems.length) { - layoutTopStartOrMiddleItems(startItems, layout, limitWidth, false); + layoutVerticalStartOrMiddleItems(startItems, layout, limitWidth, false, 'top'); } if (middleItems.length) { - layoutTopStartOrMiddleItems(middleItems, layout, limitWidth, true); + layoutVerticalStartOrMiddleItems(middleItems, layout, limitWidth, true, 'top'); } if (endItems.length) { @@ -365,11 +295,11 @@ export function layoutBottomInlineItems(items: ILayoutItem[], layout: Layout, li const { startItems, middleItems, endItems } = getPositionItems(items); if (startItems.length) { - layoutBottomStartOrMiddleItems(startItems, layout, limitWidth, false); + layoutVerticalStartOrMiddleItems(startItems, layout, limitWidth, false, 'bottom'); } if (middleItems.length) { - layoutBottomStartOrMiddleItems(middleItems, layout, limitWidth, true); + layoutVerticalStartOrMiddleItems(middleItems, layout, limitWidth, true, 'bottom'); } if (endItems.length) { From 320c89ae88c7eca047cf9639ab2cbe9800a17d06 Mon Sep 17 00:00:00 2001 From: skie1997 Date: Fri, 19 Jan 2024 06:48:48 +0000 Subject: [PATCH 04/25] docs: generate changelog of release v1.8.8 --- docs/assets/changelog/en/release.md | 27 +++++++++++++++++++++++++++ docs/assets/changelog/zh/release.md | 27 +++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/docs/assets/changelog/en/release.md b/docs/assets/changelog/en/release.md index 2767084ec8..640a2be256 100644 --- a/docs/assets/changelog/en/release.md +++ b/docs/assets/changelog/en/release.md @@ -1,3 +1,30 @@ +# v1.8.8 + +2024-01-19 + + +**🆕 New feature** + +- **@visactor/vchart**: enhance scroll effect, closed [#2037](https://github.com/VisActor/VChart/issues/2037) +- **@visactor/vchart**: upgrade @visactor/vrender-core to locked 0.17.14 +- **@visactor/vchart**: sankey chart supports disableTriggerEvent configuration +- **@visactor/vchart**: support new layout type region-relative-overlap + +**🐛 Bug fix** + +- **@visactor/vchart**: `area.interactive` in area series spec is not available, related [#2030](https://github.com/VisActor/VChart/issues/2030) +- **@visactor/vchart**: fix sortDataByAxis not work after datazoom changed axis +- **@visactor/vchart**: crosshair should show when `trimPadding` of axis is true, fix [#2054](https://github.com/VisActor/VChart/issues/2054) +- **@visactor/vchart**: calculate layer transform for dimension tooltip +- **@visactor/vchart**: fixed the issue where activePoint does not take effect when the visible configuration of line chart point is false +- **@visactor/vchart**: different effect when configuring label.overlap:true in [#1956](https://github.com/VisActor/VChart/issues/1956) +- **@visactor/vchart**: label position incorrect with region indent +- **scroll**: event error in lynx env. fix[#2041](https://github.com/VisActor/VChart/issues/2041) +- **@visactor/vchart**: map scale ratio not correct after updateSpec or resize +- **@visactor/vchart**: fix the bug of nice when tickCount is a function, fix [#2050](https://github.com/VisActor/VChart/issues/2050) + +[more detail about v1.8.8](https://github.com/VisActor/VChart/releases/tag/v1.8.8) + # v1.8.7 2024-01-11 diff --git a/docs/assets/changelog/zh/release.md b/docs/assets/changelog/zh/release.md index c3b722fe10..f6495cc1c7 100644 --- a/docs/assets/changelog/zh/release.md +++ b/docs/assets/changelog/zh/release.md @@ -1,3 +1,30 @@ +# v1.8.8 + +2024-01-19 + + +**🆕 新增功能** + +- **@visactor/vchart**: enhance scroll effect, closed [#2037](https://github.com/VisActor/VChart/issues/2037) +- **@visactor/vchart**: upgrade @visactor/vrender-core to locked 0.17.14 +- **@visactor/vchart**: sankey chart supports disableTriggerEvent configuration +- **@visactor/vchart**: support new layout type region-relative-overlap + +**🐛 功能修复** + +- **@visactor/vchart**: `area.interactive` in area series spec is not available, related [#2030](https://github.com/VisActor/VChart/issues/2030) +- **@visactor/vchart**: fix sortDataByAxis not work after datazoom changed axis +- **@visactor/vchart**: crosshair should show when `trimPadding` of axis is true, fix [#2054](https://github.com/VisActor/VChart/issues/2054) +- **@visactor/vchart**: calculate layer transform for dimension tooltip +- **@visactor/vchart**: fixed the issue where activePoint does not take effect when the visible configuration of line chart point is false +- **@visactor/vchart**: different effect when configuring label.overlap:true in [#1956](https://github.com/VisActor/VChart/issues/1956) +- **@visactor/vchart**: label position incorrect with region indent +- **scroll**: event error in lynx env. fix[#2041](https://github.com/VisActor/VChart/issues/2041) +- **@visactor/vchart**: map scale ratio not correct after updateSpec or resize +- **@visactor/vchart**: fix the bug of nice when tickCount is a function, fix [#2050](https://github.com/VisActor/VChart/issues/2050) + +[更多详情请查看 v1.8.8](https://github.com/VisActor/VChart/releases/tag/v1.8.8) + # v1.8.7 2024-01-11 From 527fb0fc2f72eb9bff3934ec467f15de85cc3788 Mon Sep 17 00:00:00 2001 From: skie1997 Date: Fri, 19 Jan 2024 15:02:08 +0800 Subject: [PATCH 05/25] chore: translate change log --- docs/assets/changelog/zh/release.md | 54 ++++++++++++++--------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/docs/assets/changelog/zh/release.md b/docs/assets/changelog/zh/release.md index f6495cc1c7..2568e58083 100644 --- a/docs/assets/changelog/zh/release.md +++ b/docs/assets/changelog/zh/release.md @@ -1,30 +1,30 @@ -# v1.8.8 - -2024-01-19 - - -**🆕 新增功能** - -- **@visactor/vchart**: enhance scroll effect, closed [#2037](https://github.com/VisActor/VChart/issues/2037) -- **@visactor/vchart**: upgrade @visactor/vrender-core to locked 0.17.14 -- **@visactor/vchart**: sankey chart supports disableTriggerEvent configuration -- **@visactor/vchart**: support new layout type region-relative-overlap - -**🐛 功能修复** - -- **@visactor/vchart**: `area.interactive` in area series spec is not available, related [#2030](https://github.com/VisActor/VChart/issues/2030) -- **@visactor/vchart**: fix sortDataByAxis not work after datazoom changed axis -- **@visactor/vchart**: crosshair should show when `trimPadding` of axis is true, fix [#2054](https://github.com/VisActor/VChart/issues/2054) -- **@visactor/vchart**: calculate layer transform for dimension tooltip -- **@visactor/vchart**: fixed the issue where activePoint does not take effect when the visible configuration of line chart point is false -- **@visactor/vchart**: different effect when configuring label.overlap:true in [#1956](https://github.com/VisActor/VChart/issues/1956) -- **@visactor/vchart**: label position incorrect with region indent -- **scroll**: event error in lynx env. fix[#2041](https://github.com/VisActor/VChart/issues/2041) -- **@visactor/vchart**: map scale ratio not correct after updateSpec or resize -- **@visactor/vchart**: fix the bug of nice when tickCount is a function, fix [#2050](https://github.com/VisActor/VChart/issues/2050) - -[更多详情请查看 v1.8.8](https://github.com/VisActor/VChart/releases/tag/v1.8.8) - +# v1.8.8 + +2024-01-19 + + +**🆕 新增功能** + +- **@visactor/vchart**: 增强滚动效果,已关闭 [#2037](https://github.com/VisActor/VChart/issues/2037) +- **@visactor/vchart**: 升级 @visactor/vrender-core 至锁定版本 0.17.14 +- **@visactor/vchart**: sankey 图表支持 disableTriggerEvent 配置 +- **@visactor/vchart**: 支持新的布局类型 region-relative-overlap + +**🐛 功能修复** + +- **@visactor/vchart**: `area.interactive` 在 area series spec 中不可用,相关 [#2030](https://github.com/VisActor/VChart/issues/2030) +- **@visactor/vchart**: 修复 datazoom 改变轴后 sortDataByAxis 不工作的问题 +- **@visactor/vchart**: 当轴的 `trimPadding` 为 true 时,应显示 crosshair,修复 [#2054](https://github.com/VisActor/VChart/issues/2054) +- **@visactor/vchart**: 为 dimension tooltip 计算层转换 +- **@visactor/vchart**: 修复了线图点的可见配置为 false 时 activePoint 不生效的问题 +- **@visactor/vchart**: 在 [#1956](https://github.com/VisActor/VChart/issues/1956) 中配置 label.overlap:true 时的不同效果 +- **@visactor/vchart**: label 位置与 region indent 不正确 +- **scroll**: 在 lynx 环境中的事件错误。修复[#2041](https://github.com/VisActor/VChart/issues/2041) +- **@visactor/vchart**: 在 updateSpec 或 resize 后,地图比例尺不正确 +- **@visactor/vchart**: 修复 tickCount 是函数时 nice 的 bug,修复 [#2050](https://github.com/VisActor/VChart/issues/2050) + +[更多详情请查看 v1.8.8](https://github.com/VisActor/VChart/releases/tag/v1.8.8) + # v1.8.7 2024-01-11 From ea8978275f899a60a99e603001bd8235e8014ea9 Mon Sep 17 00:00:00 2001 From: xiaoluoHe Date: Fri, 19 Jan 2024 16:03:59 +0800 Subject: [PATCH 06/25] fix: update animation should exludes `defined` channel in line mark --- packages/vchart/src/animation/config.ts | 2 +- packages/vchart/src/series/radar/animation.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/vchart/src/animation/config.ts b/packages/vchart/src/animation/config.ts index 426841d572..2faaf6c2cd 100644 --- a/packages/vchart/src/animation/config.ts +++ b/packages/vchart/src/animation/config.ts @@ -124,7 +124,7 @@ export const registerLineAnimation = () => { update: [ { type: 'update', - options: { excludeChannels: 'points' } + options: { excludeChannels: ['points', 'defined'] } }, { channel: ['points'], diff --git a/packages/vchart/src/series/radar/animation.ts b/packages/vchart/src/series/radar/animation.ts index 850346e8c2..ec2a3c2296 100644 --- a/packages/vchart/src/series/radar/animation.ts +++ b/packages/vchart/src/series/radar/animation.ts @@ -106,7 +106,7 @@ export const registerRadarAnimation = () => { disappear: preset === 'clipIn' ? undefined : radarPresetAnimation(params, preset, 'out'), update: [ { - options: { excludeChannels: 'points' } + options: { excludeChannels: ['points', 'defined'] } }, { channel: ['points'], From 6b5691d8b0d4dd686c7072793d9a836934adb67e Mon Sep 17 00:00:00 2001 From: xiaoluoHe Date: Fri, 19 Jan 2024 16:05:06 +0800 Subject: [PATCH 07/25] docs: update change log --- ...tion-excludes-defined-channel_2024-01-19-08-04.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 common/changes/@visactor/vchart/fix-update-animation-excludes-defined-channel_2024-01-19-08-04.json diff --git a/common/changes/@visactor/vchart/fix-update-animation-excludes-defined-channel_2024-01-19-08-04.json b/common/changes/@visactor/vchart/fix-update-animation-excludes-defined-channel_2024-01-19-08-04.json new file mode 100644 index 0000000000..fc29d4a6c6 --- /dev/null +++ b/common/changes/@visactor/vchart/fix-update-animation-excludes-defined-channel_2024-01-19-08-04.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@visactor/vchart", + "comment": "fix: update animation should exludes `defined` channel", + "type": "none" + } + ], + "packageName": "@visactor/vchart" +} \ No newline at end of file From 447a71cbcc96683e78443ea81632ea1eefb5bcde Mon Sep 17 00:00:00 2001 From: xile611 Date: Fri, 19 Jan 2024 17:23:40 +0800 Subject: [PATCH 08/25] fix: fix bug of crosshair timer, fix #2088 --- packages/vchart/src/component/crosshair/base.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/vchart/src/component/crosshair/base.ts b/packages/vchart/src/component/crosshair/base.ts index 8367eed96d..2459c702c3 100644 --- a/packages/vchart/src/component/crosshair/base.ts +++ b/packages/vchart/src/component/crosshair/base.ts @@ -165,6 +165,10 @@ export abstract class BaseCrossHair { + if (!this._option) { + return; + } + const { event } = params as BaseEventParams; // compute layer offset const layer = this._option.getCompiler().getStage().getLayer(undefined); From 3fe4c7b23f1f5eae75c1ca71dd7c97e27b64a521 Mon Sep 17 00:00:00 2001 From: xile611 Date: Fri, 19 Jan 2024 17:24:34 +0800 Subject: [PATCH 09/25] docs: update changlog of rush --- .../vchart/fix-crosshair-timer_2024-01-19-09-24.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 common/changes/@visactor/vchart/fix-crosshair-timer_2024-01-19-09-24.json diff --git a/common/changes/@visactor/vchart/fix-crosshair-timer_2024-01-19-09-24.json b/common/changes/@visactor/vchart/fix-crosshair-timer_2024-01-19-09-24.json new file mode 100644 index 0000000000..b6a1ef3211 --- /dev/null +++ b/common/changes/@visactor/vchart/fix-crosshair-timer_2024-01-19-09-24.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "fix: fix bug of crosshair timer, fix #2088\n\n", + "type": "none", + "packageName": "@visactor/vchart" + } + ], + "packageName": "@visactor/vchart", + "email": "dingling112@gmail.com" +} \ No newline at end of file From a3728910b8412d3b2104654fcae5e218ec784a1b Mon Sep 17 00:00:00 2001 From: xile611 Date: Fri, 19 Jan 2024 17:46:31 +0800 Subject: [PATCH 10/25] fix: rename some functions --- packages/vchart/src/layout/util.ts | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/vchart/src/layout/util.ts b/packages/vchart/src/layout/util.ts index 3f8eb4ad0d..dddf6b4b24 100644 --- a/packages/vchart/src/layout/util.ts +++ b/packages/vchart/src/layout/util.ts @@ -56,16 +56,16 @@ function adjustItemsToCenter(allItems: ILayoutItem[][], isVertical: boolean, con } } -function layoutHorizontalStartOrMiddleItems( +function layoutLeftRightStartOrMiddleItems( items: ILayoutItem[], layout: Layout, limitHeight: number, isMiddle: boolean, - align: 'left' | 'right' + position: 'left' | 'right' ) { if (items.length) { let maxWidth = 0; - const isRight = align === 'right'; + const isRight = position === 'right'; const xSign = isRight ? -1 : 1; let preX = isRight ? layout.rightCurrent : layout.leftCurrent; let preTop = layout.topCurrent; @@ -111,15 +111,15 @@ function layoutHorizontalStartOrMiddleItems( } } -function layoutVerticalStartOrMiddleItems( +function layoutTopBottomStartOrMiddleItems( items: ILayoutItem[], layout: Layout, limitWidth: number, isMiddle: boolean, - align: 'top' | 'bottom' + position: 'top' | 'bottom' ) { if (items.length) { - const isTop = align === 'top'; + const isTop = position === 'top'; const ySign = isTop ? 1 : -1; let maxHeight = 0; let preLeft = layout.leftCurrent; @@ -166,11 +166,11 @@ function layoutVerticalStartOrMiddleItems( export function layoutLeftInlineItems(items: ILayoutItem[], layout: Layout, limitHeight: number) { const { startItems, middleItems, endItems } = getPositionItems(items); if (startItems.length) { - layoutHorizontalStartOrMiddleItems(startItems, layout, limitHeight, false, 'left'); + layoutLeftRightStartOrMiddleItems(startItems, layout, limitHeight, false, 'left'); } if (middleItems.length) { - layoutHorizontalStartOrMiddleItems(middleItems, layout, limitHeight, true, 'left'); + layoutLeftRightStartOrMiddleItems(middleItems, layout, limitHeight, true, 'left'); } if (endItems.length) { @@ -209,11 +209,11 @@ export function layoutRightInlineItems(items: ILayoutItem[], layout: Layout, lim const { startItems, middleItems, endItems } = getPositionItems(items); if (startItems.length) { - layoutHorizontalStartOrMiddleItems(startItems, layout, limitHeight, false, 'right'); + layoutLeftRightStartOrMiddleItems(startItems, layout, limitHeight, false, 'right'); } if (middleItems.length) { - layoutHorizontalStartOrMiddleItems(middleItems, layout, limitHeight, true, 'right'); + layoutLeftRightStartOrMiddleItems(middleItems, layout, limitHeight, true, 'right'); } if (endItems.length) { @@ -251,11 +251,11 @@ export function layoutTopInlineItems(items: ILayoutItem[], layout: Layout, limit const { startItems, middleItems, endItems } = getPositionItems(items); if (startItems.length) { - layoutVerticalStartOrMiddleItems(startItems, layout, limitWidth, false, 'top'); + layoutTopBottomStartOrMiddleItems(startItems, layout, limitWidth, false, 'top'); } if (middleItems.length) { - layoutVerticalStartOrMiddleItems(middleItems, layout, limitWidth, true, 'top'); + layoutTopBottomStartOrMiddleItems(middleItems, layout, limitWidth, true, 'top'); } if (endItems.length) { @@ -295,11 +295,11 @@ export function layoutBottomInlineItems(items: ILayoutItem[], layout: Layout, li const { startItems, middleItems, endItems } = getPositionItems(items); if (startItems.length) { - layoutVerticalStartOrMiddleItems(startItems, layout, limitWidth, false, 'bottom'); + layoutTopBottomStartOrMiddleItems(startItems, layout, limitWidth, false, 'bottom'); } if (middleItems.length) { - layoutVerticalStartOrMiddleItems(middleItems, layout, limitWidth, true, 'bottom'); + layoutTopBottomStartOrMiddleItems(middleItems, layout, limitWidth, true, 'bottom'); } if (endItems.length) { From 623c585474a4cdb8e71ffa89237367f922d9cb18 Mon Sep 17 00:00:00 2001 From: "lixuefei.1313" Date: Fri, 19 Jan 2024 17:53:20 +0800 Subject: [PATCH 11/25] fix: revert indent of region --- .../src/component/axis/cartesian/axis.ts | 8 ++--- .../vchart/src/component/axis/polar/axis.ts | 4 +-- packages/vchart/src/component/brush/brush.ts | 8 ++--- .../vchart/src/component/crosshair/base.ts | 10 +++--- .../data-zoom/data-filter-base-component.ts | 2 +- .../src/component/geo/geo-coordinate.ts | 4 +-- .../src/component/indicator/indicator.ts | 6 ++-- packages/vchart/src/component/label/label.ts | 6 ++-- .../vchart/src/component/label/total-label.ts | 6 ++-- .../src/component/map-label/component.ts | 2 +- .../component/marker/mark-line/mark-line.ts | 12 +++---- packages/vchart/src/component/marker/utils.ts | 32 +++++++++---------- .../component/tooltip/utils/show-tooltip.ts | 4 +-- packages/vchart/src/core/vchart.ts | 2 +- packages/vchart/src/layout/base-layout.ts | 8 ++--- packages/vchart/src/layout/interface.ts | 7 +--- packages/vchart/src/layout/layout-item.ts | 31 ------------------ packages/vchart/src/layout/layout3d/index.ts | 1 - packages/vchart/src/model/interface.ts | 5 --- packages/vchart/src/model/layout-model.ts | 15 --------- packages/vchart/src/series/bar/bar.ts | 2 +- .../vchart/src/series/base/base-series.ts | 15 ++------- .../src/series/correlation/correlation.ts | 7 +--- .../vchart/src/series/mixin/line-mixin.ts | 2 +- packages/vchart/src/series/pie/3d/pie-3d.ts | 4 +-- packages/vchart/src/series/pie/pie.ts | 14 ++++---- packages/vchart/src/series/polar/polar.ts | 2 +- packages/vchart/src/series/sankey/sankey.ts | 7 +--- .../vchart/src/series/sunburst/sunburst.ts | 4 +-- packages/vchart/src/series/word-cloud/base.ts | 6 ++-- 30 files changed, 80 insertions(+), 156 deletions(-) diff --git a/packages/vchart/src/component/axis/cartesian/axis.ts b/packages/vchart/src/component/axis/cartesian/axis.ts index f2e780d6c7..69be333821 100644 --- a/packages/vchart/src/component/axis/cartesian/axis.ts +++ b/packages/vchart/src/component/axis/cartesian/axis.ts @@ -644,13 +644,13 @@ export abstract class CartesianAxis) => { const region = this.getRegions()?.[0]; - return region ? region.getLayoutPositionExcludeIndent() : pos; + return region ? region.getLayoutStartPoint() : pos; }; onLayoutEnd(ctx: any): void { @@ -570,7 +570,7 @@ export abstract class PolarAxis extends BaseComponent i } protected _getBrushInteractiveAttr(region: IRegion) { - const regionLayoutPosition = region.getLayoutPositionExcludeIndent(); - const regionLayoutRect = region.getLayoutRectExcludeIndent(); + const regionLayoutPosition = region.getLayoutStartPoint(); + const regionLayoutRect = region.getLayoutRect(); const seriesRegionStartX = regionLayoutPosition.x; const seriesRegionEndX = seriesRegionStartX + regionLayoutRect.width; const seriesRegionStartY = regionLayoutPosition.y; @@ -322,11 +322,11 @@ export class Brush extends BaseComponent i } private _reconfigLinkedItem(operateMask: IPolygon, region: IRegion) { - const regionLayoutPos = region.getLayoutPositionExcludeIndent(); + const regionLayoutPos = region.getLayoutStartPoint(); const seriesId = region.getSeries().map(s => s.id); this._linkedSeries.forEach((s: ISeries) => { if (!seriesId.includes(s.id)) { - const sRegionLayoutPos = s.getRegion().getLayoutPositionExcludeIndent(); + const sRegionLayoutPos = s.getRegion().getLayoutStartPoint(); const regionOffsetX = sRegionLayoutPos.x - regionLayoutPos.x; const regionOffsetY = sRegionLayoutPos.y - regionLayoutPos.y; diff --git a/packages/vchart/src/component/crosshair/base.ts b/packages/vchart/src/component/crosshair/base.ts index 8367eed96d..060e5e61df 100644 --- a/packages/vchart/src/component/crosshair/base.ts +++ b/packages/vchart/src/component/crosshair/base.ts @@ -236,11 +236,11 @@ export abstract class BaseCrossHair { - const { x: regionStartX, y: regionStartY } = r.getLayoutPositionExcludeIndent(); + const { x: regionStartX, y: regionStartY } = r.getLayoutStartPoint(); x1 = Math.min(x1, regionStartX - sx); y1 = Math.min(y1, regionStartY - sy); - x2 = Math.max(x2, regionStartX + r.getLayoutRectExcludeIndent().width - sx); - y2 = Math.max(y2, regionStartY + r.getLayoutRectExcludeIndent().height - sy); + x2 = Math.max(x2, regionStartX + r.getLayoutRect().width - sx); + y2 = Math.max(y2, regionStartY + r.getLayoutRect().height - sy); }); map.set(idx, { x1, y1, x2, y2, axis: axis as unknown as T }); }); @@ -254,8 +254,8 @@ export abstract class BaseCrossHair implements IGeo } onLayoutEnd(ctx: IModelLayoutOption) { - this.setLayoutRect(this._regions[0].getLayoutRectExcludeIndent()); - this.setLayoutStartPosition(this._regions[0].getLayoutPositionExcludeIndent()); + this.setLayoutRect(this._regions[0].getLayoutRect()); + this.setLayoutStartPosition(this._regions[0].getLayoutStartPoint()); const { width, height } = this.getLayoutRect(); const { translate, scale, center } = this.evaluateProjection([0, 0], [width, height]); translate && this._projection.translate(translate); diff --git a/packages/vchart/src/component/indicator/indicator.ts b/packages/vchart/src/component/indicator/indicator.ts index 9df6baa287..954e1eb51d 100644 --- a/packages/vchart/src/component/indicator/indicator.ts +++ b/packages/vchart/src/component/indicator/indicator.ts @@ -174,8 +174,8 @@ export class Indicator extends BaseComponent implem private _getIndicatorAttrs() { const region = this._regions[0]; - const { width, height } = region.getLayoutRectExcludeIndent(); - const { x, y } = region.getLayoutPositionExcludeIndent(); + const { width, height } = region.getLayoutRect(); + const { x, y } = region.getLayoutStartPoint(); const contentComponentSpec: IIndicatorItemSpec[] = []; array(this._spec.content).forEach((eachItem: IIndicatorItemSpec) => { @@ -261,7 +261,7 @@ export class Indicator extends BaseComponent implem private _computeLayoutRadius() { const region = this._regions[0]; - const { width, height } = region.getLayoutRectExcludeIndent(); + const { width, height } = region.getLayoutRect(); return Math.min(width / 2, height / 2); } diff --git a/packages/vchart/src/component/label/label.ts b/packages/vchart/src/component/label/label.ts index 4136bced45..a561d32011 100644 --- a/packages/vchart/src/component/label/label.ts +++ b/packages/vchart/src/component/label/label.ts @@ -304,8 +304,8 @@ export class Label extends BaseLabelComponent { .filter(cmp => cmp.type === 'totalLabel') .map(cmp => cmp.getMarks()[0].getProductId()) }, - x: labelInfos[0].series.getRegion().layout.indent.left, - y: labelInfos[0].series.getRegion().layout.indent.top + x: 0, + y: 0 }, defaultLabelConfig(rule, labelInfo), { @@ -330,7 +330,7 @@ export class Label extends BaseLabelComponent { : textAttribute(labelInfos[params.labelIndex], datum, labelSpec.formatMethod, labelSpec.formatter); } }) - .size(() => labelInfos[0].series.getRegion().getLayoutRectExcludeIndent()); + .size(() => labelInfos[0].series.getRegion().getLayoutRect()); } compileMarks() { diff --git a/packages/vchart/src/component/label/total-label.ts b/packages/vchart/src/component/label/total-label.ts index a519da3202..313c2ef770 100644 --- a/packages/vchart/src/component/label/total-label.ts +++ b/packages/vchart/src/component/label/total-label.ts @@ -113,8 +113,8 @@ export class TotalLabel extends BaseLabelComponent { { textStyle: { pickable: this._spec.interactive === true }, position: totalLabelPosition(series, this._baseMark.type), - x: series.getRegion().layout.indent.left, - y: series.getRegion().layout.indent.top + x: 0, + y: 0 }, { offset, @@ -140,7 +140,7 @@ export class TotalLabel extends BaseLabelComponent { this._spec.formatMethod ); }) - .size(() => this._regions[0].getLayoutRectExcludeIndent()); + .size(() => this._regions[0].getLayoutRect()); }); } diff --git a/packages/vchart/src/component/map-label/component.ts b/packages/vchart/src/component/map-label/component.ts index 98e8b0f74c..5a886d52f8 100644 --- a/packages/vchart/src/component/map-label/component.ts +++ b/packages/vchart/src/component/map-label/component.ts @@ -367,7 +367,7 @@ export class MapLabelComponent extends BaseComponent { }); const datum = this._data.getLatestData()[i]; const anchor = this.dataToPosition(datum); - const regionPos = this.getRegions()[0].getLayoutPositionExcludeIndent(); + const regionPos = this.getRegions()[0].getLayoutStartPoint(); const showLeader = !!(this._spec.leader?.visible && (icon || nameLabel || valueLabel)); this._markerComponents[i].setAttributes({ x: regionPos.x, diff --git a/packages/vchart/src/component/marker/mark-line/mark-line.ts b/packages/vchart/src/component/marker/mark-line/mark-line.ts index 412e92dfdb..5b017737b6 100644 --- a/packages/vchart/src/component/marker/mark-line/mark-line.ts +++ b/packages/vchart/src/component/marker/mark-line/mark-line.ts @@ -182,16 +182,16 @@ export class MarkLine extends BaseMarker implements IMarkLine { let expandDistanceValue: number; if (isPercent(expandDistance)) { const regionStart = startRelativeSeries.getRegion(); - const regionStartLayoutStartPoint = regionStart.getLayoutPositionExcludeIndent(); + const regionStartLayoutStartPoint = regionStart.getLayoutStartPoint(); const regionEnd = endRelativeSeries.getRegion(); - const regionEndLayoutStartPoint = regionEnd.getLayoutPositionExcludeIndent(); + const regionEndLayoutStartPoint = regionEnd.getLayoutStartPoint(); if (connectDirection === 'bottom' || connectDirection === 'top') { const regionHeight = Math.abs( Math.min(regionStartLayoutStartPoint.y, regionEndLayoutStartPoint.y) - Math.max( - regionStartLayoutStartPoint.y + regionStart.getLayoutRectExcludeIndent().height, - regionEndLayoutStartPoint.y + regionEnd.getLayoutRectExcludeIndent().height + regionStartLayoutStartPoint.y + regionStart.getLayoutRect().height, + regionEndLayoutStartPoint.y + regionEnd.getLayoutRect().height ) ); expandDistanceValue = (Number(expandDistance.substring(0, expandDistance.length - 1)) * regionHeight) / 100; @@ -199,8 +199,8 @@ export class MarkLine extends BaseMarker implements IMarkLine { const regionWidth = Math.abs( Math.min(regionStartLayoutStartPoint.x, regionEndLayoutStartPoint.x) - Math.max( - regionStartLayoutStartPoint.x + regionStart.getLayoutRectExcludeIndent().width, - regionEndLayoutStartPoint.x + regionEnd.getLayoutRectExcludeIndent().width + regionStartLayoutStartPoint.x + regionStart.getLayoutRect().width, + regionEndLayoutStartPoint.x + regionEnd.getLayoutRect().width ) ); expandDistanceValue = (Number(expandDistance.substring(0, expandDistance.length - 1)) * regionWidth) / 100; diff --git a/packages/vchart/src/component/marker/utils.ts b/packages/vchart/src/component/marker/utils.ts index c800413225..38ffd2aab3 100644 --- a/packages/vchart/src/component/marker/utils.ts +++ b/packages/vchart/src/component/marker/utils.ts @@ -82,22 +82,22 @@ export function xyLayout( autoRange: boolean ) { const regionStart = startRelativeSeries.getRegion(); - const regionStartLayoutStartPoint = regionStart.getLayoutPositionExcludeIndent(); + const regionStartLayoutStartPoint = regionStart.getLayoutStartPoint(); const regionEnd = endRelativeSeries.getRegion(); - const regionEndLayoutStartPoint = regionEnd.getLayoutPositionExcludeIndent(); + const regionEndLayoutStartPoint = regionEnd.getLayoutStartPoint(); const regionWidth = Math.abs( Math.min(regionStartLayoutStartPoint.x, regionEndLayoutStartPoint.x) - Math.max( - regionStartLayoutStartPoint.x + regionStart.getLayoutRectExcludeIndent().width, - regionEndLayoutStartPoint.x + regionEnd.getLayoutRectExcludeIndent().width + regionStartLayoutStartPoint.x + regionStart.getLayoutRect().width, + regionEndLayoutStartPoint.x + regionEnd.getLayoutRect().width ) ); const regionHeight = Math.abs( Math.min(regionStartLayoutStartPoint.y, regionEndLayoutStartPoint.y) - Math.max( - regionStartLayoutStartPoint.y + regionStart.getLayoutRectExcludeIndent().height, - regionEndLayoutStartPoint.y + regionEnd.getLayoutRectExcludeIndent().height + regionStartLayoutStartPoint.y + regionStart.getLayoutRect().height, + regionEndLayoutStartPoint.y + regionEnd.getLayoutRect().height ) ); @@ -121,8 +121,8 @@ export function xyLayout( } else if (isValid(datum.x)) { const x = getXValue(datum, xDomain, autoRange, refSeries, regionWidth, regionStartLayoutStartPoint); const y = Math.max( - regionStartLayoutStartPoint.y + regionStart.getLayoutRectExcludeIndent().height, - regionEndLayoutStartPoint.y + regionEnd.getLayoutRectExcludeIndent().height + regionStartLayoutStartPoint.y + regionStart.getLayoutRect().height, + regionEndLayoutStartPoint.y + regionEnd.getLayoutRect().height ); const y1 = Math.min(regionStartLayoutStartPoint.y, regionEndLayoutStartPoint.y); lines.push([ @@ -139,8 +139,8 @@ export function xyLayout( const x = Math.min(regionStartLayoutStartPoint.x, regionEndLayoutStartPoint.x); const y = getYValue(datum, yDomain, autoRange, refSeries, regionHeight, regionStartLayoutStartPoint); const x1 = Math.max( - regionStartLayoutStartPoint.x + regionStart.getLayoutRectExcludeIndent().width, - regionEndLayoutStartPoint.x + regionEnd.getLayoutRectExcludeIndent().width + regionStartLayoutStartPoint.x + regionStart.getLayoutRect().width, + regionEndLayoutStartPoint.x + regionEnd.getLayoutRect().width ); lines.push([ { @@ -178,9 +178,9 @@ export function coordinateLayout( ) => { const refRelativeSeries = datum?.getRefRelativeSeries ? datum.getRefRelativeSeries() : relativeSeries; const regionStart = refRelativeSeries.getRegion(); - const regionStartLayoutStartPoint = regionStart.getLayoutPositionExcludeIndent(); + const regionStartLayoutStartPoint = regionStart.getLayoutStartPoint(); - const { width: regionWidth, height: regionHeight } = regionStart.getLayoutRectExcludeIndent(); + const { width: regionWidth, height: regionHeight } = regionStart.getLayoutRect(); let offsetX = 0; let offsetY = 0; @@ -222,8 +222,8 @@ export function coordinateLayout( export function positionLayout(positions: MarkerPositionPoint[], series: ISeries, regionRelative: boolean): IPoint[] { if (regionRelative) { const region = series.getRegion(); - const { x: regionStartX, y: regionStartY } = region.getLayoutPositionExcludeIndent(); - const { width: regionWidth, height: regionHeight } = region.getLayoutRectExcludeIndent(); + const { x: regionStartX, y: regionStartY } = region.getLayoutStartPoint(); + const { width: regionWidth, height: regionHeight } = region.getLayoutRect(); return positions.map(position => { let { x, y } = position; if (isPercent(x)) { @@ -264,8 +264,8 @@ export function computeClipRange(regions: IRegion[]) { let minY = Infinity; let maxY = -Infinity; regions.forEach((region: IRegion) => { - const regionPos = region.getLayoutPositionExcludeIndent(); - const regionRect = region.getLayoutRectExcludeIndent(); + const regionPos = region.getLayoutStartPoint(); + const regionRect = region.getLayoutRect(); if (regionPos.x < minX) { minX = regionPos.x; } diff --git a/packages/vchart/src/component/tooltip/utils/show-tooltip.ts b/packages/vchart/src/component/tooltip/utils/show-tooltip.ts index a3a48a0660..794b4cff4d 100644 --- a/packages/vchart/src/component/tooltip/utils/show-tooltip.ts +++ b/packages/vchart/src/component/tooltip/utils/show-tooltip.ts @@ -303,8 +303,8 @@ export function showTooltip( // 组织数据 const activeType = opt.activeType ?? (markInfoList.length > 1 ? 'dimension' : 'mark'); - const regionPos = region.getLayoutPositionExcludeIndent(); - const regionRect = region.getLayoutRectExcludeIndent(); + const regionPos = region.getLayoutStartPoint(); + const regionRect = region.getLayoutRect(); const container = componentOptions.globalInstance.getContainer(); const containerPos = { x: 0, diff --git a/packages/vchart/src/core/vchart.ts b/packages/vchart/src/core/vchart.ts index 0bdcf90ae4..efd22c656e 100644 --- a/packages/vchart/src/core/vchart.ts +++ b/packages/vchart/src/core/vchart.ts @@ -1748,7 +1748,7 @@ export class VChart implements IVChart { .getViewData() // eslint-disable-next-line eqeqeq .latestData.find((viewDatum: Datum) => keys.every(k => viewDatum[k] == datum[k])); - const seriesLayoutStartPoint = series.getRegion().getLayoutPositionExcludeIndent(); + const seriesLayoutStartPoint = series.getRegion().getLayoutStartPoint(); let point: IPoint; if (handledDatum) { point = series.dataToPosition(handledDatum); diff --git a/packages/vchart/src/layout/base-layout.ts b/packages/vchart/src/layout/base-layout.ts index 5173ba5a34..e01c69f0c8 100644 --- a/packages/vchart/src/layout/base-layout.ts +++ b/packages/vchart/src/layout/base-layout.ts @@ -362,10 +362,10 @@ export class Layout implements IBaseLayout { const relativeRegion = this.filterRegionsWithID(regionItems, item.layoutBindRegionID[0]); item.setLayoutRect({ - height: relativeRegion.layoutExcludeIndent.height + height: relativeRegion.getLayoutRect().height }); item.setLayoutStartPosition({ - y: relativeRegion.layoutExcludeIndent.y + item.layoutOffsetY + item.layoutPaddingTop + y: relativeRegion.getLayoutStartPoint().y + item.layoutOffsetY + item.layoutPaddingTop }); if (item.layoutOrient === 'right') { @@ -377,11 +377,11 @@ export class Layout implements IBaseLayout { const relativeRegion = this.filterRegionsWithID(regionItems, item.layoutBindRegionID[0]); item.setLayoutRect({ - width: relativeRegion.layoutExcludeIndent.width + width: relativeRegion.getLayoutRect().width }); item.setLayoutStartPosition({ - x: relativeRegion.layoutExcludeIndent.x + item.layoutOffsetX + item.layoutPaddingLeft + x: relativeRegion.getLayoutStartPoint().x + item.layoutOffsetX + item.layoutPaddingLeft }); if (item.layoutOrient === 'bottom') { diff --git a/packages/vchart/src/layout/interface.ts b/packages/vchart/src/layout/interface.ts index 30b343c85a..9c9e4695b8 100644 --- a/packages/vchart/src/layout/interface.ts +++ b/packages/vchart/src/layout/interface.ts @@ -1,6 +1,6 @@ import type { IBoundsLike } from '@visactor/vutils'; import type { StringOrNumber } from '../typings/common'; -import type { IOrientType, IPadding, IRect } from '../typings/space'; +import type { IOrientType, IRect } from '../typings/space'; import type { IPoint } from '../typings/coordinate'; import type { ILayoutNumber, ILayoutPaddingSpec, ILayoutPoint, ILayoutRect, ILayoutType } from '../typings/layout'; import type { ILayoutModel } from '../model/interface'; @@ -91,11 +91,6 @@ export interface ILayoutItem { layoutPaddingRight: number; layoutPaddingBottom: number; - // 锁进 概念上等同于 padding - indent: IPadding; - // 锁进后的布局属性 - layoutExcludeIndent: IRect; - layoutOffsetX: number; layoutOffsetY: number; diff --git a/packages/vchart/src/layout/layout-item.ts b/packages/vchart/src/layout/layout-item.ts index c2a0e6fc49..4fc14478be 100644 --- a/packages/vchart/src/layout/layout-item.ts +++ b/packages/vchart/src/layout/layout-item.ts @@ -95,29 +95,6 @@ export class LayoutItem implements ILayoutItem { layoutPaddingRight: ILayoutItem['layoutPaddingRight'] = 0; layoutPaddingBottom: ILayoutItem['layoutPaddingBottom'] = 0; - // 锁进 等同于 padding - protected _indent: IPadding = { - left: 0, - top: 0, - right: 0, - bottom: 0 - }; - - get indent() { - return this._indent; - } - - private _layoutExcludeIndent: IRect = { - x: 0, - y: 0, - width: 0, - height: 0 - }; - - get layoutExcludeIndent() { - return this._layoutExcludeIndent; - } - layoutOffsetX: ILayoutItem['layoutOffsetX'] = 0; layoutOffsetY: ILayoutItem['layoutOffsetY'] = 0; @@ -161,9 +138,6 @@ export class LayoutItem implements ILayoutItem { this.layoutPaddingTop = paddingValue.top; this.layoutPaddingBottom = paddingValue.bottom; - const indent = normalizeLayoutPaddingSpec(spec.indent); - this._indent = calcPadding(indent, chartViewRect, chartViewRect); - this._minHeight = isNil(spec.minHeight) ? this._minHeight ?? null : calcLayoutNumber(spec.minHeight, chartViewRect.height, chartViewRect); @@ -296,8 +270,6 @@ export class LayoutItem implements ILayoutItem { if (isValidNumber(pos.y)) { this._layoutStartPoint.y = pos.y; } - this._layoutExcludeIndent.x = this._layoutStartPoint.x + this._indent.left; - this._layoutExcludeIndent.y = this._layoutStartPoint.y + this._indent.top; this._model.afterSetLayoutStartPoint?.(this._layoutStartPoint); } @@ -314,9 +286,6 @@ export class LayoutItem implements ILayoutItem { } this.setRectInSpec(this._layoutRect); - - this._layoutExcludeIndent.width = Math.max(this._layoutRect.width - this._indent.left - this._indent.right, 1); - this._layoutExcludeIndent.height = Math.max(this._layoutRect.height - this._indent.top - this._indent.bottom, 1); } getLayout(): IRect { diff --git a/packages/vchart/src/layout/layout3d/index.ts b/packages/vchart/src/layout/layout3d/index.ts index 7834b26be0..3ca476e377 100644 --- a/packages/vchart/src/layout/layout3d/index.ts +++ b/packages/vchart/src/layout/layout3d/index.ts @@ -7,7 +7,6 @@ import { Layout } from '../base-layout'; import { isXAxis, isYAxis } from '../../component/axis/cartesian/util/common'; import { Factory } from '../../core/factory'; import type { IAxis } from '../../component/axis'; -import type { ILayoutRect } from '../../typings/layout'; export class Layout3d extends Layout implements IBaseLayout { static type = 'layout3d'; diff --git a/packages/vchart/src/model/interface.ts b/packages/vchart/src/model/interface.ts index a56a868a83..50a76fcc99 100644 --- a/packages/vchart/src/model/interface.ts +++ b/packages/vchart/src/model/interface.ts @@ -141,11 +141,6 @@ export interface ILayoutModel extends IModel { getLayoutRect: () => ILayoutRect; setLayoutRect: (rect: Partial, levelMap?: Partial) => void; - // 得到排除锁进后的布局起点 - getLayoutPositionExcludeIndent: () => IPoint; - // 得到排除锁进后的尺寸 - getLayoutRectExcludeIndent: () => ILayoutRect; - getLastComputeOutBounds: () => IBoundsLike; getBoundsInRect: (rect: ILayoutRect, fullRect: ILayoutRect) => IBoundsLike; diff --git a/packages/vchart/src/model/layout-model.ts b/packages/vchart/src/model/layout-model.ts index 9b0cb44ed4..1e1d25cbd0 100644 --- a/packages/vchart/src/model/layout-model.ts +++ b/packages/vchart/src/model/layout-model.ts @@ -78,21 +78,6 @@ export abstract class LayoutModel extends BaseModel { } // 布局相关 - // 得到排除锁进后的布局起点 - getLayoutPositionExcludeIndent() { - let { x, y } = this.getLayoutStartPoint(); - x += this._layout.indent.left; - y += this._layout.indent.top; - return { x, y }; - } - // 得到排除锁进后的尺寸 - getLayoutRectExcludeIndent() { - let { width, height } = this.getLayoutRect(); - width -= this._layout.indent.left + this._layout.indent.right; - height -= this._layout.indent.top + this._layout.indent.bottom; - return { width, height }; - } - getLayoutStartPoint() { return this._layout ? this._layout.getLayoutStartPoint() : this._layoutStartPos; } diff --git a/packages/vchart/src/series/bar/bar.ts b/packages/vchart/src/series/bar/bar.ts index 0b8aa2f77f..d48e30bad0 100644 --- a/packages/vchart/src/series/bar/bar.ts +++ b/packages/vchart/src/series/bar/bar.ts @@ -595,7 +595,7 @@ export class BarSeries extends Cartes super.compile(); if (this._spec.sampling) { - const { width, height } = this._region.getLayoutRectExcludeIndent(); + const { width, height } = this._region.getLayoutRect(); const samplingTrans = []; const fieldsY = this._fieldY; const fieldsX = this._fieldX; diff --git a/packages/vchart/src/series/base/base-series.ts b/packages/vchart/src/series/base/base-series.ts index 8431b85229..f36958a017 100644 --- a/packages/vchart/src/series/base/base-series.ts +++ b/packages/vchart/src/series/base/base-series.ts @@ -121,15 +121,15 @@ export abstract class BaseSeries extends BaseModel imp }; getLayoutStartPoint(): ILayoutPoint { - return this._region.getLayoutPositionExcludeIndent(); + return this._region.getLayoutStartPoint(); } private _layoutRect: ILayoutRect = { width: null, height: null }; getLayoutRect: () => ILayoutRect = () => { return { - width: this._layoutRect.width ?? this._region.getLayoutRectExcludeIndent().width, - height: this._layoutRect.height ?? this._region.getLayoutRectExcludeIndent().height + width: this._layoutRect.width ?? this._region.getLayoutRect().width, + height: this._layoutRect.height ?? this._region.getLayoutRect().height }; }; @@ -686,15 +686,6 @@ export abstract class BaseSeries extends BaseModel imp dataView: false } ) as IGroupMark; - this.setMarkStyle( - this._rootMark, - { - x: () => this._region.layout.indent.left, - y: () => this._region.layout.indent.top - }, - 'normal', - AttributeLevel.Base_Series - ); this._rootMark.setZIndex(this.layoutZIndex); } diff --git a/packages/vchart/src/series/correlation/correlation.ts b/packages/vchart/src/series/correlation/correlation.ts index c9e8d4e02c..efa5b2f22f 100644 --- a/packages/vchart/src/series/correlation/correlation.ts +++ b/packages/vchart/src/series/correlation/correlation.ts @@ -341,12 +341,7 @@ export class CorrelationSeries extends params3d.anchor3d = (datum: Datum) => { const anchor = [ // TODO: label 布局依赖自身图元属性,这里无法获取到 - this._center?.x ?? this._region.getLayoutRectExcludeIndent().width / 2, - this._center?.y ?? this._region.getLayoutRectExcludeIndent().height / 2 + this._center?.x ?? this._region.getLayoutRect().width / 2, + this._center?.y ?? this._region.getLayoutRect().height / 2 ]; return anchor; }; diff --git a/packages/vchart/src/series/pie/pie.ts b/packages/vchart/src/series/pie/pie.ts index f5b6a5c546..31c73e865e 100644 --- a/packages/vchart/src/series/pie/pie.ts +++ b/packages/vchart/src/series/pie/pie.ts @@ -65,8 +65,8 @@ export class BasePieSeries extends PolarSeries protected _center!: IPoint | null; public get center(): IPoint { return { - x: this._spec?.centerX ?? this._region.getLayoutRectExcludeIndent().width / 2, - y: this._spec?.centerY ?? this._region.getLayoutRectExcludeIndent().height / 2 + x: this._spec?.centerX ?? this._region.getLayoutRect().width / 2, + y: this._spec?.centerY ?? this._region.getLayoutRect().height / 2 }; } protected _centerOffset!: number; @@ -86,8 +86,8 @@ export class BasePieSeries extends PolarSeries // center this._markAttributeContext.getCenter = () => { return { - x: () => this._center?.x ?? this._region.getLayoutRectExcludeIndent().width / 2, - y: () => this._center?.y ?? this._region.getLayoutRectExcludeIndent().height / 2 + x: () => this._center?.x ?? this._region.getLayoutRect().width / 2, + y: () => this._center?.y ?? this._region.getLayoutRect().height / 2 }; }; @@ -191,8 +191,8 @@ export class BasePieSeries extends PolarSeries this.setMarkStyle( pieMark, { - x: () => this._center?.x ?? this._region.getLayoutRectExcludeIndent().width / 2, - y: () => this._center?.y ?? this._region.getLayoutRectExcludeIndent().height / 2, + x: () => this._center?.x ?? this._region.getLayoutRect().width / 2, + y: () => this._center?.y ?? this._region.getLayoutRect().height / 2, fill: this.getColorAttribute(), outerRadius: isSpecValueWithScale(this._outerRadius) ? this._outerRadius @@ -298,7 +298,7 @@ export class BasePieSeries extends PolarSeries } protected computeLayoutRadius() { - const { width, height } = this._region.getLayoutRectExcludeIndent(); + const { width, height } = this._region.getLayoutRect(); return Math.min(width / 2, height / 2); } diff --git a/packages/vchart/src/series/polar/polar.ts b/packages/vchart/src/series/polar/polar.ts index ed2d7662f8..f32f089f96 100644 --- a/packages/vchart/src/series/polar/polar.ts +++ b/packages/vchart/src/series/polar/polar.ts @@ -209,7 +209,7 @@ export abstract class PolarSeries } protected _computeLayoutRadius() { - const { width, height } = this._region.getLayoutRectExcludeIndent(); + const { width, height } = this._region.getLayoutRect(); return Math.min(width / 2, height / 2); } diff --git a/packages/vchart/src/series/sankey/sankey.ts b/packages/vchart/src/series/sankey/sankey.ts index a83c3f9417..d1be935ecd 100644 --- a/packages/vchart/src/series/sankey/sankey.ts +++ b/packages/vchart/src/series/sankey/sankey.ts @@ -1383,12 +1383,7 @@ export class SankeySeries exten onLayoutEnd(ctx: any): void { super.onLayoutEnd(ctx); - this._viewBox.set( - 0, - 0, - this._region.getLayoutRectExcludeIndent().width, - this._region.getLayoutRectExcludeIndent().height - ); + this._viewBox.set(0, 0, this._region.getLayoutRect().width, this._region.getLayoutRect().height); // calculate the sankeyLayout this.getViewData().reRunAllTransform(); diff --git a/packages/vchart/src/series/sunburst/sunburst.ts b/packages/vchart/src/series/sunburst/sunburst.ts index 3b594b42a2..1dcc28e21e 100644 --- a/packages/vchart/src/series/sunburst/sunburst.ts +++ b/packages/vchart/src/series/sunburst/sunburst.ts @@ -385,11 +385,11 @@ export class SunburstSeries extends PolarSeries { private _computeRadius(radius: number | number[]) { if (isArray(radius)) { return radius.map(r => { - const { width, height } = this.getRegion().getLayoutRectExcludeIndent(); + const { width, height } = this.getRegion().getLayoutRect(); return Math.min(width / 2, height / 2) * r; }); } - const { width, height } = this.getRegion().getLayoutRectExcludeIndent(); + const { width, height } = this.getRegion().getLayoutRect(); return Math.min(width / 2, height / 2) * radius; } diff --git a/packages/vchart/src/series/word-cloud/base.ts b/packages/vchart/src/series/word-cloud/base.ts index bd6d557fbd..ba02778a52 100644 --- a/packages/vchart/src/series/word-cloud/base.ts +++ b/packages/vchart/src/series/word-cloud/base.ts @@ -270,7 +270,7 @@ export class BaseWordCloudSeries 0 && width > 0)) { return; @@ -347,7 +347,7 @@ export class BaseWordCloudSeries Date: Fri, 19 Jan 2024 18:15:07 +0800 Subject: [PATCH 12/25] fix: fix position bug of inline-normal --- packages/vchart/src/layout/util.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/vchart/src/layout/util.ts b/packages/vchart/src/layout/util.ts index dddf6b4b24..32553bb32e 100644 --- a/packages/vchart/src/layout/util.ts +++ b/packages/vchart/src/layout/util.ts @@ -107,7 +107,11 @@ function layoutLeftRightStartOrMiddleItems( adjustItemsToCenter(allItems, true, limitHeight); } - layout.rightCurrent = preX + xSign * maxWidth; + if (isRight) { + layout.rightCurrent = preX + xSign * maxWidth; + } else { + layout.leftCurrent = preX + xSign * maxWidth; + } } } @@ -159,7 +163,11 @@ function layoutTopBottomStartOrMiddleItems( adjustItemsToCenter(allItems, false, limitWidth); } - layout.topCurrent = preLeft + ySign * maxHeight; + if (isTop) { + layout.topCurrent = preY + ySign * maxHeight; + } else { + layout.bottomCurrent = preY + ySign * maxHeight; + } } } From 759d938ee9b8104e2249b1733dc71b39803ef404 Mon Sep 17 00:00:00 2001 From: xile611 Date: Sun, 21 Jan 2024 16:03:16 +0800 Subject: [PATCH 13/25] feat: support `alignSelf` of layout `normal-inline` elements, fix #2072 --- packages/vchart/src/layout/interface.ts | 28 +++++++++++- packages/vchart/src/layout/layout-item.ts | 9 +++- packages/vchart/src/layout/util.ts | 54 ++++++++++++++++++++++- packages/vchart/src/typings/layout.ts | 2 + 4 files changed, 89 insertions(+), 4 deletions(-) diff --git a/packages/vchart/src/layout/interface.ts b/packages/vchart/src/layout/interface.ts index 9c9e4695b8..83ac67cb31 100644 --- a/packages/vchart/src/layout/interface.ts +++ b/packages/vchart/src/layout/interface.ts @@ -2,7 +2,14 @@ import type { IBoundsLike } from '@visactor/vutils'; import type { StringOrNumber } from '../typings/common'; import type { IOrientType, IRect } from '../typings/space'; import type { IPoint } from '../typings/coordinate'; -import type { ILayoutNumber, ILayoutPaddingSpec, ILayoutPoint, ILayoutRect, ILayoutType } from '../typings/layout'; +import type { + ILayoutAlignSelf, + ILayoutNumber, + ILayoutPaddingSpec, + ILayoutPoint, + ILayoutRect, + ILayoutType +} from '../typings/layout'; import type { ILayoutModel } from '../model/interface'; export interface IBaseLayout { @@ -86,6 +93,15 @@ export interface ILayoutItem { /** 是否自动缩进 */ autoIndent: boolean; + /** + * inline元素和其他同行元素的对齐方式 + * 顶部的inline元素,'start' - 顶部对齐;'end' - '底部对齐'; 'center' - 居中对齐 + * 底部的inline元素,'start' - 底部对齐;'end' - '顶部对齐'; 'center' - 居中对齐 + * 左侧的inline元素,'start' - 左侧对齐;'end' - '右侧对齐'; 'center' - 居中对齐 + * 右侧的inline元素,'start' - 右侧对齐;'end' - '左侧对齐'; 'center' - 居中对齐 + */ + alignSelf?: 'start' | 'end' | 'center'; + layoutPaddingLeft: number; layoutPaddingTop: number; layoutPaddingRight: number; @@ -151,6 +167,15 @@ export interface ILayoutItemSpec { */ layoutLevel?: number; + /** + * inline元素和其他同行元素的对齐方式 + * 顶部的inline元素,'start' - 顶部对齐;'end' - '底部对齐'; 'center' - 居中对齐 + * 底部的inline元素,'start' - 底部对齐;'end' - '顶部对齐'; 'center' - 居中对齐 + * 左侧的inline元素,'start' - 左侧对齐;'end' - '右侧对齐'; 'center' - 居中对齐 + * 右侧的inline元素,'start' - 右侧对齐;'end' - '左侧对齐'; 'center' - 居中对齐 + */ + alignSelf?: 'start' | 'end' | 'center'; + // 基础的布局配置 /** 模块布局位置 */ orient?: IOrientType; @@ -203,6 +228,7 @@ export interface ILayoutItemInitOption { layoutType: ILayoutType; layoutLevel: number; layoutOrient?: IOrientType; + alignSelf?: ILayoutAlignSelf; transformLayoutRect?: (rect: ILayoutRect) => ILayoutRect; transformLayoutPosition?: (pos: Partial) => Partial; } diff --git a/packages/vchart/src/layout/layout-item.ts b/packages/vchart/src/layout/layout-item.ts index 4fc14478be..7a748fee75 100644 --- a/packages/vchart/src/layout/layout-item.ts +++ b/packages/vchart/src/layout/layout-item.ts @@ -8,7 +8,7 @@ import { LayoutLevel, DEFAULT_LAYOUT_RECT_LEVEL, USER_LAYOUT_RECT_LEVEL } from ' import type { ILayoutItem, ILayoutItemInitOption, ILayoutItemSpec } from './interface'; import type { IChartLayoutOption } from '../chart/interface/common'; -import type { ILayoutPoint, ILayoutRect } from '../typings/layout'; +import type { ILayoutAlignSelf, ILayoutPoint, ILayoutRect } from '../typings/layout'; export class LayoutItem implements ILayoutItem { protected _spec: ILayoutItemSpec; @@ -102,6 +102,8 @@ export class LayoutItem implements ILayoutItem { chartLayoutRect!: ILayoutRect; + alignSelf: ILayoutAlignSelf; + protected _model: ILayoutModel; get model() { @@ -119,6 +121,7 @@ export class LayoutItem implements ILayoutItem { this._option = option; this.layoutLevel = option.layoutLevel; this.layoutType = option.layoutType; + this.alignSelf = option.alignSelf; if (option.layoutOrient) { this.layoutOrient = option.layoutOrient; } @@ -179,6 +182,10 @@ export class LayoutItem implements ILayoutItem { if (!isNil(spec.offsetY)) { this.layoutOffsetY = calcLayoutNumber(spec.offsetY, chartViewRect.height, chartViewRect); } + + if (spec.alignSelf) { + this.alignSelf = spec.alignSelf; + } } } diff --git a/packages/vchart/src/layout/util.ts b/packages/vchart/src/layout/util.ts index 32553bb32e..339f02fb00 100644 --- a/packages/vchart/src/layout/util.ts +++ b/packages/vchart/src/layout/util.ts @@ -72,6 +72,7 @@ function layoutLeftRightStartOrMiddleItems( const allItems: ILayoutItem[][] = []; let singleLineItems: ILayoutItem[] = []; + const maxWidths: number[] = []; items.forEach(item => { const layoutRect = layout.getItemComputeLayoutRect(item); const rect = item.computeBoundsInRect(layoutRect); @@ -84,9 +85,9 @@ function layoutLeftRightStartOrMiddleItems( y: preTop + item.layoutOffsetY + item.layoutPaddingTop }); - maxWidth = Math.max(maxWidth, itemTotalWidth); preTop += itemTotalHeight; if (preTop > limitHeight && singleLineItems.length) { + maxWidths.push(maxWidth); preX += xSign * maxWidth; maxWidth = itemTotalWidth; preTop = layout.topCurrent + itemTotalHeight; @@ -98,11 +99,34 @@ function layoutLeftRightStartOrMiddleItems( allItems.push(singleLineItems); singleLineItems = [item]; } else { + maxWidth = Math.max(maxWidth, itemTotalWidth); singleLineItems.push(item); } }); + maxWidths.push(maxWidth); allItems.push(singleLineItems); + allItems.forEach((lineItems: ILayoutItem[], index: number) => { + if (lineItems.length > 1) { + maxWidth = maxWidths[index]; + + lineItems.forEach(item => { + if (!item.alignSelf || item.alignSelf === 'start') { + return; + } + + const pos = item.getLayoutStartPoint(); + const ratio = item.alignSelf === 'center' ? 0.5 : 1; + const delta = maxWidth - (item.getLayoutRect().width + item.layoutPaddingLeft + item.layoutPaddingRight); + + item.setLayoutStartPosition({ + x: pos.x + xSign * delta * ratio, + y: pos.y + }); + }); + } + }); + if (isMiddle) { adjustItemsToCenter(allItems, true, limitHeight); } @@ -130,6 +154,8 @@ function layoutTopBottomStartOrMiddleItems( let preY = isTop ? layout.topCurrent : layout.bottomCurrent; const allItems: ILayoutItem[][] = []; let singleLineItems: ILayoutItem[] = []; + const maxHeights: number[] = []; + items.forEach(item => { const layoutRect = layout.getItemComputeLayoutRect(item); const rect = item.computeBoundsInRect(layoutRect); @@ -142,9 +168,9 @@ function layoutTopBottomStartOrMiddleItems( y: preY + item.layoutOffsetY + itemOffsetY }); - maxHeight = Math.max(maxHeight, itemTotalHeight); preLeft += itemTotalWidth; if (preLeft > limitWidth && singleLineItems.length) { + maxHeights.push(maxHeight); preLeft = layout.leftCurrent + itemTotalWidth; preY += ySign * maxHeight; maxHeight = itemTotalHeight; @@ -155,10 +181,34 @@ function layoutTopBottomStartOrMiddleItems( allItems.push(singleLineItems); singleLineItems = [item]; } else { + maxHeight = Math.max(maxHeight, itemTotalHeight); singleLineItems.push(item); } }); + maxHeights.push(maxHeight); allItems.push(singleLineItems); + + allItems.forEach((lineItems: ILayoutItem[], index: number) => { + if (lineItems.length > 1) { + maxHeight = maxHeights[index]; + + lineItems.forEach(item => { + if (!item.alignSelf || item.alignSelf === 'start') { + return; + } + + const pos = item.getLayoutStartPoint(); + const ratio = item.alignSelf === 'center' ? 0.5 : 1; + const delta = maxHeight - (item.getLayoutRect().height + item.layoutPaddingTop + item.layoutPaddingBottom); + + item.setLayoutStartPosition({ + x: pos.x, + y: pos.y + ySign * delta * ratio + }); + }); + } + }); + if (isMiddle) { adjustItemsToCenter(allItems, false, limitWidth); } diff --git a/packages/vchart/src/typings/layout.ts b/packages/vchart/src/typings/layout.ts index bdea1afa58..2e318833df 100644 --- a/packages/vchart/src/typings/layout.ts +++ b/packages/vchart/src/typings/layout.ts @@ -39,3 +39,5 @@ export type ILayoutOrientPadding = { /** 布局 padding的配置 */ export type ILayoutPaddingSpec = ILayoutOrientPadding | ILayoutNumber | ILayoutNumber[]; + +export type ILayoutAlignSelf = 'start' | 'end' | 'center'; From 7a8ef70f1a3a4a9eb7784ddb6095e12022b4b3ce Mon Sep 17 00:00:00 2001 From: xile611 Date: Sun, 21 Jan 2024 16:03:57 +0800 Subject: [PATCH 14/25] docs: update changlog of rush --- ...at-align-inline-items_2024-01-21-08-03.json | 11 +++++++++++ packages/vchart/src/layout/interface.ts | 18 +++++++++--------- packages/vchart/src/layout/util.ts | 4 ++-- packages/vchart/src/typings/layout.ts | 2 +- 4 files changed, 23 insertions(+), 12 deletions(-) create mode 100644 common/changes/@visactor/vchart/feat-align-inline-items_2024-01-21-08-03.json diff --git a/common/changes/@visactor/vchart/feat-align-inline-items_2024-01-21-08-03.json b/common/changes/@visactor/vchart/feat-align-inline-items_2024-01-21-08-03.json new file mode 100644 index 0000000000..fa24c4e66a --- /dev/null +++ b/common/changes/@visactor/vchart/feat-align-inline-items_2024-01-21-08-03.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "feat: support `alignSelf` of layout `normal-inline` elements, fix #2072 \n\n", + "type": "none", + "packageName": "@visactor/vchart" + } + ], + "packageName": "@visactor/vchart", + "email": "dingling112@gmail.com" +} \ No newline at end of file diff --git a/packages/vchart/src/layout/interface.ts b/packages/vchart/src/layout/interface.ts index 83ac67cb31..e0a962bb1d 100644 --- a/packages/vchart/src/layout/interface.ts +++ b/packages/vchart/src/layout/interface.ts @@ -95,12 +95,12 @@ export interface ILayoutItem { /** * inline元素和其他同行元素的对齐方式 - * 顶部的inline元素,'start' - 顶部对齐;'end' - '底部对齐'; 'center' - 居中对齐 - * 底部的inline元素,'start' - 底部对齐;'end' - '顶部对齐'; 'center' - 居中对齐 - * 左侧的inline元素,'start' - 左侧对齐;'end' - '右侧对齐'; 'center' - 居中对齐 - * 右侧的inline元素,'start' - 右侧对齐;'end' - '左侧对齐'; 'center' - 居中对齐 + * 顶部的inline元素,'start' - 顶部对齐;'end' - '底部对齐'; 'middle' - 居中对齐 + * 底部的inline元素,'start' - 底部对齐;'end' - '顶部对齐'; 'middle' - 居中对齐 + * 左侧的inline元素,'start' - 左侧对齐;'end' - '右侧对齐'; 'middle' - 居中对齐 + * 右侧的inline元素,'start' - 右侧对齐;'end' - '左侧对齐'; 'middle' - 居中对齐 */ - alignSelf?: 'start' | 'end' | 'center'; + alignSelf?: 'start' | 'end' | 'middle'; layoutPaddingLeft: number; layoutPaddingTop: number; @@ -169,10 +169,10 @@ export interface ILayoutItemSpec { /** * inline元素和其他同行元素的对齐方式 - * 顶部的inline元素,'start' - 顶部对齐;'end' - '底部对齐'; 'center' - 居中对齐 - * 底部的inline元素,'start' - 底部对齐;'end' - '顶部对齐'; 'center' - 居中对齐 - * 左侧的inline元素,'start' - 左侧对齐;'end' - '右侧对齐'; 'center' - 居中对齐 - * 右侧的inline元素,'start' - 右侧对齐;'end' - '左侧对齐'; 'center' - 居中对齐 + * 顶部的inline元素,'start' - 顶部对齐;'end' - '底部对齐'; 'middle' - 居中对齐 + * 底部的inline元素,'start' - 底部对齐;'end' - '顶部对齐'; 'middle' - 居中对齐 + * 左侧的inline元素,'start' - 左侧对齐;'end' - '右侧对齐'; 'middle' - 居中对齐 + * 右侧的inline元素,'start' - 右侧对齐;'end' - '左侧对齐'; 'middle' - 居中对齐 */ alignSelf?: 'start' | 'end' | 'center'; diff --git a/packages/vchart/src/layout/util.ts b/packages/vchart/src/layout/util.ts index 339f02fb00..0f8a8f31a1 100644 --- a/packages/vchart/src/layout/util.ts +++ b/packages/vchart/src/layout/util.ts @@ -116,7 +116,7 @@ function layoutLeftRightStartOrMiddleItems( } const pos = item.getLayoutStartPoint(); - const ratio = item.alignSelf === 'center' ? 0.5 : 1; + const ratio = item.alignSelf === 'middle' ? 0.5 : 1; const delta = maxWidth - (item.getLayoutRect().width + item.layoutPaddingLeft + item.layoutPaddingRight); item.setLayoutStartPosition({ @@ -198,7 +198,7 @@ function layoutTopBottomStartOrMiddleItems( } const pos = item.getLayoutStartPoint(); - const ratio = item.alignSelf === 'center' ? 0.5 : 1; + const ratio = item.alignSelf === 'middle' ? 0.5 : 1; const delta = maxHeight - (item.getLayoutRect().height + item.layoutPaddingTop + item.layoutPaddingBottom); item.setLayoutStartPosition({ diff --git a/packages/vchart/src/typings/layout.ts b/packages/vchart/src/typings/layout.ts index 2e318833df..a31b60230c 100644 --- a/packages/vchart/src/typings/layout.ts +++ b/packages/vchart/src/typings/layout.ts @@ -40,4 +40,4 @@ export type ILayoutOrientPadding = { /** 布局 padding的配置 */ export type ILayoutPaddingSpec = ILayoutOrientPadding | ILayoutNumber | ILayoutNumber[]; -export type ILayoutAlignSelf = 'start' | 'end' | 'center'; +export type ILayoutAlignSelf = 'start' | 'end' | 'middle'; From 968a805e4871caf25279581c2b94a026a20d401c Mon Sep 17 00:00:00 2001 From: xile611 Date: Sun, 21 Jan 2024 16:41:43 +0800 Subject: [PATCH 15/25] docs: update docs of alignSelf --- docs/assets/examples/en/layout/align-self.md | 135 +++++++++++++++++++ docs/assets/examples/menu.json | 7 + docs/assets/examples/zh/layout/align-self.md | 135 +++++++++++++++++++ docs/assets/option/en/common/layout-item.md | 11 ++ docs/assets/option/zh/common/layout-item.md | 11 ++ packages/vchart/src/layout/interface.ts | 2 +- 6 files changed, 300 insertions(+), 1 deletion(-) create mode 100644 docs/assets/examples/en/layout/align-self.md create mode 100644 docs/assets/examples/zh/layout/align-self.md diff --git a/docs/assets/examples/en/layout/align-self.md b/docs/assets/examples/en/layout/align-self.md new file mode 100644 index 0000000000..b1f2b99995 --- /dev/null +++ b/docs/assets/examples/en/layout/align-self.md @@ -0,0 +1,135 @@ +--- +category: examples +group: layout +title: 行内元素对齐配置 +order: 37-3 +cover: +option: pieChart#layout +--- + +# 行内元素对齐配置 + +在图表中,行内布局的元素,可以通过`alignSelf`调整行内对齐方式。 + +## 关键配置 + +- layoutType: 'normal-inline',行内布局类型。 +- alignSelf: 'end',调整行内对齐方式。 + +## 代码演示 + +```javascript livedemo +const spec = { + type: 'common', + data: [ + { + id: 'id0', + values: [ + { type: '0~29', value: '126.04' }, + { type: '30~59', value: '128.77' }, + { type: '60~', value: '77.09' } + ] + }, + { + id: 'id1', + values: [ + { type: '0~9', value: '39.12' }, + { type: '10~19', value: '43.01' }, + { type: '20~29', value: '43.91' }, + { type: '30~39', value: '45.4' }, + { type: '40~49', value: '40.89' }, + { type: '50~59', value: '42.48' }, + { type: '60~69', value: '39.63' }, + { type: '70~79', value: '25.17' }, + { type: '80 and over', value: '12.29' } + ] + } + ], + series: [ + { + type: 'pie', + dataIndex: 0, + outerRadius: 0.65, + innerRadius: 0, + valueField: 'value', + categoryField: 'type', + label: { + position: 'inside', + visible: true, + style: { + fill: 'white' + } + }, + pie: { + style: { + stroke: '#ffffff', + lineWidth: 2 + } + } + }, + { + type: 'pie', + dataIndex: 1, + outerRadius: 0.8, + innerRadius: 0.67, + valueField: 'value', + categoryField: 'type', + label: { + visible: true + }, + pie: { + style: { + stroke: '#ffffff', + lineWidth: 2 + } + } + } + ], + color: ['#98abc5', '#8a89a6', '#7b6888', '#6b486b', '#a05d56', '#d0743c', '#ff8c00'], + title: { + visible: true, + text: 'Population Distribution by Age in the United States, 2021 (in millions)', + textStyle: { + fontFamily: 'Times New Roman' + } + }, + legends: [ + { + visible: true, + title: { + visible: true, + text: 'Inner' + }, + orient: 'right', + layoutType: 'normal-inline', + position: 'middle', + alignSelf: 'end', + maxHeight: 100, + data: (data, colorScale, globalScale) => { + return data.slice(0, 3); + } + }, + { + visible: true, + orient: 'right', + layoutType: 'normal-inline', + position: 'middle', + alignSelf: 'end', + title: { + visible: true, + text: 'Outter' + }, + maxHeight: 100, + data: (data, colorScale, globalScale) => { + return data.slice(3); + } + } + ] +}; + +const vchart = new VChart(spec, { dom: CONTAINER_ID }); +vchart.renderAsync(); + +// Just for the convenience of console debugging, DO NOT COPY! +window['vchart'] = vchart; +``` diff --git a/docs/assets/examples/menu.json b/docs/assets/examples/menu.json index 85483a4fd5..ddcdbc0da2 100644 --- a/docs/assets/examples/menu.json +++ b/docs/assets/examples/menu.json @@ -2127,6 +2127,13 @@ "zh": "行列布局", "en": "Row and Column Layout" } + }, + { + "path": "align-self", + "title": { + "zh": "行列布局", + "en": "Row and Column Layout" + } } ] }, diff --git a/docs/assets/examples/zh/layout/align-self.md b/docs/assets/examples/zh/layout/align-self.md new file mode 100644 index 0000000000..b1f2b99995 --- /dev/null +++ b/docs/assets/examples/zh/layout/align-self.md @@ -0,0 +1,135 @@ +--- +category: examples +group: layout +title: 行内元素对齐配置 +order: 37-3 +cover: +option: pieChart#layout +--- + +# 行内元素对齐配置 + +在图表中,行内布局的元素,可以通过`alignSelf`调整行内对齐方式。 + +## 关键配置 + +- layoutType: 'normal-inline',行内布局类型。 +- alignSelf: 'end',调整行内对齐方式。 + +## 代码演示 + +```javascript livedemo +const spec = { + type: 'common', + data: [ + { + id: 'id0', + values: [ + { type: '0~29', value: '126.04' }, + { type: '30~59', value: '128.77' }, + { type: '60~', value: '77.09' } + ] + }, + { + id: 'id1', + values: [ + { type: '0~9', value: '39.12' }, + { type: '10~19', value: '43.01' }, + { type: '20~29', value: '43.91' }, + { type: '30~39', value: '45.4' }, + { type: '40~49', value: '40.89' }, + { type: '50~59', value: '42.48' }, + { type: '60~69', value: '39.63' }, + { type: '70~79', value: '25.17' }, + { type: '80 and over', value: '12.29' } + ] + } + ], + series: [ + { + type: 'pie', + dataIndex: 0, + outerRadius: 0.65, + innerRadius: 0, + valueField: 'value', + categoryField: 'type', + label: { + position: 'inside', + visible: true, + style: { + fill: 'white' + } + }, + pie: { + style: { + stroke: '#ffffff', + lineWidth: 2 + } + } + }, + { + type: 'pie', + dataIndex: 1, + outerRadius: 0.8, + innerRadius: 0.67, + valueField: 'value', + categoryField: 'type', + label: { + visible: true + }, + pie: { + style: { + stroke: '#ffffff', + lineWidth: 2 + } + } + } + ], + color: ['#98abc5', '#8a89a6', '#7b6888', '#6b486b', '#a05d56', '#d0743c', '#ff8c00'], + title: { + visible: true, + text: 'Population Distribution by Age in the United States, 2021 (in millions)', + textStyle: { + fontFamily: 'Times New Roman' + } + }, + legends: [ + { + visible: true, + title: { + visible: true, + text: 'Inner' + }, + orient: 'right', + layoutType: 'normal-inline', + position: 'middle', + alignSelf: 'end', + maxHeight: 100, + data: (data, colorScale, globalScale) => { + return data.slice(0, 3); + } + }, + { + visible: true, + orient: 'right', + layoutType: 'normal-inline', + position: 'middle', + alignSelf: 'end', + title: { + visible: true, + text: 'Outter' + }, + maxHeight: 100, + data: (data, colorScale, globalScale) => { + return data.slice(3); + } + } + ] +}; + +const vchart = new VChart(spec, { dom: CONTAINER_ID }); +vchart.renderAsync(); + +// Just for the convenience of console debugging, DO NOT COPY! +window['vchart'] = vchart; +``` diff --git a/docs/assets/option/en/common/layout-item.md b/docs/assets/option/en/common/layout-item.md index be80d69747..11acaf1893 100644 --- a/docs/assets/option/en/common/layout-item.md +++ b/docs/assets/option/en/common/layout-item.md @@ -31,6 +31,17 @@ Module layout position. Available positions: {{ /if }} +#${prefix} alignSelf('start' | 'end' | 'middle') = 'start' + +Starting from version 1.8.9, + +For elements with a layout type of 'normal-inline', set the alignment of inline elements as follows: + +- For elements at the top, 'start' - align to the top; 'end' - align to the bottom; 'middle' - align to the center +- For elements at the bottom, 'start' - align to the bottom; 'end' - align to the top; 'middle' - align to the center +- For elements on the left, 'start' - align to the left; 'end' - align to the right; 'middle' - align to the center +- For elements on the right, 'start' - align to the right; 'end' - align to the left; 'middle' - align to the center + #${prefix} padding(ILayoutNumber|Array|Object) = 0 Layout spacing configuration (four directions: up, down, left, and right) for the module. It supports non-object configuration, array configuration, and object configuration. diff --git a/docs/assets/option/zh/common/layout-item.md b/docs/assets/option/zh/common/layout-item.md index 8173a65f07..395020cc35 100644 --- a/docs/assets/option/zh/common/layout-item.md +++ b/docs/assets/option/zh/common/layout-item.md @@ -31,6 +31,17 @@ {{ /if }} +#${prefix} alignSelf('start' | 'end' | 'middle') = 'start' + +从 1.8.9 版本开始支持, + +对于布局类型为`normal-inline`的元素,设置行内元素的对齐方式: + +- 顶部的元素,'start' - 顶部对齐;'end' - '底部对齐'; 'middle' - 居中对齐 +- 底部的元素,'start' - 底部对齐;'end' - '顶部对齐'; 'middle' - 居中对齐 +- 左侧的元素,'start' - 左侧对齐;'end' - '右侧对齐'; 'middle' - 居中对齐 +- 右侧的元素,'start' - 右侧对齐;'end' - '左侧对齐'; 'middle' - 居中对齐 + #${prefix} padding(ILayoutNumber|Array|Object) = 0 模块的布局间距配置(上下左右四个方向),支持非对象配置、数组配置与对象配置。 diff --git a/packages/vchart/src/layout/interface.ts b/packages/vchart/src/layout/interface.ts index e0a962bb1d..73198909f0 100644 --- a/packages/vchart/src/layout/interface.ts +++ b/packages/vchart/src/layout/interface.ts @@ -174,7 +174,7 @@ export interface ILayoutItemSpec { * 左侧的inline元素,'start' - 左侧对齐;'end' - '右侧对齐'; 'middle' - 居中对齐 * 右侧的inline元素,'start' - 右侧对齐;'end' - '左侧对齐'; 'middle' - 居中对齐 */ - alignSelf?: 'start' | 'end' | 'center'; + alignSelf?: 'start' | 'end' | 'middle'; // 基础的布局配置 /** 模块布局位置 */ From 322deb3ae07c632585f39aa2e91a9f90ae0ee983 Mon Sep 17 00:00:00 2001 From: xile611 Date: Sun, 21 Jan 2024 17:25:18 +0800 Subject: [PATCH 16/25] fix: support `alignSelf` in `position:end` elements --- docs/assets/examples/zh/layout/align-self.md | 20 +- docs/assets/option/en/common/layout-item.md | 8 +- packages/vchart/src/layout/util.ts | 287 +++++++++---------- 3 files changed, 155 insertions(+), 160 deletions(-) diff --git a/docs/assets/examples/zh/layout/align-self.md b/docs/assets/examples/zh/layout/align-self.md index b1f2b99995..9292c99c4a 100644 --- a/docs/assets/examples/zh/layout/align-self.md +++ b/docs/assets/examples/zh/layout/align-self.md @@ -100,10 +100,10 @@ const spec = { visible: true, text: 'Inner' }, - orient: 'right', + orient: 'bottom', layoutType: 'normal-inline', - position: 'middle', - alignSelf: 'end', + position: 'start', + // alignSelf: 'end', maxHeight: 100, data: (data, colorScale, globalScale) => { return data.slice(0, 3); @@ -111,14 +111,14 @@ const spec = { }, { visible: true, - orient: 'right', + orient: 'bottom', layoutType: 'normal-inline', - position: 'middle', - alignSelf: 'end', - title: { - visible: true, - text: 'Outter' - }, + position: 'start', + // alignSelf: 'end', + // title: { + // visible: true, + // text: 'Outter' + // }, maxHeight: 100, data: (data, colorScale, globalScale) => { return data.slice(3); diff --git a/docs/assets/option/en/common/layout-item.md b/docs/assets/option/en/common/layout-item.md index 11acaf1893..d161a6b1c6 100644 --- a/docs/assets/option/en/common/layout-item.md +++ b/docs/assets/option/en/common/layout-item.md @@ -37,10 +37,10 @@ Starting from version 1.8.9, For elements with a layout type of 'normal-inline', set the alignment of inline elements as follows: -- For elements at the top, 'start' - align to the top; 'end' - align to the bottom; 'middle' - align to the center -- For elements at the bottom, 'start' - align to the bottom; 'end' - align to the top; 'middle' - align to the center -- For elements on the left, 'start' - align to the left; 'end' - align to the right; 'middle' - align to the center -- For elements on the right, 'start' - align to the right; 'end' - align to the left; 'middle' - align to the center +- For elements at the top, 'start' - align to the top; 'end' - align to the bottom; 'middle' - align to the middle +- For elements at the bottom, 'start' - align to the bottom; 'end' - align to the top; 'middle' - align to the middle +- For elements on the left, 'start' - align to the left; 'end' - align to the right; 'middle' - align to the middle +- For elements on the right, 'start' - align to the right; 'end' - align to the left; 'middle' - align to the middle #${prefix} padding(ILayoutNumber|Array|Object) = 0 diff --git a/packages/vchart/src/layout/util.ts b/packages/vchart/src/layout/util.ts index 0f8a8f31a1..d0f1f67786 100644 --- a/packages/vchart/src/layout/util.ts +++ b/packages/vchart/src/layout/util.ts @@ -56,6 +56,40 @@ function adjustItemsToCenter(allItems: ILayoutItem[][], isVertical: boolean, con } } +function alignSelfOfItems(allItems: ILayoutItem[][], isVertical: boolean, maxSizes: number[], sign: number) { + let maxSize: number; + + allItems.forEach((lineItems: ILayoutItem[], index: number) => { + if (lineItems.length > 1) { + maxSize = maxSizes[index]; + + lineItems.forEach(item => { + if (!item.alignSelf || item.alignSelf === 'start') { + return; + } + + const pos = item.getLayoutStartPoint(); + const ratio = item.alignSelf === 'middle' ? 0.5 : 1; + const delta = isVertical + ? maxSize - (item.getLayoutRect().width + item.layoutPaddingLeft + item.layoutPaddingRight) + : maxSize - (item.getLayoutRect().height + item.layoutPaddingTop + item.layoutPaddingBottom); + + if (isVertical) { + item.setLayoutStartPosition({ + x: pos.x + sign * delta * ratio, + y: pos.y + }); + } else { + item.setLayoutStartPosition({ + x: pos.x, + y: pos.y + sign * delta * ratio + }); + } + }); + } + }); +} + function layoutLeftRightStartOrMiddleItems( items: ILayoutItem[], layout: Layout, @@ -106,30 +140,65 @@ function layoutLeftRightStartOrMiddleItems( maxWidths.push(maxWidth); allItems.push(singleLineItems); - allItems.forEach((lineItems: ILayoutItem[], index: number) => { - if (lineItems.length > 1) { - maxWidth = maxWidths[index]; + alignSelfOfItems(allItems, true, maxWidths, xSign); - lineItems.forEach(item => { - if (!item.alignSelf || item.alignSelf === 'start') { - return; - } + if (isMiddle) { + adjustItemsToCenter(allItems, true, limitHeight); + } - const pos = item.getLayoutStartPoint(); - const ratio = item.alignSelf === 'middle' ? 0.5 : 1; - const delta = maxWidth - (item.getLayoutRect().width + item.layoutPaddingLeft + item.layoutPaddingRight); + if (isRight) { + layout.rightCurrent = preX + xSign * maxWidth; + } else { + layout.leftCurrent = preX + xSign * maxWidth; + } + } +} - item.setLayoutStartPosition({ - x: pos.x + xSign * delta * ratio, - y: pos.y - }); +function layoutLeftRightEndItems(items: ILayoutItem[], layout: Layout, limitWidth: number, position: 'left' | 'right') { + if (items.length) { + let maxWidth = 0; + const isRight = position === 'right'; + const xSign = isRight ? -1 : 1; + let preX = isRight ? layout.rightCurrent : layout.leftCurrent; + let preBottom = layout.bottomCurrent; + + const allItems: ILayoutItem[][] = []; + let singleLineItems: ILayoutItem[] = []; + const maxWidths: number[] = []; + items.forEach(item => { + const layoutRect = layout.getItemComputeLayoutRect(item); + const rect = item.computeBoundsInRect(layoutRect); + item.setLayoutRect(rect); + const itemTotalHeight = rect.height + item.layoutPaddingTop + item.layoutPaddingBottom; + const itemTotalWidth = rect.width + item.layoutPaddingLeft + item.layoutPaddingRight; + const itemOffsetX = isRight ? -rect.width - item.layoutPaddingRight : item.layoutPaddingLeft; + + if (preBottom < itemTotalHeight && singleLineItems.length) { + maxWidths.push(maxWidth); + preX += xSign * maxWidth; + maxWidth = itemTotalWidth; + preBottom = layout.bottomCurrent; + + item.setLayoutStartPosition({ + x: preX + item.layoutOffsetX + itemOffsetX, + y: preBottom + item.layoutOffsetY - rect.height - item.layoutPaddingBottom }); + allItems.push(singleLineItems); + singleLineItems = [item]; + } else { + item.setLayoutStartPosition({ + x: preX + item.layoutOffsetX + itemOffsetX, + y: preBottom + item.layoutOffsetY - rect.height - item.layoutPaddingBottom + }); + maxWidth = Math.max(maxWidth, itemTotalWidth); + preBottom -= itemTotalHeight; + singleLineItems.push(item); } }); + maxWidths.push(maxWidth); + allItems.push(singleLineItems); - if (isMiddle) { - adjustItemsToCenter(allItems, true, limitHeight); - } + alignSelfOfItems(allItems, true, maxWidths, xSign); if (isRight) { layout.rightCurrent = preX + xSign * maxWidth; @@ -188,26 +257,7 @@ function layoutTopBottomStartOrMiddleItems( maxHeights.push(maxHeight); allItems.push(singleLineItems); - allItems.forEach((lineItems: ILayoutItem[], index: number) => { - if (lineItems.length > 1) { - maxHeight = maxHeights[index]; - - lineItems.forEach(item => { - if (!item.alignSelf || item.alignSelf === 'start') { - return; - } - - const pos = item.getLayoutStartPoint(); - const ratio = item.alignSelf === 'middle' ? 0.5 : 1; - const delta = maxHeight - (item.getLayoutRect().height + item.layoutPaddingTop + item.layoutPaddingBottom); - - item.setLayoutStartPosition({ - x: pos.x, - y: pos.y + ySign * delta * ratio - }); - }); - } - }); + alignSelfOfItems(allItems, false, maxHeights, ySign); if (isMiddle) { adjustItemsToCenter(allItems, false, limitWidth); @@ -221,45 +271,72 @@ function layoutTopBottomStartOrMiddleItems( } } -export function layoutLeftInlineItems(items: ILayoutItem[], layout: Layout, limitHeight: number) { - const { startItems, middleItems, endItems } = getPositionItems(items); - if (startItems.length) { - layoutLeftRightStartOrMiddleItems(startItems, layout, limitHeight, false, 'left'); - } +function layoutTopBottomEndItems(items: ILayoutItem[], layout: Layout, limitWidth: number, position: 'top' | 'bottom') { + if (items.length) { + const isTop = position === 'top'; + const ySign = isTop ? 1 : -1; + let maxHeight = 0; + let preRight = layout.rightCurrent; + let preY = isTop ? layout.topCurrent : layout.bottomCurrent; - if (middleItems.length) { - layoutLeftRightStartOrMiddleItems(middleItems, layout, limitHeight, true, 'left'); - } + const allItems: ILayoutItem[][] = []; + let singleLineItems: ILayoutItem[] = []; + const maxHeights: number[] = []; - if (endItems.length) { - let maxWidth = 0; - let preLeft = layout.leftCurrent; - let preBottom = layout.bottomCurrent; - endItems.forEach(item => { + items.forEach(item => { const layoutRect = layout.getItemComputeLayoutRect(item); const rect = item.computeBoundsInRect(layoutRect); item.setLayoutRect(rect); const itemTotalHeight = rect.height + item.layoutPaddingTop + item.layoutPaddingBottom; const itemTotalWidth = rect.width + item.layoutPaddingLeft + item.layoutPaddingRight; + const itemOffsetY = isTop ? item.layoutPaddingTop : -rect.height - item.layoutPaddingBottom; + + if (preRight < itemTotalWidth && singleLineItems.length) { + preRight = layout.rightCurrent; + preY += ySign * maxHeight; + maxHeight = itemTotalHeight; - if (preBottom < itemTotalHeight) { - preLeft += maxWidth; - maxWidth = itemTotalWidth; - preBottom = layout.bottomCurrent; item.setLayoutStartPosition({ - x: preLeft + item.layoutOffsetX + item.layoutPaddingLeft, - y: preBottom + item.layoutOffsetY - rect.height - item.layoutPaddingBottom + x: layout.rightCurrent + item.layoutOffsetX - rect.width - item.layoutPaddingRight, + y: preY + item.layoutOffsetY + itemOffsetY }); + allItems.push(singleLineItems); + singleLineItems = [item]; } else { + singleLineItems.push(item); item.setLayoutStartPosition({ - x: preLeft + item.layoutOffsetX + item.layoutPaddingLeft, - y: preBottom + item.layoutOffsetY - rect.height - item.layoutPaddingBottom + x: preRight + item.layoutOffsetX - rect.width - item.layoutPaddingRight, + y: preY + item.layoutOffsetY + itemOffsetY }); - maxWidth = Math.max(maxWidth, itemTotalWidth); - preBottom -= itemTotalHeight; + maxHeight = Math.max(maxHeight, itemTotalHeight); + preRight -= itemTotalWidth; } }); - layout.leftCurrent = preLeft + maxWidth; + maxHeights.push(maxHeight); + allItems.push(singleLineItems); + + alignSelfOfItems(allItems, false, maxHeights, ySign); + + if (isTop) { + layout.topCurrent = preY + ySign * maxHeight; + } else { + layout.bottomCurrent = preY + ySign * maxHeight; + } + } +} + +export function layoutLeftInlineItems(items: ILayoutItem[], layout: Layout, limitHeight: number) { + const { startItems, middleItems, endItems } = getPositionItems(items); + if (startItems.length) { + layoutLeftRightStartOrMiddleItems(startItems, layout, limitHeight, false, 'left'); + } + + if (middleItems.length) { + layoutLeftRightStartOrMiddleItems(middleItems, layout, limitHeight, true, 'left'); + } + + if (endItems.length) { + layoutLeftRightEndItems(endItems, layout, limitHeight, 'left'); } } @@ -275,33 +352,7 @@ export function layoutRightInlineItems(items: ILayoutItem[], layout: Layout, lim } if (endItems.length) { - let maxWidth = 0; - let preRight = layout.rightCurrent; - let preBottom = layout.bottomCurrent; - endItems.forEach(item => { - const layoutRect = layout.getItemComputeLayoutRect(item); - const rect = item.computeBoundsInRect(layoutRect); - item.setLayoutRect(rect); - const itemTotalHeight = rect.height + item.layoutPaddingTop + item.layoutPaddingBottom; - const itemTotalWidth = rect.width + item.layoutPaddingLeft + item.layoutPaddingRight; - if (preBottom < itemTotalHeight) { - preRight -= maxWidth; - maxWidth = itemTotalWidth; - preBottom = layout.bottomCurrent; - item.setLayoutStartPosition({ - x: preRight + item.layoutOffsetX - rect.width - item.layoutPaddingRight, - y: preBottom + item.layoutOffsetY - rect.height - item.layoutPaddingBottom - }); - } else { - item.setLayoutStartPosition({ - x: preRight + item.layoutOffsetX - rect.width - item.layoutPaddingRight, - y: preBottom + item.layoutOffsetY - rect.height - item.layoutPaddingBottom - }); - maxWidth = Math.max(maxWidth, itemTotalWidth); - preBottom -= itemTotalHeight; - } - }); - layout.rightCurrent = preRight - maxWidth; + layoutLeftRightEndItems(endItems, layout, limitHeight, 'right'); } } @@ -317,35 +368,7 @@ export function layoutTopInlineItems(items: ILayoutItem[], layout: Layout, limit } if (endItems.length) { - let maxHeight = 0; - - let preTop = layout.topCurrent; - let preRight = layout.rightCurrent; - endItems.forEach(item => { - const layoutRect = layout.getItemComputeLayoutRect(item); - const rect = item.computeBoundsInRect(layoutRect); - item.setLayoutRect(rect); - const itemTotalHeight = rect.height + item.layoutPaddingTop + item.layoutPaddingBottom; - const itemTotalWidth = rect.width + item.layoutPaddingLeft + item.layoutPaddingRight; - if (preRight < itemTotalWidth) { - preRight = layout.rightCurrent; - preTop += maxHeight; - maxHeight = itemTotalHeight; - - item.setLayoutStartPosition({ - x: layout.rightCurrent + item.layoutOffsetX - rect.width - item.layoutPaddingRight, - y: preTop + item.layoutOffsetY + item.layoutPaddingTop - }); - } else { - item.setLayoutStartPosition({ - x: preRight + item.layoutOffsetX - rect.width - item.layoutPaddingRight, - y: preTop + item.layoutOffsetY + item.layoutPaddingTop - }); - maxHeight = Math.max(maxHeight, itemTotalHeight); - preRight -= itemTotalWidth; - } - }); - layout.topCurrent = preTop + maxHeight; + layoutTopBottomEndItems(endItems, layout, limitWidth, 'top'); } } @@ -361,34 +384,6 @@ export function layoutBottomInlineItems(items: ILayoutItem[], layout: Layout, li } if (endItems.length) { - let maxHeight = 0; - let preBottom = layout.bottomCurrent; - let preRight = layout.rightCurrent; - // 末尾的,从右往左布局 - endItems.forEach(item => { - const layoutRect = layout.getItemComputeLayoutRect(item); - const rect = item.computeBoundsInRect(layoutRect); - item.setLayoutRect(rect); - const itemTotalHeight = rect.height + item.layoutPaddingTop + item.layoutPaddingBottom; - const itemTotalWidth = rect.width + item.layoutPaddingLeft + item.layoutPaddingRight; - if (preRight < itemTotalWidth) { - preRight = layout.rightCurrent; - preBottom -= maxHeight; - maxHeight = itemTotalHeight; - - item.setLayoutStartPosition({ - x: layout.rightCurrent + item.layoutOffsetX - rect.width - item.layoutPaddingRight, - y: preBottom + item.layoutOffsetY - rect.height - item.layoutPaddingBottom - }); - } else { - item.setLayoutStartPosition({ - x: preRight + item.layoutOffsetX - rect.width - item.layoutPaddingRight, - y: preBottom + item.layoutOffsetY - rect.height - item.layoutPaddingBottom - }); - maxHeight = Math.max(maxHeight, itemTotalHeight); - preRight -= itemTotalWidth; - } - }); - layout.bottomCurrent = preBottom - maxHeight; + layoutTopBottomEndItems(endItems, layout, limitWidth, 'bottom'); } } From fcc75063d9c9cd5970ec77d3a45fe66368765dc0 Mon Sep 17 00:00:00 2001 From: xile611 Date: Mon, 22 Jan 2024 11:23:38 +0800 Subject: [PATCH 17/25] fix: remove `alignSelf` in layout-item options --- packages/vchart/src/layout/interface.ts | 1 - packages/vchart/src/layout/layout-item.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/packages/vchart/src/layout/interface.ts b/packages/vchart/src/layout/interface.ts index 73198909f0..eb02c40d27 100644 --- a/packages/vchart/src/layout/interface.ts +++ b/packages/vchart/src/layout/interface.ts @@ -228,7 +228,6 @@ export interface ILayoutItemInitOption { layoutType: ILayoutType; layoutLevel: number; layoutOrient?: IOrientType; - alignSelf?: ILayoutAlignSelf; transformLayoutRect?: (rect: ILayoutRect) => ILayoutRect; transformLayoutPosition?: (pos: Partial) => Partial; } diff --git a/packages/vchart/src/layout/layout-item.ts b/packages/vchart/src/layout/layout-item.ts index 7a748fee75..2ce0f459d1 100644 --- a/packages/vchart/src/layout/layout-item.ts +++ b/packages/vchart/src/layout/layout-item.ts @@ -121,7 +121,6 @@ export class LayoutItem implements ILayoutItem { this._option = option; this.layoutLevel = option.layoutLevel; this.layoutType = option.layoutType; - this.alignSelf = option.alignSelf; if (option.layoutOrient) { this.layoutOrient = option.layoutOrient; } From cb85644a0a160c285071e8ed1057d5eb1714d3de Mon Sep 17 00:00:00 2001 From: zhouxinyu Date: Mon, 22 Jan 2024 11:47:03 +0800 Subject: [PATCH 18/25] feat: support supportsTouchEvents and supportsPointerEvents config --- .../@visactor/vchart/develop_2024-01-22-03-46.json | 10 ++++++++++ packages/vchart/src/compile/interface/compiler.ts | 10 ++++++++++ 2 files changed, 20 insertions(+) create mode 100644 common/changes/@visactor/vchart/develop_2024-01-22-03-46.json diff --git a/common/changes/@visactor/vchart/develop_2024-01-22-03-46.json b/common/changes/@visactor/vchart/develop_2024-01-22-03-46.json new file mode 100644 index 0000000000..65b23ad951 --- /dev/null +++ b/common/changes/@visactor/vchart/develop_2024-01-22-03-46.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@visactor/vchart", + "comment": "feat: support supportsTouchEvents and supportsPointerEvents config", + "type": "none" + } + ], + "packageName": "@visactor/vchart" +} \ No newline at end of file diff --git a/packages/vchart/src/compile/interface/compiler.ts b/packages/vchart/src/compile/interface/compiler.ts index 113a2d0ba2..46478c5c3b 100644 --- a/packages/vchart/src/compile/interface/compiler.ts +++ b/packages/vchart/src/compile/interface/compiler.ts @@ -111,6 +111,16 @@ export interface IRenderOption { * @since 1.8.3 */ enableHtmlAttribute?: boolean; + /** + * @since 1.8.8 + * 是否支持touch事件 + */ + supportsTouchEvents?: boolean; + /** + * @since 1.8.8 + * 是否支持pointer事件 + */ + supportsPointerEvents?: boolean; } export type CompilerListenerParameters = { From 1eb3f3ae616d4da427667875feba95618719a971 Mon Sep 17 00:00:00 2001 From: kkxxkk2019 Date: Mon, 22 Jan 2024 13:58:59 +0800 Subject: [PATCH 19/25] fix: fix the bugs of axis's onZero property, fixed #2098,#2099 --- .../src/component/axis/cartesian/axis.ts | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/packages/vchart/src/component/axis/cartesian/axis.ts b/packages/vchart/src/component/axis/cartesian/axis.ts index 69be333821..6ae93442a4 100644 --- a/packages/vchart/src/component/axis/cartesian/axis.ts +++ b/packages/vchart/src/component/axis/cartesian/axis.ts @@ -3,7 +3,7 @@ import type { IBounds, IBoundsLike, Maybe } from '@visactor/vutils'; import type { IEffect, IModelInitOption, IModelSpecInfo } from '../../../model/interface'; import type { ICartesianSeries } from '../../../series/interface'; import type { IRegion } from '../../../region/interface'; -import type { ICartesianAxisCommonSpec, IAxisHelper, ICartesianAxisCommonTheme } from './interface'; +import type { ICartesianAxisCommonSpec, IAxisHelper } from './interface'; import { isArray, isValid, isValidNumber, mergeSpec, eachSeries, isNil, isUndefined } from '../../../util'; import type { IOrientType } from '../../../typings/space'; // eslint-disable-next-line no-duplicate-imports @@ -12,15 +12,7 @@ import type { IBaseScale } from '@visactor/vscale'; // eslint-disable-next-line no-duplicate-imports import { isContinuous } from '@visactor/vscale'; import { Factory } from '../../../core/factory'; -import { - autoAxisType, - isXAxis, - getOrient, - isZAxis, - isYAxis, - getCartesianAxisInfo, - transformInverse -} from './util/common'; +import { isXAxis, getOrient, isZAxis, isYAxis, getCartesianAxisInfo, transformInverse } from './util/common'; import { ChartEvent, DEFAULT_LAYOUT_RECT_LEVEL, LayoutZIndex, USER_LAYOUT_RECT_LEVEL } from '../../../constant'; import { LayoutLevel } from '../../../constant/index'; import pluginMap from '../../../plugin/components'; @@ -776,12 +768,10 @@ export abstract class CartesianAxis { return ( - (isX ? !isXAxis(item.orient) : isXAxis(item.orient)) && + (isX ? !isXAxis(item.getOrient()) : isXAxis(item.getOrient())) && isContinuous(item.getScale().type) && - item - .getTickData() - .getLatestData() - ?.find((d: any) => d.value === 0) + item.getScale().domain()[0] <= 0 && + item.getScale().domain()[1] >= 0 ); }; const relativeAxes = axesComponents.filter(item => isValidAxis(item)); From 18c26a99726c4e440aa52745d7549c7a771f5e6d Mon Sep 17 00:00:00 2001 From: kkxxkk2019 Date: Mon, 22 Jan 2024 13:59:51 +0800 Subject: [PATCH 20/25] chore: update rush change --- .../vchart/fix-domainLine-onZero_2024-01-22-05-59.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 common/changes/@visactor/vchart/fix-domainLine-onZero_2024-01-22-05-59.json diff --git a/common/changes/@visactor/vchart/fix-domainLine-onZero_2024-01-22-05-59.json b/common/changes/@visactor/vchart/fix-domainLine-onZero_2024-01-22-05-59.json new file mode 100644 index 0000000000..770e310b94 --- /dev/null +++ b/common/changes/@visactor/vchart/fix-domainLine-onZero_2024-01-22-05-59.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@visactor/vchart", + "comment": "fix: fix the bugs of axis's onZero property, fixed #2098,#2099", + "type": "none" + } + ], + "packageName": "@visactor/vchart" +} \ No newline at end of file From 293ce7aff87fa25b296b57a93c6a96f77cbceae6 Mon Sep 17 00:00:00 2001 From: kkxxkk2019 Date: Mon, 22 Jan 2024 15:45:44 +0800 Subject: [PATCH 21/25] fix: onZero only work for axis's ticks include 0 --- packages/vchart/src/component/axis/cartesian/axis.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/vchart/src/component/axis/cartesian/axis.ts b/packages/vchart/src/component/axis/cartesian/axis.ts index 6ae93442a4..fcf23ec7a0 100644 --- a/packages/vchart/src/component/axis/cartesian/axis.ts +++ b/packages/vchart/src/component/axis/cartesian/axis.ts @@ -770,8 +770,7 @@ export abstract class CartesianAxis= 0 + item.getScale().ticks().includes(0) // 只有显示的刻度包含 0 的时候展示 ); }; const relativeAxes = axesComponents.filter(item => isValidAxis(item)); From 258d850b9705c824fcda999ae3537ab2f2b7b08e Mon Sep 17 00:00:00 2001 From: kkxxkk2019 Date: Mon, 22 Jan 2024 16:12:25 +0800 Subject: [PATCH 22/25] fix: fix the bug of onZero --- packages/vchart/src/component/axis/cartesian/axis.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/vchart/src/component/axis/cartesian/axis.ts b/packages/vchart/src/component/axis/cartesian/axis.ts index fcf23ec7a0..91a765c7dd 100644 --- a/packages/vchart/src/component/axis/cartesian/axis.ts +++ b/packages/vchart/src/component/axis/cartesian/axis.ts @@ -767,11 +767,14 @@ export abstract class CartesianAxis { - return ( - (isX ? !isXAxis(item.getOrient()) : isXAxis(item.getOrient())) && + return (isX ? !isXAxis(item.getOrient()) : isXAxis(item.getOrient())) && isContinuous(item.getScale().type) && - item.getScale().ticks().includes(0) // 只有显示的刻度包含 0 的时候展示 - ); + item.getTickData() + ? item + .getTickData() + .getLatestData() + ?.find((d: any) => d.value === 0) + : item.getScale().ticks().includes(0); }; const relativeAxes = axesComponents.filter(item => isValidAxis(item)); if (relativeAxes.length) { From 96bc877c8a5bd46080b9b916e3cf90a4168e0f37 Mon Sep 17 00:00:00 2001 From: zhouxinyu Date: Mon, 22 Jan 2024 16:18:01 +0800 Subject: [PATCH 23/25] chore: change version to 1.8.9 --- packages/vchart/src/compile/interface/compiler.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/vchart/src/compile/interface/compiler.ts b/packages/vchart/src/compile/interface/compiler.ts index 46478c5c3b..ebcd792cdd 100644 --- a/packages/vchart/src/compile/interface/compiler.ts +++ b/packages/vchart/src/compile/interface/compiler.ts @@ -112,12 +112,12 @@ export interface IRenderOption { */ enableHtmlAttribute?: boolean; /** - * @since 1.8.8 + * @since 1.8.9 * 是否支持touch事件 */ supportsTouchEvents?: boolean; /** - * @since 1.8.8 + * @since 1.8.9 * 是否支持pointer事件 */ supportsPointerEvents?: boolean; From 4fe29f63f7710bc8c89d623a6258c10a9402a08d Mon Sep 17 00:00:00 2001 From: xiaoluoHe Date: Mon, 22 Jan 2024 17:19:21 +0800 Subject: [PATCH 24/25] docs: correct the gif cover of vchart animation demo --- docs/assets/examples/zh/storytelling/bar-oneByOne-series.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/assets/examples/zh/storytelling/bar-oneByOne-series.md b/docs/assets/examples/zh/storytelling/bar-oneByOne-series.md index 33727c4414..ea39315871 100644 --- a/docs/assets/examples/zh/storytelling/bar-oneByOne-series.md +++ b/docs/assets/examples/zh/storytelling/bar-oneByOne-series.md @@ -4,7 +4,7 @@ group: storytelling title: 柱状图按系列依次入场动画 keywords: animation,bar,barChart,comparison order: 42-0 -cover: /vchart/preview/bar-oneByOne-rect_1.8.3.gif +cover: /vchart/preview/bar-oneByOne-series_1.8.3.gif option: barChart#animationAppear --- From 8b630a22e620ede91167e46f52fe8b8a1f5c2252 Mon Sep 17 00:00:00 2001 From: zhouxinyu Date: Mon, 22 Jan 2024 17:53:17 +0800 Subject: [PATCH 25/25] feat: upgrade vrender --- ...feat-upgrade-vrender_2024-01-22-09-53.json | 10 + common/config/rush/pnpm-lock.yaml | 204 +++++++++--------- docs/package.json | 6 +- packages/react-vchart/package.json | 6 +- packages/vchart/package.json | 20 +- packages/vmind/package.json | 8 +- packages/vutils-extension/package.json | 4 +- tools/story-player/package.json | 6 +- 8 files changed, 137 insertions(+), 127 deletions(-) create mode 100644 common/changes/@visactor/vchart/feat-upgrade-vrender_2024-01-22-09-53.json diff --git a/common/changes/@visactor/vchart/feat-upgrade-vrender_2024-01-22-09-53.json b/common/changes/@visactor/vchart/feat-upgrade-vrender_2024-01-22-09-53.json new file mode 100644 index 0000000000..d05062e7a2 --- /dev/null +++ b/common/changes/@visactor/vchart/feat-upgrade-vrender_2024-01-22-09-53.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@visactor/vchart", + "comment": "feat: upgrade vrender", + "type": "none" + } + ], + "packageName": "@visactor/vchart" +} \ No newline at end of file diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 337b79b7b5..dde3f7595f 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -17,10 +17,10 @@ importers: '@types/react-dom': ^18.0.0 '@visactor/vchart': workspace:1.8.7 '@visactor/vchart-theme': ~1.6.6 - '@visactor/vgrammar': 0.10.10 + '@visactor/vgrammar': 0.10.11 '@visactor/vmind': workspace:1.2.1 - '@visactor/vrender': 0.17.16 - '@visactor/vrender-kits': 0.17.16 + '@visactor/vrender': 0.17.17 + '@visactor/vrender-kits': 0.17.17 '@visactor/vutils': ~0.17.3 '@vitejs/plugin-react': 3.1.0 axios: ^1.4.0 @@ -46,10 +46,10 @@ importers: '@arco-design/web-react': 2.46.1_yok4whjnfjlfyjmdmcaku5uzjq '@visactor/vchart': link:../packages/vchart '@visactor/vchart-theme': 1.6.9 - '@visactor/vgrammar': 0.10.10 + '@visactor/vgrammar': 0.10.11 '@visactor/vmind': link:../packages/vmind - '@visactor/vrender': 0.17.16 - '@visactor/vrender-kits': 0.17.16 + '@visactor/vrender': 0.17.17 + '@visactor/vrender-kits': 0.17.17 '@visactor/vutils': 0.17.3 axios: 1.6.3 highlight.js: 11.9.0 @@ -128,9 +128,9 @@ importers: '@types/react-dom': ^18.0.0 '@types/react-is': ^17.0.3 '@visactor/vchart': workspace:1.8.7 - '@visactor/vgrammar-core': 0.10.10 - '@visactor/vrender-core': 0.17.16 - '@visactor/vrender-kits': 0.17.16 + '@visactor/vgrammar-core': 0.10.11 + '@visactor/vrender-core': 0.17.17 + '@visactor/vrender-kits': 0.17.17 '@visactor/vutils': ~0.17.3 '@vitejs/plugin-react': 3.1.0 eslint: ~8.18.0 @@ -150,9 +150,9 @@ importers: vite: 3.2.6 dependencies: '@visactor/vchart': link:../vchart - '@visactor/vgrammar-core': 0.10.10 - '@visactor/vrender-core': 0.17.16 - '@visactor/vrender-kits': 0.17.16 + '@visactor/vgrammar-core': 0.10.11 + '@visactor/vrender-core': 0.17.17 + '@visactor/vrender-kits': 0.17.17 '@visactor/vutils': 0.17.3 react-is: 18.2.0 devDependencies: @@ -285,16 +285,16 @@ importers: '@types/node': '*' '@types/offscreencanvas': 2019.6.4 '@visactor/vdataset': ~0.17.3 - '@visactor/vgrammar-core': 0.10.10 - '@visactor/vgrammar-hierarchy': 0.10.10 - '@visactor/vgrammar-projection': 0.10.10 - '@visactor/vgrammar-sankey': 0.10.10 - '@visactor/vgrammar-util': 0.10.10 - '@visactor/vgrammar-wordcloud': 0.10.10 - '@visactor/vgrammar-wordcloud-shape': 0.10.10 - '@visactor/vrender-components': 0.17.16 - '@visactor/vrender-core': 0.17.16 - '@visactor/vrender-kits': 0.17.16 + '@visactor/vgrammar-core': 0.10.11 + '@visactor/vgrammar-hierarchy': 0.10.11 + '@visactor/vgrammar-projection': 0.10.11 + '@visactor/vgrammar-sankey': 0.10.11 + '@visactor/vgrammar-util': 0.10.11 + '@visactor/vgrammar-wordcloud': 0.10.11 + '@visactor/vgrammar-wordcloud-shape': 0.10.11 + '@visactor/vrender-components': 0.17.17 + '@visactor/vrender-core': 0.17.17 + '@visactor/vrender-kits': 0.17.17 '@visactor/vscale': ~0.17.3 '@visactor/vutils': ~0.17.3 '@visactor/vutils-extension': workspace:1.8.7 @@ -330,16 +330,16 @@ importers: vite: 3.2.6 dependencies: '@visactor/vdataset': 0.17.3 - '@visactor/vgrammar-core': 0.10.10 - '@visactor/vgrammar-hierarchy': 0.10.10 - '@visactor/vgrammar-projection': 0.10.10 - '@visactor/vgrammar-sankey': 0.10.10 - '@visactor/vgrammar-util': 0.10.10 - '@visactor/vgrammar-wordcloud': 0.10.10 - '@visactor/vgrammar-wordcloud-shape': 0.10.10 - '@visactor/vrender-components': 0.17.16 - '@visactor/vrender-core': 0.17.16 - '@visactor/vrender-kits': 0.17.16 + '@visactor/vgrammar-core': 0.10.11 + '@visactor/vgrammar-hierarchy': 0.10.11 + '@visactor/vgrammar-projection': 0.10.11 + '@visactor/vgrammar-sankey': 0.10.11 + '@visactor/vgrammar-util': 0.10.11 + '@visactor/vgrammar-wordcloud': 0.10.11 + '@visactor/vgrammar-wordcloud-shape': 0.10.11 + '@visactor/vrender-components': 0.17.17 + '@visactor/vrender-core': 0.17.17 + '@visactor/vrender-kits': 0.17.17 '@visactor/vscale': 0.17.3 '@visactor/vutils': 0.17.3 '@visactor/vutils-extension': link:../vutils-extension @@ -444,8 +444,8 @@ importers: '@visactor/chart-advisor': 0.1.10 '@visactor/vchart': workspace:1.8.7 '@visactor/vdataset': ~0.17.3 - '@visactor/vrender-core': 0.17.16 - '@visactor/vrender-kits': 0.17.16 + '@visactor/vrender-core': 0.17.17 + '@visactor/vrender-kits': 0.17.17 '@visactor/vutils': ~0.17.3 '@visactor/vutils-extension': workspace:1.8.7 '@vitejs/plugin-react': 3.1.0 @@ -475,8 +475,8 @@ importers: dependencies: '@visactor/chart-advisor': 0.1.10 '@visactor/vdataset': 0.17.3 - '@visactor/vrender-core': 0.17.16 - '@visactor/vrender-kits': 0.17.16 + '@visactor/vrender-core': 0.17.17 + '@visactor/vrender-kits': 0.17.17 '@visactor/vutils': 0.17.3 axios: 1.6.3 dayjs: 1.11.10 @@ -530,8 +530,8 @@ importers: '@types/jest': ^26.0.0 '@types/node': '*' '@types/offscreencanvas': 2019.6.4 - '@visactor/vrender-core': 0.17.16 - '@visactor/vrender-kits': 0.17.16 + '@visactor/vrender-core': 0.17.17 + '@visactor/vrender-kits': 0.17.17 '@visactor/vscale': ~0.17.3 '@visactor/vutils': ~0.17.3 eslint: ~8.18.0 @@ -550,8 +550,8 @@ importers: typescript: 4.9.5 vite: 3.2.6 dependencies: - '@visactor/vrender-core': 0.17.16 - '@visactor/vrender-kits': 0.17.16 + '@visactor/vrender-core': 0.17.17 + '@visactor/vrender-kits': 0.17.17 '@visactor/vscale': 0.17.3 '@visactor/vutils': 0.17.3 devDependencies: @@ -796,9 +796,9 @@ importers: '@typescript-eslint/eslint-plugin': 5.30.0 '@typescript-eslint/parser': 5.30.0 '@visactor/vchart': workspace:1.8.7 - '@visactor/vrender': 0.17.16 - '@visactor/vrender-core': 0.17.16 - '@visactor/vrender-kits': 0.17.16 + '@visactor/vrender': 0.17.17 + '@visactor/vrender-core': 0.17.17 + '@visactor/vrender-kits': 0.17.17 '@visactor/vutils': ~0.17.3 cross-env: ^7.0.3 eslint: ~8.18.0 @@ -811,9 +811,9 @@ importers: vite: 3.2.6 dependencies: '@visactor/vchart': link:../../packages/vchart - '@visactor/vrender': 0.17.16 - '@visactor/vrender-core': 0.17.16 - '@visactor/vrender-kits': 0.17.16 + '@visactor/vrender': 0.17.17 + '@visactor/vrender-core': 0.17.17 + '@visactor/vrender-kits': 0.17.17 '@visactor/vutils': 0.17.3 devDependencies: '@internal/bundler': link:../bundler @@ -4711,118 +4711,118 @@ packages: topojson-client: 3.1.0 dev: false - /@visactor/vgrammar-coordinate/0.10.10: - resolution: {integrity: sha512-wua7572CBrzNYLQH7sf/rN90HAf73D2BkTevUiRqAuMaaNjmB0zddDkbsNkUf7dMQ3s9SiDkJfxvNja4heCKhQ==} + /@visactor/vgrammar-coordinate/0.10.11: + resolution: {integrity: sha512-XSUvEkaf/NQHFafmTwqoIMZicp9fF3o6NB2FDpuWrK4DI1lTuip/0RkqrC+kBAjc5erjt0em0TiITyqXpp4G6w==} dependencies: - '@visactor/vgrammar-util': 0.10.10 + '@visactor/vgrammar-util': 0.10.11 '@visactor/vutils': 0.17.3 dev: false - /@visactor/vgrammar-core/0.10.10: - resolution: {integrity: sha512-xyIutg6lpf+xP/LKKrTLbzubYvOjJY6DIodVzyYTFmHYh4f17n/J885IOY5n0E3MHPb0GosGkur/bghnYhDXfg==} + /@visactor/vgrammar-core/0.10.11: + resolution: {integrity: sha512-VL9vcLPDg1LrHl7EOx0Ga9ATsoaChKIaCGzxjrPEjWiIS5VPU9Rs0jBKP+ch8BjamAoSuqL5mKd0L/RaUBqlaA==} dependencies: '@visactor/vdataset': 0.17.3 - '@visactor/vgrammar-coordinate': 0.10.10 - '@visactor/vgrammar-util': 0.10.10 - '@visactor/vrender-components': 0.17.16 - '@visactor/vrender-core': 0.17.16 - '@visactor/vrender-kits': 0.17.16 + '@visactor/vgrammar-coordinate': 0.10.11 + '@visactor/vgrammar-util': 0.10.11 + '@visactor/vrender-components': 0.17.17 + '@visactor/vrender-core': 0.17.17 + '@visactor/vrender-kits': 0.17.17 '@visactor/vscale': 0.17.3 '@visactor/vutils': 0.17.3 dev: false - /@visactor/vgrammar-hierarchy/0.10.10: - resolution: {integrity: sha512-DoZiwcwiNJ/CDxiMN/45ItPrpUCeeLRXaPHRwB67jt3g11hkA2tsUNJ9Pg7d52F54nfwOmt0eiPl2/TmeSBQHw==} + /@visactor/vgrammar-hierarchy/0.10.11: + resolution: {integrity: sha512-0r3k51pPlJHu63BduG3htsV/ul62aVcKJxFftRfvKkwGjm1KeHoOZEEAwIf78U2puio0BkLqVn2Ek2L4FYZaIg==} dependencies: - '@visactor/vgrammar-core': 0.10.10 - '@visactor/vgrammar-util': 0.10.10 - '@visactor/vrender-core': 0.17.16 - '@visactor/vrender-kits': 0.17.16 + '@visactor/vgrammar-core': 0.10.11 + '@visactor/vgrammar-util': 0.10.11 + '@visactor/vrender-core': 0.17.17 + '@visactor/vrender-kits': 0.17.17 '@visactor/vutils': 0.17.3 dev: false - /@visactor/vgrammar-projection/0.10.10: - resolution: {integrity: sha512-mzDM466mmp3zYgsh/sJokietstG2KktqEM+tSG3eteXu5QrBuxTgVAMOl8PPQoS858f0vnP4tH1RfIfiQ7AmWQ==} + /@visactor/vgrammar-projection/0.10.11: + resolution: {integrity: sha512-yEiKsxdfs5+g60wv5xZ1kyS/EDrAsUzAxCMpFFASVUYbQObHvW+elm+UPq2TBX6KZqAM0gsd1inzaLvfsCrLSg==} dependencies: - '@visactor/vgrammar-core': 0.10.10 - '@visactor/vgrammar-util': 0.10.10 + '@visactor/vgrammar-core': 0.10.11 + '@visactor/vgrammar-util': 0.10.11 '@visactor/vutils': 0.17.3 d3-geo: 1.12.1 dev: false - /@visactor/vgrammar-sankey/0.10.10: - resolution: {integrity: sha512-Q6uqQQDs2jL2RMv9n+QDUloFiJrl2elUcWf/c//2omPoTZd2tmFXnMLOrJ6llUGM1ILNNnN3MwDA+ujmVf/0gA==} + /@visactor/vgrammar-sankey/0.10.11: + resolution: {integrity: sha512-BbJTPuyydsL/L5XtQv59Q82GgJeePY7Wleac798usx3GnDK0GAOrPsI3bubSsOESJ4pNk3V4HPGEQDG1vCPb4w==} dependencies: - '@visactor/vgrammar-core': 0.10.10 - '@visactor/vgrammar-util': 0.10.10 - '@visactor/vrender-core': 0.17.16 - '@visactor/vrender-kits': 0.17.16 + '@visactor/vgrammar-core': 0.10.11 + '@visactor/vgrammar-util': 0.10.11 + '@visactor/vrender-core': 0.17.17 + '@visactor/vrender-kits': 0.17.17 '@visactor/vutils': 0.17.3 dev: false - /@visactor/vgrammar-util/0.10.10: - resolution: {integrity: sha512-DBduCU9vREaNMaiDsvcLZoOW8b3cydW4cvU3F5WmtKiSYcH7LZKWoGQGjllQZBsHKBTMTWrbLbMDhcTeaUQT1A==} + /@visactor/vgrammar-util/0.10.11: + resolution: {integrity: sha512-cJZLmKZvN95Y+yGhX+28+UpZu3bhYYlXDlHJNvXHyonI76ZYgtceyon2b3lI6XIsUsBGcD4Uo777s949X5os3g==} dependencies: '@visactor/vutils': 0.17.3 dev: false - /@visactor/vgrammar-wordcloud-shape/0.10.10: - resolution: {integrity: sha512-0WCVaKRPQaKh62XyPa1kILQu4vhDzDjQZ0zpRaC2MqQt3//0mdXzZ+tf1I2j4XGE04cZturtVHnk+JX3aRA7lw==} + /@visactor/vgrammar-wordcloud-shape/0.10.11: + resolution: {integrity: sha512-NsQOYJp+9WHnIApMvkcUOaajxIg5U/r6rD8LKnoXW/HqAN2TFYXcRR3Daqmk9rrpM5VztQimKOsA1yZWyzozrA==} dependencies: - '@visactor/vgrammar-core': 0.10.10 - '@visactor/vgrammar-util': 0.10.10 - '@visactor/vrender-core': 0.17.16 - '@visactor/vrender-kits': 0.17.16 + '@visactor/vgrammar-core': 0.10.11 + '@visactor/vgrammar-util': 0.10.11 + '@visactor/vrender-core': 0.17.17 + '@visactor/vrender-kits': 0.17.17 '@visactor/vscale': 0.17.3 '@visactor/vutils': 0.17.3 dev: false - /@visactor/vgrammar-wordcloud/0.10.10: - resolution: {integrity: sha512-Wup3Oy16K4W0J5sCP2kpOoUuvpYoL9xCxY/TzGe9LoasG9ZmQ2y581fpW/EGHZYAAAlboS4tXedRrGbZycFAHg==} + /@visactor/vgrammar-wordcloud/0.10.11: + resolution: {integrity: sha512-JWDqjGhr9JlYkKVBeEkiOqLQk7C1x1BtnsZ+E8oN541gzUqHwfS9qZyhwI3OyoSLewJlsSSPu1vXLKSQzLzKPA==} dependencies: - '@visactor/vgrammar-core': 0.10.10 - '@visactor/vgrammar-util': 0.10.10 - '@visactor/vrender-core': 0.17.16 - '@visactor/vrender-kits': 0.17.16 + '@visactor/vgrammar-core': 0.10.11 + '@visactor/vgrammar-util': 0.10.11 + '@visactor/vrender-core': 0.17.17 + '@visactor/vrender-kits': 0.17.17 '@visactor/vutils': 0.17.3 dev: false - /@visactor/vgrammar/0.10.10: - resolution: {integrity: sha512-SrGSTQIsufksDOzCuCmEZlX/ESPhbqnQ5ybQaeyjuOg8IMBjI+K5i7qKJrwHvxVRTFzoJrIZukLs/5n8kEUoeQ==} + /@visactor/vgrammar/0.10.11: + resolution: {integrity: sha512-BIEGLhQbZPt1+F4uB/0j9VkmrRJTWpyhDICI6sWzvDYVmd51eyTaIC3jMQicQVIcI+Ledi7S7tJfXwNESJnyqg==} dependencies: - '@visactor/vgrammar-core': 0.10.10 + '@visactor/vgrammar-core': 0.10.11 dev: false - /@visactor/vrender-components/0.17.16: - resolution: {integrity: sha512-4aS6BklJUXK94n/hHA1785Cnt4nn8zt/bSaYWmmNQCEnHasy8g/W9ppWV9M4jPlaql/0edEzDruZZef004av/Q==} + /@visactor/vrender-components/0.17.17: + resolution: {integrity: sha512-7gYFQrozvBkyGF7s/JHXdWDZnATzymxzug63CZd4EB7A0OXKatVDImXRePqwzlPD3QamF7QMVWn0CuIx3gQ2gA==} dependencies: - '@visactor/vrender-core': 0.17.16 - '@visactor/vrender-kits': 0.17.16 + '@visactor/vrender-core': 0.17.17 + '@visactor/vrender-kits': 0.17.17 '@visactor/vscale': 0.17.3 '@visactor/vutils': 0.17.3 dev: false - /@visactor/vrender-core/0.17.16: - resolution: {integrity: sha512-BKdGUuw6dlSGpTF3gApAxdW4Hzdld2WuDhhj2hY8RyVYcH0BaSZM1v25jPtTnOepBdT8t+DTGiHVKWKaairWOA==} + /@visactor/vrender-core/0.17.17: + resolution: {integrity: sha512-pAZGaimunDAWOBdFhzPh0auH5ryxAHr+MVoz+QdASG+6RZXy8D02l8v2QYu4+e4uorxe/s2ZkdNDm81SlNkoHQ==} dependencies: '@visactor/vutils': 0.17.3 color-convert: 2.0.1 dev: false - /@visactor/vrender-kits/0.17.16: - resolution: {integrity: sha512-meitvZwbcU2a5DKpUhYZ5yYeqnKXF1VJL4uCDc2t6LM2SQ45jLWqDmrilwoEJ1suj1a1hPlfJ1L/Y8CP6I3dLg==} + /@visactor/vrender-kits/0.17.17: + resolution: {integrity: sha512-noRP1hAHvPCv36nf2P6sZ930Tk+dJ8jpPWIUm1cFYmUNdcumgIS8Cug0RyeZ+saSqVt5FDTwIwifhOqupw5Zaw==} dependencies: '@resvg/resvg-js': 2.4.1 - '@visactor/vrender-core': 0.17.16 + '@visactor/vrender-core': 0.17.17 '@visactor/vutils': 0.17.3 roughjs: 4.5.2 dev: false - /@visactor/vrender/0.17.16: - resolution: {integrity: sha512-4q74PN+CKZ/Rsc1526Yl43Yfzbtf2KCY0slPESU9fBMKovO8JukxR/Eebzv+OaYKz85UFfkfrpOsCyR3l7qNoA==} + /@visactor/vrender/0.17.17: + resolution: {integrity: sha512-yzv61l4WMHzKZMOrlnmpQZKIq1FrcXLRpzYgpRr341jhn6JMERk7sMBAVfBzFrsJqkG6uZdMSGCW6FP084XPrA==} dependencies: - '@visactor/vrender-core': 0.17.16 - '@visactor/vrender-kits': 0.17.16 + '@visactor/vrender-core': 0.17.17 + '@visactor/vrender-kits': 0.17.17 dev: false /@visactor/vscale/0.17.3: diff --git a/docs/package.json b/docs/package.json index 985a84b8be..3e83bb85e6 100644 --- a/docs/package.json +++ b/docs/package.json @@ -16,9 +16,9 @@ "@visactor/vchart-theme": "~1.6.6", "@visactor/vmind": "workspace:1.2.1", "@visactor/vutils": "~0.17.3", - "@visactor/vrender": "0.17.16", - "@visactor/vrender-kits": "0.17.16", - "@visactor/vgrammar": "0.10.10", + "@visactor/vrender": "0.17.17", + "@visactor/vrender-kits": "0.17.17", + "@visactor/vgrammar": "0.10.11", "markdown-it": "^13.0.0", "highlight.js": "^11.8.0", "axios": "^1.4.0", diff --git a/packages/react-vchart/package.json b/packages/react-vchart/package.json index ae19db984b..5e084495d1 100644 --- a/packages/react-vchart/package.json +++ b/packages/react-vchart/package.json @@ -31,9 +31,9 @@ "dependencies": { "@visactor/vchart": "workspace:1.8.7", "@visactor/vutils": "~0.17.3", - "@visactor/vrender-core": "0.17.16", - "@visactor/vrender-kits": "0.17.16", - "@visactor/vgrammar-core": "0.10.10", + "@visactor/vrender-core": "0.17.17", + "@visactor/vrender-kits": "0.17.17", + "@visactor/vgrammar-core": "0.10.11", "react-is": "^18.2.0" }, "devDependencies": { diff --git a/packages/vchart/package.json b/packages/vchart/package.json index 0bcfa28bb1..699c2fbbd9 100644 --- a/packages/vchart/package.json +++ b/packages/vchart/package.json @@ -120,16 +120,16 @@ "@visactor/vutils": "~0.17.3", "@visactor/vdataset": "~0.17.3", "@visactor/vscale": "~0.17.3", - "@visactor/vrender-core": "0.17.16", - "@visactor/vrender-kits": "0.17.16", - "@visactor/vrender-components": "0.17.16", - "@visactor/vgrammar-core": "0.10.10", - "@visactor/vgrammar-projection": "0.10.10", - "@visactor/vgrammar-wordcloud": "0.10.10", - "@visactor/vgrammar-wordcloud-shape": "0.10.10", - "@visactor/vgrammar-hierarchy": "0.10.10", - "@visactor/vgrammar-sankey": "0.10.10", - "@visactor/vgrammar-util": "0.10.10", + "@visactor/vrender-core": "0.17.17", + "@visactor/vrender-kits": "0.17.17", + "@visactor/vrender-components": "0.17.17", + "@visactor/vgrammar-core": "0.10.11", + "@visactor/vgrammar-projection": "0.10.11", + "@visactor/vgrammar-wordcloud": "0.10.11", + "@visactor/vgrammar-wordcloud-shape": "0.10.11", + "@visactor/vgrammar-hierarchy": "0.10.11", + "@visactor/vgrammar-sankey": "0.10.11", + "@visactor/vgrammar-util": "0.10.11", "@visactor/vutils-extension": "workspace:1.8.7" }, "publishConfig": { diff --git a/packages/vmind/package.json b/packages/vmind/package.json index fb99f5ac91..f408d76e34 100644 --- a/packages/vmind/package.json +++ b/packages/vmind/package.json @@ -57,8 +57,8 @@ "react-dom": "^18.0.0", "react-router-dom": "6.9.0", "@visactor/vchart": "workspace:1.8.7", - "@visactor/vrender-core": "0.17.16", - "@visactor/vrender-kits": "0.17.16", + "@visactor/vrender-core": "0.17.17", + "@visactor/vrender-kits": "0.17.17", "@visactor/vutils-extension": "workspace:1.8.7", "@rollup/plugin-dynamic-import-vars": "~2.1.0", "@ffmpeg/core": "^0.11.0", @@ -69,8 +69,8 @@ }, "dependencies": { "@visactor/chart-advisor": "0.1.10", - "@visactor/vrender-core": "0.17.16", - "@visactor/vrender-kits": "0.17.16", + "@visactor/vrender-core": "0.17.17", + "@visactor/vrender-kits": "0.17.17", "@visactor/vdataset": "~0.17.3", "@visactor/vutils": "~0.17.3", "axios": "^1.4.0", diff --git a/packages/vutils-extension/package.json b/packages/vutils-extension/package.json index 9f7eff9224..dc0d8903a7 100644 --- a/packages/vutils-extension/package.json +++ b/packages/vutils-extension/package.json @@ -24,8 +24,8 @@ "dependencies": { "@visactor/vutils": "~0.17.3", "@visactor/vscale": "~0.17.3", - "@visactor/vrender-core": "0.17.16", - "@visactor/vrender-kits": "0.17.16" + "@visactor/vrender-core": "0.17.17", + "@visactor/vrender-kits": "0.17.17" }, "devDependencies": { "@internal/bundler": "workspace:*", diff --git a/tools/story-player/package.json b/tools/story-player/package.json index f20d9d1493..3a2b4b2d0b 100644 --- a/tools/story-player/package.json +++ b/tools/story-player/package.json @@ -56,10 +56,10 @@ "vite": "3.2.6" }, "dependencies": { - "@visactor/vrender-core": "0.17.16", - "@visactor/vrender-kits": "0.17.16", + "@visactor/vrender-core": "0.17.17", + "@visactor/vrender-kits": "0.17.17", "@visactor/vchart": "workspace:1.8.7", - "@visactor/vrender": "0.17.16", + "@visactor/vrender": "0.17.17", "@visactor/vutils": "~0.17.3" } }