Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Auto release] release 0.18.10 #1113

Merged
merged 13 commits into from
Mar 29, 2024
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
1,935 changes: 1,022 additions & 913 deletions common/config/rush/pnpm-lock.yaml

Large diffs are not rendered by default.

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":"0.18.9","nextBump":"patch"}]
[{"definitionName":"lockStepVersion","policyName":"vrenderMain","version":"0.18.10","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": "~0.18.1",
"@visactor/vgrammar": "~0.5.7",
"@visactor/vrender": "workspace:0.18.9",
"@visactor/vrender": "workspace:0.18.10",
"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": "0.18.10",
"tag": "@visactor/react-vrender-utils_v0.18.10",
"date": "Fri, 29 Mar 2024 08:02:16 GMT",
"comments": {}
},
{
"version": "0.18.9",
"tag": "@visactor/react-vrender-utils_v0.18.9",
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 Thu, 28 Mar 2024 10:13:24 GMT and should not be manually modified.
This log was last generated on Fri, 29 Mar 2024 08:02:16 GMT and should not be manually modified.

## 0.18.10
Fri, 29 Mar 2024 08:02:16 GMT

_Version update only_

## 0.18.9
Thu, 28 Mar 2024 10:13: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": "0.18.9",
"version": "0.18.10",
"description": "",
"sideEffects": false,
"main": "cjs/index.js",
Expand All @@ -24,8 +24,8 @@
"react-dom": "^18.2.0"
},
"dependencies": {
"@visactor/vrender": "workspace:0.18.9",
"@visactor/react-vrender": "workspace:0.18.9",
"@visactor/vrender": "workspace:0.18.10",
"@visactor/react-vrender": "workspace:0.18.10",
"@visactor/vutils": "~0.18.1",
"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": "0.18.10",
"tag": "@visactor/react-vrender_v0.18.10",
"date": "Fri, 29 Mar 2024 08:02:16 GMT",
"comments": {}
},
{
"version": "0.18.9",
"tag": "@visactor/react-vrender_v0.18.9",
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 Thu, 28 Mar 2024 10:13:24 GMT and should not be manually modified.
This log was last generated on Fri, 29 Mar 2024 08:02:16 GMT and should not be manually modified.

## 0.18.10
Fri, 29 Mar 2024 08:02:16 GMT

_Version update only_

## 0.18.9
Thu, 28 Mar 2024 10:13: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": "0.18.9",
"version": "0.18.10",
"description": "",
"sideEffects": false,
"main": "cjs/index.js",
Expand All @@ -23,7 +23,7 @@
"react": "^18.2.0"
},
"dependencies": {
"@visactor/vrender": "workspace:0.18.9",
"@visactor/vrender": "workspace:0.18.10",
"@visactor/vutils": "~0.18.1",
"react-reconciler": "^0.29.0",
"tslib": "^2.3.1"
Expand Down
18 changes: 18 additions & 0 deletions packages/vrender-components/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
{
"name": "@visactor/vrender-components",
"entries": [
{
"version": "0.18.10",
"tag": "@visactor/vrender-components_v0.18.10",
"date": "Fri, 29 Mar 2024 08:02:16 GMT",
"comments": {
"none": [
{
"comment": "fix: when user set `defaultSelected` value to be [], all legend's items should be unselected, fixed https://github.com/VisActor/VChart/issues/2445"
},
{
"comment": "fix: when user set `defaultSelected` value to be [], all legend's items should be unselected, fixed https://github.com/VisActor/VChart/issues/2445"
},
{
"comment": "fix: fix alignment calculation for line axis axis text, fixed https://github.com/VisActor/VChart/issues/2449"
}
]
}
},
{
"version": "0.18.9",
"tag": "@visactor/vrender-components_v0.18.9",
Expand Down
11 changes: 10 additions & 1 deletion packages/vrender-components/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# Change Log - @visactor/vrender-components

This log was last generated on Thu, 28 Mar 2024 10:13:24 GMT and should not be manually modified.
This log was last generated on Fri, 29 Mar 2024 08:02:16 GMT and should not be manually modified.

## 0.18.10
Fri, 29 Mar 2024 08:02:16 GMT

### Updates

- fix: when user set `defaultSelected` value to be [], all legend's items should be unselected, fixed https://github.com/VisActor/VChart/issues/2445
- fix: when user set `defaultSelected` value to be [], all legend's items should be unselected, fixed https://github.com/VisActor/VChart/issues/2445
- fix: fix alignment calculation for line axis axis text, fixed https://github.com/VisActor/VChart/issues/2449

## 0.18.9
Thu, 28 Mar 2024 10:13:24 GMT
Expand Down
6 changes: 3 additions & 3 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": "0.18.9",
"version": "0.18.10",
"description": "components library for dp visualization",
"sideEffects": false,
"main": "cjs/index.js",
Expand All @@ -24,8 +24,8 @@
"analysis-core": "bundle -f umd -a -i core.ts"
},
"dependencies": {
"@visactor/vrender-core": "workspace:0.18.9",
"@visactor/vrender-kits": "workspace:0.18.9",
"@visactor/vrender-core": "workspace:0.18.10",
"@visactor/vrender-kits": "workspace:0.18.10",
"@visactor/vutils": "~0.18.1",
"@visactor/vscale": "~0.17.3"
},
Expand Down
10 changes: 6 additions & 4 deletions packages/vrender-components/src/axis/line.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,12 +311,14 @@ export class LineAxis extends AxisBase<LineAxisAttributes> {
angle?: number
): { textAlign: TextAlignType; textBaseline: TextBaselineType } {
const orient = this.attribute.orient;
if (isValidNumber(angle) || (vector[0] === 0 && vector[1] === 0)) {
const isCartesian = ['top', 'bottom', 'right', 'left'].includes(orient);
// 目前的向量方法暂无法返回正确的笛卡尔坐标轴下文本旋转后的问题,所以通过这种方法判断,保证旋转后 textAlign 和 textBaseline 也正确
if (isCartesian || (vector[0] === 0 && vector[1] === 0)) {
if (orient === 'top' || orient === 'bottom') {
return getXAxisLabelAlign(orient, angle);
return getXAxisLabelAlign(inside ? (orient === 'bottom' ? 'top' : 'bottom') : orient, angle);
}
if (orient === 'left' || orient === 'right') {
return getYAxisLabelAlign(orient, angle);
return getYAxisLabelAlign(inside ? (orient === 'left' ? 'right' : 'left') : orient, angle);
}
}

Expand Down Expand Up @@ -558,7 +560,7 @@ export class LineAxis extends AxisBase<LineAxisAttributes> {
const axisLineWidth = line && line.visible ? line.style.lineWidth ?? 1 : 0;
const tickLength = tick && tick.visible ? tick.length ?? 4 : 0;
if (title && title.visible && typeof title.text === 'string') {
titleHeight = measureTextSize(title.text, title.textStyle, this.stage?.getTheme().text.fontFamily).height;
titleHeight = measureTextSize(title.text, title.textStyle, this.stage?.getTheme()?.text).height;
const padding = normalizePadding(title.padding);
titleSpacing = title.space + padding[0] + padding[2];
}
Expand Down
2 changes: 1 addition & 1 deletion packages/vrender-components/src/indicator/indicator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export class Indicator extends AbstractComponent<Required<IndicatorAttributes>>
const originWidth = measureTextSize(
(indicatorItemSpec.style?.text ?? '') as string | number | number[] | string[],
(indicatorItemSpec.style ?? {}) as Partial<ITextGraphicAttribute>,
this.stage?.getTheme().text.fontFamily
this.stage?.getTheme()?.text
).width;
if (originWidth > 0) {
const ratio = (limit * (indicatorItemSpec.fitPercent ?? 0.5)) / originWidth;
Expand Down
8 changes: 6 additions & 2 deletions packages/vrender-components/src/label/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,14 @@ export class LabelBase<T extends BaseLabelAttrs> extends AbstractComponent<T> {
};

protected _createLabelText(attributes: LabelItem) {
const textAttrs = {
...this.stage?.getTheme()?.text,
...attributes
};
if (isRichText(attributes as any, 'textType')) {
return graphicCreator.richtext(richTextAttributeTransform(attributes as any));
return graphicCreator.richtext(richTextAttributeTransform(textAttrs as any));
}
return graphicCreator.text(attributes as ITextGraphicAttribute);
return graphicCreator.text(textAttrs as ITextGraphicAttribute);
}

private _prepare() {
Expand Down
14 changes: 7 additions & 7 deletions packages/vrender-components/src/legend/discrete/discrete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export class DiscreteLegend extends LegendBase<DiscreteLegendAttrs> {
maxRow = 2,
maxWidth,
maxHeight,
defaultSelected = [],
defaultSelected,
lazyload,
autoPage
} = this.attribute as DiscreteLegendAttrs;
Expand Down Expand Up @@ -239,12 +239,12 @@ export class DiscreteLegend extends LegendBase<DiscreteLegendAttrs> {
}
item.index = index; // 用于维护图例的顺序

const itemGroup = this._renderEachItem(
item,
isEmpty(defaultSelected) ? true : defaultSelected?.includes(item.label),
index,
legendItems
);
let isSelected = true;
if (isArray(defaultSelected)) {
isSelected = defaultSelected.includes(item.label);
}

const itemGroup = this._renderEachItem(item, isSelected, index, legendItems);

const itemWidth = itemGroup.attribute.width;
const itemHeight = itemGroup.attribute.height;
Expand Down
2 changes: 1 addition & 1 deletion packages/vrender-components/src/pager/pager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export class Pager extends AbstractComponent<Required<PagerAttributes>> {
textBaseline: 'middle',
...textStyle
},
this.stage?.getTheme().text.fontFamily
this.stage?.getTheme()?.text
);

const handlerSizeX = isNumber(handlerSize) ? handlerSize : handlerSize[0];
Expand Down
2 changes: 1 addition & 1 deletion packages/vrender-components/src/tag/tag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export class Tag extends AbstractComponent<Required<TagAttributes>> {
}

// 因为文本可能发生旋转,所以需要使用 measureTextSize 方法
const textBounds = measureTextSize(textAttrs.text as string, textStyle, this.stage?.getTheme().text.fontFamily);
const textBounds = measureTextSize(textAttrs.text as string, textStyle, this.stage?.getTheme()?.text);
const textWidth = textBounds.width;
const textHeight = textBounds.height;
tagWidth += textWidth;
Expand Down
12 changes: 6 additions & 6 deletions packages/vrender-components/src/util/text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@ export const initTextMeasure = (
export function measureTextSize(
text: string | number | string[] | number[],
textSpec: Partial<ITextGraphicAttribute>,
fontFamily: string = DEFAULT_TEXT_FONT_FAMILY
defaultTextTheme: Partial<ITextGraphicAttribute> = {}
) {
if (!text) {
return { width: 0, height: 0 };
}
const bounds = getTextBounds({
text,
fontFamily: textSpec.fontFamily ?? fontFamily,
fontSize: textSpec.fontSize || 12,
fontWeight: textSpec.fontWeight as any,
textAlign: textSpec.textAlign ?? 'center',
fontFamily: textSpec.fontFamily || defaultTextTheme.fontFamily || DEFAULT_TEXT_FONT_FAMILY,
fontSize: textSpec.fontSize || defaultTextTheme.fontSize || 12,
fontWeight: textSpec.fontWeight || defaultTextTheme.fontWeight,
textAlign: textSpec.textAlign || 'center',
textBaseline: textSpec.textBaseline,
ellipsis: !!textSpec.ellipsis,
maxLineWidth: textSpec.maxLineWidth || Infinity,
lineHeight: textSpec.fontSize || 12
lineHeight: textSpec.fontSize || defaultTextTheme.fontSize || 12
});

return { width: bounds.width(), height: bounds.height() };
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": "0.18.10",
"tag": "@visactor/vrender-core_v0.18.10",
"date": "Fri, 29 Mar 2024 08:02:16 GMT",
"comments": {}
},
{
"version": "0.18.9",
"tag": "@visactor/vrender-core_v0.18.9",
Expand Down
7 changes: 6 additions & 1 deletion packages/vrender-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @visactor/vrender-core

This log was last generated on Thu, 28 Mar 2024 10:13:24 GMT and should not be manually modified.
This log was last generated on Fri, 29 Mar 2024 08:02:16 GMT and should not be manually modified.

## 0.18.10
Fri, 29 Mar 2024 08:02:16 GMT

_Version update only_

## 0.18.9
Thu, 28 Mar 2024 10:13:24 GMT
Expand Down
2 changes: 1 addition & 1 deletion packages/vrender-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visactor/vrender-core",
"version": "0.18.9",
"version": "0.18.10",
"description": "",
"sideEffects": [
"./src/modules.ts",
Expand Down
6 changes: 6 additions & 0 deletions packages/vrender-kits/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"name": "@visactor/vrender-kits",
"entries": [
{
"version": "0.18.10",
"tag": "@visactor/vrender-kits_v0.18.10",
"date": "Fri, 29 Mar 2024 08:02:16 GMT",
"comments": {}
},
{
"version": "0.18.9",
"tag": "@visactor/vrender-kits_v0.18.9",
Expand Down
7 changes: 6 additions & 1 deletion packages/vrender-kits/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @visactor/vrender-kits

This log was last generated on Thu, 28 Mar 2024 10:13:24 GMT and should not be manually modified.
This log was last generated on Fri, 29 Mar 2024 08:02:16 GMT and should not be manually modified.

## 0.18.10
Fri, 29 Mar 2024 08:02:16 GMT

_Version update only_

## 0.18.9
Thu, 28 Mar 2024 10:13:24 GMT
Expand Down
4 changes: 2 additions & 2 deletions packages/vrender-kits/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visactor/vrender-kits",
"version": "0.18.9",
"version": "0.18.10",
"description": "",
"sideEffects": false,
"main": "cjs/index.js",
Expand All @@ -20,7 +20,7 @@
"test": ""
},
"dependencies": {
"@visactor/vrender-core": "workspace:0.18.9",
"@visactor/vrender-core": "workspace:0.18.10",
"@visactor/vutils": "~0.18.1",
"@resvg/resvg-js": "2.4.1",
"roughjs": "4.5.2"
Expand Down
6 changes: 6 additions & 0 deletions packages/vrender/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"name": "@visactor/vrender",
"entries": [
{
"version": "0.18.10",
"tag": "@visactor/vrender_v0.18.10",
"date": "Fri, 29 Mar 2024 08:02:16 GMT",
"comments": {}
},
{
"version": "0.18.9",
"tag": "@visactor/vrender_v0.18.9",
Expand Down
7 changes: 6 additions & 1 deletion packages/vrender/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @visactor/vrender

This log was last generated on Thu, 28 Mar 2024 10:13:24 GMT and should not be manually modified.
This log was last generated on Fri, 29 Mar 2024 08:02:16 GMT and should not be manually modified.

## 0.18.10
Fri, 29 Mar 2024 08:02:16 GMT

_Version update only_

## 0.18.9
Thu, 28 Mar 2024 10:13:24 GMT
Expand Down
Loading
Loading