From 27c94a6c570ff7f72f2bd38dc8192dac3f576bfe Mon Sep 17 00:00:00 2001 From: Rui-Sun Date: Tue, 10 Sep 2024 20:44:20 +0800 Subject: [PATCH 01/30] fix: add disableFill box color in checkbox and radio #1437 --- .../fix-checkbox-disable-fill_2024-09-10-12-44.json | 10 ++++++++++ .../__tests__/browser/examples/checkbox.ts | 5 ++++- packages/vrender-components/src/checkbox/checkbox.ts | 5 +++++ packages/vrender-components/src/radio/radio.ts | 5 +++++ 4 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 common/changes/@visactor/vrender/fix-checkbox-disable-fill_2024-09-10-12-44.json diff --git a/common/changes/@visactor/vrender/fix-checkbox-disable-fill_2024-09-10-12-44.json b/common/changes/@visactor/vrender/fix-checkbox-disable-fill_2024-09-10-12-44.json new file mode 100644 index 000000000..3b3c779b3 --- /dev/null +++ b/common/changes/@visactor/vrender/fix-checkbox-disable-fill_2024-09-10-12-44.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@visactor/vrender", + "comment": "fix: add disableFill box color in checkbox and radio #1437", + "type": "none" + } + ], + "packageName": "@visactor/vrender" +} \ No newline at end of file diff --git a/packages/vrender-components/__tests__/browser/examples/checkbox.ts b/packages/vrender-components/__tests__/browser/examples/checkbox.ts index 74d8bad8f..2f6c39907 100644 --- a/packages/vrender-components/__tests__/browser/examples/checkbox.ts +++ b/packages/vrender-components/__tests__/browser/examples/checkbox.ts @@ -14,7 +14,10 @@ export function run() { text: 'checkbox' }, checked: false, - disabled: true + disabled: true, + box: { + disableFill: 'red' + } }) ); diff --git a/packages/vrender-components/src/checkbox/checkbox.ts b/packages/vrender-components/src/checkbox/checkbox.ts index 2260ee16b..c9346059e 100644 --- a/packages/vrender-components/src/checkbox/checkbox.ts +++ b/packages/vrender-components/src/checkbox/checkbox.ts @@ -96,6 +96,11 @@ export class CheckBox extends AbstractComponent> { fill: this.attribute.box.checkedFill, stroke: this.attribute.box.checkedStroke }); + } else if (this.attribute.disabled) { + this._box.setAttributes({ + fill: this.attribute.box.disableFill + // stroke: this.attribute.box.disableFill + }); } this.appendChild(this._box); } diff --git a/packages/vrender-components/src/radio/radio.ts b/packages/vrender-components/src/radio/radio.ts index cb5d6c69f..2c4f1e563 100644 --- a/packages/vrender-components/src/radio/radio.ts +++ b/packages/vrender-components/src/radio/radio.ts @@ -81,6 +81,11 @@ export class Radio extends AbstractComponent> { fill: this.attribute.circle.checkedFill, stroke: this.attribute.circle.checkedStroke }); + } else if (this.attribute.disabled) { + this._circle.setAttributes({ + fill: this.attribute.circle.disableFill + // stroke: this.attribute.circle.disableFill + }); } this.appendChild(this._circle); } From 95c13c542eb3ea268e2388a7e1adfc8c99d4f891 Mon Sep 17 00:00:00 2001 From: xile611 Date: Thu, 12 Sep 2024 09:54:56 +0000 Subject: [PATCH 02/30] docs: generate changelog of release v0.20.4 --- docs/assets/changelog/en/changelog.md | 18 ++++++++++++++++++ docs/assets/changelog/zh/changelog.md | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/docs/assets/changelog/en/changelog.md b/docs/assets/changelog/en/changelog.md index b3530ac5e..a3148708c 100644 --- a/docs/assets/changelog/en/changelog.md +++ b/docs/assets/changelog/en/changelog.md @@ -1,3 +1,21 @@ +# v0.20.4 + +2024-09-12 + + +**🆕 New feature** + +- **@visactor/vrender-core**: pauseRender support pass count + +**🐛 Bug fix** + +- **@visactor/vrender-components**: fix the issue where labels are not drawn when the linelabel animation is enabled. +- **@visactor/vrender-core**: add updateHoverIconState in richtext + + + +[more detail about v0.20.4](https://github.com/VisActor/VRender/releases/tag/v0.20.4) + # v0.20.3 2024-09-09 diff --git a/docs/assets/changelog/zh/changelog.md b/docs/assets/changelog/zh/changelog.md index 2bb2143bb..f03b1306e 100644 --- a/docs/assets/changelog/zh/changelog.md +++ b/docs/assets/changelog/zh/changelog.md @@ -1,3 +1,21 @@ +# v0.20.4 + +2024-09-12 + + +**🆕 新增功能** + +- **@visactor/vrender-core**: pauseRender support pass count + +**🐛 功能修复** + +- **@visactor/vrender-components**: fix the issue where labels are not drawn when the linelabel animation is enabled. +- **@visactor/vrender-core**: add updateHoverIconState in richtext + + + +[更多详情请查看 v0.20.4](https://github.com/VisActor/VRender/releases/tag/v0.20.4) + # v0.20.3 2024-09-09 From 1c98bc4abf0e6a9aca79a3a8fe701944ae747a2f Mon Sep 17 00:00:00 2001 From: xile611 Date: Thu, 12 Sep 2024 12:07:31 +0800 Subject: [PATCH 03/30] feat: add `autoLimit` and `autoWrap` for radar chart --- packages/vrender-components/src/axis/base.ts | 10 +- .../vrender-components/src/axis/circle.ts | 94 +++++++++++++++---- .../src/axis/overlap/circle-auto-limit.ts | 80 ++++++++++++++++ .../src/axis/overlap/circle-auto-wrap.ts | 23 +++++ .../axis/tick-data/discrete/polar-angle.ts | 36 +++++-- packages/vrender-components/src/axis/type.ts | 2 +- packages/vrender-components/src/axis/util.ts | 44 +-------- 7 files changed, 219 insertions(+), 70 deletions(-) create mode 100644 packages/vrender-components/src/axis/overlap/circle-auto-limit.ts create mode 100644 packages/vrender-components/src/axis/overlap/circle-auto-wrap.ts diff --git a/packages/vrender-components/src/axis/base.ts b/packages/vrender-components/src/axis/base.ts index a8c802c2f..f240aa0a5 100644 --- a/packages/vrender-components/src/axis/base.ts +++ b/packages/vrender-components/src/axis/base.ts @@ -32,7 +32,8 @@ import type { TickAttributes, TransformedAxisItem, SubTickAttributes, - TickLineItem + TickLineItem, + callbackFunc } from './type'; import { Tag } from '../tag/tag'; import { getElMap, getVerticalCoord } from './util'; @@ -79,7 +80,6 @@ export abstract class AxisBase extends AbstractCom abstract getVerticalVector(offset: number, inside: boolean, point: Point): [number, number]; abstract getRelativeVector(point?: Point): [number, number]; protected abstract getTitleAttribute(): TagAttributes; - protected abstract getTextBaseline(vector: [number, number], inside?: boolean): TextBaselineType; protected abstract beforeLabelsOverlap( labelShapes: IText[], labelData: AxisItem[], @@ -524,7 +524,11 @@ export abstract class AxisBase extends AbstractCom : tickDatum.label; let { style: textStyle } = this.attribute.label as LabelAttributes; textStyle = isFunction(textStyle) - ? merge({}, DEFAULT_AXIS_THEME.label.style, textStyle(tickDatum, index, tickData, layer)) + ? merge( + {}, + DEFAULT_AXIS_THEME.label.style, + (textStyle as callbackFunc | undefined>)(tickDatum, index, tickData, layer) + ) : textStyle; const labelAlign = this.getLabelAlign(vector, inside, (textStyle as ITextGraphicAttribute).angle); diff --git a/packages/vrender-components/src/axis/circle.ts b/packages/vrender-components/src/axis/circle.ts index 9ba6e9cad..07527cc1a 100644 --- a/packages/vrender-components/src/axis/circle.ts +++ b/packages/vrender-components/src/axis/circle.ts @@ -10,10 +10,10 @@ import type { TextBaselineType } from '@visactor/vrender-core'; // eslint-disable-next-line no-duplicate-imports -import { graphicCreator } from '@visactor/vrender-core'; +import { createSymbol, graphicCreator } from '@visactor/vrender-core'; // eslint-disable-next-line no-duplicate-imports import type { Point } from '@visactor/vutils'; -import { isNil, get, merge, isNumberClose, isEmpty, mixin, isValidNumber } from '@visactor/vutils'; +import { isNil, get, merge, isNumberClose, isEmpty, mixin, isValidNumber, isFunction } from '@visactor/vutils'; import { POLAR_END_ANGLE, POLAR_START_ANGLE } from '../constant'; import type { CircleAxisAttributes, TitleAttributes, SubTickAttributes, TickLineItem, AxisItem } from './type'; import { AxisBase } from './base'; @@ -23,6 +23,9 @@ import { CircleAxisMixin } from './mixin/circle'; import { getCircleLabelPosition, getCirclePoints, getPolygonPath } from './util'; import type { ComponentOptions } from '../interface'; import { loadCircleAxisComponent } from './register'; +import { autoHide as autoHideFunc } from './overlap/auto-hide'; +import { circleAutoWrap } from './overlap/circle-auto-wrap'; +import { circleAutoLimit } from './overlap/circle-auto-limit'; loadCircleAxisComponent(); export interface CircleAxis @@ -194,19 +197,6 @@ export class CircleAxis extends AxisBase { return subTickLineItems; } - - protected getTextBaseline(vector: number[]): TextBaselineType { - let base: TextBaselineType = 'middle'; - if (isNumberClose(vector[1], 0)) { - base = 'middle'; - } else if (vector[1] > 0 && vector[1] > Math.abs(vector[0])) { - base = 'top'; - } else if (vector[1] < 0 && Math.abs(vector[1]) > Math.abs(vector[0])) { - base = 'bottom'; - } - return base; - } - protected beforeLabelsOverlap( labelShapes: IText[], labelData: AxisItem[], @@ -223,8 +213,48 @@ export class CircleAxis extends AxisBase { layer: number, layerCount: number ): void { - // 暂不支持 - return; + if (isEmpty(labelShapes)) { + return; + } + + const { inside, radius, center, width, height, label, orient } = this.attribute; + const bounds = + isValidNumber(width) && isValidNumber(height) + ? { + x1: 0, + y1: 0, + x2: width, + y2: height + } + : { + x1: center.x - radius, + y1: center.y - radius, + x2: center.x + radius, + y2: center.y + radius + }; + const labelPoints = labelData.map(item => this.getTickCoord(item.value)); + const { layoutFunc, autoLimit, limitEllipsis, autoHide, autoHideMethod, autoHideSeparation, autoWrap } = label; + + if (isFunction(layoutFunc)) { + // 自定义布局 + layoutFunc(labelShapes, labelData, layer, this); + } else { + if (autoWrap) { + circleAutoWrap(labelShapes, labelPoints, { inside, center, bounds, ellipsis: limitEllipsis }); + } + + // autoWrap has computed width & height limit + if (!autoWrap && autoLimit) { + circleAutoLimit(labelShapes, labelPoints, { inside, center, bounds, ellipsis: limitEllipsis }); + } + if (autoHide) { + autoHideFunc(labelShapes, { + orient, + method: autoHideMethod, + separation: autoHideSeparation + }); + } + } } protected afterLabelsOverlap( labelShapes: IText[], @@ -241,6 +271,23 @@ export class CircleAxis extends AxisBase { inside?: boolean, angle?: number ): { textAlign: TextAlignType; textBaseline: TextBaselineType } { + if (isNumberClose(vector[0], 0)) { + return { + textAlign: 'center', + textBaseline: vector[0] > 0 ? 'top' : 'bottom' + }; + } else if (vector[0] < 0) { + return { + textAlign: 'right', + textBaseline: 'middle' + }; + } else if (vector[0] > 0) { + return { + textAlign: 'left', + textBaseline: 'middle' + }; + } + return { textAlign: 'center', //'left', textBaseline: 'middle' //'top' @@ -253,7 +300,18 @@ export class CircleAxis extends AxisBase { text: string | number, style: Partial ) { - return getCircleLabelPosition(point, vector, text, style); + const pos = getCircleLabelPosition(point, vector, text, style); + + this.axisContainer.add( + createSymbol({ + ...pos, + size: 10, + fill: 'red', + fillOpacity: 0.5 + }) + ); + + return pos; } } diff --git a/packages/vrender-components/src/axis/overlap/circle-auto-limit.ts b/packages/vrender-components/src/axis/overlap/circle-auto-limit.ts new file mode 100644 index 000000000..b399bee91 --- /dev/null +++ b/packages/vrender-components/src/axis/overlap/circle-auto-limit.ts @@ -0,0 +1,80 @@ +import type { IText, ITextGraphicAttribute } from '@visactor/vrender-core'; +import { isNumberClose } from '@visactor/vutils'; +import type { Point } from '../../core/type'; + +type WrapConfig = { + inside?: boolean; + ellipsis?: string; + bounds: { x1: number; x2: number; y1: number; y2: number }; + autoWrap?: boolean; +}; + +function findSiblingLabels(labels: IText[], selfIndex: number) { + const len = labels.length; + const prevLabel = selfIndex >= 1 ? labels[selfIndex - 1] : labels[len - 1]; + const nextLabel = selfIndex < len - 1 ? labels[selfIndex + 1] : labels[0]; + + return { prevLabel, nextLabel }; +} +/** + * 基于所有的标签初始化未知已经布局在圆的边缘 + * @param labels + * @param labelPoints + * @param config + */ +export function circleAutoLimit(labels: IText[], labelPoints: Point[], config: WrapConfig) { + const { ellipsis, inside, bounds, autoWrap } = config; + + if (!inside) { + // TODO inside label暂不处理,现在应该没有类似的需求 + labels.forEach((label, index) => { + const b = label.AABBBounds; + const point = labelPoints[index]; + + if (isNumberClose(point.x, 0)) { + const boxWidth = bounds.x2 - bounds.x1; + // 12点和6点钟方向对应的label + if (labels.length >= 3) { + // 这里其实有一个前提:所有的label都是按照顺时针或者逆时针排序好的 + const prevLabel = index >= 1 ? labels[index - 1] : labels[labels.length - 1]; + const nextLabel = index < labels.length - 1 ? labels[index + 1] : labels[0]; + const maxWidth = + nextLabel.AABBBounds.x1 > prevLabel.AABBBounds.x2 + ? nextLabel.AABBBounds.x1 - prevLabel.AABBBounds.x2 + : nextLabel.AABBBounds.x2 < prevLabel.AABBBounds.x1 + ? prevLabel.AABBBounds.x1 - nextLabel.AABBBounds.x2 + : boxWidth; + if (label.AABBBounds.width() > maxWidth) { + adjustMaxLineWidth(label, label.AABBBounds.width() - maxWidth, ellipsis); + } + } else if (label.AABBBounds.width() > boxWidth) { + adjustMaxLineWidth(label, label.AABBBounds.width() - boxWidth, ellipsis); + } + } else if (b.x2 > bounds.x2) { + if (autoWrap) { + // const heightLimit = + } + adjustMaxLineWidth(label, b.x2 - bounds.x2, ellipsis); + } else if (b.x1 < bounds.x1) { + adjustMaxLineWidth(label, bounds.x1 - b.x1, ellipsis); + } + }); + } +} + +export function adjustMaxLineWidth(label: IText, delta: number, ellipsis: string) { + const maxLineWidth = label.AABBBounds.width() - delta; + const { x = 0, textAlign } = label.attribute; + const newAttrs: ITextGraphicAttribute = { + maxLineWidth, + ellipsis: label.attribute.ellipsis ?? ellipsis + }; + + if (textAlign === 'right') { + newAttrs.x = x - delta; + } else if (textAlign === 'center') { + newAttrs.x = x - delta / 2; + } + + label.setAttributes(newAttrs); +} diff --git a/packages/vrender-components/src/axis/overlap/circle-auto-wrap.ts b/packages/vrender-components/src/axis/overlap/circle-auto-wrap.ts new file mode 100644 index 000000000..fa602ac11 --- /dev/null +++ b/packages/vrender-components/src/axis/overlap/circle-auto-wrap.ts @@ -0,0 +1,23 @@ +import type { IText } from '@visactor/vrender-core'; +import { isEmpty, isValidNumber } from '@visactor/vutils'; +import { isAngleHorizontal, isAngleVertical } from './util'; +import type { Point } from '../../core/type'; +import type { AxisItem } from '../type'; + +type WrapConfig = { + center: Point; + inside?: boolean; + ellipsis?: string; + bounds: { x1: number; x2: number; y1: number; y2: number }; +}; + +export function circleAutoWrap(labels: IText[], labelData: AxisItem[], config: WrapConfig) { + const { center, inside, bounds } = config; + if (isEmpty(labels)) { + return; + } + + if (inside) { + } else { + } +} diff --git a/packages/vrender-components/src/axis/tick-data/discrete/polar-angle.ts b/packages/vrender-components/src/axis/tick-data/discrete/polar-angle.ts index 696797683..c9845f1d3 100644 --- a/packages/vrender-components/src/axis/tick-data/discrete/polar-angle.ts +++ b/packages/vrender-components/src/axis/tick-data/discrete/polar-angle.ts @@ -1,6 +1,6 @@ import type { BandScale, IBaseScale } from '@visactor/vscale'; -import { isFunction, isValid, maxInArray, minInArray } from '@visactor/vutils'; -import type { IPolarTickDataOpt, ITickData } from '../../type'; +import { isFunction, isValid, maxInArray, minInArray, isNumberClose } from '@visactor/vutils'; +import type { IPolarTickDataOpt, ITickCallbackOption, ITickData } from '../../type'; import { MIN_TICK_GAP, convertDomainToTickData, labelOverlap } from '../util'; import { AABBBounds } from '@visactor/vutils'; import { initTextMeasure } from '../../../util/text'; @@ -22,16 +22,34 @@ export const getPolarAngleLabelBounds = (scale: IBaseScale, domain: any[], op: I // 估算文本位置 const angle = scale.scale(v); + const center = { x: 0, y: 0 }; let textX = 0; let textY = 0; const orient = { - align: labelStyle.textAlign ?? 'center', - baseline: labelStyle.textBaseline ?? 'middle' + align: labelStyle.textAlign, + baseline: labelStyle.textBaseline }; - const { x, y } = getPolarAngleLabelPosition(angle, { x: 0, y: 0 }, radius, labelOffset, inside, str, labelStyle); - textX = x + (orient.align === 'right' ? -textWidth : orient.align === 'center' ? -textWidth / 2 : 0); - textY = y + (orient.baseline === 'bottom' ? -textHeight : orient.baseline === 'middle' ? -textHeight / 2 : 0); + const { x, y } = getPolarAngleLabelPosition(angle, center, radius, labelOffset, inside, str, labelStyle); + + if (!orient.align) { + if (isNumberClose(x, center.x)) { + if (!orient.baseline) { + if (y > center.y) { + orient.baseline = 'top'; + } else { + orient.baseline = 'bottom'; + } + } + } else if (x > center.x) { + orient.align = 'left'; + } else if (x < center.x) { + orient.align = 'right'; + } + } + + textX = x + (orient.align === 'right' ? -textWidth : orient.align === 'left' ? 0 : -textWidth / 2); + textY = y + (orient.baseline === 'bottom' ? -textHeight : orient.baseline === 'top' ? 0 : -textHeight / 2); // 计算 label 包围盒 const bounds = new AABBBounds() @@ -67,7 +85,9 @@ export const polarAngleAxisDiscreteTicks = (scale: BandScale, op: IPolarTickData } else if (isValid(tickCount)) { const range = scale.range(); const rangeSize = Math.abs(range[range.length - 1] - range[0]); - const count = isFunction(tickCount) ? tickCount({ axisLength: rangeSize, labelStyle }) : tickCount; + const count = isFunction(tickCount) + ? (tickCount as (option: ITickCallbackOption) => number)({ axisLength: rangeSize, labelStyle }) + : tickCount; scaleTicks = scale.ticks(count); } else if (op.sampling) { const domain = scale.domain(); diff --git a/packages/vrender-components/src/axis/type.ts b/packages/vrender-components/src/axis/type.ts index f999dd7e6..7bcb84711 100644 --- a/packages/vrender-components/src/axis/type.ts +++ b/packages/vrender-components/src/axis/type.ts @@ -567,7 +567,7 @@ export interface ITickData { // label: string; } -type ITickCallbackOption = { +export type ITickCallbackOption = { /** * 坐标轴占据的画布大小。 * 直角坐标系中为轴的宽度或高度。 diff --git a/packages/vrender-components/src/axis/util.ts b/packages/vrender-components/src/axis/util.ts index 7017993fd..7f149e536 100644 --- a/packages/vrender-components/src/axis/util.ts +++ b/packages/vrender-components/src/axis/util.ts @@ -37,46 +37,10 @@ export function getCircleLabelPosition( text: string | number, style: Partial ) { - const labelBounds = getTextBounds({ - text, - ...style - }); - const width = labelBounds.width(); - const height = labelBounds.height(); - const angle = clampRadian(Math.atan2(tickVector[1], tickVector[0])) - Math.PI; - - const PI_3_4 = (Math.PI * 3) / 4; - const PI_1_4 = Math.PI / 4; - const PI_1_2 = Math.PI / 2; - - // x - const baseX = tickPosition.x; - let dx = 0; - if (isInRange(angle, -PI_3_4, -PI_1_4)) { - dx = ((angle + PI_3_4) / PI_1_2 - 0.5) * width; - } else if (isInRange(angle, PI_1_4, PI_3_4)) { - dx = (0.5 - (angle - PI_1_4) / PI_1_2) * width; - } else if (Math.cos(angle) >= 0) { - dx = width * 0.5; - } else { - dx = -width * 0.5; - } - const x = baseX - dx; - - const baseY = tickPosition.y; - let dy = 0; - if (isInRange(angle, -PI_3_4, -PI_1_4)) { - dy = -height * 0.5; - } else if (isInRange(angle, PI_1_4, PI_3_4)) { - dy = height * 0.5; - } else if (Math.cos(angle) >= 0) { - dy = (0.5 - (PI_1_4 - angle) / PI_1_2) * height; - } else { - dy = (0.5 - clampRadian(angle - PI_3_4) / PI_1_2) * height; - } - const y = baseY - dy; - - return { x, y }; + return { + x: tickPosition.x + tickVector[0], + y: tickPosition.y + tickVector[1] + }; } export function getAxisBreakSymbolAttrs(props: BreakSymbol = {}) { From 401db5d76de88878954853bd6e09e347a9ed5cb1 Mon Sep 17 00:00:00 2001 From: xile611 Date: Fri, 13 Sep 2024 14:47:03 +0800 Subject: [PATCH 04/30] feat: support autoWrap in circle axis --- .../vrender-components/src/axis/circle.ts | 11 ++-- .../src/axis/overlap/circle-auto-limit.ts | 64 ++++++++++++------- .../src/axis/overlap/circle-auto-wrap.ts | 23 ------- 3 files changed, 46 insertions(+), 52 deletions(-) delete mode 100644 packages/vrender-components/src/axis/overlap/circle-auto-wrap.ts diff --git a/packages/vrender-components/src/axis/circle.ts b/packages/vrender-components/src/axis/circle.ts index 07527cc1a..ceaaeb345 100644 --- a/packages/vrender-components/src/axis/circle.ts +++ b/packages/vrender-components/src/axis/circle.ts @@ -218,8 +218,9 @@ export class CircleAxis extends AxisBase { } const { inside, radius, center, width, height, label, orient } = this.attribute; + // 宽高为0的异常情况,还是以圆心进行布局 const bounds = - isValidNumber(width) && isValidNumber(height) + width && height ? { x1: 0, y1: 0, @@ -239,13 +240,9 @@ export class CircleAxis extends AxisBase { // 自定义布局 layoutFunc(labelShapes, labelData, layer, this); } else { - if (autoWrap) { - circleAutoWrap(labelShapes, labelPoints, { inside, center, bounds, ellipsis: limitEllipsis }); - } - // autoWrap has computed width & height limit - if (!autoWrap && autoLimit) { - circleAutoLimit(labelShapes, labelPoints, { inside, center, bounds, ellipsis: limitEllipsis }); + if (autoLimit || autoWrap) { + circleAutoLimit(labelShapes, labelPoints, { inside, autoWrap, bounds, ellipsis: limitEllipsis }); } if (autoHide) { autoHideFunc(labelShapes, { diff --git a/packages/vrender-components/src/axis/overlap/circle-auto-limit.ts b/packages/vrender-components/src/axis/overlap/circle-auto-limit.ts index b399bee91..b09ca0577 100644 --- a/packages/vrender-components/src/axis/overlap/circle-auto-limit.ts +++ b/packages/vrender-components/src/axis/overlap/circle-auto-limit.ts @@ -16,6 +16,45 @@ function findSiblingLabels(labels: IText[], selfIndex: number) { return { prevLabel, nextLabel }; } + +function adjustMaxLineWidth(label: IText, delta: number, ellipsis: string) { + const maxLineWidth = label.AABBBounds.width() - delta; + const { x = 0, textAlign } = label.attribute; + const newAttrs: ITextGraphicAttribute = { + maxLineWidth, + ellipsis: label.attribute.ellipsis ?? ellipsis + }; + + if (textAlign === 'right') { + newAttrs.x = x - delta; + } else if (textAlign === 'center') { + newAttrs.x = x - delta / 2; + } + + label.setAttributes(newAttrs); +} + +function adjustMaxHeight( + labels: IText[], + selfIndex: number, + bounds: { x1: number; x2: number; y1: number; y2: number } +) { + if (labels.length < 3) { + } else { + const { prevLabel, nextLabel } = findSiblingLabels(labels, selfIndex); + const label = labels[selfIndex]; + const heightLimit = + nextLabel.AABBBounds.y1 > label.AABBBounds.y1 + ? Math.min(nextLabel.AABBBounds.y1 - label.AABBBounds.y1, bounds.y2 - label.AABBBounds.y1) + : prevLabel.AABBBounds.y1 > label.AABBBounds.y1 + ? Math.min(prevLabel.AABBBounds.y1 - label.AABBBounds.y1, bounds.y2 - label.AABBBounds.y1) + : bounds.y2 - label.AABBBounds.y1; + + if (heightLimit > 0) { + label.setAttributes({ whiteSpace: 'normal', heightLimit }); + } + } +} /** * 基于所有的标签初始化未知已经布局在圆的边缘 * @param labels @@ -36,8 +75,7 @@ export function circleAutoLimit(labels: IText[], labelPoints: Point[], config: W // 12点和6点钟方向对应的label if (labels.length >= 3) { // 这里其实有一个前提:所有的label都是按照顺时针或者逆时针排序好的 - const prevLabel = index >= 1 ? labels[index - 1] : labels[labels.length - 1]; - const nextLabel = index < labels.length - 1 ? labels[index + 1] : labels[0]; + const { prevLabel, nextLabel } = findSiblingLabels(labels, index); const maxWidth = nextLabel.AABBBounds.x1 > prevLabel.AABBBounds.x2 ? nextLabel.AABBBounds.x1 - prevLabel.AABBBounds.x2 @@ -51,30 +89,12 @@ export function circleAutoLimit(labels: IText[], labelPoints: Point[], config: W adjustMaxLineWidth(label, label.AABBBounds.width() - boxWidth, ellipsis); } } else if (b.x2 > bounds.x2) { - if (autoWrap) { - // const heightLimit = - } adjustMaxLineWidth(label, b.x2 - bounds.x2, ellipsis); + autoWrap && adjustMaxHeight(labels, index, bounds); } else if (b.x1 < bounds.x1) { adjustMaxLineWidth(label, bounds.x1 - b.x1, ellipsis); + autoWrap && adjustMaxHeight(labels, index, bounds); } }); } } - -export function adjustMaxLineWidth(label: IText, delta: number, ellipsis: string) { - const maxLineWidth = label.AABBBounds.width() - delta; - const { x = 0, textAlign } = label.attribute; - const newAttrs: ITextGraphicAttribute = { - maxLineWidth, - ellipsis: label.attribute.ellipsis ?? ellipsis - }; - - if (textAlign === 'right') { - newAttrs.x = x - delta; - } else if (textAlign === 'center') { - newAttrs.x = x - delta / 2; - } - - label.setAttributes(newAttrs); -} diff --git a/packages/vrender-components/src/axis/overlap/circle-auto-wrap.ts b/packages/vrender-components/src/axis/overlap/circle-auto-wrap.ts deleted file mode 100644 index fa602ac11..000000000 --- a/packages/vrender-components/src/axis/overlap/circle-auto-wrap.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { IText } from '@visactor/vrender-core'; -import { isEmpty, isValidNumber } from '@visactor/vutils'; -import { isAngleHorizontal, isAngleVertical } from './util'; -import type { Point } from '../../core/type'; -import type { AxisItem } from '../type'; - -type WrapConfig = { - center: Point; - inside?: boolean; - ellipsis?: string; - bounds: { x1: number; x2: number; y1: number; y2: number }; -}; - -export function circleAutoWrap(labels: IText[], labelData: AxisItem[], config: WrapConfig) { - const { center, inside, bounds } = config; - if (isEmpty(labels)) { - return; - } - - if (inside) { - } else { - } -} From c306003a60ce4a30beec9b874e76bc122e4bc39c Mon Sep 17 00:00:00 2001 From: xile611 Date: Fri, 13 Sep 2024 15:33:25 +0800 Subject: [PATCH 05/30] fix: fix auto-limit of circle-axis --- packages/vrender-components/src/axis/base.ts | 23 +------- .../vrender-components/src/axis/circle.ts | 14 +---- packages/vrender-components/src/axis/line.ts | 21 ++++++++ .../src/axis/overlap/circle-auto-limit.ts | 52 +++++++++++-------- .../axis/tick-data/discrete/polar-angle.ts | 2 +- packages/vrender-components/src/axis/util.ts | 14 ++--- 6 files changed, 58 insertions(+), 68 deletions(-) diff --git a/packages/vrender-components/src/axis/base.ts b/packages/vrender-components/src/axis/base.ts index f240aa0a5..9fc851f29 100644 --- a/packages/vrender-components/src/axis/base.ts +++ b/packages/vrender-components/src/axis/base.ts @@ -17,7 +17,7 @@ import type { import { graphicCreator } from '@visactor/vrender-core'; import type { Dict } from '@visactor/vutils'; // eslint-disable-next-line no-duplicate-imports -import { abs, cloneDeep, get, isEmpty, isFunction, isNumberClose, merge, pi } from '@visactor/vutils'; +import { abs, cloneDeep, get, isEmpty, isFunction, merge, pi } from '@visactor/vutils'; import { AbstractComponent } from '../core/base'; import type { Point } from '../core/type'; import type { TagAttributes } from '../tag'; @@ -361,27 +361,6 @@ export abstract class AxisBase extends AbstractCom return getVerticalCoord(point, this.getVerticalVector(offset, inside, point)); } - protected getTextAlign(vector: number[]): TextAlignType { - let align: TextAlignType = 'center'; - - if (isNumberClose(vector[0], 0)) { - if (isNumberClose(vector[1], 0)) { - if (Object.is(vector[1], -0)) { - align = 'start'; - } else if (Object.is(vector[0], -0)) { - align = 'end'; - } - } else { - align = 'center'; - } - } else if (vector[0] > 0) { - align = 'start'; - } else if (vector[0] < 0) { - align = 'end'; - } - return align; - } - protected getTickLineItems() { const { tick } = this.attribute; const data = this.data; diff --git a/packages/vrender-components/src/axis/circle.ts b/packages/vrender-components/src/axis/circle.ts index ceaaeb345..cfe201974 100644 --- a/packages/vrender-components/src/axis/circle.ts +++ b/packages/vrender-components/src/axis/circle.ts @@ -233,7 +233,6 @@ export class CircleAxis extends AxisBase { x2: center.x + radius, y2: center.y + radius }; - const labelPoints = labelData.map(item => this.getTickCoord(item.value)); const { layoutFunc, autoLimit, limitEllipsis, autoHide, autoHideMethod, autoHideSeparation, autoWrap } = label; if (isFunction(layoutFunc)) { @@ -242,7 +241,7 @@ export class CircleAxis extends AxisBase { } else { // autoWrap has computed width & height limit if (autoLimit || autoWrap) { - circleAutoLimit(labelShapes, labelPoints, { inside, autoWrap, bounds, ellipsis: limitEllipsis }); + circleAutoLimit(labelShapes, { inside, autoWrap, bounds, ellipsis: limitEllipsis, center }); } if (autoHide) { autoHideFunc(labelShapes, { @@ -297,16 +296,7 @@ export class CircleAxis extends AxisBase { text: string | number, style: Partial ) { - const pos = getCircleLabelPosition(point, vector, text, style); - - this.axisContainer.add( - createSymbol({ - ...pos, - size: 10, - fill: 'red', - fillOpacity: 0.5 - }) - ); + const pos = getCircleLabelPosition(point, vector); return pos; } diff --git a/packages/vrender-components/src/axis/line.ts b/packages/vrender-components/src/axis/line.ts index 19f58d7ad..280845e0e 100644 --- a/packages/vrender-components/src/axis/line.ts +++ b/packages/vrender-components/src/axis/line.ts @@ -168,6 +168,27 @@ export class LineAxis extends AxisBase { container.add(axisLineGroup as unknown as INode); } + protected getTextAlign(vector: number[]): TextAlignType { + let align: TextAlignType = 'center'; + + if (isNumberClose(vector[0], 0)) { + if (isNumberClose(vector[1], 0)) { + if (Object.is(vector[1], -0)) { + align = 'start'; + } else if (Object.is(vector[0], -0)) { + align = 'end'; + } + } else { + align = 'center'; + } + } else if (vector[0] > 0) { + align = 'start'; + } else if (vector[0] < 0) { + align = 'end'; + } + return align; + } + // TODO: 太 hack 了,需要静心优化 protected getTitleAttribute() { const { diff --git a/packages/vrender-components/src/axis/overlap/circle-auto-limit.ts b/packages/vrender-components/src/axis/overlap/circle-auto-limit.ts index b09ca0577..3ca9053ee 100644 --- a/packages/vrender-components/src/axis/overlap/circle-auto-limit.ts +++ b/packages/vrender-components/src/axis/overlap/circle-auto-limit.ts @@ -3,6 +3,7 @@ import { isNumberClose } from '@visactor/vutils'; import type { Point } from '../../core/type'; type WrapConfig = { + center: Point; inside?: boolean; ellipsis?: string; bounds: { x1: number; x2: number; y1: number; y2: number }; @@ -17,19 +18,18 @@ function findSiblingLabels(labels: IText[], selfIndex: number) { return { prevLabel, nextLabel }; } -function adjustMaxLineWidth(label: IText, delta: number, ellipsis: string) { - const maxLineWidth = label.AABBBounds.width() - delta; +function adjustMaxLineWidth(label: IText, maxLineWidth: number, ellipsis: string) { const { x = 0, textAlign } = label.attribute; const newAttrs: ITextGraphicAttribute = { maxLineWidth, ellipsis: label.attribute.ellipsis ?? ellipsis }; - if (textAlign === 'right') { - newAttrs.x = x - delta; - } else if (textAlign === 'center') { - newAttrs.x = x - delta / 2; - } + // if (textAlign === 'right') { + // newAttrs.x = x - delta; + // } else if (textAlign === 'center') { + // newAttrs.x = x - delta / 2; + // } label.setAttributes(newAttrs); } @@ -61,38 +61,46 @@ function adjustMaxHeight( * @param labelPoints * @param config */ -export function circleAutoLimit(labels: IText[], labelPoints: Point[], config: WrapConfig) { - const { ellipsis, inside, bounds, autoWrap } = config; +export function circleAutoLimit(labels: IText[], config: WrapConfig) { + const { ellipsis, inside, bounds, autoWrap, center } = config; if (!inside) { // TODO inside label暂不处理,现在应该没有类似的需求 labels.forEach((label, index) => { + const { x } = label.attribute; const b = label.AABBBounds; - const point = labelPoints[index]; - if (isNumberClose(point.x, 0)) { + if (isNumberClose(x, center.x)) { const boxWidth = bounds.x2 - bounds.x1; // 12点和6点钟方向对应的label if (labels.length >= 3) { // 这里其实有一个前提:所有的label都是按照顺时针或者逆时针排序好的 const { prevLabel, nextLabel } = findSiblingLabels(labels, index); + let leftX = prevLabel.attribute.x; + let rightX = nextLabel.attribute.x; + + if (leftX > rightX) { + leftX = nextLabel.attribute.x; + rightX = prevLabel.attribute.x; + } + const maxWidth = - nextLabel.AABBBounds.x1 > prevLabel.AABBBounds.x2 - ? nextLabel.AABBBounds.x1 - prevLabel.AABBBounds.x2 - : nextLabel.AABBBounds.x2 < prevLabel.AABBBounds.x1 - ? prevLabel.AABBBounds.x1 - nextLabel.AABBBounds.x2 - : boxWidth; + leftX === rightX + ? boxWidth + : x >= leftX && x <= rightX + ? rightX - leftX + : Math.min(Math.abs(leftX - x), Math.abs(rightX - x)); if (label.AABBBounds.width() > maxWidth) { - adjustMaxLineWidth(label, label.AABBBounds.width() - maxWidth, ellipsis); + adjustMaxLineWidth(label, maxWidth, ellipsis); } } else if (label.AABBBounds.width() > boxWidth) { - adjustMaxLineWidth(label, label.AABBBounds.width() - boxWidth, ellipsis); + adjustMaxLineWidth(label, boxWidth, ellipsis); } - } else if (b.x2 > bounds.x2) { - adjustMaxLineWidth(label, b.x2 - bounds.x2, ellipsis); + } else if (x > center.x && b.x2 > bounds.x2) { + adjustMaxLineWidth(label, bounds.x2 - x, ellipsis); autoWrap && adjustMaxHeight(labels, index, bounds); - } else if (b.x1 < bounds.x1) { - adjustMaxLineWidth(label, bounds.x1 - b.x1, ellipsis); + } else if (x < center.x && b.x1 < bounds.x1) { + adjustMaxLineWidth(label, x - bounds.x1, ellipsis); autoWrap && adjustMaxHeight(labels, index, bounds); } }); diff --git a/packages/vrender-components/src/axis/tick-data/discrete/polar-angle.ts b/packages/vrender-components/src/axis/tick-data/discrete/polar-angle.ts index c9845f1d3..8180b1184 100644 --- a/packages/vrender-components/src/axis/tick-data/discrete/polar-angle.ts +++ b/packages/vrender-components/src/axis/tick-data/discrete/polar-angle.ts @@ -30,7 +30,7 @@ export const getPolarAngleLabelBounds = (scale: IBaseScale, domain: any[], op: I baseline: labelStyle.textBaseline }; - const { x, y } = getPolarAngleLabelPosition(angle, center, radius, labelOffset, inside, str, labelStyle); + const { x, y } = getPolarAngleLabelPosition(angle, center, radius, labelOffset, inside); if (!orient.align) { if (isNumberClose(x, center.x)) { diff --git a/packages/vrender-components/src/axis/util.ts b/packages/vrender-components/src/axis/util.ts index 7f149e536..2ce44e743 100644 --- a/packages/vrender-components/src/axis/util.ts +++ b/packages/vrender-components/src/axis/util.ts @@ -1,4 +1,3 @@ -import { getTextBounds } from '@visactor/vrender-core'; // eslint-disable-next-line no-duplicate-imports import type { IGraphic, IGroup, ITextGraphicAttribute, TextAlignType, TextBaselineType } from '@visactor/vrender-core'; import type { Dict } from '@visactor/vutils'; @@ -31,12 +30,7 @@ export function isInRange(a: number, min: number, max: number) { return !isLess(a, min, 0, 1e-6) && !isGreater(a, max, 0, 1e-6); } -export function getCircleLabelPosition( - tickPosition: Point, - tickVector: [number, number], - text: string | number, - style: Partial -) { +export function getCircleLabelPosition(tickPosition: Point, tickVector: [number, number]) { return { x: tickPosition.x + tickVector[0], y: tickPosition.y + tickVector[1] @@ -120,14 +114,12 @@ export function getPolarAngleLabelPosition( center: { x: number; y: number }, radius: number, labelOffset: number, - inside: boolean, - text: string | number, - style: Partial + inside: boolean ) { const point = polarToCartesian({ x: 0, y: 0 }, radius, angle); const labelPoint = getVerticalCoord(point, getCircleVerticalVector(labelOffset, point, center, inside)); const vector = getCircleVerticalVector(labelOffset || 1, labelPoint, center, inside); - return getCircleLabelPosition(labelPoint, vector, text, style); + return getCircleLabelPosition(labelPoint, vector); } export function getCirclePoints(center: Point, count: number, radius: number, startAngle: number, endAngle: number) { From 5672150cfce228abe806e76141bfdb51ad95b2e3 Mon Sep 17 00:00:00 2001 From: xile611 Date: Fri, 13 Sep 2024 15:43:43 +0800 Subject: [PATCH 06/30] fix: fix autoLimit of circle-axis --- .../vrender-components/src/axis/circle.ts | 3 +-- .../src/axis/overlap/circle-auto-limit.ts | 22 ++++++++----------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/packages/vrender-components/src/axis/circle.ts b/packages/vrender-components/src/axis/circle.ts index cfe201974..bbecfeed9 100644 --- a/packages/vrender-components/src/axis/circle.ts +++ b/packages/vrender-components/src/axis/circle.ts @@ -10,7 +10,7 @@ import type { TextBaselineType } from '@visactor/vrender-core'; // eslint-disable-next-line no-duplicate-imports -import { createSymbol, graphicCreator } from '@visactor/vrender-core'; +import { graphicCreator } from '@visactor/vrender-core'; // eslint-disable-next-line no-duplicate-imports import type { Point } from '@visactor/vutils'; import { isNil, get, merge, isNumberClose, isEmpty, mixin, isValidNumber, isFunction } from '@visactor/vutils'; @@ -24,7 +24,6 @@ import { getCircleLabelPosition, getCirclePoints, getPolygonPath } from './util' import type { ComponentOptions } from '../interface'; import { loadCircleAxisComponent } from './register'; import { autoHide as autoHideFunc } from './overlap/auto-hide'; -import { circleAutoWrap } from './overlap/circle-auto-wrap'; import { circleAutoLimit } from './overlap/circle-auto-limit'; loadCircleAxisComponent(); diff --git a/packages/vrender-components/src/axis/overlap/circle-auto-limit.ts b/packages/vrender-components/src/axis/overlap/circle-auto-limit.ts index 3ca9053ee..35a3a98ff 100644 --- a/packages/vrender-components/src/axis/overlap/circle-auto-limit.ts +++ b/packages/vrender-components/src/axis/overlap/circle-auto-limit.ts @@ -1,4 +1,4 @@ -import type { IText, ITextGraphicAttribute } from '@visactor/vrender-core'; +import type { IText } from '@visactor/vrender-core'; import { isNumberClose } from '@visactor/vutils'; import type { Point } from '../../core/type'; @@ -19,19 +19,10 @@ function findSiblingLabels(labels: IText[], selfIndex: number) { } function adjustMaxLineWidth(label: IText, maxLineWidth: number, ellipsis: string) { - const { x = 0, textAlign } = label.attribute; - const newAttrs: ITextGraphicAttribute = { + label.setAttributes({ maxLineWidth, ellipsis: label.attribute.ellipsis ?? ellipsis - }; - - // if (textAlign === 'right') { - // newAttrs.x = x - delta; - // } else if (textAlign === 'center') { - // newAttrs.x = x - delta / 2; - // } - - label.setAttributes(newAttrs); + }); } function adjustMaxHeight( @@ -67,10 +58,15 @@ export function circleAutoLimit(labels: IText[], config: WrapConfig) { if (!inside) { // TODO inside label暂不处理,现在应该没有类似的需求 labels.forEach((label, index) => { - const { x } = label.attribute; + const { x, y } = label.attribute; const b = label.AABBBounds; if (isNumberClose(x, center.x)) { + if (y > bounds.y2 || y < bounds.y1) { + adjustMaxLineWidth(label, 0, ellipsis); + return; + } + const boxWidth = bounds.x2 - bounds.x1; // 12点和6点钟方向对应的label if (labels.length >= 3) { From f0fbda27abe8403a3f5b5585aa330185e311c7bd Mon Sep 17 00:00:00 2001 From: xile611 Date: Fri, 13 Sep 2024 15:53:58 +0800 Subject: [PATCH 07/30] test: update test case of circle-axis --- .../vrender-components/__tests__/unit/axis/circle.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/vrender-components/__tests__/unit/axis/circle.test.ts b/packages/vrender-components/__tests__/unit/axis/circle.test.ts index ba6d7b19f..e0e4f5889 100644 --- a/packages/vrender-components/__tests__/unit/axis/circle.test.ts +++ b/packages/vrender-components/__tests__/unit/axis/circle.test.ts @@ -76,9 +76,9 @@ describe('Circle Axis', () => { // label const axisLabels = axis.getElementsByName(`${AXIS_ELEMENT_NAME.labelContainer}-layer-0`)[0] as unknown as Group; expect(axisLabels.childrenCount).toBe(8); - expect((axisLabels.children[1] as unknown as Text).attribute.textAlign).toBe('center'); + expect((axisLabels.children[1] as unknown as Text).attribute.textAlign).toBe('left'); expect((axisLabels.children[1] as unknown as Text).attribute.textBaseline).toBe('middle'); - expect((axisLabels.children[5] as unknown as Text).attribute.textAlign).toBe('center'); + expect((axisLabels.children[5] as unknown as Text).attribute.textAlign).toBe('right'); expect((axisLabels.children[5] as unknown as Text).attribute.textBaseline).toBe('middle'); // tick & subTick From c3bd633fa42e0b2fbe9bb80dd10ed7efdd0624cc Mon Sep 17 00:00:00 2001 From: xile611 Date: Fri, 13 Sep 2024 16:58:53 +0800 Subject: [PATCH 08/30] fix: fix align of circle axis --- packages/vrender-components/src/axis/circle.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/vrender-components/src/axis/circle.ts b/packages/vrender-components/src/axis/circle.ts index bbecfeed9..5b90da6ac 100644 --- a/packages/vrender-components/src/axis/circle.ts +++ b/packages/vrender-components/src/axis/circle.ts @@ -269,7 +269,7 @@ export class CircleAxis extends AxisBase { if (isNumberClose(vector[0], 0)) { return { textAlign: 'center', - textBaseline: vector[0] > 0 ? 'top' : 'bottom' + textBaseline: vector[1] > 0 ? 'top' : 'bottom' }; } else if (vector[0] < 0) { return { @@ -297,7 +297,7 @@ export class CircleAxis extends AxisBase { ) { const pos = getCircleLabelPosition(point, vector); - return pos; + return point; } } From db44bbc4335a2d2309f8da0e857a1d5bafb5aafa Mon Sep 17 00:00:00 2001 From: xile611 Date: Fri, 13 Sep 2024 18:12:48 +0800 Subject: [PATCH 09/30] fix: optimize text-baseline of circle-axis --- .../__tests__/unit/axis/circle.test.ts | 4 ++-- packages/vrender-components/src/axis/circle.ts | 16 ++++++++++++++-- .../src/axis/overlap/circle-auto-limit.ts | 13 +++++++------ 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/packages/vrender-components/__tests__/unit/axis/circle.test.ts b/packages/vrender-components/__tests__/unit/axis/circle.test.ts index e0e4f5889..7ca2016e1 100644 --- a/packages/vrender-components/__tests__/unit/axis/circle.test.ts +++ b/packages/vrender-components/__tests__/unit/axis/circle.test.ts @@ -77,9 +77,9 @@ describe('Circle Axis', () => { const axisLabels = axis.getElementsByName(`${AXIS_ELEMENT_NAME.labelContainer}-layer-0`)[0] as unknown as Group; expect(axisLabels.childrenCount).toBe(8); expect((axisLabels.children[1] as unknown as Text).attribute.textAlign).toBe('left'); - expect((axisLabels.children[1] as unknown as Text).attribute.textBaseline).toBe('middle'); + expect((axisLabels.children[1] as unknown as Text).attribute.textBaseline).toBe('bottom'); expect((axisLabels.children[5] as unknown as Text).attribute.textAlign).toBe('right'); - expect((axisLabels.children[5] as unknown as Text).attribute.textBaseline).toBe('middle'); + expect((axisLabels.children[5] as unknown as Text).attribute.textBaseline).toBe('top'); // tick & subTick const tickLineGroup = axis.getElementsByName(AXIS_ELEMENT_NAME.tickContainer)[0] as unknown as Group; diff --git a/packages/vrender-components/src/axis/circle.ts b/packages/vrender-components/src/axis/circle.ts index 5b90da6ac..0868d9f93 100644 --- a/packages/vrender-components/src/axis/circle.ts +++ b/packages/vrender-components/src/axis/circle.ts @@ -261,6 +261,18 @@ export class CircleAxis extends AxisBase { return; } + protected getTextBaseline(vector: [number, number]) { + if (Math.abs(vector[1] / vector[0]) < 0.3) { + return 'middle'; + } else if (vector[1] < 0) { + return 'bottom'; + } else if (vector[1] > 0) { + return 'top'; + } + + return 'middle'; + } + protected getLabelAlign( vector: [number, number], inside?: boolean, @@ -274,12 +286,12 @@ export class CircleAxis extends AxisBase { } else if (vector[0] < 0) { return { textAlign: 'right', - textBaseline: 'middle' + textBaseline: this.getTextBaseline(vector) }; } else if (vector[0] > 0) { return { textAlign: 'left', - textBaseline: 'middle' + textBaseline: this.getTextBaseline(vector) }; } diff --git a/packages/vrender-components/src/axis/overlap/circle-auto-limit.ts b/packages/vrender-components/src/axis/overlap/circle-auto-limit.ts index 35a3a98ff..b594b3a3f 100644 --- a/packages/vrender-components/src/axis/overlap/circle-auto-limit.ts +++ b/packages/vrender-components/src/axis/overlap/circle-auto-limit.ts @@ -34,12 +34,13 @@ function adjustMaxHeight( } else { const { prevLabel, nextLabel } = findSiblingLabels(labels, selfIndex); const label = labels[selfIndex]; - const heightLimit = - nextLabel.AABBBounds.y1 > label.AABBBounds.y1 - ? Math.min(nextLabel.AABBBounds.y1 - label.AABBBounds.y1, bounds.y2 - label.AABBBounds.y1) - : prevLabel.AABBBounds.y1 > label.AABBBounds.y1 - ? Math.min(prevLabel.AABBBounds.y1 - label.AABBBounds.y1, bounds.y2 - label.AABBBounds.y1) - : bounds.y2 - label.AABBBounds.y1; + + const heightLimit = Math.min( + Math.abs(prevLabel.attribute.y - label.attribute.y), + Math.abs(nextLabel.attribute.y - label.attribute.y), + Math.abs(label.attribute.y - bounds.y1), + Math.abs(label.attribute.y - bounds.y2) + ); if (heightLimit > 0) { label.setAttributes({ whiteSpace: 'normal', heightLimit }); From 7672721505693e33f6be43d49c6f17f847b02bf3 Mon Sep 17 00:00:00 2001 From: xile611 Date: Fri, 6 Sep 2024 18:10:17 +0800 Subject: [PATCH 10/30] feat: optimize the parameters of customShape --- packages/vrender-components/src/interface.ts | 11 +-- packages/vrender-components/src/label/base.ts | 9 +- packages/vrender-components/src/label/type.ts | 9 +- packages/vrender-components/src/tag/tag.ts | 96 +++++++------------ 4 files changed, 52 insertions(+), 73 deletions(-) diff --git a/packages/vrender-components/src/interface.ts b/packages/vrender-components/src/interface.ts index 551d182bd..5daa44740 100644 --- a/packages/vrender-components/src/interface.ts +++ b/packages/vrender-components/src/interface.ts @@ -1,9 +1,10 @@ import type { ICustomPath2D, IGraphicAttribute, + IGroup, IRectGraphicAttribute, - IRichTextAttribute, - ITextGraphicAttribute + IRichText, + IText } from '@visactor/vrender-core'; import type { TextContent } from './core/type'; @@ -20,11 +21,7 @@ export type BackgroundAttributes = { * 自定义路径 * @since 0.19.19 */ - customShape?: ( - text: ITextGraphicAttribute | IRichTextAttribute, - attrs: Partial, - path: ICustomPath2D - ) => ICustomPath2D; + customShape?: (container: IGroup, attrs: Partial, path: ICustomPath2D) => ICustomPath2D; } & Partial; export type IDelayType = 'debounce' | 'throttle'; diff --git a/packages/vrender-components/src/label/base.ts b/packages/vrender-components/src/label/base.ts index d2e07daa8..f3cc0e0a9 100644 --- a/packages/vrender-components/src/label/base.ts +++ b/packages/vrender-components/src/label/base.ts @@ -142,7 +142,14 @@ export class LabelBase extends AbstractComponent { if (line.customShape) { const customShape = line.customShape; lineGraphic.pathProxy = (attrs: Partial) => { - return customShape(text.attribute, attrs, new CustomPath2D()); + return customShape( + { + text, + baseMark: baseMark + }, + attrs, + new CustomPath2D() + ); }; } diff --git a/packages/vrender-components/src/label/type.ts b/packages/vrender-components/src/label/type.ts index 76df325d1..a0449e4bb 100644 --- a/packages/vrender-components/src/label/type.ts +++ b/packages/vrender-components/src/label/type.ts @@ -12,7 +12,8 @@ import type { IRichText, ILine, ICustomPath2D, - IArc + IArc, + IGroup } from '@visactor/vrender-core'; import type { BoundsAnchorType, IPointLike, InsideBoundsAnchorType } from '@visactor/vutils'; @@ -427,11 +428,7 @@ export interface ILabelLineSpec { * 自定义路径 * @since 0.19.21 */ - customShape?: ( - text: ITextGraphicAttribute, - attrs: Partial, - path: ICustomPath2D - ) => ICustomPath2D; + customShape?: (container: IGroup, attrs: Partial, path: ICustomPath2D) => ICustomPath2D; /** * 引导线样式 */ diff --git a/packages/vrender-components/src/tag/tag.ts b/packages/vrender-components/src/tag/tag.ts index 046e4c1cc..902b5aaed 100644 --- a/packages/vrender-components/src/tag/tag.ts +++ b/packages/vrender-components/src/tag/tag.ts @@ -83,6 +83,8 @@ export class Tag extends AbstractComponent> { const group = this.createOrUpdateChild('tag-content', { x: 0, y: 0, zIndex: 1 }, 'group') as IGroup; let symbol; + let tagX = -parsedPadding[3]; + let tagY = -parsedPadding[0]; let tagWidth = parsedPadding[1] + parsedPadding[3]; let tagHeight = parsedPadding[0] + parsedPadding[2]; let textX = 0; @@ -128,33 +130,10 @@ export class Tag extends AbstractComponent> { y: 0 }; textShape = group.createOrUpdateChild('tag-text', richTextAttrs, 'richtext') as IRichText; - - // 绘制背景层 - const { visible: bgVisible, ...backgroundStyle } = panel; - if (visible && isBoolean(bgVisible)) { - const bgRect = this.createOrUpdateChild( - 'tag-panel', - { - ...backgroundStyle, - visible: bgVisible && !!text, - x: textShape.AABBBounds.x1 - parsedPadding[1], - y: textShape.AABBBounds.y1 - parsedPadding[0], - width: textShape.AABBBounds.width() + (parsedPadding[1] + parsedPadding[3]), - height: textShape.AABBBounds.height() + (parsedPadding[0] + parsedPadding[2]) - }, - 'rect' - ) as IRect; - if (!isEmpty(state?.panel)) { - bgRect.states = state.panel; - } - if (backgroundStyle.customShape) { - const customShape = backgroundStyle.customShape; - bgRect.pathProxy = (attrs: Partial) => { - return customShape(textShape.attribute, attrs, new CustomPath2D()); - }; - } - this._bgRect = bgRect; - } + tagWidth += textShape.AABBBounds.width(); + tagHeight += textShape.AABBBounds.height(); + tagX += textShape.AABBBounds.x1; + tagY += textShape.AABBBounds.y1; } else { const textAttrs = { text: isObject(text) && 'type' in text && text.type === 'text' ? text.text : text, @@ -193,8 +172,8 @@ export class Tag extends AbstractComponent> { } } - let x = 0; - let y = 0; + tagX = 0; + tagY = 0; let flag = 0; if (textAlign === 'left' || textAlign === 'start') { flag = 1; @@ -204,14 +183,14 @@ export class Tag extends AbstractComponent> { flag = 0; } if (!flag) { - x -= tagWidth / 2; + tagX -= tagWidth / 2; if (symbol) { symbol.setAttribute('x', (symbol.attribute.x || 0) - textWidth / 2); } group.setAttribute('x', -symbolPlaceWidth / 2); } else if (flag < 0) { - x -= tagWidth; + tagX -= tagWidth; if (symbol) { symbol.setAttribute('x', (symbol.attribute.x || 0) - textWidth); } @@ -287,12 +266,12 @@ export class Tag extends AbstractComponent> { } if (textBaseline === 'middle') { - y -= tagHeight / 2; + tagY -= tagHeight / 2; if (symbol) { symbol.setAttribute('y', 0); } } else if (textBaseline === 'bottom') { - y -= tagHeight; + tagY -= tagHeight; if (symbol) { symbol.setAttribute('y', -textHeight / 2); } @@ -304,33 +283,32 @@ export class Tag extends AbstractComponent> { symbol.setAttribute('y', textHeight / 2); } } - - // 绘制背景层 - const { visible: bgVisible, ...backgroundStyle } = panel; - if (visible && isBoolean(bgVisible)) { - const bgRect = this.createOrUpdateChild( - 'tag-panel', - { - ...backgroundStyle, - visible: bgVisible && !!text, - x, - y, - width: tagWidth, - height: tagHeight - }, - 'rect' - ) as IRect; - if (!isEmpty(state?.panel)) { - bgRect.states = state.panel; - } - if (backgroundStyle.customShape) { - const customShape = backgroundStyle.customShape; - bgRect.pathProxy = (attrs: Partial) => { - return customShape(textShape.attribute, attrs, new CustomPath2D()); - }; - } - this._bgRect = bgRect; + } + // 绘制背景层 + const { visible: bgVisible, ...backgroundStyle } = panel; + if (visible && isBoolean(bgVisible)) { + const bgRect = this.createOrUpdateChild( + 'tag-panel', + { + ...backgroundStyle, + visible: bgVisible && !!text, + width: tagWidth, + height: tagHeight, + x: tagX, + y: tagY + }, + 'rect' + ) as IRect; + if (!isEmpty(state?.panel)) { + bgRect.states = state.panel; + } + if (backgroundStyle.customShape) { + const customShape = backgroundStyle.customShape; + bgRect.pathProxy = (attrs: Partial) => { + return customShape(this, attrs, new CustomPath2D()); + }; } + this._bgRect = bgRect; } this._textShape = textShape; this._symbol = symbol; From 1d6b1982219d567b31c2fcf38df49cd2a282177a Mon Sep 17 00:00:00 2001 From: xile611 Date: Wed, 18 Sep 2024 11:26:29 +0800 Subject: [PATCH 11/30] fix: fix error of bounds-context --- packages/vrender-core/src/common/bounds-context.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/vrender-core/src/common/bounds-context.ts b/packages/vrender-core/src/common/bounds-context.ts index f2df6c4a7..9297dcd10 100644 --- a/packages/vrender-core/src/common/bounds-context.ts +++ b/packages/vrender-core/src/common/bounds-context.ts @@ -118,7 +118,9 @@ export class BoundsContext implements IPath2D { } // @ts-ignore arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void { - throw new Error('不支持arcTo'); + // 主要用于绘制圆角的场景,暂时只算第一个控制点 + this.bounds.add(x1, y1); + // this.bounds.add(x2, y2); } // @ts-ignore bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void { From 3e950885706e40a5828224c38dd3ea2d2771fd76 Mon Sep 17 00:00:00 2001 From: xile611 Date: Wed, 18 Sep 2024 12:02:05 +0800 Subject: [PATCH 12/30] fix: fix `textStyle` of data-zoom --- packages/vrender-components/src/data-zoom/data-zoom.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/vrender-components/src/data-zoom/data-zoom.ts b/packages/vrender-components/src/data-zoom/data-zoom.ts index 3c28aceff..946d30464 100644 --- a/packages/vrender-components/src/data-zoom/data-zoom.ts +++ b/packages/vrender-components/src/data-zoom/data-zoom.ts @@ -523,11 +523,11 @@ export class DataZoom extends AbstractComponent> { }; startTextAlignStyle = { textAlign: this.isTextOverflow(componentBoundsLike, startTextBounds, 'start') ? 'left' : 'right', - textBaseline: 'middle' + textBaseline: restStartTextStyle?.textStyle?.textBaseline ?? 'middle' }; endTextAlignStyle = { textAlign: this.isTextOverflow(componentBoundsLike, endTextBounds, 'end') ? 'right' : 'left', - textBaseline: 'middle' + textBaseline: restEndTextStyle?.textStyle?.textBaseline ?? 'middle' }; } else { startTextPosition = { @@ -539,11 +539,11 @@ export class DataZoom extends AbstractComponent> { y: position.y + end * height }; startTextAlignStyle = { - textAlign: 'center', + textAlign: restStartTextStyle?.textStyle?.textAlign ?? 'center', textBaseline: this.isTextOverflow(componentBoundsLike, startTextBounds, 'start') ? 'top' : 'bottom' }; endTextAlignStyle = { - textAlign: 'center', + textAlign: restEndTextStyle?.textStyle?.textAlign ?? 'center', textBaseline: this.isTextOverflow(componentBoundsLike, endTextBounds, 'end') ? 'bottom' : 'top' }; } From e7d8e840300640471160eca7bd9b596980193132 Mon Sep 17 00:00:00 2001 From: xile611 Date: Wed, 18 Sep 2024 12:02:38 +0800 Subject: [PATCH 13/30] docs: update changlog of rush --- .../fix-data-zoom-text-style_2024-09-18-04-02.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 common/changes/@visactor/vrender-components/fix-data-zoom-text-style_2024-09-18-04-02.json diff --git a/common/changes/@visactor/vrender-components/fix-data-zoom-text-style_2024-09-18-04-02.json b/common/changes/@visactor/vrender-components/fix-data-zoom-text-style_2024-09-18-04-02.json new file mode 100644 index 000000000..29af86028 --- /dev/null +++ b/common/changes/@visactor/vrender-components/fix-data-zoom-text-style_2024-09-18-04-02.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "fix: fix `textStyle` of data-zoom\n\n", + "type": "none", + "packageName": "@visactor/vrender-components" + } + ], + "packageName": "@visactor/vrender-components", + "email": "dingling112@gmail.com" +} \ No newline at end of file From 2c969db321a08c3acee1fefb01841c0a7906b43f Mon Sep 17 00:00:00 2001 From: xile611 Date: Wed, 18 Sep 2024 14:36:02 +0800 Subject: [PATCH 14/30] docs: update changelog of vrender --- .../fix-arc-label-line-shape_2024-09-18-06-35.json | 10 ++++++++++ .../fix-arc-label-line-shape_2024-09-18-06-35.json | 10 ++++++++++ 2 files changed, 20 insertions(+) create mode 100644 common/changes/@visactor/vrender-components/fix-arc-label-line-shape_2024-09-18-06-35.json create mode 100644 common/changes/@visactor/vrender-core/fix-arc-label-line-shape_2024-09-18-06-35.json diff --git a/common/changes/@visactor/vrender-components/fix-arc-label-line-shape_2024-09-18-06-35.json b/common/changes/@visactor/vrender-components/fix-arc-label-line-shape_2024-09-18-06-35.json new file mode 100644 index 000000000..38e0b4c57 --- /dev/null +++ b/common/changes/@visactor/vrender-components/fix-arc-label-line-shape_2024-09-18-06-35.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@visactor/vrender-components", + "comment": "fix: update parameters", + "type": "none" + } + ], + "packageName": "@visactor/vrender-components" +} \ No newline at end of file diff --git a/common/changes/@visactor/vrender-core/fix-arc-label-line-shape_2024-09-18-06-35.json b/common/changes/@visactor/vrender-core/fix-arc-label-line-shape_2024-09-18-06-35.json new file mode 100644 index 000000000..e4ba37d88 --- /dev/null +++ b/common/changes/@visactor/vrender-core/fix-arc-label-line-shape_2024-09-18-06-35.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@visactor/vrender-core", + "comment": "fix: fix error of `bounds-contex` when use `arcTo` in customShape", + "type": "none" + } + ], + "packageName": "@visactor/vrender-core" +} \ No newline at end of file From 02c37eec092c2310df5b0862703b654674260216 Mon Sep 17 00:00:00 2001 From: xile611 Date: Wed, 18 Sep 2024 16:06:29 +0800 Subject: [PATCH 15/30] fix: fix error of morphing animation in `multiToOneMorph`, fix #1439 --- .../src/graphic/graphic-service/graphic-service.ts | 6 +++--- packages/vrender/__tests__/browser/src/pages/morphing.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/vrender-core/src/graphic/graphic-service/graphic-service.ts b/packages/vrender-core/src/graphic/graphic-service/graphic-service.ts index 30dabda04..186d5535e 100644 --- a/packages/vrender-core/src/graphic/graphic-service/graphic-service.ts +++ b/packages/vrender-core/src/graphic/graphic-service/graphic-service.ts @@ -362,9 +362,9 @@ export class DefaultGraphicService implements IGraphicService { return true; } - // if (graphic.shadowRoot) { - // return true; - // } + if (graphic.shadowRoot) { + return true; + } if (!graphic.valid) { aabbBounds.clear(); diff --git a/packages/vrender/__tests__/browser/src/pages/morphing.ts b/packages/vrender/__tests__/browser/src/pages/morphing.ts index a9d0212d5..93502018e 100644 --- a/packages/vrender/__tests__/browser/src/pages/morphing.ts +++ b/packages/vrender/__tests__/browser/src/pages/morphing.ts @@ -184,7 +184,7 @@ export const page = () => { const symbols = createSymbol({ x: Math.random() * 500, y: Math.random() * 500, - symbolType: 'triangleLeft', + symbolType: 'arrow', size: 10, fill: colorPools[2], // angle: Math.PI / 4, @@ -194,9 +194,9 @@ export const page = () => { stage.defaultLayer.appendChild(symbols); } - stage.defaultLayer.appendChild(arc); + // stage.defaultLayer.appendChild(arc); - oneToMultiMorph(arc, symbolList, { duration: 2000, splitPath: 'clone', easing: 'quadIn' }); + // oneToMultiMorph(arc, symbolList, { duration: 2000, easing: 'quadIn' }); const fromSymbolList = []; for (let i = 0; i < 23; i++) { From a2902e50084553506fa41ef0f4fe9cad0bc9064f Mon Sep 17 00:00:00 2001 From: xile611 Date: Wed, 18 Sep 2024 16:07:37 +0800 Subject: [PATCH 16/30] docs: update changlog of rush --- .../fix-muti-to-one-morphing_2024-09-18-08-07.json | 11 +++++++++++ .../fix-muti-to-one-morphing_2024-09-18-08-07.json | 11 +++++++++++ .../fix-muti-to-one-morphing_2024-09-18-08-07.json | 11 +++++++++++ 3 files changed, 33 insertions(+) create mode 100644 common/changes/@visactor/vrender-components/fix-muti-to-one-morphing_2024-09-18-08-07.json create mode 100644 common/changes/@visactor/vrender-core/fix-muti-to-one-morphing_2024-09-18-08-07.json create mode 100644 common/changes/@visactor/vrender/fix-muti-to-one-morphing_2024-09-18-08-07.json diff --git a/common/changes/@visactor/vrender-components/fix-muti-to-one-morphing_2024-09-18-08-07.json b/common/changes/@visactor/vrender-components/fix-muti-to-one-morphing_2024-09-18-08-07.json new file mode 100644 index 000000000..f3c940cf1 --- /dev/null +++ b/common/changes/@visactor/vrender-components/fix-muti-to-one-morphing_2024-09-18-08-07.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "fix: fix error of morphing animation in `multiToOneMorph`, fix #1439\n\n", + "type": "none", + "packageName": "@visactor/vrender-components" + } + ], + "packageName": "@visactor/vrender-components", + "email": "dingling112@gmail.com" +} \ No newline at end of file diff --git a/common/changes/@visactor/vrender-core/fix-muti-to-one-morphing_2024-09-18-08-07.json b/common/changes/@visactor/vrender-core/fix-muti-to-one-morphing_2024-09-18-08-07.json new file mode 100644 index 000000000..ef44cc178 --- /dev/null +++ b/common/changes/@visactor/vrender-core/fix-muti-to-one-morphing_2024-09-18-08-07.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "fix: fix error of morphing animation in `multiToOneMorph`, fix #1439\n\n", + "type": "none", + "packageName": "@visactor/vrender-core" + } + ], + "packageName": "@visactor/vrender-core", + "email": "dingling112@gmail.com" +} \ No newline at end of file diff --git a/common/changes/@visactor/vrender/fix-muti-to-one-morphing_2024-09-18-08-07.json b/common/changes/@visactor/vrender/fix-muti-to-one-morphing_2024-09-18-08-07.json new file mode 100644 index 000000000..89fb99749 --- /dev/null +++ b/common/changes/@visactor/vrender/fix-muti-to-one-morphing_2024-09-18-08-07.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "fix: fix error of morphing animation in `multiToOneMorph`, fix #1439\n\n", + "type": "none", + "packageName": "@visactor/vrender" + } + ], + "packageName": "@visactor/vrender", + "email": "dingling112@gmail.com" +} \ No newline at end of file From 0793c1466889b251e8d544a4e3190ed74fcdcbd2 Mon Sep 17 00:00:00 2001 From: zhouxinyu Date: Thu, 19 Sep 2024 10:50:16 +0800 Subject: [PATCH 17/30] feat: fix issue with richtext width on disableAutoWrapLine mode, support clip attr --- .../feat-richtext-clip_2024-09-19-02-49.json | 10 ++ packages/vrender-core/src/graphic/richtext.ts | 21 +++ .../vrender-core/src/graphic/richtext/line.ts | 82 +++++++---- .../__tests__/browser/src/pages/richtext.ts | 136 ++++++++++++------ 4 files changed, 174 insertions(+), 75 deletions(-) create mode 100644 common/changes/@visactor/vrender-core/feat-richtext-clip_2024-09-19-02-49.json diff --git a/common/changes/@visactor/vrender-core/feat-richtext-clip_2024-09-19-02-49.json b/common/changes/@visactor/vrender-core/feat-richtext-clip_2024-09-19-02-49.json new file mode 100644 index 000000000..c35b0dabb --- /dev/null +++ b/common/changes/@visactor/vrender-core/feat-richtext-clip_2024-09-19-02-49.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@visactor/vrender-core", + "comment": "feat: fix issue with richtext width on disableAutoWrapLine mode, support clip attr", + "type": "none" + } + ], + "packageName": "@visactor/vrender-core" +} \ No newline at end of file diff --git a/packages/vrender-core/src/graphic/richtext.ts b/packages/vrender-core/src/graphic/richtext.ts index bd1bd4ec0..5175009af 100644 --- a/packages/vrender-core/src/graphic/richtext.ts +++ b/packages/vrender-core/src/graphic/richtext.ts @@ -263,6 +263,27 @@ export class RichText extends Graphic implements IRic } return this._frameCache; } + + get clip() { + const frameCache = this.getFrameCache(); + if (frameCache.actualHeight > frameCache.height) { + return true; + } + const { disableAutoWrapLine } = this.attribute; + if (disableAutoWrapLine) { + for (let i = 0; i < frameCache.lines.length; i++) { + const l = frameCache.lines[i]; + for (let j = 0; j < l.paragraphs.length; j++) { + const p = l.paragraphs[j]; + if ((p as any).overflow && (p as any).text !== '') { + return true; + } + } + } + } + return false; + // if (height < this.attribute.height || ) + } combinedStyleToCharacter(config: IRichTextImageCharacter | IRichTextParagraphCharacter) { const { fill, diff --git a/packages/vrender-core/src/graphic/richtext/line.ts b/packages/vrender-core/src/graphic/richtext/line.ts index b7b891c6d..74f499e72 100644 --- a/packages/vrender-core/src/graphic/richtext/line.ts +++ b/packages/vrender-core/src/graphic/richtext/line.ts @@ -142,41 +142,61 @@ export default class Line { drawIcon: (icon: IRichTextIcon, context: IContext2d, x: number, y: number, baseline: number) => void ) { if (drawEllipsis && (lastLine || this.paragraphs.some(p => (p as Paragraph).overflow))) { - // 处理省略号 - let otherParagraphWidth = 0; + // 检测是否需要省略号,因为会有多行同时省略的情况 + let emptyOverflow = true; + let skipEllipsis = false; for (let i = this.paragraphs.length - 1; i >= 0; i--) { const paragraph = this.paragraphs[i]; if ((paragraph as Paragraph).overflow) { - continue; - } - if (paragraph instanceof RichTextIcon) { - break; // todo: 处理最后为图标,显示省略号的情况 - } - if (this.direction === 'vertical' && paragraph.direction !== 'vertical') { - paragraph.verticalEllipsis = true; - break; - } - const ellipsis = drawEllipsis === true ? '...' : drawEllipsis || ''; - paragraph.ellipsisStr = ellipsis; - // const { width } = measureText('...', paragraph.style); - const { width } = measureTextCanvas(ellipsis, paragraph.character); - const ellipsisWidth = width || 0; - if (ellipsisWidth <= this.blankWidth + otherParagraphWidth) { - // 省略号可以直接接在后面paragraph - lastLine && (paragraph.ellipsis = 'add'); - - break; - } else if (ellipsisWidth <= this.blankWidth + otherParagraphWidth + paragraph.width) { - // 省略号需要替换paragraph中的字符 - paragraph.ellipsis = 'replace'; - paragraph.ellipsisWidth = ellipsisWidth; - paragraph.ellipsisOtherParagraphWidth = this.blankWidth + otherParagraphWidth; - - break; + emptyOverflow = emptyOverflow && (paragraph as Paragraph).text === ''; } else { - // 省略号需要的width大于paragraph的width,隐藏paragraph,向前搜索 - paragraph.ellipsis = 'hide'; - otherParagraphWidth += paragraph.width; + if (emptyOverflow) { + skipEllipsis = true; + break; + } + } + } + + // 处理省略号 + let otherParagraphWidth = 0; + if (!skipEllipsis) { + for (let i = this.paragraphs.length - 1; i >= 0; i--) { + const paragraph = this.paragraphs[i]; + if ((paragraph as Paragraph).overflow) { + if ((paragraph as Paragraph).text === '') { + break; + } + continue; + } + if (paragraph instanceof RichTextIcon) { + break; // todo: 处理最后为图标,显示省略号的情况 + } + if (this.direction === 'vertical' && paragraph.direction !== 'vertical') { + paragraph.verticalEllipsis = true; + break; + } + const ellipsis = drawEllipsis === true ? '...' : drawEllipsis || ''; + paragraph.ellipsisStr = ellipsis; + // const { width } = measureText('...', paragraph.style); + const { width } = measureTextCanvas(ellipsis, paragraph.character); + const ellipsisWidth = width || 0; + if (ellipsisWidth <= this.blankWidth + otherParagraphWidth) { + // 省略号可以直接接在后面paragraph + lastLine && (paragraph.ellipsis = 'add'); + + break; + } else if (ellipsisWidth <= this.blankWidth + otherParagraphWidth + paragraph.width) { + // 省略号需要替换paragraph中的字符 + paragraph.ellipsis = 'replace'; + paragraph.ellipsisWidth = ellipsisWidth; + paragraph.ellipsisOtherParagraphWidth = this.blankWidth + otherParagraphWidth; + + break; + } else { + // 省略号需要的width大于paragraph的width,隐藏paragraph,向前搜索 + paragraph.ellipsis = 'hide'; + otherParagraphWidth += paragraph.width; + } } } } diff --git a/packages/vrender/__tests__/browser/src/pages/richtext.ts b/packages/vrender/__tests__/browser/src/pages/richtext.ts index b43e3b6d3..ad3c22cae 100644 --- a/packages/vrender/__tests__/browser/src/pages/richtext.ts +++ b/packages/vrender/__tests__/browser/src/pages/richtext.ts @@ -961,6 +961,52 @@ export const page = () => { }) ); + const rt = createRichText({ + fontSize: 14, + fill: '#FFC400', + fontFamily: + 'PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol', + textAlign: 'center', + textBaseline: 'middle', + boundsPadding: [10, 0, 10, 0], + fontWeight: 'normal', + fillOpacity: 1, + ellipsis: true, + pickable: true, + lineJoin: 'bevel', + stroke: '#ffffff', + _debug_bounds: true, + zIndex: -1, + // maxLineWidth: 200, + disableAutoWrapLine: true, + x: 100, + y: 100, + angle: 0, + // lineWidth: 0, + textConfig: [ + { + text: '空值0\n', + fontSize: 12, + textAlign: 'left', + fill: '#1F2329' + }, + { + text: '8%', + fontSize: 12, + textAlign: 'left', + fill: '#646A73' + } + ], + z: 0, + // width: 30, + width: 31, + // width: 0, + height: 80 + // maxWidth: 200 + }); + + console.log(rt); + const stage = createStage({ canvas: 'main', width: 1200, @@ -986,50 +1032,52 @@ export const page = () => { shapes.length = 0; - shapes.push( - createRichText({ - fontSize: 14, - fill: '#FF8A00', - fontFamily: - 'PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol', - textAlign: 'center', - textBaseline: 'middle', - boundsPadding: [-1, 0, -1, 0], - visible: true, - fontWeight: 'normal', - fillOpacity: 1, - pickable: false, - lineJoin: 'bevel', - stroke: '#ffffff', - width: 50, - height: 40, - ellipsis: true, - disableAutoWrapLine: true, - x: 446.334013251786, - y: 198.39408125844088, - angle: 0, - lineWidth: 0, - textConfig: [ - { - text: 'aluminum1111111111111\n', - fontSize: 14, - fontWeight: 'bold', - fill: 'red' - }, - { - text: '1.13%', - fontSize: 14, - lineThrough: true, - underline: true, - fill: 'green' - } - ], - z: 0, - id: 'vrender-component-arc-label-2', - opacity: 1, - strokeOpacity: 1 - }) - ); + shapes.push(rt); + + // shapes.push( + // createRichText({ + // fontSize: 14, + // fill: '#FF8A00', + // fontFamily: + // 'PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol', + // textAlign: 'center', + // textBaseline: 'middle', + // boundsPadding: [-1, 0, -1, 0], + // visible: true, + // fontWeight: 'normal', + // fillOpacity: 1, + // pickable: false, + // lineJoin: 'bevel', + // stroke: '#ffffff', + // width: 50, + // height: 40, + // ellipsis: true, + // disableAutoWrapLine: true, + // x: 446.334013251786, + // y: 198.39408125844088, + // angle: 0, + // lineWidth: 0, + // textConfig: [ + // { + // text: 'aluminum1111111111111\n', + // fontSize: 14, + // fontWeight: 'bold', + // fill: 'red' + // }, + // { + // text: '1.13%', + // fontSize: 14, + // lineThrough: true, + // underline: true, + // fill: 'green' + // } + // ], + // z: 0, + // id: 'vrender-component-arc-label-2', + // opacity: 1, + // strokeOpacity: 1 + // }) + // ); addShapesToStage(stage, shapes as any, true); stage.render(); From 9d666465d970ba5886c65745fea3be98e3ecbf50 Mon Sep 17 00:00:00 2001 From: zhouxinyu Date: Thu, 19 Sep 2024 10:51:56 +0800 Subject: [PATCH 18/30] feat: add cliped to IRichText --- packages/vrender-core/src/interface/graphic/richText.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/vrender-core/src/interface/graphic/richText.ts b/packages/vrender-core/src/interface/graphic/richText.ts index 7d9f5d1fe..01d788a52 100644 --- a/packages/vrender-core/src/interface/graphic/richText.ts +++ b/packages/vrender-core/src/interface/graphic/richText.ts @@ -219,6 +219,7 @@ export interface IRichTextFrame { export interface IRichText extends IGraphic { getFrameCache: () => IRichTextFrame; + cliped?: boolean; } export interface IRichTextIcon extends IImage { From 1daf88677c895e8f3f93a4065101199057b8dc9c Mon Sep 17 00:00:00 2001 From: zhouxinyu Date: Thu, 19 Sep 2024 11:16:25 +0800 Subject: [PATCH 19/30] feat: poptip suppport multiline text, closed #1444 --- .../feat-poptip-multiline_2024-09-19-03-16.json | 10 ++++++++++ packages/vrender-core/src/graphic/text.ts | 8 ++++---- packages/vrender/__tests__/browser/src/pages/text.ts | 5 ++++- 3 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 common/changes/@visactor/vrender-core/feat-poptip-multiline_2024-09-19-03-16.json diff --git a/common/changes/@visactor/vrender-core/feat-poptip-multiline_2024-09-19-03-16.json b/common/changes/@visactor/vrender-core/feat-poptip-multiline_2024-09-19-03-16.json new file mode 100644 index 000000000..41b6c198f --- /dev/null +++ b/common/changes/@visactor/vrender-core/feat-poptip-multiline_2024-09-19-03-16.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@visactor/vrender-core", + "comment": "feat: poptip suppport multiline text, closed #1444", + "type": "none" + } + ], + "packageName": "@visactor/vrender-core" +} \ No newline at end of file diff --git a/packages/vrender-core/src/graphic/text.ts b/packages/vrender-core/src/graphic/text.ts index f06b90f25..a52b9034b 100644 --- a/packages/vrender-core/src/graphic/text.ts +++ b/packages/vrender-core/src/graphic/text.ts @@ -78,14 +78,14 @@ export class Text extends Graphic implements IText { get cliped(): boolean | undefined { const textTheme = this.getGraphicTheme(); const attribute = this.attribute; - if (this.isMultiLine) { - return undefined; - } - const { maxLineWidth = textTheme.maxLineWidth } = attribute; + const { maxLineWidth = textTheme.maxLineWidth, text, whiteSpace = textTheme.whiteSpace } = attribute; if (!Number.isFinite(maxLineWidth)) { return false; } this.tryUpdateAABBBounds(); + if (Array.isArray(text) && whiteSpace !== 'normal') { + return !this.cache.layoutData.lines.every((item, idx) => item.str === attribute.text); + } if (attribute.direction === 'vertical' && this.cache.verticalList && this.cache.verticalList[0]) { return this.cache.verticalList[0].map(item => item.text).join('') !== attribute.text.toString(); } diff --git a/packages/vrender/__tests__/browser/src/pages/text.ts b/packages/vrender/__tests__/browser/src/pages/text.ts index 76b0d93a4..9f175f2c5 100644 --- a/packages/vrender/__tests__/browser/src/pages/text.ts +++ b/packages/vrender/__tests__/browser/src/pages/text.ts @@ -126,12 +126,15 @@ export const page = () => { // }, // background: 'red', // backgroundCornerRadius: 10, - text: '这是一行文字', + text: ['这是一行文字', '这是第二哈那个'], fill: 'red', + maxLineWidth: 100, + whiteSpace: 'normal', fontSize: 36, textBaseline: 'top' }) ); + console.log('aaa', graphics[graphics.length - 1]); graphics.push( createLine({ x: 300, From 381ff99bc6c76746bca0512d7548c23acf9b1deb Mon Sep 17 00:00:00 2001 From: xile611 Date: Thu, 19 Sep 2024 15:44:29 +0800 Subject: [PATCH 20/30] fix: fix auto-limit of circle-axis when has labels less than 2 --- .../vrender-components/src/axis/circle.ts | 2 -- .../src/axis/overlap/circle-auto-limit.ts | 27 ++++++++++--------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/packages/vrender-components/src/axis/circle.ts b/packages/vrender-components/src/axis/circle.ts index 0868d9f93..4f2944558 100644 --- a/packages/vrender-components/src/axis/circle.ts +++ b/packages/vrender-components/src/axis/circle.ts @@ -307,8 +307,6 @@ export class CircleAxis extends AxisBase { text: string | number, style: Partial ) { - const pos = getCircleLabelPosition(point, vector); - return point; } } diff --git a/packages/vrender-components/src/axis/overlap/circle-auto-limit.ts b/packages/vrender-components/src/axis/overlap/circle-auto-limit.ts index b594b3a3f..96c2691af 100644 --- a/packages/vrender-components/src/axis/overlap/circle-auto-limit.ts +++ b/packages/vrender-components/src/axis/overlap/circle-auto-limit.ts @@ -30,21 +30,24 @@ function adjustMaxHeight( selfIndex: number, bounds: { x1: number; x2: number; y1: number; y2: number } ) { - if (labels.length < 3) { - } else { + const siblings = []; + if (labels.length >= 3) { const { prevLabel, nextLabel } = findSiblingLabels(labels, selfIndex); - const label = labels[selfIndex]; - const heightLimit = Math.min( - Math.abs(prevLabel.attribute.y - label.attribute.y), - Math.abs(nextLabel.attribute.y - label.attribute.y), - Math.abs(label.attribute.y - bounds.y1), - Math.abs(label.attribute.y - bounds.y2) - ); + siblings.push(prevLabel, nextLabel); + } else if (labels.length === 2) { + siblings.push(labels[selfIndex === 0 ? 1 : 0]); + } + const label = labels[selfIndex]; + + let heightLimit = Math.min(Math.abs(label.attribute.y - bounds.y1), Math.abs(label.attribute.y - bounds.y2)); + + siblings.forEach(sibling => { + heightLimit = Math.min(heightLimit, Math.abs(sibling.attribute.y - label.attribute.y)); + }); - if (heightLimit > 0) { - label.setAttributes({ whiteSpace: 'normal', heightLimit }); - } + if (heightLimit > 0) { + label.setAttributes({ whiteSpace: 'normal', heightLimit }); } } /** From e6d7ef07e05520cb1d86d433164614900c2c14b7 Mon Sep 17 00:00:00 2001 From: zhouxinyu Date: Thu, 19 Sep 2024 20:29:00 +0800 Subject: [PATCH 21/30] fix: rename clip to cliped --- packages/vrender-core/src/graphic/richtext.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vrender-core/src/graphic/richtext.ts b/packages/vrender-core/src/graphic/richtext.ts index 5175009af..a2e94ebd1 100644 --- a/packages/vrender-core/src/graphic/richtext.ts +++ b/packages/vrender-core/src/graphic/richtext.ts @@ -264,7 +264,7 @@ export class RichText extends Graphic implements IRic return this._frameCache; } - get clip() { + get cliped() { const frameCache = this.getFrameCache(); if (frameCache.actualHeight > frameCache.height) { return true; From 6a1efda53869180978b559deba559b110eed2ec9 Mon Sep 17 00:00:00 2001 From: zhouxinyu Date: Thu, 19 Sep 2024 20:49:29 +0800 Subject: [PATCH 22/30] fix: text cliped support lineClamp --- packages/vrender-core/src/graphic/text.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/vrender-core/src/graphic/text.ts b/packages/vrender-core/src/graphic/text.ts index a52b9034b..a91818bd7 100644 --- a/packages/vrender-core/src/graphic/text.ts +++ b/packages/vrender-core/src/graphic/text.ts @@ -83,8 +83,14 @@ export class Text extends Graphic implements IText { return false; } this.tryUpdateAABBBounds(); - if (Array.isArray(text) && whiteSpace !== 'normal') { - return !this.cache.layoutData.lines.every((item, idx) => item.str === attribute.text); + if (this.cache.layoutData.lines) { + let mergedText = ''; + this.cache.layoutData.lines.forEach(item => { + mergedText += item.str; + }); + const originText = Array.isArray(text) ? text.join('') : text; + + return originText !== mergedText; } if (attribute.direction === 'vertical' && this.cache.verticalList && this.cache.verticalList[0]) { return this.cache.verticalList[0].map(item => item.text).join('') !== attribute.text.toString(); From 5738229fcb0e4b70610e940295c7ec34da3afd5b Mon Sep 17 00:00:00 2001 From: xile611 Date: Wed, 11 Sep 2024 17:51:24 +0800 Subject: [PATCH 23/30] fix: fix maxLineWidth of arc label --- packages/vrender-components/src/label/arc.ts | 30 ++++++++++++++------ packages/vrender-components/src/util/text.ts | 8 ++++-- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/packages/vrender-components/src/label/arc.ts b/packages/vrender-components/src/label/arc.ts index e52d545d4..cb383e9f2 100644 --- a/packages/vrender-components/src/label/arc.ts +++ b/packages/vrender-components/src/label/arc.ts @@ -11,7 +11,7 @@ import { } from '@visactor/vutils'; import { LabelBase } from './base'; import type { ArcLabelAttrs, IPoint, Quadrant, BaseLabelAttrs, LabelItem, IArcLabelLineSpec } from './type'; -import type { IArc, IRichTextAttribute } from '@visactor/vrender-core'; +import type { IArc, IRichTextAttribute, ITextAttribute } from '@visactor/vrender-core'; // eslint-disable-next-line no-duplicate-imports import { type IRichText, type IText, type IArcGraphicAttribute, type IGraphic } from '@visactor/vrender-core'; import { @@ -82,7 +82,6 @@ export class ArcInfo { this.outerRadius = outerRadius; this.circleCenter = circleCenter; this.labelVisible = true; - this.labelLimit = 0; } getLabelBounds(): IBoundsLike { @@ -170,7 +169,9 @@ export class ArcLabel extends LabelBase { } const labels = super._layout(texts); - const textBoundsArray = labels.map(label => this.getGraphicBounds(label as any)); + const textBoundsArray = labels.map(label => { + return this.getGraphicBounds(label as any); + }); const ellipsisLabelAttribute = { ...this.attribute.textStyle, text: '…' @@ -220,16 +221,21 @@ export class ArcLabel extends LabelBase { x: basedArc.labelPosition.x, y: basedArc.labelPosition.y, angle: basedArc.angle, - maxLineWidth: basedArc.labelLimit, points: basedArc.pointA && basedArc.pointB && basedArc.pointC ? [basedArc.pointA, basedArc.pointB, basedArc.pointC] : undefined, line: basedArc.labelLine }; - if (labels[i].type === 'richtext') { - (labelAttribute as unknown as IRichTextAttribute).width = basedArc.labelLimit; + + if (basedArc.labelLimit) { + if (labels[i].type === 'richtext') { + (labelAttribute as unknown as IRichTextAttribute).width = basedArc.labelLimit; + } else { + (labelAttribute as unknown as ITextAttribute).maxLineWidth = basedArc.labelLimit; + } } + labels[i].setAttributes(labelAttribute); } } @@ -526,12 +532,18 @@ export class ArcLabel extends LabelBase { break; } labelWidth = Math.max(this._ellipsisWidth, labelWidth); - arc.labelLimit = labelWidth; + const needAdjustLimit = labelWidth < arc.labelSize.width - 1; + + if (needAdjustLimit) { + arc.labelLimit = labelWidth; + } else { + arc.labelLimit = null; + } + arc.pointC = { x: cx, y: labelPosition.y }; const align = this._computeAlign(arc, attribute); - const targetCenterOffset = - getAlignOffset(align) * (arc.labelLimit < arc.labelSize.width ? arc.labelLimit : arc.labelSize.width); + const targetCenterOffset = getAlignOffset(align) * (needAdjustLimit ? labelWidth : arc.labelSize.width); if (labelLayoutAlign === 'edge') { // edge 模式下的多行文本对齐方向与其他模式相反 diff --git a/packages/vrender-components/src/util/text.ts b/packages/vrender-components/src/util/text.ts index 00dd819e7..3c62d511b 100644 --- a/packages/vrender-components/src/util/text.ts +++ b/packages/vrender-components/src/util/text.ts @@ -9,7 +9,7 @@ import type { import { getTextBounds, graphicCreator } from '@visactor/vrender-core'; import type { ITextMeasureOption } from '@visactor/vutils'; // eslint-disable-next-line no-duplicate-imports -import { TextMeasure, isObject } from '@visactor/vutils'; +import { TextMeasure, isObject, isValid } from '@visactor/vutils'; import { DEFAULT_TEXT_FONT_FAMILY, DEFAULT_TEXT_FONT_SIZE } from '../constant'; import type { HTMLTextContent, ReactTextContent, TextContent } from '../core/type'; @@ -75,9 +75,13 @@ export function getTextType(attributes: TextContent, typeKey = 'type') { } export function richTextAttributeTransform(attributes: ITextGraphicAttribute & IRichTextAttribute & TextContent) { + if (isValid(attributes.maxLineWidth)) { + attributes.maxWidth = attributes.maxLineWidth; + delete attributes.maxLineWidth; + } + attributes.width = attributes.width ?? 0; attributes.height = attributes.height ?? 0; - attributes.maxWidth = attributes.maxLineWidth; attributes.textConfig = (attributes.text as unknown as any).text || attributes.text; return attributes; } From 344d634853896a644cfd3922aae7fc9a72709b6d Mon Sep 17 00:00:00 2001 From: xile611 Date: Wed, 11 Sep 2024 17:51:44 +0800 Subject: [PATCH 24/30] docs: update changlog of rush --- .../fix-arc-label-text-ellipse_2024-09-11-09-51.json | 11 +++++++++++ .../fix-arc-label-text-ellipse_2024-09-11-09-51.json | 11 +++++++++++ .../fix-arc-label-text-ellipse_2024-09-11-09-51.json | 11 +++++++++++ 3 files changed, 33 insertions(+) create mode 100644 common/changes/@visactor/vrender-components/fix-arc-label-text-ellipse_2024-09-11-09-51.json create mode 100644 common/changes/@visactor/vrender-core/fix-arc-label-text-ellipse_2024-09-11-09-51.json create mode 100644 common/changes/@visactor/vrender/fix-arc-label-text-ellipse_2024-09-11-09-51.json diff --git a/common/changes/@visactor/vrender-components/fix-arc-label-text-ellipse_2024-09-11-09-51.json b/common/changes/@visactor/vrender-components/fix-arc-label-text-ellipse_2024-09-11-09-51.json new file mode 100644 index 000000000..a6788d364 --- /dev/null +++ b/common/changes/@visactor/vrender-components/fix-arc-label-text-ellipse_2024-09-11-09-51.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "fix: fix maxLineWidth of arc label\n\n", + "type": "none", + "packageName": "@visactor/vrender-components" + } + ], + "packageName": "@visactor/vrender-components", + "email": "dingling112@gmail.com" +} \ No newline at end of file diff --git a/common/changes/@visactor/vrender-core/fix-arc-label-text-ellipse_2024-09-11-09-51.json b/common/changes/@visactor/vrender-core/fix-arc-label-text-ellipse_2024-09-11-09-51.json new file mode 100644 index 000000000..66fd1baf3 --- /dev/null +++ b/common/changes/@visactor/vrender-core/fix-arc-label-text-ellipse_2024-09-11-09-51.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "fix: fix maxLineWidth of arc label\n\n", + "type": "none", + "packageName": "@visactor/vrender-core" + } + ], + "packageName": "@visactor/vrender-core", + "email": "dingling112@gmail.com" +} \ No newline at end of file diff --git a/common/changes/@visactor/vrender/fix-arc-label-text-ellipse_2024-09-11-09-51.json b/common/changes/@visactor/vrender/fix-arc-label-text-ellipse_2024-09-11-09-51.json new file mode 100644 index 000000000..ba5c6a19f --- /dev/null +++ b/common/changes/@visactor/vrender/fix-arc-label-text-ellipse_2024-09-11-09-51.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "fix: fix maxLineWidth of arc label\n\n", + "type": "none", + "packageName": "@visactor/vrender" + } + ], + "packageName": "@visactor/vrender", + "email": "dingling112@gmail.com" +} \ No newline at end of file From 180d43276518c728294030a267f72305d2dacbdb Mon Sep 17 00:00:00 2001 From: xile611 Date: Thu, 19 Sep 2024 21:48:35 +0800 Subject: [PATCH 25/30] fix: upgrade vutil to 0.18.16 --- common/config/rush/pnpm-lock.yaml | 44 +++++++++++------------ docs/demos/package.json | 2 +- docs/package.json | 2 +- packages/react-vrender-utils/package.json | 2 +- packages/react-vrender/package.json | 2 +- packages/vrender-components/package.json | 6 ++-- packages/vrender-core/package.json | 2 +- packages/vrender-kits/package.json | 2 +- packages/vrender/package.json | 2 +- 9 files changed, 32 insertions(+), 32 deletions(-) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 77b7b99d7..f12fa276c 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -15,7 +15,7 @@ importers: '@visactor/vchart': 1.3.0 '@visactor/vgrammar': ~0.5.7 '@visactor/vrender': workspace:0.20.4 - '@visactor/vutils': ~0.18.15 + '@visactor/vutils': ~0.18.16 '@vitejs/plugin-react': 3.1.0 axios: ^1.4.0 chalk: ^3.0.0 @@ -38,7 +38,7 @@ importers: '@visactor/vchart': 1.3.0 '@visactor/vgrammar': 0.5.7 '@visactor/vrender': link:../packages/vrender - '@visactor/vutils': 0.18.15 + '@visactor/vutils': 0.18.16 axios: 1.7.4 highlight.js: 11.10.0 lodash: 4.17.21 @@ -72,7 +72,7 @@ importers: '@types/react-dom': ^18.0.0 '@types/react-reconciler': ^0.28.2 '@visactor/vrender': workspace:0.20.4 - '@visactor/vutils': ~0.18.15 + '@visactor/vutils': ~0.18.16 '@vitejs/plugin-react': 3.1.0 cross-env: ^7.0.3 eslint: ~8.18.0 @@ -84,7 +84,7 @@ importers: vite: 3.2.6 dependencies: '@visactor/vrender': link:../vrender - '@visactor/vutils': 0.18.15 + '@visactor/vutils': 0.18.16 react-reconciler: 0.29.2_react@18.3.1 tslib: 2.6.3 devDependencies: @@ -113,7 +113,7 @@ importers: '@types/react-dom': ^18.0.0 '@visactor/react-vrender': workspace:0.20.4 '@visactor/vrender': workspace:0.20.4 - '@visactor/vutils': ~0.18.15 + '@visactor/vutils': ~0.18.16 '@vitejs/plugin-react': 3.1.0 cross-env: ^7.0.3 eslint: ~8.18.0 @@ -126,7 +126,7 @@ importers: dependencies: '@visactor/react-vrender': link:../react-vrender '@visactor/vrender': link:../vrender - '@visactor/vutils': 0.18.15 + '@visactor/vutils': 0.18.16 react-reconciler: 0.29.2_react@18.3.1 tslib: 2.6.3 devDependencies: @@ -155,7 +155,7 @@ importers: '@types/react-dom': ^18.0.0 '@visactor/vrender-core': workspace:0.20.4 '@visactor/vrender-kits': workspace:0.20.4 - '@visactor/vutils': ~0.18.15 + '@visactor/vutils': ~0.18.16 '@vitejs/plugin-react': 3.1.0 canvas: 2.11.2 cross-env: ^7.0.3 @@ -179,7 +179,7 @@ importers: '@types/jest': 26.0.24 '@types/react': 18.3.3 '@types/react-dom': 18.3.0 - '@visactor/vutils': 0.18.15 + '@visactor/vutils': 0.18.16 '@vitejs/plugin-react': 3.1.0_vite@3.2.6 canvas: 2.11.2 cross-env: 7.0.3 @@ -202,8 +202,8 @@ importers: '@types/jest': ^26.0.0 '@visactor/vrender-core': workspace:0.20.4 '@visactor/vrender-kits': workspace:0.20.4 - '@visactor/vscale': ~0.18.15 - '@visactor/vutils': ~0.18.15 + '@visactor/vscale': ~0.18.16 + '@visactor/vutils': ~0.18.16 cross-env: ^7.0.3 eslint: ~8.18.0 jest: ^26.0.0 @@ -215,8 +215,8 @@ importers: dependencies: '@visactor/vrender-core': link:../vrender-core '@visactor/vrender-kits': link:../vrender-kits - '@visactor/vscale': 0.18.15 - '@visactor/vutils': 0.18.15 + '@visactor/vscale': 0.18.16 + '@visactor/vutils': 0.18.16 devDependencies: '@internal/bundler': link:../../tools/bundler '@internal/eslint-config': link:../../share/eslint-config @@ -241,7 +241,7 @@ importers: '@types/jest': ^26.0.0 '@types/react': ^18.0.0 '@types/react-dom': ^18.0.0 - '@visactor/vutils': ~0.18.15 + '@visactor/vutils': ~0.18.16 '@vitejs/plugin-react': 3.1.0 color-convert: 2.0.1 cross-env: ^7.0.3 @@ -255,7 +255,7 @@ importers: typescript: 4.9.5 vite: 3.2.6 dependencies: - '@visactor/vutils': 0.18.15 + '@visactor/vutils': 0.18.16 color-convert: 2.0.1 devDependencies: '@internal/bundler': link:../../tools/bundler @@ -288,7 +288,7 @@ importers: '@types/react': ^18.0.0 '@types/react-dom': ^18.0.0 '@visactor/vrender-core': workspace:0.20.4 - '@visactor/vutils': ~0.18.15 + '@visactor/vutils': ~0.18.16 '@vitejs/plugin-react': 3.1.0 canvas: 2.11.2 cross-env: ^7.0.3 @@ -302,7 +302,7 @@ importers: dependencies: '@resvg/resvg-js': 2.4.1 '@visactor/vrender-core': link:../vrender-core - '@visactor/vutils': 0.18.15 + '@visactor/vutils': 0.18.16 roughjs: 4.5.2 devDependencies: '@internal/bundler': link:../../tools/bundler @@ -3422,10 +3422,10 @@ packages: '@visactor/vutils': 0.15.14 dev: false - /@visactor/vscale/0.18.15: - resolution: {integrity: sha512-09dDWc6muJbOMxzp4odCsyLjqAF6u3BOx9kAJJ0tEpKE1AuHL4BTejNe697mJAnXqAo2ynAA+dn+cgWYiW1WQg==} + /@visactor/vscale/0.18.16: + resolution: {integrity: sha512-iOMo7dHoImlRntHdSLVbx4dgyGQ7SCSeOHoA5Re7rDmC23h8Tsb9n5sP8l6DRYq/Xzuq0yAbR80iizmNZnnlWw==} dependencies: - '@visactor/vutils': 0.18.15 + '@visactor/vutils': 0.18.16 dev: false /@visactor/vutils/0.13.3: @@ -3444,8 +3444,8 @@ packages: eventemitter3: 4.0.7 dev: false - /@visactor/vutils/0.18.15: - resolution: {integrity: sha512-gTw8n14SU4avmqZ6VwpHwqoDfOCq044M2QA43rViNaHBnOQ/ePOPRZHl0heSfGQoMIJSZUD7SowLnn5NJjVXYw==} + /@visactor/vutils/0.18.16: + resolution: {integrity: sha512-F2QZVtnc47L1jXyz9o5bEeadIwgdPfoQy6gxE+n6bPJfKZHq3YKp0B5ase9+m2sKNBCrHYc2q9k5lRtp8h/TAQ==} dependencies: '@turf/helpers': 6.5.0 '@turf/invariant': 6.5.0 @@ -6205,7 +6205,7 @@ packages: resolution: {integrity: sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==} engines: {node: '>= 4.0'} os: [darwin] - deprecated: The v1 package contains DANGEROUS / INSECURE binaries. Upgrade to safe fsevents v2 + deprecated: Upgrade to fsevents v2 to mitigate potential security issues requiresBuild: true dependencies: bindings: 1.5.0 diff --git a/docs/demos/package.json b/docs/demos/package.json index caba6c946..dc9e44eae 100644 --- a/docs/demos/package.json +++ b/docs/demos/package.json @@ -12,7 +12,7 @@ "@internal/eslint-config": "workspace:*", "@internal/ts-config": "workspace:*", "@visactor/vrender-kits": "workspace:0.14.8", - "@visactor/vutils": "~0.18.15", + "@visactor/vutils": "~0.18.16", "d3-scale-chromatic": "^3.0.0", "lodash": "4.17.21", "dat.gui": "^0.7.9", diff --git a/docs/package.json b/docs/package.json index b4fdf49d9..48a5e4fa5 100644 --- a/docs/package.json +++ b/docs/package.json @@ -11,7 +11,7 @@ "dependencies": { "@arco-design/web-react": "2.46.1", "@visactor/vchart": "1.3.0", - "@visactor/vutils": "~0.18.15", + "@visactor/vutils": "~0.18.16", "@visactor/vgrammar": "~0.5.7", "@visactor/vrender": "workspace:0.20.4", "markdown-it": "^13.0.0", diff --git a/packages/react-vrender-utils/package.json b/packages/react-vrender-utils/package.json index 1408c3fd5..94388c428 100644 --- a/packages/react-vrender-utils/package.json +++ b/packages/react-vrender-utils/package.json @@ -26,7 +26,7 @@ "dependencies": { "@visactor/vrender": "workspace:0.20.4", "@visactor/react-vrender": "workspace:0.20.4", - "@visactor/vutils": "~0.18.15", + "@visactor/vutils": "~0.18.16", "react-reconciler": "^0.29.0", "tslib": "^2.3.1" }, diff --git a/packages/react-vrender/package.json b/packages/react-vrender/package.json index 8d22a2b7b..b2c10088b 100644 --- a/packages/react-vrender/package.json +++ b/packages/react-vrender/package.json @@ -24,7 +24,7 @@ }, "dependencies": { "@visactor/vrender": "workspace:0.20.4", - "@visactor/vutils": "~0.18.15", + "@visactor/vutils": "~0.18.16", "react-reconciler": "^0.29.0", "tslib": "^2.3.1" }, diff --git a/packages/vrender-components/package.json b/packages/vrender-components/package.json index 4f812f9d8..c83bed660 100644 --- a/packages/vrender-components/package.json +++ b/packages/vrender-components/package.json @@ -24,8 +24,8 @@ "analysis-core": "cross-env DEBUG='Bundler*' bundle -f umd -a -i core.ts" }, "dependencies": { - "@visactor/vutils": "~0.18.15", - "@visactor/vscale": "~0.18.15", + "@visactor/vutils": "~0.18.16", + "@visactor/vscale": "~0.18.16", "@visactor/vrender-core": "workspace:0.20.4", "@visactor/vrender-kits": "workspace:0.20.4" }, @@ -34,7 +34,7 @@ "@internal/eslint-config": "workspace:*", "@internal/ts-config": "workspace:*", "@rushstack/eslint-patch": "~1.1.4", - "@visactor/vscale": "~0.18.15", + "@visactor/vscale": "~0.18.16", "@types/jest": "^26.0.0", "jest": "^26.0.0", "jest-electron": "^0.1.12", diff --git a/packages/vrender-core/package.json b/packages/vrender-core/package.json index 0d74603d8..a520b5c66 100644 --- a/packages/vrender-core/package.json +++ b/packages/vrender-core/package.json @@ -29,7 +29,7 @@ }, "dependencies": { "color-convert": "2.0.1", - "@visactor/vutils": "~0.18.15" + "@visactor/vutils": "~0.18.16" }, "devDependencies": { "@internal/bundler": "workspace:*", diff --git a/packages/vrender-kits/package.json b/packages/vrender-kits/package.json index 6ae97f4dc..4a8fb7914 100644 --- a/packages/vrender-kits/package.json +++ b/packages/vrender-kits/package.json @@ -20,7 +20,7 @@ "test": "" }, "dependencies": { - "@visactor/vutils": "~0.18.15", + "@visactor/vutils": "~0.18.16", "@visactor/vrender-core": "workspace:0.20.4", "@resvg/resvg-js": "2.4.1", "roughjs": "4.5.2" diff --git a/packages/vrender/package.json b/packages/vrender/package.json index 159670431..22a49a3c8 100644 --- a/packages/vrender/package.json +++ b/packages/vrender/package.json @@ -32,7 +32,7 @@ "@internal/eslint-config": "workspace:*", "@internal/ts-config": "workspace:*", "@rushstack/eslint-patch": "~1.1.4", - "@visactor/vutils": "~0.18.15", + "@visactor/vutils": "~0.18.16", "canvas": "2.11.2", "react": "^18.0.0", "react-dom": "^18.0.0", From ad95cca06c405241840bc68747f4153b9028c1d5 Mon Sep 17 00:00:00 2001 From: xile611 Date: Fri, 20 Sep 2024 10:22:40 +0800 Subject: [PATCH 26/30] fix: fix error of text.cliped when has only one line --- packages/vrender-core/src/graphic/text.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vrender-core/src/graphic/text.ts b/packages/vrender-core/src/graphic/text.ts index a91818bd7..489c9aeeb 100644 --- a/packages/vrender-core/src/graphic/text.ts +++ b/packages/vrender-core/src/graphic/text.ts @@ -83,7 +83,7 @@ export class Text extends Graphic implements IText { return false; } this.tryUpdateAABBBounds(); - if (this.cache.layoutData.lines) { + if (this.cache?.layoutData?.lines) { let mergedText = ''; this.cache.layoutData.lines.forEach(item => { mergedText += item.str; From dd616e7e827e26800dec1ab17e721889dc535d15 Mon Sep 17 00:00:00 2001 From: xile611 Date: Fri, 20 Sep 2024 10:51:22 +0800 Subject: [PATCH 27/30] fix: fix limit of arc label --- packages/vrender-components/src/label/arc.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/vrender-components/src/label/arc.ts b/packages/vrender-components/src/label/arc.ts index cb383e9f2..666d120bc 100644 --- a/packages/vrender-components/src/label/arc.ts +++ b/packages/vrender-components/src/label/arc.ts @@ -228,12 +228,12 @@ export class ArcLabel extends LabelBase { line: basedArc.labelLine }; - if (basedArc.labelLimit) { - if (labels[i].type === 'richtext') { - (labelAttribute as unknown as IRichTextAttribute).width = basedArc.labelLimit; - } else { - (labelAttribute as unknown as ITextAttribute).maxLineWidth = basedArc.labelLimit; - } + if (labels[i].type === 'richtext') { + (labelAttribute as unknown as IRichTextAttribute).width = + basedArc.labelLimit ?? (labels[i].attribute as IRichTextAttribute).width; + } else { + (labelAttribute as unknown as ITextAttribute).maxLineWidth = + basedArc.labelLimit ?? (labels[i].attribute as ITextAttribute).maxLineWidth; } labels[i].setAttributes(labelAttribute); From 22909c95dbcb7eef28c4efd48f8c52218808ae1b Mon Sep 17 00:00:00 2001 From: xile611 Date: Fri, 20 Sep 2024 14:11:16 +0800 Subject: [PATCH 28/30] fix: fix path string of arc, fix #1434 --- packages/vrender-core/src/common/shape/arc.ts | 59 +++++++++++-------- 1 file changed, 33 insertions(+), 26 deletions(-) diff --git a/packages/vrender-core/src/common/shape/arc.ts b/packages/vrender-core/src/common/shape/arc.ts index 6fc003e22..2c6d36924 100644 --- a/packages/vrender-core/src/common/shape/arc.ts +++ b/packages/vrender-core/src/common/shape/arc.ts @@ -184,30 +184,37 @@ export const addArcToBezierPath = ( ) => { // https://stackoverflow.com/questions/1734745/how-to-create-circle-with-b%C3%A9zier-curves const delta = Math.abs(endAngle - startAngle); - const len = (Math.tan(delta / 4) * 4) / 3; - const dir = endAngle < startAngle ? -1 : 1; - - const c1 = Math.cos(startAngle); - const s1 = Math.sin(startAngle); - const c2 = Math.cos(endAngle); - const s2 = Math.sin(endAngle); - - const x1 = c1 * rx + cx; - const y1 = s1 * ry + cy; - - const x4 = c2 * rx + cx; - const y4 = s2 * ry + cy; - - const hx = rx * len * dir; - const hy = ry * len * dir; - - bezierPath.push( - // Move control points on tangent. - x1 - hx * s1, - y1 + hy * c1, - x4 + hx * s2, - y4 - hy * c2, - x4, - y4 - ); + const count = delta > 0.5 * Math.PI ? Math.ceil((2 * delta) / Math.PI) : 1; + const stepAngle = (endAngle - startAngle) / count; + + for (let i = 0; i < count; i++) { + const sa = startAngle + stepAngle * i; + const ea = startAngle + stepAngle * (i + 1); + const len = (Math.tan(Math.abs(stepAngle) / 4) * 4) / 3; + const dir = ea < sa ? -1 : 1; + + const c1 = Math.cos(sa); + const s1 = Math.sin(sa); + const c2 = Math.cos(ea); + const s2 = Math.sin(ea); + + const x1 = c1 * rx + cx; + const y1 = s1 * ry + cy; + + const x4 = c2 * rx + cx; + const y4 = s2 * ry + cy; + + const hx = rx * len * dir; + const hy = ry * len * dir; + + bezierPath.push( + // Move control points on tangent. + x1 - hx * s1, + y1 + hy * c1, + x4 + hx * s2, + y4 - hy * c2, + x4, + y4 + ); + } }; From 26d0c9769df7aa2f9bc7d878de99eb9feb9f33ae Mon Sep 17 00:00:00 2001 From: xile611 Date: Fri, 20 Sep 2024 14:11:59 +0800 Subject: [PATCH 29/30] docs: update changlog of rush --- .../fix-custom-path-arc-string_2024-09-20-06-11.json | 11 +++++++++++ .../fix-custom-path-arc-string_2024-09-20-06-11.json | 11 +++++++++++ .../fix-custom-path-arc-string_2024-09-20-06-11.json | 11 +++++++++++ .../fix-custom-path-arc-string_2024-09-20-06-11.json | 11 +++++++++++ .../fix-custom-path-arc-string_2024-09-20-06-11.json | 11 +++++++++++ .../fix-custom-path-arc-string_2024-09-20-06-11.json | 11 +++++++++++ 6 files changed, 66 insertions(+) create mode 100644 common/changes/@visactor/react-vrender-utils/fix-custom-path-arc-string_2024-09-20-06-11.json create mode 100644 common/changes/@visactor/react-vrender/fix-custom-path-arc-string_2024-09-20-06-11.json create mode 100644 common/changes/@visactor/vrender-components/fix-custom-path-arc-string_2024-09-20-06-11.json create mode 100644 common/changes/@visactor/vrender-core/fix-custom-path-arc-string_2024-09-20-06-11.json create mode 100644 common/changes/@visactor/vrender-kits/fix-custom-path-arc-string_2024-09-20-06-11.json create mode 100644 common/changes/@visactor/vrender/fix-custom-path-arc-string_2024-09-20-06-11.json diff --git a/common/changes/@visactor/react-vrender-utils/fix-custom-path-arc-string_2024-09-20-06-11.json b/common/changes/@visactor/react-vrender-utils/fix-custom-path-arc-string_2024-09-20-06-11.json new file mode 100644 index 000000000..81cbe0710 --- /dev/null +++ b/common/changes/@visactor/react-vrender-utils/fix-custom-path-arc-string_2024-09-20-06-11.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "fix: fix path string of arc, fix #1434\n\n", + "type": "none", + "packageName": "@visactor/react-vrender-utils" + } + ], + "packageName": "@visactor/react-vrender-utils", + "email": "dingling112@gmail.com" +} \ No newline at end of file diff --git a/common/changes/@visactor/react-vrender/fix-custom-path-arc-string_2024-09-20-06-11.json b/common/changes/@visactor/react-vrender/fix-custom-path-arc-string_2024-09-20-06-11.json new file mode 100644 index 000000000..c9402d7a5 --- /dev/null +++ b/common/changes/@visactor/react-vrender/fix-custom-path-arc-string_2024-09-20-06-11.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "fix: fix path string of arc, fix #1434\n\n", + "type": "none", + "packageName": "@visactor/react-vrender" + } + ], + "packageName": "@visactor/react-vrender", + "email": "dingling112@gmail.com" +} \ No newline at end of file diff --git a/common/changes/@visactor/vrender-components/fix-custom-path-arc-string_2024-09-20-06-11.json b/common/changes/@visactor/vrender-components/fix-custom-path-arc-string_2024-09-20-06-11.json new file mode 100644 index 000000000..99981ca6a --- /dev/null +++ b/common/changes/@visactor/vrender-components/fix-custom-path-arc-string_2024-09-20-06-11.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "fix: fix path string of arc, fix #1434\n\n", + "type": "none", + "packageName": "@visactor/vrender-components" + } + ], + "packageName": "@visactor/vrender-components", + "email": "dingling112@gmail.com" +} \ No newline at end of file diff --git a/common/changes/@visactor/vrender-core/fix-custom-path-arc-string_2024-09-20-06-11.json b/common/changes/@visactor/vrender-core/fix-custom-path-arc-string_2024-09-20-06-11.json new file mode 100644 index 000000000..e57e4e231 --- /dev/null +++ b/common/changes/@visactor/vrender-core/fix-custom-path-arc-string_2024-09-20-06-11.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "fix: fix path string of arc, fix #1434\n\n", + "type": "none", + "packageName": "@visactor/vrender-core" + } + ], + "packageName": "@visactor/vrender-core", + "email": "dingling112@gmail.com" +} \ No newline at end of file diff --git a/common/changes/@visactor/vrender-kits/fix-custom-path-arc-string_2024-09-20-06-11.json b/common/changes/@visactor/vrender-kits/fix-custom-path-arc-string_2024-09-20-06-11.json new file mode 100644 index 000000000..6ad2d9e4c --- /dev/null +++ b/common/changes/@visactor/vrender-kits/fix-custom-path-arc-string_2024-09-20-06-11.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "fix: fix path string of arc, fix #1434\n\n", + "type": "none", + "packageName": "@visactor/vrender-kits" + } + ], + "packageName": "@visactor/vrender-kits", + "email": "dingling112@gmail.com" +} \ No newline at end of file diff --git a/common/changes/@visactor/vrender/fix-custom-path-arc-string_2024-09-20-06-11.json b/common/changes/@visactor/vrender/fix-custom-path-arc-string_2024-09-20-06-11.json new file mode 100644 index 000000000..332c40890 --- /dev/null +++ b/common/changes/@visactor/vrender/fix-custom-path-arc-string_2024-09-20-06-11.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "fix: fix path string of arc, fix #1434\n\n", + "type": "none", + "packageName": "@visactor/vrender" + } + ], + "packageName": "@visactor/vrender", + "email": "dingling112@gmail.com" +} \ No newline at end of file From ae9413688df25a8370ab00d30cdd033744054cdc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 20 Sep 2024 06:44:30 +0000 Subject: [PATCH 30/30] build: prelease version 0.20.5 --- ...stom-path-arc-string_2024-09-20-06-11.json | 11 -------- ...stom-path-arc-string_2024-09-20-06-11.json | 11 -------- ...arc-label-line-shape_2024-09-18-06-35.json | 10 ------- ...c-label-text-ellipse_2024-09-11-09-51.json | 11 -------- ...stom-path-arc-string_2024-09-20-06-11.json | 11 -------- ...data-zoom-text-style_2024-09-18-04-02.json | 11 -------- ...muti-to-one-morphing_2024-09-18-08-07.json | 11 -------- ...eat-poptip-multiline_2024-09-19-03-16.json | 10 ------- .../feat-richtext-clip_2024-09-19-02-49.json | 10 ------- ...arc-label-line-shape_2024-09-18-06-35.json | 10 ------- ...c-label-text-ellipse_2024-09-11-09-51.json | 11 -------- ...stom-path-arc-string_2024-09-20-06-11.json | 11 -------- ...muti-to-one-morphing_2024-09-18-08-07.json | 11 -------- ...stom-path-arc-string_2024-09-20-06-11.json | 11 -------- ...c-label-text-ellipse_2024-09-11-09-51.json | 11 -------- ...heckbox-disable-fill_2024-09-10-12-44.json | 10 ------- ...stom-path-arc-string_2024-09-20-06-11.json | 11 -------- ...muti-to-one-morphing_2024-09-18-08-07.json | 11 -------- common/config/rush/pnpm-lock.yaml | 26 +++++++++--------- common/config/rush/version-policies.json | 2 +- docs/package.json | 2 +- packages/react-vrender-utils/CHANGELOG.json | 12 +++++++++ packages/react-vrender-utils/CHANGELOG.md | 11 +++++++- packages/react-vrender-utils/package.json | 6 ++--- packages/react-vrender/CHANGELOG.json | 12 +++++++++ packages/react-vrender/CHANGELOG.md | 11 +++++++- packages/react-vrender/package.json | 4 +-- packages/vrender-components/CHANGELOG.json | 24 +++++++++++++++++ packages/vrender-components/CHANGELOG.md | 21 ++++++++++++++- packages/vrender-components/package.json | 6 ++--- packages/vrender-core/CHANGELOG.json | 27 +++++++++++++++++++ packages/vrender-core/CHANGELOG.md | 20 +++++++++++++- packages/vrender-core/package.json | 2 +- packages/vrender-kits/CHANGELOG.json | 12 +++++++++ packages/vrender-kits/CHANGELOG.md | 11 +++++++- packages/vrender-kits/package.json | 4 +-- packages/vrender/CHANGELOG.json | 21 +++++++++++++++ packages/vrender/CHANGELOG.md | 18 ++++++++++++- packages/vrender/package.json | 6 ++--- tools/bugserver-trigger/package.json | 8 +++--- 40 files changed, 227 insertions(+), 232 deletions(-) delete mode 100644 common/changes/@visactor/react-vrender-utils/fix-custom-path-arc-string_2024-09-20-06-11.json delete mode 100644 common/changes/@visactor/react-vrender/fix-custom-path-arc-string_2024-09-20-06-11.json delete mode 100644 common/changes/@visactor/vrender-components/fix-arc-label-line-shape_2024-09-18-06-35.json delete mode 100644 common/changes/@visactor/vrender-components/fix-arc-label-text-ellipse_2024-09-11-09-51.json delete mode 100644 common/changes/@visactor/vrender-components/fix-custom-path-arc-string_2024-09-20-06-11.json delete mode 100644 common/changes/@visactor/vrender-components/fix-data-zoom-text-style_2024-09-18-04-02.json delete mode 100644 common/changes/@visactor/vrender-components/fix-muti-to-one-morphing_2024-09-18-08-07.json delete mode 100644 common/changes/@visactor/vrender-core/feat-poptip-multiline_2024-09-19-03-16.json delete mode 100644 common/changes/@visactor/vrender-core/feat-richtext-clip_2024-09-19-02-49.json delete mode 100644 common/changes/@visactor/vrender-core/fix-arc-label-line-shape_2024-09-18-06-35.json delete mode 100644 common/changes/@visactor/vrender-core/fix-arc-label-text-ellipse_2024-09-11-09-51.json delete mode 100644 common/changes/@visactor/vrender-core/fix-custom-path-arc-string_2024-09-20-06-11.json delete mode 100644 common/changes/@visactor/vrender-core/fix-muti-to-one-morphing_2024-09-18-08-07.json delete mode 100644 common/changes/@visactor/vrender-kits/fix-custom-path-arc-string_2024-09-20-06-11.json delete mode 100644 common/changes/@visactor/vrender/fix-arc-label-text-ellipse_2024-09-11-09-51.json delete mode 100644 common/changes/@visactor/vrender/fix-checkbox-disable-fill_2024-09-10-12-44.json delete mode 100644 common/changes/@visactor/vrender/fix-custom-path-arc-string_2024-09-20-06-11.json delete mode 100644 common/changes/@visactor/vrender/fix-muti-to-one-morphing_2024-09-18-08-07.json diff --git a/common/changes/@visactor/react-vrender-utils/fix-custom-path-arc-string_2024-09-20-06-11.json b/common/changes/@visactor/react-vrender-utils/fix-custom-path-arc-string_2024-09-20-06-11.json deleted file mode 100644 index 81cbe0710..000000000 --- a/common/changes/@visactor/react-vrender-utils/fix-custom-path-arc-string_2024-09-20-06-11.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "changes": [ - { - "comment": "fix: fix path string of arc, fix #1434\n\n", - "type": "none", - "packageName": "@visactor/react-vrender-utils" - } - ], - "packageName": "@visactor/react-vrender-utils", - "email": "dingling112@gmail.com" -} \ No newline at end of file diff --git a/common/changes/@visactor/react-vrender/fix-custom-path-arc-string_2024-09-20-06-11.json b/common/changes/@visactor/react-vrender/fix-custom-path-arc-string_2024-09-20-06-11.json deleted file mode 100644 index c9402d7a5..000000000 --- a/common/changes/@visactor/react-vrender/fix-custom-path-arc-string_2024-09-20-06-11.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "changes": [ - { - "comment": "fix: fix path string of arc, fix #1434\n\n", - "type": "none", - "packageName": "@visactor/react-vrender" - } - ], - "packageName": "@visactor/react-vrender", - "email": "dingling112@gmail.com" -} \ No newline at end of file diff --git a/common/changes/@visactor/vrender-components/fix-arc-label-line-shape_2024-09-18-06-35.json b/common/changes/@visactor/vrender-components/fix-arc-label-line-shape_2024-09-18-06-35.json deleted file mode 100644 index 38e0b4c57..000000000 --- a/common/changes/@visactor/vrender-components/fix-arc-label-line-shape_2024-09-18-06-35.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "changes": [ - { - "packageName": "@visactor/vrender-components", - "comment": "fix: update parameters", - "type": "none" - } - ], - "packageName": "@visactor/vrender-components" -} \ No newline at end of file diff --git a/common/changes/@visactor/vrender-components/fix-arc-label-text-ellipse_2024-09-11-09-51.json b/common/changes/@visactor/vrender-components/fix-arc-label-text-ellipse_2024-09-11-09-51.json deleted file mode 100644 index a6788d364..000000000 --- a/common/changes/@visactor/vrender-components/fix-arc-label-text-ellipse_2024-09-11-09-51.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "changes": [ - { - "comment": "fix: fix maxLineWidth of arc label\n\n", - "type": "none", - "packageName": "@visactor/vrender-components" - } - ], - "packageName": "@visactor/vrender-components", - "email": "dingling112@gmail.com" -} \ No newline at end of file diff --git a/common/changes/@visactor/vrender-components/fix-custom-path-arc-string_2024-09-20-06-11.json b/common/changes/@visactor/vrender-components/fix-custom-path-arc-string_2024-09-20-06-11.json deleted file mode 100644 index 99981ca6a..000000000 --- a/common/changes/@visactor/vrender-components/fix-custom-path-arc-string_2024-09-20-06-11.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "changes": [ - { - "comment": "fix: fix path string of arc, fix #1434\n\n", - "type": "none", - "packageName": "@visactor/vrender-components" - } - ], - "packageName": "@visactor/vrender-components", - "email": "dingling112@gmail.com" -} \ No newline at end of file diff --git a/common/changes/@visactor/vrender-components/fix-data-zoom-text-style_2024-09-18-04-02.json b/common/changes/@visactor/vrender-components/fix-data-zoom-text-style_2024-09-18-04-02.json deleted file mode 100644 index 29af86028..000000000 --- a/common/changes/@visactor/vrender-components/fix-data-zoom-text-style_2024-09-18-04-02.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "changes": [ - { - "comment": "fix: fix `textStyle` of data-zoom\n\n", - "type": "none", - "packageName": "@visactor/vrender-components" - } - ], - "packageName": "@visactor/vrender-components", - "email": "dingling112@gmail.com" -} \ No newline at end of file diff --git a/common/changes/@visactor/vrender-components/fix-muti-to-one-morphing_2024-09-18-08-07.json b/common/changes/@visactor/vrender-components/fix-muti-to-one-morphing_2024-09-18-08-07.json deleted file mode 100644 index f3c940cf1..000000000 --- a/common/changes/@visactor/vrender-components/fix-muti-to-one-morphing_2024-09-18-08-07.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "changes": [ - { - "comment": "fix: fix error of morphing animation in `multiToOneMorph`, fix #1439\n\n", - "type": "none", - "packageName": "@visactor/vrender-components" - } - ], - "packageName": "@visactor/vrender-components", - "email": "dingling112@gmail.com" -} \ No newline at end of file diff --git a/common/changes/@visactor/vrender-core/feat-poptip-multiline_2024-09-19-03-16.json b/common/changes/@visactor/vrender-core/feat-poptip-multiline_2024-09-19-03-16.json deleted file mode 100644 index 41b6c198f..000000000 --- a/common/changes/@visactor/vrender-core/feat-poptip-multiline_2024-09-19-03-16.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "changes": [ - { - "packageName": "@visactor/vrender-core", - "comment": "feat: poptip suppport multiline text, closed #1444", - "type": "none" - } - ], - "packageName": "@visactor/vrender-core" -} \ No newline at end of file diff --git a/common/changes/@visactor/vrender-core/feat-richtext-clip_2024-09-19-02-49.json b/common/changes/@visactor/vrender-core/feat-richtext-clip_2024-09-19-02-49.json deleted file mode 100644 index c35b0dabb..000000000 --- a/common/changes/@visactor/vrender-core/feat-richtext-clip_2024-09-19-02-49.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "changes": [ - { - "packageName": "@visactor/vrender-core", - "comment": "feat: fix issue with richtext width on disableAutoWrapLine mode, support clip attr", - "type": "none" - } - ], - "packageName": "@visactor/vrender-core" -} \ No newline at end of file diff --git a/common/changes/@visactor/vrender-core/fix-arc-label-line-shape_2024-09-18-06-35.json b/common/changes/@visactor/vrender-core/fix-arc-label-line-shape_2024-09-18-06-35.json deleted file mode 100644 index e4ba37d88..000000000 --- a/common/changes/@visactor/vrender-core/fix-arc-label-line-shape_2024-09-18-06-35.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "changes": [ - { - "packageName": "@visactor/vrender-core", - "comment": "fix: fix error of `bounds-contex` when use `arcTo` in customShape", - "type": "none" - } - ], - "packageName": "@visactor/vrender-core" -} \ No newline at end of file diff --git a/common/changes/@visactor/vrender-core/fix-arc-label-text-ellipse_2024-09-11-09-51.json b/common/changes/@visactor/vrender-core/fix-arc-label-text-ellipse_2024-09-11-09-51.json deleted file mode 100644 index 66fd1baf3..000000000 --- a/common/changes/@visactor/vrender-core/fix-arc-label-text-ellipse_2024-09-11-09-51.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "changes": [ - { - "comment": "fix: fix maxLineWidth of arc label\n\n", - "type": "none", - "packageName": "@visactor/vrender-core" - } - ], - "packageName": "@visactor/vrender-core", - "email": "dingling112@gmail.com" -} \ No newline at end of file diff --git a/common/changes/@visactor/vrender-core/fix-custom-path-arc-string_2024-09-20-06-11.json b/common/changes/@visactor/vrender-core/fix-custom-path-arc-string_2024-09-20-06-11.json deleted file mode 100644 index e57e4e231..000000000 --- a/common/changes/@visactor/vrender-core/fix-custom-path-arc-string_2024-09-20-06-11.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "changes": [ - { - "comment": "fix: fix path string of arc, fix #1434\n\n", - "type": "none", - "packageName": "@visactor/vrender-core" - } - ], - "packageName": "@visactor/vrender-core", - "email": "dingling112@gmail.com" -} \ No newline at end of file diff --git a/common/changes/@visactor/vrender-core/fix-muti-to-one-morphing_2024-09-18-08-07.json b/common/changes/@visactor/vrender-core/fix-muti-to-one-morphing_2024-09-18-08-07.json deleted file mode 100644 index ef44cc178..000000000 --- a/common/changes/@visactor/vrender-core/fix-muti-to-one-morphing_2024-09-18-08-07.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "changes": [ - { - "comment": "fix: fix error of morphing animation in `multiToOneMorph`, fix #1439\n\n", - "type": "none", - "packageName": "@visactor/vrender-core" - } - ], - "packageName": "@visactor/vrender-core", - "email": "dingling112@gmail.com" -} \ No newline at end of file diff --git a/common/changes/@visactor/vrender-kits/fix-custom-path-arc-string_2024-09-20-06-11.json b/common/changes/@visactor/vrender-kits/fix-custom-path-arc-string_2024-09-20-06-11.json deleted file mode 100644 index 6ad2d9e4c..000000000 --- a/common/changes/@visactor/vrender-kits/fix-custom-path-arc-string_2024-09-20-06-11.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "changes": [ - { - "comment": "fix: fix path string of arc, fix #1434\n\n", - "type": "none", - "packageName": "@visactor/vrender-kits" - } - ], - "packageName": "@visactor/vrender-kits", - "email": "dingling112@gmail.com" -} \ No newline at end of file diff --git a/common/changes/@visactor/vrender/fix-arc-label-text-ellipse_2024-09-11-09-51.json b/common/changes/@visactor/vrender/fix-arc-label-text-ellipse_2024-09-11-09-51.json deleted file mode 100644 index ba5c6a19f..000000000 --- a/common/changes/@visactor/vrender/fix-arc-label-text-ellipse_2024-09-11-09-51.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "changes": [ - { - "comment": "fix: fix maxLineWidth of arc label\n\n", - "type": "none", - "packageName": "@visactor/vrender" - } - ], - "packageName": "@visactor/vrender", - "email": "dingling112@gmail.com" -} \ No newline at end of file diff --git a/common/changes/@visactor/vrender/fix-checkbox-disable-fill_2024-09-10-12-44.json b/common/changes/@visactor/vrender/fix-checkbox-disable-fill_2024-09-10-12-44.json deleted file mode 100644 index 3b3c779b3..000000000 --- a/common/changes/@visactor/vrender/fix-checkbox-disable-fill_2024-09-10-12-44.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "changes": [ - { - "packageName": "@visactor/vrender", - "comment": "fix: add disableFill box color in checkbox and radio #1437", - "type": "none" - } - ], - "packageName": "@visactor/vrender" -} \ No newline at end of file diff --git a/common/changes/@visactor/vrender/fix-custom-path-arc-string_2024-09-20-06-11.json b/common/changes/@visactor/vrender/fix-custom-path-arc-string_2024-09-20-06-11.json deleted file mode 100644 index 332c40890..000000000 --- a/common/changes/@visactor/vrender/fix-custom-path-arc-string_2024-09-20-06-11.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "changes": [ - { - "comment": "fix: fix path string of arc, fix #1434\n\n", - "type": "none", - "packageName": "@visactor/vrender" - } - ], - "packageName": "@visactor/vrender", - "email": "dingling112@gmail.com" -} \ No newline at end of file diff --git a/common/changes/@visactor/vrender/fix-muti-to-one-morphing_2024-09-18-08-07.json b/common/changes/@visactor/vrender/fix-muti-to-one-morphing_2024-09-18-08-07.json deleted file mode 100644 index 89fb99749..000000000 --- a/common/changes/@visactor/vrender/fix-muti-to-one-morphing_2024-09-18-08-07.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "changes": [ - { - "comment": "fix: fix error of morphing animation in `multiToOneMorph`, fix #1439\n\n", - "type": "none", - "packageName": "@visactor/vrender" - } - ], - "packageName": "@visactor/vrender", - "email": "dingling112@gmail.com" -} \ No newline at end of file diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index f12fa276c..6c7e0ea79 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -14,7 +14,7 @@ importers: '@types/react-dom': ^18.0.0 '@visactor/vchart': 1.3.0 '@visactor/vgrammar': ~0.5.7 - '@visactor/vrender': workspace:0.20.4 + '@visactor/vrender': workspace:0.20.5 '@visactor/vutils': ~0.18.16 '@vitejs/plugin-react': 3.1.0 axios: ^1.4.0 @@ -71,7 +71,7 @@ importers: '@types/react': ^18.0.0 '@types/react-dom': ^18.0.0 '@types/react-reconciler': ^0.28.2 - '@visactor/vrender': workspace:0.20.4 + '@visactor/vrender': workspace:0.20.5 '@visactor/vutils': ~0.18.16 '@vitejs/plugin-react': 3.1.0 cross-env: ^7.0.3 @@ -111,8 +111,8 @@ importers: '@rushstack/eslint-patch': ~1.1.4 '@types/react': ^18.0.0 '@types/react-dom': ^18.0.0 - '@visactor/react-vrender': workspace:0.20.4 - '@visactor/vrender': workspace:0.20.4 + '@visactor/react-vrender': workspace:0.20.5 + '@visactor/vrender': workspace:0.20.5 '@visactor/vutils': ~0.18.16 '@vitejs/plugin-react': 3.1.0 cross-env: ^7.0.3 @@ -153,8 +153,8 @@ importers: '@types/jest': ^26.0.0 '@types/react': ^18.0.0 '@types/react-dom': ^18.0.0 - '@visactor/vrender-core': workspace:0.20.4 - '@visactor/vrender-kits': workspace:0.20.4 + '@visactor/vrender-core': workspace:0.20.5 + '@visactor/vrender-kits': workspace:0.20.5 '@visactor/vutils': ~0.18.16 '@vitejs/plugin-react': 3.1.0 canvas: 2.11.2 @@ -200,8 +200,8 @@ importers: '@internal/ts-config': workspace:* '@rushstack/eslint-patch': ~1.1.4 '@types/jest': ^26.0.0 - '@visactor/vrender-core': workspace:0.20.4 - '@visactor/vrender-kits': workspace:0.20.4 + '@visactor/vrender-core': workspace:0.20.5 + '@visactor/vrender-kits': workspace:0.20.5 '@visactor/vscale': ~0.18.16 '@visactor/vutils': ~0.18.16 cross-env: ^7.0.3 @@ -287,7 +287,7 @@ importers: '@types/node-fetch': 2.6.4 '@types/react': ^18.0.0 '@types/react-dom': ^18.0.0 - '@visactor/vrender-core': workspace:0.20.4 + '@visactor/vrender-core': workspace:0.20.5 '@visactor/vutils': ~0.18.16 '@vitejs/plugin-react': 3.1.0 canvas: 2.11.2 @@ -369,10 +369,10 @@ importers: '@rushstack/eslint-patch': ~1.1.4 '@types/node': '*' '@types/node-fetch': 2.6.4 - '@visactor/vrender': workspace:0.20.4 - '@visactor/vrender-components': workspace:0.20.4 - '@visactor/vrender-core': workspace:0.20.4 - '@visactor/vrender-kits': workspace:0.20.4 + '@visactor/vrender': workspace:0.20.5 + '@visactor/vrender-components': workspace:0.20.5 + '@visactor/vrender-core': workspace:0.20.5 + '@visactor/vrender-kits': workspace:0.20.5 cross-env: ^7.0.3 eslint: ~8.18.0 form-data: ~4.0.0 diff --git a/common/config/rush/version-policies.json b/common/config/rush/version-policies.json index eba2c500b..4eb52d350 100644 --- a/common/config/rush/version-policies.json +++ b/common/config/rush/version-policies.json @@ -1 +1 @@ -[{"definitionName":"lockStepVersion","policyName":"vrenderMain","version":"0.20.4","nextBump":"patch"}] +[{"definitionName":"lockStepVersion","policyName":"vrenderMain","version":"0.20.5","nextBump":"patch"}] diff --git a/docs/package.json b/docs/package.json index 48a5e4fa5..a202b8e35 100644 --- a/docs/package.json +++ b/docs/package.json @@ -13,7 +13,7 @@ "@visactor/vchart": "1.3.0", "@visactor/vutils": "~0.18.16", "@visactor/vgrammar": "~0.5.7", - "@visactor/vrender": "workspace:0.20.4", + "@visactor/vrender": "workspace:0.20.5", "markdown-it": "^13.0.0", "highlight.js": "^11.8.0", "axios": "^1.4.0", diff --git a/packages/react-vrender-utils/CHANGELOG.json b/packages/react-vrender-utils/CHANGELOG.json index 6408810f9..cd485cded 100644 --- a/packages/react-vrender-utils/CHANGELOG.json +++ b/packages/react-vrender-utils/CHANGELOG.json @@ -1,6 +1,18 @@ { "name": "@visactor/react-vrender-utils", "entries": [ + { + "version": "0.20.5", + "tag": "@visactor/react-vrender-utils_v0.20.5", + "date": "Fri, 20 Sep 2024 06:37:57 GMT", + "comments": { + "none": [ + { + "comment": "fix: fix path string of arc, fix #1434\n\n" + } + ] + } + }, { "version": "0.20.4", "tag": "@visactor/react-vrender-utils_v0.20.4", diff --git a/packages/react-vrender-utils/CHANGELOG.md b/packages/react-vrender-utils/CHANGELOG.md index f5099019f..530a1b144 100644 --- a/packages/react-vrender-utils/CHANGELOG.md +++ b/packages/react-vrender-utils/CHANGELOG.md @@ -1,6 +1,15 @@ # Change Log - @visactor/react-vrender-utils -This log was last generated on Thu, 12 Sep 2024 07:33:20 GMT and should not be manually modified. +This log was last generated on Fri, 20 Sep 2024 06:37:57 GMT and should not be manually modified. + +## 0.20.5 +Fri, 20 Sep 2024 06:37:57 GMT + +### Updates + +- fix: fix path string of arc, fix #1434 + + ## 0.20.4 Thu, 12 Sep 2024 07:33:20 GMT diff --git a/packages/react-vrender-utils/package.json b/packages/react-vrender-utils/package.json index 94388c428..d9cc637ca 100644 --- a/packages/react-vrender-utils/package.json +++ b/packages/react-vrender-utils/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/react-vrender-utils", - "version": "0.20.4", + "version": "0.20.5", "description": "", "sideEffects": false, "main": "cjs/index.js", @@ -24,8 +24,8 @@ "react-dom": "^18.2.0" }, "dependencies": { - "@visactor/vrender": "workspace:0.20.4", - "@visactor/react-vrender": "workspace:0.20.4", + "@visactor/vrender": "workspace:0.20.5", + "@visactor/react-vrender": "workspace:0.20.5", "@visactor/vutils": "~0.18.16", "react-reconciler": "^0.29.0", "tslib": "^2.3.1" diff --git a/packages/react-vrender/CHANGELOG.json b/packages/react-vrender/CHANGELOG.json index 99cfc0c85..71469b48f 100644 --- a/packages/react-vrender/CHANGELOG.json +++ b/packages/react-vrender/CHANGELOG.json @@ -1,6 +1,18 @@ { "name": "@visactor/react-vrender", "entries": [ + { + "version": "0.20.5", + "tag": "@visactor/react-vrender_v0.20.5", + "date": "Fri, 20 Sep 2024 06:37:57 GMT", + "comments": { + "none": [ + { + "comment": "fix: fix path string of arc, fix #1434\n\n" + } + ] + } + }, { "version": "0.20.4", "tag": "@visactor/react-vrender_v0.20.4", diff --git a/packages/react-vrender/CHANGELOG.md b/packages/react-vrender/CHANGELOG.md index bc64b15c0..efe1ad0a9 100644 --- a/packages/react-vrender/CHANGELOG.md +++ b/packages/react-vrender/CHANGELOG.md @@ -1,6 +1,15 @@ # Change Log - @visactor/react-vrender -This log was last generated on Thu, 12 Sep 2024 07:33:20 GMT and should not be manually modified. +This log was last generated on Fri, 20 Sep 2024 06:37:57 GMT and should not be manually modified. + +## 0.20.5 +Fri, 20 Sep 2024 06:37:57 GMT + +### Updates + +- fix: fix path string of arc, fix #1434 + + ## 0.20.4 Thu, 12 Sep 2024 07:33:20 GMT diff --git a/packages/react-vrender/package.json b/packages/react-vrender/package.json index b2c10088b..144409191 100644 --- a/packages/react-vrender/package.json +++ b/packages/react-vrender/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/react-vrender", - "version": "0.20.4", + "version": "0.20.5", "description": "", "sideEffects": false, "main": "cjs/index.js", @@ -23,7 +23,7 @@ "react": "^18.2.0" }, "dependencies": { - "@visactor/vrender": "workspace:0.20.4", + "@visactor/vrender": "workspace:0.20.5", "@visactor/vutils": "~0.18.16", "react-reconciler": "^0.29.0", "tslib": "^2.3.1" diff --git a/packages/vrender-components/CHANGELOG.json b/packages/vrender-components/CHANGELOG.json index 421bde038..6512b3ba1 100644 --- a/packages/vrender-components/CHANGELOG.json +++ b/packages/vrender-components/CHANGELOG.json @@ -1,6 +1,30 @@ { "name": "@visactor/vrender-components", "entries": [ + { + "version": "0.20.5", + "tag": "@visactor/vrender-components_v0.20.5", + "date": "Fri, 20 Sep 2024 06:37:57 GMT", + "comments": { + "none": [ + { + "comment": "fix: update parameters" + }, + { + "comment": "fix: fix maxLineWidth of arc label\n\n" + }, + { + "comment": "fix: fix path string of arc, fix #1434\n\n" + }, + { + "comment": "fix: fix `textStyle` of data-zoom\n\n" + }, + { + "comment": "fix: fix error of morphing animation in `multiToOneMorph`, fix #1439\n\n" + } + ] + } + }, { "version": "0.20.4", "tag": "@visactor/vrender-components_v0.20.4", diff --git a/packages/vrender-components/CHANGELOG.md b/packages/vrender-components/CHANGELOG.md index bc62af835..d3ca06ff8 100644 --- a/packages/vrender-components/CHANGELOG.md +++ b/packages/vrender-components/CHANGELOG.md @@ -1,6 +1,25 @@ # Change Log - @visactor/vrender-components -This log was last generated on Thu, 12 Sep 2024 07:33:20 GMT and should not be manually modified. +This log was last generated on Fri, 20 Sep 2024 06:37:57 GMT and should not be manually modified. + +## 0.20.5 +Fri, 20 Sep 2024 06:37:57 GMT + +### Updates + +- fix: update parameters +- fix: fix maxLineWidth of arc label + + +- fix: fix path string of arc, fix #1434 + + +- fix: fix `textStyle` of data-zoom + + +- fix: fix error of morphing animation in `multiToOneMorph`, fix #1439 + + ## 0.20.4 Thu, 12 Sep 2024 07:33:20 GMT diff --git a/packages/vrender-components/package.json b/packages/vrender-components/package.json index c83bed660..219314acb 100644 --- a/packages/vrender-components/package.json +++ b/packages/vrender-components/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vrender-components", - "version": "0.20.4", + "version": "0.20.5", "description": "components library for dp visualization", "sideEffects": false, "main": "cjs/index.js", @@ -26,8 +26,8 @@ "dependencies": { "@visactor/vutils": "~0.18.16", "@visactor/vscale": "~0.18.16", - "@visactor/vrender-core": "workspace:0.20.4", - "@visactor/vrender-kits": "workspace:0.20.4" + "@visactor/vrender-core": "workspace:0.20.5", + "@visactor/vrender-kits": "workspace:0.20.5" }, "devDependencies": { "@internal/bundler": "workspace:*", diff --git a/packages/vrender-core/CHANGELOG.json b/packages/vrender-core/CHANGELOG.json index 42e201b97..ac17d76bc 100644 --- a/packages/vrender-core/CHANGELOG.json +++ b/packages/vrender-core/CHANGELOG.json @@ -1,6 +1,33 @@ { "name": "@visactor/vrender-core", "entries": [ + { + "version": "0.20.5", + "tag": "@visactor/vrender-core_v0.20.5", + "date": "Fri, 20 Sep 2024 06:37:57 GMT", + "comments": { + "none": [ + { + "comment": "feat: poptip suppport multiline text, closed #1444" + }, + { + "comment": "feat: fix issue with richtext width on disableAutoWrapLine mode, support clip attr" + }, + { + "comment": "fix: fix error of `bounds-contex` when use `arcTo` in customShape" + }, + { + "comment": "fix: fix maxLineWidth of arc label\n\n" + }, + { + "comment": "fix: fix path string of arc, fix #1434\n\n" + }, + { + "comment": "fix: fix error of morphing animation in `multiToOneMorph`, fix #1439\n\n" + } + ] + } + }, { "version": "0.20.4", "tag": "@visactor/vrender-core_v0.20.4", diff --git a/packages/vrender-core/CHANGELOG.md b/packages/vrender-core/CHANGELOG.md index 0d7cfb266..6a1234e31 100644 --- a/packages/vrender-core/CHANGELOG.md +++ b/packages/vrender-core/CHANGELOG.md @@ -1,6 +1,24 @@ # Change Log - @visactor/vrender-core -This log was last generated on Thu, 12 Sep 2024 07:33:20 GMT and should not be manually modified. +This log was last generated on Fri, 20 Sep 2024 06:37:57 GMT and should not be manually modified. + +## 0.20.5 +Fri, 20 Sep 2024 06:37:57 GMT + +### Updates + +- feat: poptip suppport multiline text, closed #1444 +- feat: fix issue with richtext width on disableAutoWrapLine mode, support clip attr +- fix: fix error of `bounds-contex` when use `arcTo` in customShape +- fix: fix maxLineWidth of arc label + + +- fix: fix path string of arc, fix #1434 + + +- fix: fix error of morphing animation in `multiToOneMorph`, fix #1439 + + ## 0.20.4 Thu, 12 Sep 2024 07:33:20 GMT diff --git a/packages/vrender-core/package.json b/packages/vrender-core/package.json index a520b5c66..004aaab06 100644 --- a/packages/vrender-core/package.json +++ b/packages/vrender-core/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vrender-core", - "version": "0.20.4", + "version": "0.20.5", "description": "", "sideEffects": [ "./src/modules.ts", diff --git a/packages/vrender-kits/CHANGELOG.json b/packages/vrender-kits/CHANGELOG.json index 74dff8332..c0f9fa671 100644 --- a/packages/vrender-kits/CHANGELOG.json +++ b/packages/vrender-kits/CHANGELOG.json @@ -1,6 +1,18 @@ { "name": "@visactor/vrender-kits", "entries": [ + { + "version": "0.20.5", + "tag": "@visactor/vrender-kits_v0.20.5", + "date": "Fri, 20 Sep 2024 06:37:57 GMT", + "comments": { + "none": [ + { + "comment": "fix: fix path string of arc, fix #1434\n\n" + } + ] + } + }, { "version": "0.20.4", "tag": "@visactor/vrender-kits_v0.20.4", diff --git a/packages/vrender-kits/CHANGELOG.md b/packages/vrender-kits/CHANGELOG.md index da5baf269..d09658354 100644 --- a/packages/vrender-kits/CHANGELOG.md +++ b/packages/vrender-kits/CHANGELOG.md @@ -1,6 +1,15 @@ # Change Log - @visactor/vrender-kits -This log was last generated on Thu, 12 Sep 2024 07:33:20 GMT and should not be manually modified. +This log was last generated on Fri, 20 Sep 2024 06:37:57 GMT and should not be manually modified. + +## 0.20.5 +Fri, 20 Sep 2024 06:37:57 GMT + +### Updates + +- fix: fix path string of arc, fix #1434 + + ## 0.20.4 Thu, 12 Sep 2024 07:33:20 GMT diff --git a/packages/vrender-kits/package.json b/packages/vrender-kits/package.json index 4a8fb7914..abe6a0ad6 100644 --- a/packages/vrender-kits/package.json +++ b/packages/vrender-kits/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vrender-kits", - "version": "0.20.4", + "version": "0.20.5", "description": "", "sideEffects": false, "main": "cjs/index.js", @@ -21,7 +21,7 @@ }, "dependencies": { "@visactor/vutils": "~0.18.16", - "@visactor/vrender-core": "workspace:0.20.4", + "@visactor/vrender-core": "workspace:0.20.5", "@resvg/resvg-js": "2.4.1", "roughjs": "4.5.2" }, diff --git a/packages/vrender/CHANGELOG.json b/packages/vrender/CHANGELOG.json index 960c7ccc1..e7ba03bf8 100644 --- a/packages/vrender/CHANGELOG.json +++ b/packages/vrender/CHANGELOG.json @@ -1,6 +1,27 @@ { "name": "@visactor/vrender", "entries": [ + { + "version": "0.20.5", + "tag": "@visactor/vrender_v0.20.5", + "date": "Fri, 20 Sep 2024 06:37:57 GMT", + "comments": { + "none": [ + { + "comment": "fix: fix maxLineWidth of arc label\n\n" + }, + { + "comment": "fix: add disableFill box color in checkbox and radio #1437" + }, + { + "comment": "fix: fix path string of arc, fix #1434\n\n" + }, + { + "comment": "fix: fix error of morphing animation in `multiToOneMorph`, fix #1439\n\n" + } + ] + } + }, { "version": "0.20.4", "tag": "@visactor/vrender_v0.20.4", diff --git a/packages/vrender/CHANGELOG.md b/packages/vrender/CHANGELOG.md index 34d0039a4..0e9b3e2a9 100644 --- a/packages/vrender/CHANGELOG.md +++ b/packages/vrender/CHANGELOG.md @@ -1,6 +1,22 @@ # Change Log - @visactor/vrender -This log was last generated on Thu, 12 Sep 2024 07:33:20 GMT and should not be manually modified. +This log was last generated on Fri, 20 Sep 2024 06:37:57 GMT and should not be manually modified. + +## 0.20.5 +Fri, 20 Sep 2024 06:37:57 GMT + +### Updates + +- fix: fix maxLineWidth of arc label + + +- fix: add disableFill box color in checkbox and radio #1437 +- fix: fix path string of arc, fix #1434 + + +- fix: fix error of morphing animation in `multiToOneMorph`, fix #1439 + + ## 0.20.4 Thu, 12 Sep 2024 07:33:20 GMT diff --git a/packages/vrender/package.json b/packages/vrender/package.json index 22a49a3c8..6bd2e22a9 100644 --- a/packages/vrender/package.json +++ b/packages/vrender/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vrender", - "version": "0.20.4", + "version": "0.20.5", "description": "", "sideEffects": true, "main": "cjs/index.js", @@ -24,8 +24,8 @@ "test-watch": "cross-env DEBUG_MODE=1 jest --watch" }, "dependencies": { - "@visactor/vrender-core": "workspace:0.20.4", - "@visactor/vrender-kits": "workspace:0.20.4" + "@visactor/vrender-core": "workspace:0.20.5", + "@visactor/vrender-kits": "workspace:0.20.5" }, "devDependencies": { "@internal/bundler": "workspace:*", diff --git a/tools/bugserver-trigger/package.json b/tools/bugserver-trigger/package.json index 4ddc3c94c..cdcf9fd10 100644 --- a/tools/bugserver-trigger/package.json +++ b/tools/bugserver-trigger/package.json @@ -8,10 +8,10 @@ "ci": "ts-node --transpileOnly --skipProject ./scripts/trigger-test.ts" }, "dependencies": { - "@visactor/vrender": "workspace:0.20.4", - "@visactor/vrender-core": "workspace:0.20.4", - "@visactor/vrender-kits": "workspace:0.20.4", - "@visactor/vrender-components": "workspace:0.20.4" + "@visactor/vrender": "workspace:0.20.5", + "@visactor/vrender-core": "workspace:0.20.5", + "@visactor/vrender-kits": "workspace:0.20.5", + "@visactor/vrender-components": "workspace:0.20.5" }, "devDependencies": { "@rushstack/eslint-patch": "~1.1.4",