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
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.22.9","nextBump":"patch"}]
[{"definitionName":"lockStepVersion","policyName":"vrenderMain","version":"0.22.10","nextBump":"patch"}]
14 changes: 14 additions & 0 deletions docs/assets/changelog/en/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# v0.22.9

2025-04-18


**🐛 Bug fix**

- **@visactor/vrender-components**: fix state not sync with mouse
- **@visactor/vrender-core**: fix issue with string anchor and scale



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

# v0.22.8

2025-04-16
Expand Down
14 changes: 14 additions & 0 deletions docs/assets/changelog/zh/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# v0.22.9

2025-04-18


**🐛 功能修复**

- **@visactor/vrender-components**: fix state not sync with mouse
- **@visactor/vrender-core**: fix issue with string anchor and scale



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

# v0.22.8

2025-04-16
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.19.5",
"@visactor/vgrammar": "~0.5.7",
"@visactor/vrender": "workspace:0.22.9",
"@visactor/vrender": "workspace:0.22.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.22.10",
"tag": "@visactor/react-vrender-utils_v0.22.10",
"date": "Mon, 21 Apr 2025 02:48:16 GMT",
"comments": {}
},
{
"version": "0.22.9",
"tag": "@visactor/react-vrender-utils_v0.22.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 Fri, 18 Apr 2025 06:59:46 GMT and should not be manually modified.
This log was last generated on Mon, 21 Apr 2025 02:48:16 GMT and should not be manually modified.

## 0.22.10
Mon, 21 Apr 2025 02:48:16 GMT

_Version update only_

## 0.22.9
Fri, 18 Apr 2025 06:59:46 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.22.9",
"version": "0.22.10",
"description": "",
"sideEffects": false,
"main": "cjs/index.js",
Expand All @@ -24,8 +24,8 @@
"react-dom": "^18.2.0"
},
"dependencies": {
"@visactor/vrender": "workspace:0.22.9",
"@visactor/react-vrender": "workspace:0.22.9",
"@visactor/vrender": "workspace:0.22.10",
"@visactor/react-vrender": "workspace:0.22.10",
"@visactor/vutils": "~0.19.5",
"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.22.10",
"tag": "@visactor/react-vrender_v0.22.10",
"date": "Mon, 21 Apr 2025 02:48:16 GMT",
"comments": {}
},
{
"version": "0.22.9",
"tag": "@visactor/react-vrender_v0.22.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 Fri, 18 Apr 2025 06:59:46 GMT and should not be manually modified.
This log was last generated on Mon, 21 Apr 2025 02:48:16 GMT and should not be manually modified.

## 0.22.10
Mon, 21 Apr 2025 02:48:16 GMT

_Version update only_

## 0.22.9
Fri, 18 Apr 2025 06:59:46 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.22.9",
"version": "0.22.10",
"description": "",
"sideEffects": false,
"main": "cjs/index.js",
Expand All @@ -23,7 +23,7 @@
"react": "^18.2.0"
},
"dependencies": {
"@visactor/vrender": "workspace:0.22.9",
"@visactor/vrender": "workspace:0.22.10",
"@visactor/vutils": "~0.19.5",
"react-reconciler": "^0.29.0",
"tslib": "^2.3.1"
Expand Down
15 changes: 15 additions & 0 deletions packages/vrender-components/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
{
"name": "@visactor/vrender-components",
"entries": [
{
"version": "0.22.10",
"tag": "@visactor/vrender-components_v0.22.10",
"date": "Mon, 21 Apr 2025 02:48:16 GMT",
"comments": {
"none": [
{
"comment": "fix: fix preventDefault() error when passive: true\n\n"
},
{
"comment": "docs: update changlog of rush\n\n"
}
]
}
},
{
"version": "0.22.9",
"tag": "@visactor/vrender-components_v0.22.9",
Expand Down
14 changes: 13 additions & 1 deletion packages/vrender-components/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# Change Log - @visactor/vrender-components

This log was last generated on Fri, 18 Apr 2025 06:59:46 GMT and should not be manually modified.
This log was last generated on Mon, 21 Apr 2025 02:48:16 GMT and should not be manually modified.

## 0.22.10
Mon, 21 Apr 2025 02:48:16 GMT

### Updates

- fix: fix preventDefault() error when passive: true


- docs: update changlog of rush



## 0.22.9
Fri, 18 Apr 2025 06:59:46 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.22.9",
"version": "0.22.10",
"description": "components library for dp visualization",
"sideEffects": false,
"main": "cjs/index.js",
Expand All @@ -27,8 +27,8 @@
"dependencies": {
"@visactor/vutils": "~0.19.5",
"@visactor/vscale": "~0.19.5",
"@visactor/vrender-core": "workspace:0.22.9",
"@visactor/vrender-kits": "workspace:0.22.9"
"@visactor/vrender-core": "workspace:0.22.10",
"@visactor/vrender-kits": "workspace:0.22.10"
},
"devDependencies": {
"@internal/bundler": "workspace:*",
Expand Down
9 changes: 6 additions & 3 deletions packages/vrender-components/src/data-zoom/data-zoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,9 @@ export class DataZoom extends AbstractComponent<Required<DataZoomAttributes>> {
evtTarget.removeEventListener(trigger, this._onHandlerPointerUp);
});

(this as unknown as IGroup).removeEventListener('pointermove', this._onHandlerPointerMove, { capture: true });
(this as unknown as IGroup).removeEventListener('pointermove', this._onHandlerPointerMove, {
capture: true
});
}

/**
Expand Down Expand Up @@ -283,7 +285,9 @@ export class DataZoom extends AbstractComponent<Required<DataZoomAttributes>> {
* move的时候,需要通过 capture: true,能够在捕获截断被拦截,
*/
evtTarget.addEventListener('pointermove', this._onHandlerPointerMove, { capture: true });
(this as unknown as IGroup).addEventListener('pointermove', this._onHandlerPointerMove, { capture: true });
(this as unknown as IGroup).addEventListener('pointermove', this._onHandlerPointerMove, {
capture: true
});

triggers.forEach((trigger: string) => {
evtTarget.addEventListener(trigger, this._onHandlerPointerUp);
Expand All @@ -299,7 +303,6 @@ export class DataZoom extends AbstractComponent<Required<DataZoomAttributes>> {
* 4. 在endHandler上拖拽,同上
*/
private _pointerMove = (e: FederatedPointerEvent) => {
e.preventDefault();
const { start: startAttr, end: endAttr, brushSelect, realTime = true } = this.attribute as DataZoomAttributes;
const pos = this.eventPosToStagePos(e);
const { attPos, max } = this._layoutCache;
Expand Down
35 changes: 31 additions & 4 deletions packages/vrender-components/src/scrollbar/scrollbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import type { IRectGraphicAttribute, FederatedPointerEvent, IGroup, IRect } from '@visactor/vrender-core';
// eslint-disable-next-line no-duplicate-imports
import { vglobal } from '@visactor/vrender-core';
import { merge, normalizePadding, clamp, clampRange, debounce, throttle } from '@visactor/vutils';
import { merge, normalizePadding, clamp, clampRange, debounce, throttle, isValid } from '@visactor/vutils';
import { AbstractComponent } from '../core/base';

import type { ScrollBarAttributes } from './type';
Expand Down Expand Up @@ -141,8 +141,24 @@ export class ScrollBar extends AbstractComponent<Required<ScrollBarAttributes>>
if (this._slider) {
this._slider.addEventListener('pointerdown', this._onSliderPointerDown as EventListener);
}

(vglobal.env === 'browser' ? vglobal : this.stage).addEventListener('touchmove', this._handleTouchMove, {
passive: false
});
}

private _handleTouchMove = (e: TouchEvent) => {
if (isValid(this._prePos)) {
// 正在滚动中的时候
/**
* https://developer.mozilla.org/zh-CN/docs/Web/CSS/overscroll-behavior
* 由于浏览器的overscroll-behavior属性,需要在move的时候阻止浏览器默认行为,否则会因为浏览器检测到scroll行为,阻止pointer事件,
* 抛出pointercancel事件,导致拖拽行为中断。
*/
e.preventDefault();
}
};

protected render() {
this._reset();
const {
Expand Down Expand Up @@ -327,7 +343,7 @@ export class ScrollBar extends AbstractComponent<Required<ScrollBarAttributes>>
* move的时候,需要通过 capture: true,能够在捕获截断被拦截,
* move的时候,需要显示的设置passive: false,因为在移动端需要禁用浏览器默认行为
*/
obj.addEventListener('pointermove', this._onSliderPointerMoveWithDelay, { capture: true, passive: true });
obj.addEventListener('pointermove', this._onSliderPointerMoveWithDelay, { capture: true });
triggers.forEach((trigger: string) => {
obj.addEventListener(trigger, this._onSliderPointerUp);
});
Expand Down Expand Up @@ -355,7 +371,6 @@ export class ScrollBar extends AbstractComponent<Required<ScrollBarAttributes>>
};

private _onSliderPointerMove = (e: any) => {
e.preventDefault();
const { stopSliderMovePropagation = true } = this.attribute as ScrollBarAttributes;
if (stopSliderMovePropagation) {
e.stopPropagation();
Expand All @@ -375,7 +390,7 @@ export class ScrollBar extends AbstractComponent<Required<ScrollBarAttributes>>
const triggers = getEndTriggersOfDrag();
const obj = vglobal.env === 'browser' ? vglobal : this.stage;

obj.removeEventListener('pointermove', this._onSliderPointerMoveWithDelay, { capture: true, passive: false });
obj.removeEventListener('pointermove', this._onSliderPointerMoveWithDelay, { capture: true });
triggers.forEach((trigger: string) => {
obj.removeEventListener(trigger, this._onSliderPointerUp);
});
Expand All @@ -387,6 +402,7 @@ export class ScrollBar extends AbstractComponent<Required<ScrollBarAttributes>>
const preScrollRange = this.getScrollRange();
const [currentPos, currentScrollValue] = this._computeScrollValue(e);
const range: [number, number] = [preScrollRange[0] + currentScrollValue, preScrollRange[1] + currentScrollValue];
this._prePos = null;

this._dispatchEvent(SCROLLBAR_END_EVENT, {
pre: preRange,
Expand All @@ -400,4 +416,15 @@ export class ScrollBar extends AbstractComponent<Required<ScrollBarAttributes>>
this._sliderRenderBounds = null;
this._sliderLimitRange = null;
}

release(all?: boolean): void {
/**
* 浏览器上的事件必须解绑,防止内存泄漏,场景树上的事件会自动解绑
*/
super.release(all);
(vglobal.env === 'browser' ? vglobal : this.stage).addEventListener('touchmove', this._handleTouchMove, {
passive: false
});
this._clearDragEvents();
}
}
Loading
Loading