Skip to content

Commit

Permalink
Merge pull request #1474 from VisActor/release/0.20.7
Browse files Browse the repository at this point in the history
[Auto release] release 0.20.7
  • Loading branch information
skie1997 authored Sep 27, 2024
2 parents 9bff861 + c9017b5 commit 2a51b68
Show file tree
Hide file tree
Showing 28 changed files with 196 additions and 48 deletions.
26 changes: 13 additions & 13 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":"0.20.6","nextBump":"patch"}]
[{"definitionName":"lockStepVersion","policyName":"vrenderMain","version":"0.20.7","nextBump":"patch"}]
24 changes: 24 additions & 0 deletions docs/assets/changelog/en/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
# v0.20.6

2024-09-26


**🆕 New feature**

- **@visactor/vrender-components**: support obb text bounds to enhance autoHide effect
- **@visactor/vrender-core**: support obb bounds in text graphic

**🐛 Bug fix**

- **@visactor/vrender-components**: fix limit width of arc label when has customized align offset
- **@visactor/vrender-components**: fix error of `alternateColor`
- **@visactor/vrender-components**: outside label should not apply `smartInvert`
- **@visactor/vrender-components**: fix `boundsPadding` of legend focus icon
- **@visactor/vrender-core**: fix customPath of arc
- **@visactor/vrender-core**: fix issue with interactive graphic while parent was removed
- **@visactor/vrender-core**: line segment update animation result error



