Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion common/config/rush/version-policies.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"definitionName":"lockStepVersion","policyName":"vrenderMain","version":"1.0.35","nextBump":"patch"}]
[{"definitionName":"lockStepVersion","policyName":"vrenderMain","version":"1.0.36","nextBump":"patch"}]
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@visactor/vchart": "1.3.0",
"@visactor/vutils": "~1.0.12",
"@visactor/vgrammar": "~0.5.7",
"@visactor/vrender": "workspace:1.0.35",
"@visactor/vrender": "workspace:1.0.36",
"markdown-it": "^13.0.0",
"highlight.js": "^11.8.0",
"axios": "^1.4.0",
Expand Down
6 changes: 6 additions & 0 deletions packages/react-vrender-utils/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"name": "@visactor/react-vrender-utils",
"entries": [
{
"version": "1.0.36",
"tag": "@visactor/react-vrender-utils_v1.0.36",
"date": "Wed, 24 Dec 2025 06:30:43 GMT",
"comments": {}
},
{
"version": "1.0.35",
"tag": "@visactor/react-vrender-utils_v1.0.35",
Expand Down
7 changes: 6 additions & 1 deletion packages/react-vrender-utils/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @visactor/react-vrender-utils

This log was last generated on Mon, 22 Dec 2025 08:54:24 GMT and should not be manually modified.
This log was last generated on Wed, 24 Dec 2025 06:30:43 GMT and should not be manually modified.

## 1.0.36
Wed, 24 Dec 2025 06:30:43 GMT

_Version update only_

## 1.0.35
Mon, 22 Dec 2025 08:54:24 GMT
Expand Down
6 changes: 3 additions & 3 deletions packages/react-vrender-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visactor/react-vrender-utils",
"version": "1.0.35",
"version": "1.0.36",
"description": "",
"sideEffects": false,
"main": "cjs/index.js",
Expand All @@ -24,8 +24,8 @@
"react-dom": "^18.2.0"
},
"dependencies": {
"@visactor/vrender": "workspace:1.0.35",
"@visactor/react-vrender": "workspace:1.0.35",
"@visactor/vrender": "workspace:1.0.36",
"@visactor/react-vrender": "workspace:1.0.36",
"@visactor/vutils": "~1.0.12",
"react-reconciler": "^0.29.0",
"tslib": "^2.3.1"
Expand Down
6 changes: 6 additions & 0 deletions packages/react-vrender/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"name": "@visactor/react-vrender",
"entries": [
{
"version": "1.0.36",
"tag": "@visactor/react-vrender_v1.0.36",
"date": "Wed, 24 Dec 2025 06:30:43 GMT",
"comments": {}
},
{
"version": "1.0.35",
"tag": "@visactor/react-vrender_v1.0.35",
Expand Down
7 changes: 6 additions & 1 deletion packages/react-vrender/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @visactor/react-vrender

This log was last generated on Mon, 22 Dec 2025 08:54:24 GMT and should not be manually modified.
This log was last generated on Wed, 24 Dec 2025 06:30:43 GMT and should not be manually modified.

## 1.0.36
Wed, 24 Dec 2025 06:30:43 GMT

_Version update only_

## 1.0.35
Mon, 22 Dec 2025 08:54:24 GMT
Expand Down
4 changes: 2 additions & 2 deletions packages/react-vrender/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visactor/react-vrender",
"version": "1.0.35",
"version": "1.0.36",
"description": "",
"sideEffects": false,
"main": "cjs/index.js",
Expand All @@ -23,7 +23,7 @@
"react": "^18.2.0"
},
"dependencies": {
"@visactor/vrender": "workspace:1.0.35",
"@visactor/vrender": "workspace:1.0.36",
"@visactor/vutils": "~1.0.12",
"react-reconciler": "^0.29.0",
"tslib": "^2.3.1"
Expand Down
6 changes: 6 additions & 0 deletions packages/vrender-animate/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"name": "@visactor/vrender-animate",
"entries": [
{
"version": "1.0.36",
"tag": "@visactor/vrender-animate_v1.0.36",
"date": "Wed, 24 Dec 2025 06:30:43 GMT",
"comments": {}
},
{
"version": "1.0.35",
"tag": "@visactor/vrender-animate_v1.0.35",
Expand Down
7 changes: 6 additions & 1 deletion packages/vrender-animate/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @visactor/vrender-animate

This log was last generated on Mon, 22 Dec 2025 08:54:24 GMT and should not be manually modified.
This log was last generated on Wed, 24 Dec 2025 06:30:43 GMT and should not be manually modified.

## 1.0.36
Wed, 24 Dec 2025 06:30:43 GMT

_Version update only_

## 1.0.35
Mon, 22 Dec 2025 08:54:24 GMT
Expand Down
4 changes: 2 additions & 2 deletions packages/vrender-animate/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visactor/vrender-animate",
"version": "1.0.35",
"version": "1.0.36",
"description": "",
"sideEffects": false,
"main": "cjs/index.js",
Expand All @@ -21,7 +21,7 @@
},
"dependencies": {
"@visactor/vutils": "~1.0.12",
"@visactor/vrender-core": "workspace:1.0.35"
"@visactor/vrender-core": "workspace:1.0.36"
},
"devDependencies": {
"@internal/bundler": "workspace:*",
Expand Down
6 changes: 6 additions & 0 deletions packages/vrender-components/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"name": "@visactor/vrender-components",
"entries": [
{
"version": "1.0.36",
"tag": "@visactor/vrender-components_v1.0.36",
"date": "Wed, 24 Dec 2025 06:30:43 GMT",
"comments": {}
},
{
"version": "1.0.35",
"tag": "@visactor/vrender-components_v1.0.35",
Expand Down
7 changes: 6 additions & 1 deletion packages/vrender-components/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @visactor/vrender-components

This log was last generated on Mon, 22 Dec 2025 08:54:24 GMT and should not be manually modified.
This log was last generated on Wed, 24 Dec 2025 06:30:43 GMT and should not be manually modified.

## 1.0.36
Wed, 24 Dec 2025 06:30:43 GMT

_Version update only_

## 1.0.35
Mon, 22 Dec 2025 08:54:24 GMT
Expand Down
8 changes: 4 additions & 4 deletions packages/vrender-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visactor/vrender-components",
"version": "1.0.35",
"version": "1.0.36",
"description": "components library for dp visualization",
"sideEffects": false,
"main": "cjs/index.js",
Expand All @@ -27,9 +27,9 @@
"dependencies": {
"@visactor/vutils": "~1.0.12",
"@visactor/vscale": "~1.0.12",
"@visactor/vrender-core": "workspace:1.0.35",
"@visactor/vrender-kits": "workspace:1.0.35",
"@visactor/vrender-animate": "workspace:1.0.35"
"@visactor/vrender-core": "workspace:1.0.36",
"@visactor/vrender-kits": "workspace:1.0.36",
"@visactor/vrender-animate": "workspace:1.0.36"
},
"devDependencies": {
"@internal/bundler": "workspace:*",
Expand Down
5 changes: 2 additions & 3 deletions packages/vrender-components/src/axis/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ import type {
} from '@visactor/vrender-core';
// eslint-disable-next-line no-duplicate-imports
import { graphicCreator, diff } from '@visactor/vrender-core';
import type { Dict, IBounds } from '@visactor/vutils';
import type { Dict } from '@visactor/vutils';
// eslint-disable-next-line no-duplicate-imports
import { abs, cloneDeep, get, isArray, isEmpty, isEqual, isFunction, merge, pi } from '@visactor/vutils';
import { AbstractComponent } from '../core/base';
import { abs, cloneDeep, get, isEmpty, isFunction, merge, pi } from '@visactor/vutils';
import type { Point } from '../core/type';
import type { TagAttributes } from '../tag';
import { createTextGraphicByType, traverseGroup } from '../util';
Expand Down
29 changes: 25 additions & 4 deletions packages/vrender-components/src/axis/line.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,9 @@ export class LineAxis extends AxisBase<LineAxisAttributes> {
}

const offset = tickLength + labelLength + space;
const titlePoint = this.getVerticalCoord(point, offset, false); // 标题的点
const vector = this.getVerticalVector(offset, false, { x: 0, y: 0 });
const actualOffset = this.getActualOffset(offset);
const titlePoint = this.getVerticalCoord(point, actualOffset, false); // 标题的点
const vector = this.getVerticalVector(actualOffset, false, { x: 0, y: 0 });

let { angle } = restAttrs; // 用户设置的是角度
let textAlign;
Expand Down Expand Up @@ -359,14 +360,14 @@ export class LineAxis extends AxisBase<LineAxisAttributes> {
const cosValue = Math.abs(Math.cos(angle ?? 0));
maxTagWidth = cosValue < 1e-6 ? Infinity : this.attribute.end.x / cosValue;
} else {
maxTagWidth = limitSize - offset;
maxTagWidth = limitSize - actualOffset;
}
} else {
if (angle && angle !== 0) {
const sinValue = Math.abs(Math.sin(angle));
maxTagWidth = sinValue < 1e-6 ? Infinity : this.attribute.end.y / sinValue;
} else {
maxTagWidth = limitSize - offset;
maxTagWidth = limitSize - actualOffset;
}
}
}
Expand Down Expand Up @@ -886,6 +887,26 @@ export class LineAxis extends AxisBase<LineAxisAttributes> {
});
}
}

getActualOffset(offset: number): number {
const orient = this.attribute.orient;
const isVertical = orient === 'left' || orient === 'right';
if (!isVertical) {
return offset;
}

if (this.attribute.width) {
return this.attribute.width;
}
if (this.attribute.maxWidth) {
offset = Math.min(offset, this.attribute.maxWidth);
}
if (this.attribute.minWidth) {
offset = Math.max(offset, this.attribute.minWidth);
}
return offset;
}

release(): void {
super.release();
this._breaks = null;
Expand Down
7 changes: 7 additions & 0 deletions packages/vrender-components/src/axis/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,13 @@ export interface LineAxisAttributes extends Omit<AxisBaseAttributes, 'label'> {
* @since 0.20.3
*/
breaks?: AxisBreakProps[];

/**
* 最大宽度,用于自动调整标签宽度以适应布局区域
*/
maxWidth?: number;
minWidth?: number;
width?: number;
}

export interface CircleAxisAttributes extends AxisBaseAttributes {
Expand Down
6 changes: 6 additions & 0 deletions packages/vrender-core/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"name": "@visactor/vrender-core",
"entries": [
{
"version": "1.0.36",
"tag": "@visactor/vrender-core_v1.0.36",
"date": "Wed, 24 Dec 2025 06:30:43 GMT",
"comments": {}
},
{
"version": "1.0.35",
"tag": "@visactor/vrender-core_v1.0.35",
Expand Down
Loading
Loading