diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 496d6626e..c2bb0245c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -88,7 +88,7 @@ jobs: env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} NPM_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - run: node common/scripts/install-run-rush.js publish --publish --include-all + run: node common/scripts/install-run-rush.js publish --publish --include-all --tag latest - name: Update shrinkwrap run: node common/scripts/install-run-rush.js update diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 10c2c8f72..6ec73bf37 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -22,7 +22,7 @@ importers: specifier: ~0.5.7 version: 0.5.7 '@visactor/vrender': - specifier: workspace:1.0.1 + specifier: workspace:1.0.3 version: link:../packages/vrender '@visactor/vutils': specifier: 1.0.6 @@ -95,7 +95,7 @@ importers: ../../packages/react-vrender: dependencies: '@visactor/vrender': - specifier: workspace:1.0.1 + specifier: workspace:1.0.3 version: link:../vrender '@visactor/vutils': specifier: 1.0.6 @@ -153,10 +153,10 @@ importers: ../../packages/react-vrender-utils: dependencies: '@visactor/react-vrender': - specifier: workspace:1.0.1 + specifier: workspace:1.0.3 version: link:../react-vrender '@visactor/vrender': - specifier: workspace:1.0.1 + specifier: workspace:1.0.3 version: link:../vrender '@visactor/vutils': specifier: 1.0.6 @@ -211,13 +211,13 @@ importers: ../../packages/vrender: dependencies: '@visactor/vrender-animate': - specifier: workspace:1.0.1 + specifier: workspace:1.0.3 version: link:../vrender-animate '@visactor/vrender-core': - specifier: workspace:1.0.1 + specifier: workspace:1.0.3 version: link:../vrender-core '@visactor/vrender-kits': - specifier: workspace:1.0.1 + specifier: workspace:1.0.3 version: link:../vrender-kits devDependencies: '@internal/bundler': @@ -284,7 +284,7 @@ importers: ../../packages/vrender-animate: dependencies: '@visactor/vrender-core': - specifier: workspace:1.0.1 + specifier: workspace:1.0.3 version: link:../vrender-core '@visactor/vutils': specifier: 1.0.6 @@ -342,13 +342,13 @@ importers: ../../packages/vrender-components: dependencies: '@visactor/vrender-animate': - specifier: workspace:1.0.1 + specifier: workspace:1.0.3 version: link:../vrender-animate '@visactor/vrender-core': - specifier: workspace:1.0.1 + specifier: workspace:1.0.3 version: link:../vrender-core '@visactor/vrender-kits': - specifier: workspace:1.0.1 + specifier: workspace:1.0.3 version: link:../vrender-kits '@visactor/vscale': specifier: 1.0.6 @@ -467,7 +467,7 @@ importers: specifier: 2.4.1 version: 2.4.1 '@visactor/vrender-core': - specifier: workspace:1.0.1 + specifier: workspace:1.0.3 version: link:../vrender-core '@visactor/vutils': specifier: 1.0.6 @@ -583,19 +583,19 @@ importers: ../../tools/bugserver-trigger: dependencies: '@visactor/vrender': - specifier: workspace:1.0.1 + specifier: workspace:1.0.3 version: link:../../packages/vrender '@visactor/vrender-animate': - specifier: workspace:1.0.1 + specifier: workspace:1.0.3 version: link:../../packages/vrender-animate '@visactor/vrender-components': - specifier: workspace:1.0.1 + specifier: workspace:1.0.3 version: link:../../packages/vrender-components '@visactor/vrender-core': - specifier: workspace:1.0.1 + specifier: workspace:1.0.3 version: link:../../packages/vrender-core '@visactor/vrender-kits': - specifier: workspace:1.0.1 + specifier: workspace:1.0.3 version: link:../../packages/vrender-kits devDependencies: '@internal/bundler': diff --git a/common/config/rush/version-policies.json b/common/config/rush/version-policies.json index 7e5ef3d21..59535845e 100644 --- a/common/config/rush/version-policies.json +++ b/common/config/rush/version-policies.json @@ -1 +1 @@ -[{"definitionName":"lockStepVersion","policyName":"vrenderMain","version":"1.0.1","nextBump":"patch"}] +[{"definitionName":"lockStepVersion","policyName":"vrenderMain","version":"1.0.3","nextBump":"patch"}] diff --git a/docs/package.json b/docs/package.json index d998d806e..3653f84d5 100644 --- a/docs/package.json +++ b/docs/package.json @@ -13,7 +13,7 @@ "@visactor/vchart": "1.3.0", "@visactor/vutils": "1.0.6", "@visactor/vgrammar": "~0.5.7", - "@visactor/vrender": "workspace:1.0.1", + "@visactor/vrender": "workspace:1.0.3", "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 684abd46d..700a0a559 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": "1.0.3", + "tag": "@visactor/react-vrender-utils_v1.0.3", + "date": "Tue, 10 Jun 2025 09:32:32 GMT", + "comments": { + "none": [ + { + "comment": "fix: fix rele" + } + ] + } + }, { "version": "1.0.1", "tag": "@visactor/react-vrender-utils_v1.0.1", diff --git a/packages/react-vrender-utils/CHANGELOG.md b/packages/react-vrender-utils/CHANGELOG.md index 32cb33035..bb242616f 100644 --- a/packages/react-vrender-utils/CHANGELOG.md +++ b/packages/react-vrender-utils/CHANGELOG.md @@ -1,6 +1,13 @@ # Change Log - @visactor/react-vrender-utils -This log was last generated on Mon, 09 Jun 2025 07:29:07 GMT and should not be manually modified. +This log was last generated on Tue, 10 Jun 2025 09:32:32 GMT and should not be manually modified. + +## 1.0.3 +Tue, 10 Jun 2025 09:32:32 GMT + +### Updates + +- fix: fix rele ## 1.0.1 Mon, 09 Jun 2025 07:29:07 GMT diff --git a/packages/react-vrender-utils/package.json b/packages/react-vrender-utils/package.json index b6aea7f3a..a6973f232 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": "1.0.1", + "version": "1.0.3", "description": "", "sideEffects": false, "main": "cjs/index.js", @@ -24,8 +24,8 @@ "react-dom": "^18.2.0" }, "dependencies": { - "@visactor/vrender": "workspace:1.0.1", - "@visactor/react-vrender": "workspace:1.0.1", + "@visactor/vrender": "workspace:1.0.3", + "@visactor/react-vrender": "workspace:1.0.3", "@visactor/vutils": "1.0.6", "react-reconciler": "^0.29.0", "tslib": "^2.3.1" diff --git a/packages/react-vrender/CHANGELOG.json b/packages/react-vrender/CHANGELOG.json index 880ad1843..63d2cf1d1 100644 --- a/packages/react-vrender/CHANGELOG.json +++ b/packages/react-vrender/CHANGELOG.json @@ -1,6 +1,18 @@ { "name": "@visactor/react-vrender", "entries": [ + { + "version": "1.0.3", + "tag": "@visactor/react-vrender_v1.0.3", + "date": "Tue, 10 Jun 2025 09:32:32 GMT", + "comments": { + "none": [ + { + "comment": "fix: fix release version" + } + ] + } + }, { "version": "1.0.1", "tag": "@visactor/react-vrender_v1.0.1", diff --git a/packages/react-vrender/CHANGELOG.md b/packages/react-vrender/CHANGELOG.md index 5d3417ae4..528a2663f 100644 --- a/packages/react-vrender/CHANGELOG.md +++ b/packages/react-vrender/CHANGELOG.md @@ -1,6 +1,13 @@ # Change Log - @visactor/react-vrender -This log was last generated on Mon, 09 Jun 2025 07:29:07 GMT and should not be manually modified. +This log was last generated on Tue, 10 Jun 2025 09:32:32 GMT and should not be manually modified. + +## 1.0.3 +Tue, 10 Jun 2025 09:32:32 GMT + +### Updates + +- fix: fix release version ## 1.0.1 Mon, 09 Jun 2025 07:29:07 GMT diff --git a/packages/react-vrender/package.json b/packages/react-vrender/package.json index d13c8ce4e..61a4f9450 100644 --- a/packages/react-vrender/package.json +++ b/packages/react-vrender/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/react-vrender", - "version": "1.0.1", + "version": "1.0.3", "description": "", "sideEffects": false, "main": "cjs/index.js", @@ -23,7 +23,7 @@ "react": "^18.2.0" }, "dependencies": { - "@visactor/vrender": "workspace:1.0.1", + "@visactor/vrender": "workspace:1.0.3", "@visactor/vutils": "1.0.6", "react-reconciler": "^0.29.0", "tslib": "^2.3.1" diff --git a/packages/vrender-animate/CHANGELOG.json b/packages/vrender-animate/CHANGELOG.json index 8c58bc0d2..fc7ba5d83 100644 --- a/packages/vrender-animate/CHANGELOG.json +++ b/packages/vrender-animate/CHANGELOG.json @@ -1,6 +1,21 @@ { "name": "@visactor/vrender-animate", "entries": [ + { + "version": "1.0.3", + "tag": "@visactor/vrender-animate_v1.0.3", + "date": "Tue, 10 Jun 2025 09:32:32 GMT", + "comments": { + "none": [ + { + "comment": "fix: fix aniamtion of dx, dy and customParameters\n\n" + }, + { + "comment": "fix: fix rele" + } + ] + } + }, { "version": "1.0.1", "tag": "@visactor/vrender-animate_v1.0.1", diff --git a/packages/vrender-animate/CHANGELOG.md b/packages/vrender-animate/CHANGELOG.md index 91b59494b..25029b557 100644 --- a/packages/vrender-animate/CHANGELOG.md +++ b/packages/vrender-animate/CHANGELOG.md @@ -1,6 +1,16 @@ # Change Log - @visactor/vrender-animate -This log was last generated on Mon, 09 Jun 2025 07:29:07 GMT and should not be manually modified. +This log was last generated on Tue, 10 Jun 2025 09:32:32 GMT and should not be manually modified. + +## 1.0.3 +Tue, 10 Jun 2025 09:32:32 GMT + +### Updates + +- fix: fix aniamtion of dx, dy and customParameters + + +- fix: fix rele ## 1.0.1 Mon, 09 Jun 2025 07:29:07 GMT diff --git a/packages/vrender-animate/package.json b/packages/vrender-animate/package.json index 5c2ad6966..cb9b5e550 100644 --- a/packages/vrender-animate/package.json +++ b/packages/vrender-animate/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vrender-animate", - "version": "1.0.1", + "version": "1.0.3", "description": "", "sideEffects": false, "main": "cjs/index.js", @@ -21,7 +21,7 @@ }, "dependencies": { "@visactor/vutils": "1.0.6", - "@visactor/vrender-core": "workspace:1.0.1" + "@visactor/vrender-core": "workspace:1.0.3" }, "devDependencies": { "@internal/bundler": "workspace:*", diff --git a/packages/vrender-animate/src/custom/fromTo.ts b/packages/vrender-animate/src/custom/fromTo.ts index 4f325e432..c16ed83b5 100644 --- a/packages/vrender-animate/src/custom/fromTo.ts +++ b/packages/vrender-animate/src/custom/fromTo.ts @@ -14,14 +14,14 @@ export class FromTo extends ACustomAnimate> { onBind(): void { super.onBind(); - const finalAttribute = this.target.getFinalAttribute(); // 如果存在from,不存在to,那么需要设置给props Object.keys(this.from).forEach(key => { if (this.props[key] == null) { - this.props[key] = finalAttribute[key]; + this.props[key] = this.target.getGraphicAttribute(key); } }); + const finalAttribute = this.target.getFinalAttribute(); // 如果入场动画,那么需要设置属性 if (this.target.context?.animationState === 'appear') { if (finalAttribute) { diff --git a/packages/vrender-animate/src/executor/animate-executor.ts b/packages/vrender-animate/src/executor/animate-executor.ts index b288e0e0a..e3b4270b7 100644 --- a/packages/vrender-animate/src/executor/animate-executor.ts +++ b/packages/vrender-animate/src/executor/animate-executor.ts @@ -420,7 +420,10 @@ export class AnimateExecutor implements IAnimateExecutor { ) { // 处理自定义动画 if (custom && customType) { - const customParams = this.resolveValue(customParameters, graphic, {}); + const customParams = this.resolveValue(customParameters, graphic, { + width: graphic.stage.width, + height: graphic.stage.height + }); const objOptions = isFunction(options) ? options.call( null, diff --git a/packages/vrender-animate/src/interpolate/store.ts b/packages/vrender-animate/src/interpolate/store.ts index a17451169..3d6ddeb20 100644 --- a/packages/vrender-animate/src/interpolate/store.ts +++ b/packages/vrender-animate/src/interpolate/store.ts @@ -147,6 +147,16 @@ export class InterpolateUpdateStore { target.addUpdateBoundTag(); target.addUpdatePositionTag(); }; + dx = (key: string, from: number, to: number, ratio: number, step: IStep, target: IGraphic) => { + target.attribute.dx = interpolateNumber(from, to, ratio); + target.addUpdateBoundTag(); + target.addUpdatePositionTag(); + }; + dy = (key: string, from: number, to: number, ratio: number, step: IStep, target: IGraphic) => { + target.attribute.dy = interpolateNumber(from, to, ratio); + target.addUpdateBoundTag(); + target.addUpdatePositionTag(); + }; angle = (key: string, from: number, to: number, ratio: number, step: IStep, target: IGraphic) => { target.attribute.angle = interpolateNumber(from, to, ratio); target.addUpdateBoundTag(); diff --git a/packages/vrender-components/CHANGELOG.json b/packages/vrender-components/CHANGELOG.json index 146bdb021..b62c38ab7 100644 --- a/packages/vrender-components/CHANGELOG.json +++ b/packages/vrender-components/CHANGELOG.json @@ -1,6 +1,21 @@ { "name": "@visactor/vrender-components", "entries": [ + { + "version": "1.0.3", + "tag": "@visactor/vrender-components_v1.0.3", + "date": "Tue, 10 Jun 2025 09:32:32 GMT", + "comments": { + "none": [ + { + "comment": "fix: disable sampling when label is rich text\n\n" + }, + { + "comment": "fix: fix rele" + } + ] + } + }, { "version": "1.0.1", "tag": "@visactor/vrender-components_v1.0.1", diff --git a/packages/vrender-components/CHANGELOG.md b/packages/vrender-components/CHANGELOG.md index e4cebe2cc..f3d6061ae 100644 --- a/packages/vrender-components/CHANGELOG.md +++ b/packages/vrender-components/CHANGELOG.md @@ -1,6 +1,16 @@ # Change Log - @visactor/vrender-components -This log was last generated on Mon, 09 Jun 2025 07:29:07 GMT and should not be manually modified. +This log was last generated on Tue, 10 Jun 2025 09:32:32 GMT and should not be manually modified. + +## 1.0.3 +Tue, 10 Jun 2025 09:32:32 GMT + +### Updates + +- fix: disable sampling when label is rich text + + +- fix: fix rele ## 1.0.1 Mon, 09 Jun 2025 07:29:07 GMT diff --git a/packages/vrender-components/package.json b/packages/vrender-components/package.json index ed42ee030..e75dc053c 100644 --- a/packages/vrender-components/package.json +++ b/packages/vrender-components/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vrender-components", - "version": "1.0.1", + "version": "1.0.3", "description": "components library for dp visualization", "sideEffects": false, "main": "cjs/index.js", @@ -27,9 +27,9 @@ "dependencies": { "@visactor/vutils": "1.0.6", "@visactor/vscale": "1.0.6", - "@visactor/vrender-core": "workspace:1.0.1", - "@visactor/vrender-kits": "workspace:1.0.1", - "@visactor/vrender-animate": "workspace:1.0.1" + "@visactor/vrender-core": "workspace:1.0.3", + "@visactor/vrender-kits": "workspace:1.0.3", + "@visactor/vrender-animate": "workspace:1.0.3" }, "devDependencies": { "@internal/bundler": "workspace:*", diff --git a/packages/vrender-components/src/axis/tick-data/continuous.ts b/packages/vrender-components/src/axis/tick-data/continuous.ts index 777203125..bd0683ead 100644 --- a/packages/vrender-components/src/axis/tick-data/continuous.ts +++ b/packages/vrender-components/src/axis/tick-data/continuous.ts @@ -166,7 +166,7 @@ export const continuousTicks = (scale: ContinuousScale, op: ITickDataOpt): ITick samplingScaleTicks.push(tick); } }); - items = getCartesianLabelBounds(scale, samplingScaleTicks, op as ICartesianTickDataOpt).map( + items = getCartesianLabelBounds(scale, samplingScaleTicks, op as ICartesianTickDataOpt)?.map( (bounds, i) => ({ AABBBounds: bounds, @@ -174,7 +174,7 @@ export const continuousTicks = (scale: ContinuousScale, op: ITickDataOpt): ITick } as ILabelItem) ); } else { - items = getCartesianLabelBounds(scale, scaleTicks, op as ICartesianTickDataOpt).map( + items = getCartesianLabelBounds(scale, scaleTicks, op as ICartesianTickDataOpt)?.map( (bounds, i) => ({ AABBBounds: bounds, @@ -182,49 +182,52 @@ export const continuousTicks = (scale: ContinuousScale, op: ITickDataOpt): ITick } as ILabelItem) ); } - const firstSourceItem = items[0]; - const lastSourceItem = last(items); - const samplingMethod = breakData && breakData() ? methods.greedy : methods.parity; // 由于轴截断后刻度会存在不均匀的情况,所以不能使用 parity 算法 - while (items.length >= 3 && hasOverlap(items as any, labelGap)) { - items = samplingMethod(items, labelGap); - } - - const checkFirst = op.labelFirstVisible; - let checkLast = op.labelLastVisible; // 这里和 auto-hide 里的逻辑有差异,不根据 length 自动强制显示最后一个(会引起 vtable 较多 badcase)。 + if (items) { + const firstSourceItem = items[0]; + const lastSourceItem = last(items); - if (intersect(firstSourceItem as any, lastSourceItem as any, labelGap)) { - if (items.includes(lastSourceItem) && items.length > 1 && checkFirst && checkLast) { - items.splice(items.indexOf(lastSourceItem), 1); - checkLast = false; + const samplingMethod = breakData && breakData() ? methods.greedy : methods.parity; // 由于轴截断后刻度会存在不均匀的情况,所以不能使用 parity 算法 + while (items.length >= 3 && hasOverlap(items as any, labelGap)) { + items = samplingMethod(items, labelGap); } - } - forceItemVisible(firstSourceItem, items, checkFirst, (item: ILabelItem) => - intersect(item as any, firstSourceItem as any, labelGap) - ); - forceItemVisible( - lastSourceItem, - items, - checkLast, - (item: ILabelItem) => - intersect(item as any, lastSourceItem as any, labelGap) || - (checkFirst && item !== firstSourceItem ? intersect(item as any, firstSourceItem as any, labelGap) : false), - true - ); - - const ticks = items.map(item => item.value); - - if (ticks.length < 3 && labelFlush) { - if (ticks.length > 1) { - ticks.pop(); + const checkFirst = op.labelFirstVisible; + let checkLast = op.labelLastVisible; // 这里和 auto-hide 里的逻辑有差异,不根据 length 自动强制显示最后一个(会引起 vtable 较多 badcase)。 + + if (intersect(firstSourceItem as any, lastSourceItem as any, labelGap)) { + if (items.includes(lastSourceItem) && items.length > 1 && checkFirst && checkLast) { + items.splice(items.indexOf(lastSourceItem), 1); + checkLast = false; + } } - if (last(ticks) !== last(scaleTicks)) { - ticks.push(last(scaleTicks)); + + forceItemVisible(firstSourceItem, items, checkFirst, (item: ILabelItem) => + intersect(item as any, firstSourceItem as any, labelGap) + ); + forceItemVisible( + lastSourceItem, + items, + checkLast, + (item: ILabelItem) => + intersect(item as any, lastSourceItem as any, labelGap) || + (checkFirst && item !== firstSourceItem ? intersect(item as any, firstSourceItem as any, labelGap) : false), + true + ); + + const ticks = items.map(item => item.value); + + if (ticks.length < 3 && labelFlush) { + if (ticks.length > 1) { + ticks.pop(); + } + if (last(ticks) !== last(scaleTicks)) { + ticks.push(last(scaleTicks)); + } } - } - scaleTicks = ticks; + scaleTicks = ticks; + } } } return convertDomainToTickData(scaleTicks); diff --git a/packages/vrender-components/src/axis/tick-data/discrete/linear.ts b/packages/vrender-components/src/axis/tick-data/discrete/linear.ts index 7b73b87f8..d32ac2a8c 100644 --- a/packages/vrender-components/src/axis/tick-data/discrete/linear.ts +++ b/packages/vrender-components/src/axis/tick-data/discrete/linear.ts @@ -1,5 +1,5 @@ import type { BandScale, IBaseScale } from '@visactor/vscale'; -import { isFunction, isValid, maxInArray, minInArray, binaryFuzzySearchInNumberRange } from '@visactor/vutils'; +import { isFunction, isValid, maxInArray, minInArray, binaryFuzzySearchInNumberRange, isNil } from '@visactor/vutils'; import type { ICartesianTickDataOpt, ITickData } from '../../type'; import { convertDomainToTickData, getCartesianLabelBounds, isAxisHorizontal } from '../util'; @@ -13,12 +13,15 @@ const getOneDimensionalLabelBounds = ( isHorizontal: boolean ): OneDimensionalBounds[] => { const labelBoundsList = getCartesianLabelBounds(scale, domain, op); - return labelBoundsList.map(bounds => { - if (isHorizontal) { - return [bounds.x1, bounds.x2, bounds.width()]; - } - return [bounds.y1, bounds.y2, bounds.height()]; - }); + return ( + labelBoundsList && + labelBoundsList.map(bounds => { + if (isHorizontal) { + return [bounds.x1, bounds.x2, bounds.width()]; + } + return [bounds.y1, bounds.y2, bounds.height()]; + }) + ); }; /** 判断两个 bounds 是否有重叠情况 */ @@ -79,63 +82,71 @@ export const linearDiscreteTicks = (scale: BandScale, op: ICartesianTickDataOpt) const rangeEnd = maxInArray(range); if (domain.length <= rangeSize / fontSize) { - const incrementUnit = (rangeEnd - rangeStart) / domain.length; const labelBoundsList = getOneDimensionalLabelBounds(scale, domain, op, isHorizontal); - const minBoundsLength = Math.min(...labelBoundsList.map(bounds => bounds[2])); - - const stepResult = getStep( - domain, - labelBoundsList, - labelGap, - op.labelLastVisible, - Math.floor(minBoundsLength / incrementUnit), // 给step赋上合适的初值,有效改善外层循环次数 - false - ); - - scaleTicks = (scale as BandScale).stepTicks(stepResult.step); - if (op.labelLastVisible) { - if (stepResult.delCount) { - scaleTicks = scaleTicks.slice(0, scaleTicks.length - stepResult.delCount); + + if (labelBoundsList) { + const minBoundsLength = Math.min(...labelBoundsList.map(bounds => bounds[2])); + + const incrementUnit = (rangeEnd - rangeStart) / domain.length; + const stepResult = getStep( + domain, + labelBoundsList, + labelGap, + op.labelLastVisible, + Math.floor(minBoundsLength / incrementUnit), // 给step赋上合适的初值,有效改善外层循环次数 + false + ); + + scaleTicks = (scale as BandScale).stepTicks(stepResult.step); + if (op.labelLastVisible) { + if (stepResult.delCount) { + scaleTicks = scaleTicks.slice(0, scaleTicks.length - stepResult.delCount); + } + scaleTicks.push(domain[domain.length - 1]); } - scaleTicks.push(domain[domain.length - 1]); } } else { // only check first middle last, use the max size to sampling const tempDomain = [domain[0], domain[Math.floor(domain.length / 2)], domain[domain.length - 1]]; const tempList = getOneDimensionalLabelBounds(scale, tempDomain, op, isHorizontal); - let maxBounds: OneDimensionalBounds = null; - tempList.forEach(current => { - if (!maxBounds) { - maxBounds = current; - return; - } - if (maxBounds[2] < current[2]) { - maxBounds = current; - } - }); - const step = - rangeEnd - rangeStart - labelGap > 0 - ? Math.ceil((domain.length * (labelGap + maxBounds[2])) / (rangeEnd - rangeStart - labelGap)) - : domain.length - 1; + if (tempList) { + let maxBounds: OneDimensionalBounds = null; + tempList.forEach(current => { + if (!maxBounds) { + maxBounds = current; + return; + } + if (maxBounds[2] < current[2]) { + maxBounds = current; + } + }); + + const step = + rangeEnd - rangeStart - labelGap > 0 + ? Math.ceil((domain.length * (labelGap + maxBounds[2])) / (rangeEnd - rangeStart - labelGap)) + : domain.length - 1; - scaleTicks = (scale as BandScale).stepTicks(step); + scaleTicks = (scale as BandScale).stepTicks(step); - if ( - op.labelLastVisible && - (!scaleTicks.length || scaleTicks[scaleTicks.length - 1] !== domain[domain.length - 1]) - ) { if ( - scaleTicks.length && - Math.abs(scale.scale(scaleTicks[scaleTicks.length - 1]) - scale.scale(domain[domain.length - 1])) < - maxBounds[2] + op.labelLastVisible && + (!scaleTicks.length || scaleTicks[scaleTicks.length - 1] !== domain[domain.length - 1]) ) { - scaleTicks = scaleTicks.slice(0, -1); + if ( + scaleTicks.length && + Math.abs(scale.scale(scaleTicks[scaleTicks.length - 1]) - scale.scale(domain[domain.length - 1])) < + maxBounds[2] + ) { + scaleTicks = scaleTicks.slice(0, -1); + } + scaleTicks.push(domain[domain.length - 1]); } - scaleTicks.push(domain[domain.length - 1]); } } - } else { + } + + if (isNil(scaleTicks)) { scaleTicks = scale.domain(); } diff --git a/packages/vrender-components/src/axis/tick-data/util.ts b/packages/vrender-components/src/axis/tick-data/util.ts index 651d55353..f5cbbf980 100644 --- a/packages/vrender-components/src/axis/tick-data/util.ts +++ b/packages/vrender-components/src/axis/tick-data/util.ts @@ -1,5 +1,5 @@ import type { IBaseScale } from '@visactor/vscale'; -import { AABBBounds, degreeToRadian } from '@visactor/vutils'; +import { AABBBounds, degreeToRadian, isPlainObject } from '@visactor/vutils'; import type { TextAlignType, TextBaselineType } from '@visactor/vrender-core'; import { initTextMeasure } from '../../util/text'; import type { ICartesianTickDataOpt, IOrientType, ITickData } from '../type'; @@ -74,9 +74,17 @@ export const getCartesianLabelBounds = (scale: IBaseScale, domain: any[], op: IC const textMeasure = initTextMeasure(labelStyle); const range = scale.range(); - const labelBoundsList = domain.map((v: any, i: number) => { + let labelBoundsList: AABBBounds[] = []; + + for (let i = 0; i < domain.length; i++) { + const v = domain[i]; const str = labelFormatter ? labelFormatter(v) : `${v}`; + if (isPlainObject(str)) { + labelBoundsList = undefined; + break; + } + // 估算文本宽高 const { width, height } = textMeasure.quickMeasure(str); const textWidth = Math.max(width, MIN_TICK_GAP); @@ -124,8 +132,8 @@ export const getCartesianLabelBounds = (scale: IBaseScale, domain: any[], op: IC bounds.rotate(labelAngle, baseTextX, baseTextY); } - return bounds; - }); + labelBoundsList.push(bounds); + } return labelBoundsList; }; diff --git a/packages/vrender-core/CHANGELOG.json b/packages/vrender-core/CHANGELOG.json index 022566af3..837a01a4b 100644 --- a/packages/vrender-core/CHANGELOG.json +++ b/packages/vrender-core/CHANGELOG.json @@ -1,6 +1,18 @@ { "name": "@visactor/vrender-core", "entries": [ + { + "version": "1.0.3", + "tag": "@visactor/vrender-core_v1.0.3", + "date": "Tue, 10 Jun 2025 09:32:32 GMT", + "comments": { + "none": [ + { + "comment": "fix: fix rele" + } + ] + } + }, { "version": "1.0.1", "tag": "@visactor/vrender-core_v1.0.1", diff --git a/packages/vrender-core/CHANGELOG.md b/packages/vrender-core/CHANGELOG.md index 4393be68f..3b7f3c586 100644 --- a/packages/vrender-core/CHANGELOG.md +++ b/packages/vrender-core/CHANGELOG.md @@ -1,6 +1,13 @@ # Change Log - @visactor/vrender-core -This log was last generated on Mon, 09 Jun 2025 07:29:07 GMT and should not be manually modified. +This log was last generated on Tue, 10 Jun 2025 09:32:32 GMT and should not be manually modified. + +## 1.0.3 +Tue, 10 Jun 2025 09:32:32 GMT + +### Updates + +- fix: fix rele ## 1.0.1 Mon, 09 Jun 2025 07:29:07 GMT diff --git a/packages/vrender-core/package.json b/packages/vrender-core/package.json index 26dad3000..9e6f4b996 100644 --- a/packages/vrender-core/package.json +++ b/packages/vrender-core/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vrender-core", - "version": "1.0.1", + "version": "1.0.3", "description": "", "sideEffects": [ "./src/modules.ts", diff --git a/packages/vrender-kits/CHANGELOG.json b/packages/vrender-kits/CHANGELOG.json index daa624b6d..a70e080aa 100644 --- a/packages/vrender-kits/CHANGELOG.json +++ b/packages/vrender-kits/CHANGELOG.json @@ -1,6 +1,18 @@ { "name": "@visactor/vrender-kits", "entries": [ + { + "version": "1.0.3", + "tag": "@visactor/vrender-kits_v1.0.3", + "date": "Tue, 10 Jun 2025 09:32:32 GMT", + "comments": { + "none": [ + { + "comment": "fix: fix rele" + } + ] + } + }, { "version": "1.0.1", "tag": "@visactor/vrender-kits_v1.0.1", diff --git a/packages/vrender-kits/CHANGELOG.md b/packages/vrender-kits/CHANGELOG.md index 18320c597..30ff49c31 100644 --- a/packages/vrender-kits/CHANGELOG.md +++ b/packages/vrender-kits/CHANGELOG.md @@ -1,6 +1,13 @@ # Change Log - @visactor/vrender-kits -This log was last generated on Mon, 09 Jun 2025 07:29:07 GMT and should not be manually modified. +This log was last generated on Tue, 10 Jun 2025 09:32:32 GMT and should not be manually modified. + +## 1.0.3 +Tue, 10 Jun 2025 09:32:32 GMT + +### Updates + +- fix: fix rele ## 1.0.1 Mon, 09 Jun 2025 07:29:07 GMT diff --git a/packages/vrender-kits/package.json b/packages/vrender-kits/package.json index e29632722..547c884de 100644 --- a/packages/vrender-kits/package.json +++ b/packages/vrender-kits/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vrender-kits", - "version": "1.0.1", + "version": "1.0.3", "description": "", "sideEffects": false, "main": "cjs/index.js", @@ -21,7 +21,7 @@ }, "dependencies": { "@visactor/vutils": "1.0.6", - "@visactor/vrender-core": "workspace:1.0.1", + "@visactor/vrender-core": "workspace:1.0.3", "@resvg/resvg-js": "2.4.1", "roughjs": "4.5.2", "gifuct-js": "2.1.2", diff --git a/packages/vrender/CHANGELOG.json b/packages/vrender/CHANGELOG.json index 8585ef31c..45bc695d3 100644 --- a/packages/vrender/CHANGELOG.json +++ b/packages/vrender/CHANGELOG.json @@ -1,6 +1,18 @@ { "name": "@visactor/vrender", "entries": [ + { + "version": "1.0.3", + "tag": "@visactor/vrender_v1.0.3", + "date": "Tue, 10 Jun 2025 09:32:32 GMT", + "comments": { + "none": [ + { + "comment": "fix: fix rele" + } + ] + } + }, { "version": "1.0.1", "tag": "@visactor/vrender_v1.0.1", diff --git a/packages/vrender/CHANGELOG.md b/packages/vrender/CHANGELOG.md index 31cc388ac..cca8a3db2 100644 --- a/packages/vrender/CHANGELOG.md +++ b/packages/vrender/CHANGELOG.md @@ -1,6 +1,13 @@ # Change Log - @visactor/vrender -This log was last generated on Mon, 09 Jun 2025 07:29:07 GMT and should not be manually modified. +This log was last generated on Tue, 10 Jun 2025 09:32:32 GMT and should not be manually modified. + +## 1.0.3 +Tue, 10 Jun 2025 09:32:32 GMT + +### Updates + +- fix: fix rele ## 1.0.1 Mon, 09 Jun 2025 07:29:07 GMT diff --git a/packages/vrender/package.json b/packages/vrender/package.json index d3c7aeb05..03232600d 100644 --- a/packages/vrender/package.json +++ b/packages/vrender/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vrender", - "version": "1.0.1", + "version": "1.0.3", "description": "", "sideEffects": true, "main": "cjs/index.js", @@ -24,9 +24,9 @@ "test-watch": "cross-env DEBUG_MODE=1 jest --watch" }, "dependencies": { - "@visactor/vrender-core": "workspace:1.0.1", - "@visactor/vrender-kits": "workspace:1.0.1", - "@visactor/vrender-animate": "workspace:1.0.1" + "@visactor/vrender-core": "workspace:1.0.3", + "@visactor/vrender-kits": "workspace:1.0.3", + "@visactor/vrender-animate": "workspace:1.0.3" }, "devDependencies": { "@internal/bundler": "workspace:*", diff --git a/packages/vrender/tsconfig.eslint.json b/packages/vrender/tsconfig.eslint.json index d5f1b26ba..52c55f957 100644 --- a/packages/vrender/tsconfig.eslint.json +++ b/packages/vrender/tsconfig.eslint.json @@ -17,6 +17,9 @@ }, { "path": "../vrender-kits" + }, + { + "path": "../vrender-aniamte" } ] } diff --git a/packages/vrender/tsconfig.json b/packages/vrender/tsconfig.json index fa6e522b7..95836238d 100644 --- a/packages/vrender/tsconfig.json +++ b/packages/vrender/tsconfig.json @@ -16,6 +16,9 @@ }, { "path": "../vrender-kits" + }, + { + "path": "../vrender-animate" } ] } diff --git a/packages/vrender/tsconfig.test.json b/packages/vrender/tsconfig.test.json index cc04987da..c0f87af17 100644 --- a/packages/vrender/tsconfig.test.json +++ b/packages/vrender/tsconfig.test.json @@ -3,7 +3,8 @@ "compilerOptions": { "paths": { "@visactor/vrender-core": ["../vrender-core/src"], - "@visactor/vrender-kits": ["../vrender-kits/src"] + "@visactor/vrender-kits": ["../vrender-kits/src"], + "@visactor/vrender-animate": ["../vrender-aniamte"] } }, "references": [] diff --git a/tools/bugserver-trigger/package.json b/tools/bugserver-trigger/package.json index 5a5d6dc84..ffdad381f 100644 --- a/tools/bugserver-trigger/package.json +++ b/tools/bugserver-trigger/package.json @@ -8,11 +8,11 @@ "ci": "ts-node --transpileOnly --skipProject ./scripts/trigger-test.ts" }, "dependencies": { - "@visactor/vrender": "workspace:1.0.1", - "@visactor/vrender-core": "workspace:1.0.1", - "@visactor/vrender-kits": "workspace:1.0.1", - "@visactor/vrender-components": "workspace:1.0.1", - "@visactor/vrender-animate": "workspace:1.0.1" + "@visactor/vrender": "workspace:1.0.3", + "@visactor/vrender-core": "workspace:1.0.3", + "@visactor/vrender-kits": "workspace:1.0.3", + "@visactor/vrender-components": "workspace:1.0.3", + "@visactor/vrender-animate": "workspace:1.0.3" }, "devDependencies": { "@rushstack/eslint-patch": "~1.1.4",