[more detail about v0.20.6](https://github.com/VisActor/VRender/releases/tag/v0.20.6)

# v0.20.5

2024-09-20
Expand Down
24 changes: 24 additions & 0 deletions docs/assets/changelog/zh/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
# v0.20.6

2024-09-26


**🆕 新增功能**

- **@visactor/vrender-components**: support obb text bounds to enhance autoHide effect
- **@visactor/vrender-core**: support obb bounds in text graphic

**🐛 功能修复**

- **@visactor/vrender-components**: fix limit width of arc label when has customized align offset
- **@visactor/vrender-components**: fix error of `alternateColor`
- **@visactor/vrender-components**: outside label should not apply `smartInvert`
- **@visactor/vrender-components**: fix `boundsPadding` of legend focus icon
- **@visactor/vrender-core**: fix customPath of arc
- **@visactor/vrender-core**: fix issue with interactive graphic while parent was removed
- **@visactor/vrender-core**: line segment update animation result error



[更多详情请查看 v0.20.6](https://github.com/VisActor/VRender/releases/tag/v0.20.6)

# v0.20.5

2024-09-20
Expand Down
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.17",
"@visactor/vgrammar": "~0.5.7",
"@visactor/vrender": "workspace:0.20.6",
"@visactor/vrender": "workspace:0.20.7",
"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.20.7",
"tag": "@visactor/react-vrender-utils_v0.20.7",
"date": "Fri, 27 Sep 2024 03:22:31 GMT",
"comments": {}
},
{
"version": "0.20.6",
"tag": "@visactor/react-vrender-utils_v0.20.6",
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, 26 Sep 2024 09:28:36 GMT and should not be manually modified.
This log was last generated on Fri, 27 Sep 2024 03:22:31 GMT and should not be manually modified.

## 0.20.7
Fri, 27 Sep 2024 03:22:31 GMT

_Version update only_

## 0.20.6
Thu, 26 Sep 2024 09:28:35 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.20.6",
"version": "0.20.7",
"description": "",
"sideEffects": false,
"main": "cjs/index.js",
Expand All @@ -24,8 +24,8 @@
"react-dom": "^18.2.0"
},
"dependencies": {
"@visactor/vrender": "workspace:0.20.6",
"@visactor/react-vrender": "workspace:0.20.6",
"@visactor/vrender": "workspace:0.20.7",
"@visactor/react-vrender": "workspace:0.20.7",
"@visactor/vutils": "~0.18.17",
"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.20.7",
"tag": "@visactor/react-vrender_v0.20.7",
"date": "Fri, 27 Sep 2024 03:22:31 GMT",
"comments": {}
},
{
"version": "0.20.6",
"tag": "@visactor/react-vrender_v0.20.6",
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, 26 Sep 2024 09:28:36 GMT and should not be manually modified.
This log was last generated on Fri, 27 Sep 2024 03:22:31 GMT and should not be manually modified.

## 0.20.7
Fri, 27 Sep 2024 03:22:31 GMT

_Version update only_

## 0.20.6
Thu, 26 Sep 2024 09:28:36 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.20.6",
"version": "0.20.7",
"description": "",
"sideEffects": false,
"main": "cjs/index.js",
Expand All @@ -23,7 +23,7 @@
"react": "^18.2.0"
},
"dependencies": {
"@visactor/vrender": "workspace:0.20.6",
"@visactor/vrender": "workspace:0.20.7",
"@visactor/vutils": "~0.18.17",
"react-reconciler": "^0.29.0",
"tslib": "^2.3.1"
Expand Down
12 changes: 12 additions & 0 deletions packages/vrender-components/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
{
"name": "@visactor/vrender-components",
"entries": [
{
"version": "0.20.7",
"tag": "@visactor/vrender-components_v0.20.7",
"date": "Fri, 27 Sep 2024 03:22:31 GMT",
"comments": {
"none": [
{
"comment": "feat: legend support roam scroll. close@VisActor/VChart#3254"
}
]
}
},
{
"version": "0.20.6",
"tag": "@visactor/vrender-components_v0.20.6",
Expand Down
9 changes: 8 additions & 1 deletion packages/vrender-components/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Change Log - @visactor/vrender-components

This log was last generated on Thu, 26 Sep 2024 09:28:36 GMT and should not be manually modified.
This log was last generated on Fri, 27 Sep 2024 03:22:31 GMT and should not be manually modified.

## 0.20.7
Fri, 27 Sep 2024 03:22:31 GMT

### Updates

- feat: legend support roam scroll. close@VisActor/VChart#3254

## 0.20.6
Thu, 26 Sep 2024 09:28:36 GMT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,8 @@ const disableTriggerEventLegend = new DiscreteLegend({
allowAllCanceled: false,
pager: {
type: 'scrollbar',
scrollByPosition: false
scrollByPosition: false,
roamScroll: true
}
});

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.20.6",
"version": "0.20.7",
"description": "components library for dp visualization",
"sideEffects": false,
"main": "cjs/index.js",
Expand All @@ -26,8 +26,8 @@
"dependencies": {
"@visactor/vutils": "~0.18.17",
"@visactor/vscale": "~0.18.17",
"@visactor/vrender-core": "workspace:0.20.6",
"@visactor/vrender-kits": "workspace:0.20.6"
"@visactor/vrender-core": "workspace:0.20.7",
"@visactor/vrender-kits": "workspace:0.20.7"
},
"devDependencies": {
"@internal/bundler": "workspace:*",
Expand Down
24 changes: 22 additions & 2 deletions packages/vrender-components/src/legend/discrete/discrete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import {
isNil,
isFunction,
isArray,
minInArray
minInArray,
throttle
} from '@visactor/vutils';
import type {
FederatedPointerEvent,
Expand All @@ -23,7 +24,8 @@ import type {
ITextGraphicAttribute,
CustomEvent,
IText,
IRichText
IRichText,
FederatedWheelEvent
} from '@visactor/vrender-core';
// eslint-disable-next-line no-duplicate-imports
import { graphicCreator } from '@visactor/vrender-core';
Expand Down Expand Up @@ -52,6 +54,7 @@ import type {
import type { ComponentOptions } from '../../interface';
import { loadDiscreteLegendComponent } from '../register';
import { createTextGraphicByType } from '../../util';
import type { ScrollBarAttributes } from '../../scrollbar';
import { ScrollBar } from '../../scrollbar';

const DEFAULT_STATES = {
Expand Down Expand Up @@ -816,6 +819,19 @@ export class DiscreteLegend extends LegendBase<DiscreteLegendAttrs> {
return e.detail.current;
};

const onScroll = (e: FederatedWheelEvent) => {
e.preventDefault();
const scrollComponent = this._pagerComponent as ScrollBar;
const preScrollRange = scrollComponent.getScrollRange();
const { direction } = scrollComponent.attribute as ScrollBarAttributes;
const { width, height } = scrollComponent.getSliderRenderBounds();
const currentScrollValue = direction === 'vertical' ? e.deltaY / height : e.deltaX / width;
scrollComponent.setScrollRange(
[preScrollRange[0] + currentScrollValue, preScrollRange[1] + currentScrollValue],
true
);
};

const onPaging = (e: CustomEvent) => {
const newPage = pageParser(e);

Expand Down Expand Up @@ -845,6 +861,10 @@ export class DiscreteLegend extends LegendBase<DiscreteLegendAttrs> {
if (this._itemContext.isScrollbar) {
this._pagerComponent.addEventListener('scrollDrag', onPaging);
this._pagerComponent.addEventListener('scrollUp', onPaging);
if (((this.attribute as DiscreteLegendAttrs).pager as LegendScrollbarAttributes).roamScroll) {
const THROTTLE_TIME = 50;
this.addEventListener('wheel', throttle(onScroll, THROTTLE_TIME));
}
} else {
this._pagerComponent.addEventListener('toPrev', onPaging);
this._pagerComponent.addEventListener('toNext', onPaging);
Expand Down
5 changes: 5 additions & 0 deletions packages/vrender-components/src/legend/discrete/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ export type LegendScrollbarAttributes = Omit<ScrollBarAttributes, 'range' | 'lim
LegendSwitchComponentAttributes & {
type: 'scrollbar';
scrollByPosition?: boolean;
/**
* 是否支持鼠标/触控板滚动
* @default false
*/
roamScroll?: boolean;
};

export type LegendItemDatum = {
Expand Down
Loading

0 comments on commit 2a51b68

Please sign in to comment.