Skip to content

Commit

Permalink
Merge pull request #379 from VisActor/release/0.11.13
Browse files Browse the repository at this point in the history
[Auto release] release 0.11.13
  • Loading branch information
xile611 authored Feb 28, 2024
2 parents 48fe65e + d1c743c commit ac4171b
Show file tree
Hide file tree
Showing 32 changed files with 456 additions and 300 deletions.
273 changes: 143 additions & 130 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":"vgrammarMain","version":"0.11.11","mainProject":"@visactor/vgrammar-core","nextBump":"patch"}]
[{"definitionName":"lockStepVersion","policyName":"vgrammarMain","version":"0.11.12","mainProject":"@visactor/vgrammar-core","nextBump":"patch"}]
28 changes: 14 additions & 14 deletions docs/dev-demos/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,24 @@
"devDependencies": {
"@internal/eslint-config": "workspace:*",
"@internal/ts-config": "workspace:*",
"@visactor/vgrammar": "workspace:0.11.12",
"@visactor/vgrammar-core": "workspace:0.11.12",
"@visactor/vgrammar-hierarchy": "workspace:0.11.12",
"@visactor/vgrammar-sankey": "workspace:0.11.12",
"@visactor/vgrammar-projection": "workspace:0.11.12",
"@visactor/vgrammar-wordcloud": "workspace:0.11.12",
"@visactor/vgrammar-wordcloud-shape": "workspace:0.11.12",
"@visactor/vgrammar-plot": "workspace:0.11.12",
"@visactor/vutils": "~0.17.4",
"@visactor/vrender-core": "0.17.24",
"@visactor/vrender-kits": "0.17.24",
"@visactor/vrender": "0.17.24",
"@visactor/vgrammar": "workspace:0.11.13",
"@visactor/vgrammar-core": "workspace:0.11.13",
"@visactor/vgrammar-hierarchy": "workspace:0.11.13",
"@visactor/vgrammar-sankey": "workspace:0.11.13",
"@visactor/vgrammar-projection": "workspace:0.11.13",
"@visactor/vgrammar-wordcloud": "workspace:0.11.13",
"@visactor/vgrammar-wordcloud-shape": "workspace:0.11.13",
"@visactor/vgrammar-plot": "workspace:0.11.13",
"@visactor/vutils": "~0.18.1",
"@visactor/vrender-core": "0.17.25",
"@visactor/vrender-kits": "0.17.25",
"@visactor/vrender": "0.17.25",
"d3-scale-chromatic": "^3.0.0",
"lodash": "4.17.21",
"typescript": "4.9.5",
"vite": "3.2.6",
"@visactor/vgrammar-util": "workspace:0.11.12",
"@visactor/vgrammar-coordinate": "workspace:0.11.12",
"@visactor/vgrammar-util": "workspace:0.11.13",
"@visactor/vgrammar-coordinate": "workspace:0.11.13",
"@vitejs/plugin-react": "3.1.0"
}
}
13 changes: 13 additions & 0 deletions docs/site/assets/changelog/en/release.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# v0.11.11

2024-02-23


**🆕 New feature**

- **@visactor/vgrammar-core**: support `clipPath` in mark



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

# v0.11.10

2024-02-04
Expand Down
13 changes: 13 additions & 0 deletions docs/site/assets/changelog/zh/release.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# v0.11.11

2024-02-23


**🆕 新增功能**

- **@visactor/vgrammar-core**: support `clipPath` in mark



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

# v0.11.10

2024-02-04
Expand Down
28 changes: 14 additions & 14 deletions docs/site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@
},
"dependencies": {
"@arco-design/web-react": "2.46.1",
"@visactor/vgrammar": "workspace:0.11.12",
"@visactor/vgrammar-core": "workspace:0.11.12",
"@visactor/vgrammar-hierarchy": "workspace:0.11.12",
"@visactor/vgrammar-sankey": "workspace:0.11.12",
"@visactor/vgrammar-projection": "workspace:0.11.12",
"@visactor/vgrammar-wordcloud": "workspace:0.11.12",
"@visactor/vgrammar-wordcloud-shape": "workspace:0.11.12",
"@visactor/vgrammar-plot": "workspace:0.11.12",
"@visactor/vgrammar-util": "workspace:0.11.12",
"@visactor/vgrammar-coordinate": "workspace:0.11.12",
"@visactor/vutils": "~0.17.4",
"@visactor/vrender-core": "0.17.24",
"@visactor/vrender-kits": "0.17.24",
"@visactor/vrender": "0.17.24",
"@visactor/vgrammar": "workspace:0.11.13",
"@visactor/vgrammar-core": "workspace:0.11.13",
"@visactor/vgrammar-hierarchy": "workspace:0.11.13",
"@visactor/vgrammar-sankey": "workspace:0.11.13",
"@visactor/vgrammar-projection": "workspace:0.11.13",
"@visactor/vgrammar-wordcloud": "workspace:0.11.13",
"@visactor/vgrammar-wordcloud-shape": "workspace:0.11.13",
"@visactor/vgrammar-plot": "workspace:0.11.13",
"@visactor/vgrammar-util": "workspace:0.11.13",
"@visactor/vgrammar-coordinate": "workspace:0.11.13",
"@visactor/vutils": "~0.18.1",
"@visactor/vrender-core": "0.17.25",
"@visactor/vrender-kits": "0.17.25",
"@visactor/vrender": "0.17.25",
"markdown-it": "^13.0.0",
"highlight.js": "^11.8.0",
"axios": "^1.4.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/vgrammar-coordinate/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visactor/vgrammar-coordinate",
"version": "0.11.12",
"version": "0.11.13",
"description": "Coordinates for VGrammar",
"keywords": [
"coordinate",
Expand Down Expand Up @@ -34,8 +34,8 @@
"test-check": "DEBUG=jest jest --forceExit --detectOpenHandles --silent false --verbose false --runInBand"
},
"dependencies": {
"@visactor/vgrammar-util": "workspace:0.11.12",
"@visactor/vutils": "~0.17.4"
"@visactor/vgrammar-util": "workspace:0.11.13",
"@visactor/vutils": "~0.18.1"
},
"devDependencies": {
"@internal/bundler": "workspace:*",
Expand Down
12 changes: 12 additions & 0 deletions packages/vgrammar-core/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
{
"name": "@visactor/vgrammar-core",
"entries": [
{
"version": "0.11.12",
"tag": "@visactor/vgrammar-core_v0.11.12",
"date": "Wed, 28 Feb 2024 05:16:58 GMT",
"comments": {
"none": [
{
"comment": "feat: pass ticker to createStage params"
}
]
}
},
{
"version": "0.11.11",
"tag": "@visactor/vgrammar-core_v0.11.11",
Expand Down
11 changes: 9 additions & 2 deletions packages/vgrammar-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
# Change Log - @visactor/vgrammar-core

This log was last generated on Mon, 05 Feb 2024 04:06:45 GMT and should not be manually modified.
This log was last generated on Wed, 28 Feb 2024 05:16:58 GMT and should not be manually modified.

## 0.11.12
Wed, 28 Feb 2024 05:16:58 GMT

### Updates

- feat: pass ticker to createStage params

## 0.11.11
Mon, 05 Feb 2024 04:06:45 GMT
Wed, 07 Feb 2024 03:12:22 GMT

### Updates

Expand Down
18 changes: 9 additions & 9 deletions packages/vgrammar-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visactor/vgrammar-core",
"version": "0.11.12",
"version": "0.11.13",
"description": "VGrammar is a visual grammar library",
"keywords": [
"grammar",
Expand Down Expand Up @@ -35,14 +35,14 @@
"test-check": "DEBUG=jest jest --forceExit --detectOpenHandles --silent false --verbose false --runInBand"
},
"dependencies": {
"@visactor/vgrammar-coordinate": "workspace:0.11.12",
"@visactor/vgrammar-util": "workspace:0.11.12",
"@visactor/vscale": "~0.17.4",
"@visactor/vrender-core": "0.17.24",
"@visactor/vrender-kits": "0.17.24",
"@visactor/vrender-components": "0.17.24",
"@visactor/vutils": "~0.17.4",
"@visactor/vdataset": "~0.17.4"
"@visactor/vgrammar-coordinate": "workspace:0.11.13",
"@visactor/vgrammar-util": "workspace:0.11.13",
"@visactor/vscale": "~0.18.1",
"@visactor/vrender-core": "0.17.25",
"@visactor/vrender-kits": "0.17.25",
"@visactor/vrender-components": "0.17.25",
"@visactor/vutils": "~0.18.1",
"@visactor/vdataset": "~0.18.1"
},
"devDependencies": {
"@internal/bundler": "workspace:*",
Expand Down
1 change: 1 addition & 0 deletions packages/vgrammar-core/src/graph/canvas-renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ export default class CanvasRenderer implements IRenderer {
pluginList: viewOptions.pluginList,
enableHtmlAttribute: viewOptions.enableHtmlAttribute,
optimize: viewOptions.optimize,
ticker: viewOptions.ticker,
supportsTouchEvents: viewOptions.supportsTouchEvents,
supportsPointerEvents: viewOptions.supportsPointerEvents
});
Expand Down
4 changes: 2 additions & 2 deletions packages/vgrammar-core/src/graph/element.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { IPointLike } from '@visactor/vutils';
import type { IBounds, IPointLike } from '@visactor/vutils';
// eslint-disable-next-line no-duplicate-imports
import {
array,
Expand Down Expand Up @@ -170,7 +170,7 @@ export class Element implements IElement {

getBounds() {
// FIXME: 没有更新 bounds 时拿到的 bound 可能为 null
return this.graphicItem?.AABBBounds;
return this.graphicItem?.AABBBounds as IBounds;
}

getStates() {
Expand Down
17 changes: 16 additions & 1 deletion packages/vgrammar-core/src/interactions/base.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import { array, isArray, isNil, isString, isValid } from '@visactor/vutils';
import type { IBaseInteractionOptions, IGrammarBase, IView, InteractionEventHandler } from '../types';
import type {
IBaseInteractionOptions,
IElement,
IGlyphElement,
IGrammarBase,
IView,
InteractionEventHandler
} from '../types';

export abstract class BaseInteraction<T extends IBaseInteractionOptions> {
readonly view: IView;
Expand Down Expand Up @@ -71,6 +78,14 @@ export abstract class BaseInteraction<T extends IBaseInteractionOptions> {
});
}

start(element: IElement | IGlyphElement) {
// do nothing
}

reset(element?: IElement | IGlyphElement) {
// do nothing
}

protected dispatchEvent(type: 'start' | 'reset' | 'update' | 'end', params: any) {
this.view.emit(`${this.type}:${type}`, params);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export class ElementActiveByLegend extends BaseInteraction<ElementActiveByLegend
];
}

handleStart = (e: InteractionEvent, element: IElement | IGlyphElement) => {
const itemKey = e.detail?.data?.id;
start(element: IElement | IGlyphElement | string) {
const itemKey = element;

if (isNil(itemKey)) {
return;
Expand All @@ -56,13 +56,21 @@ export class ElementActiveByLegend extends BaseInteraction<ElementActiveByLegend
}
});
});
};
}

handleReset = (e: InteractionEvent) => {
reset() {
this._marks.forEach(mark => {
mark.elements.forEach(el => {
el.removeState(this.options.state);
});
});
}

handleStart = (e: InteractionEvent) => {
this.start(e.detail?.data?.id);
};

handleReset = (e: InteractionEvent) => {
this.reset();
};
}
26 changes: 17 additions & 9 deletions packages/vgrammar-core/src/interactions/element-active.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,27 @@ export class ElementActive extends BaseInteraction<ElementActiveOptions> {
];
}

handleStart = (e: InteractionEvent) => {
if (e.element) {
if (this._marks && this._marks.includes(e.element.mark)) {
e.element.addState(this.options.state);
start(element: InteractionEvent['element']) {
if (element) {
if (this._marks && this._marks.includes(element.mark)) {
element.addState(this.options.state);
}
}
};
}

handleReset = (e: InteractionEvent) => {
if (e.element) {
if (this._marks && this._marks.includes(e.element.mark)) {
e.element.removeState(this.options.state);
reset(element: InteractionEvent['element']) {
if (element) {
if (this._marks && this._marks.includes(element.mark)) {
element.removeState(this.options.state);
}
}
}

handleStart = (e: InteractionEvent) => {
this.start(e.element);
};

handleReset = (e: InteractionEvent) => {
this.reset(e.element);
};
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { isNil } from '@visactor/vutils';
import type { ElementHighlightOptions, IMark, IView, InteractionEvent } from '../types';
import { BaseInteraction } from './base';
import { InteractionStateEnum } from '../graph/enums';
import { BaseInteraction } from './base';

export class ElementHighlightByGroup extends BaseInteraction<ElementHighlightOptions> {
static type: string = 'element-highlight-by-group';
Expand Down Expand Up @@ -42,9 +42,9 @@ export class ElementHighlightByGroup extends BaseInteraction<ElementHighlightOpt
});
}

handleStart = (e: InteractionEvent) => {
if (e.element && this._marks && this._marks.includes(e.element.mark)) {
const highlightKey = e.element.groupKey;
start(element: InteractionEvent['element']) {
if (element && this._marks && this._marks.includes(element.mark)) {
const highlightKey = element.groupKey;

if (isNil(highlightKey)) {
return;
Expand All @@ -63,13 +63,21 @@ export class ElementHighlightByGroup extends BaseInteraction<ElementHighlightOpt
});
});
}
};
}

handleReset = (e: InteractionEvent) => {
const hasActiveElement = e.element && this._marks && this._marks.includes(e.element.mark);
reset(element: InteractionEvent['element']) {
const hasActiveElement = element && this._marks && this._marks.includes(element.mark);

if (hasActiveElement) {
this.clearPrevElements();
}
}

handleStart = (e: InteractionEvent) => {
this.start(e.element);
};

handleReset = (e: InteractionEvent) => {
this.reset(e.element);
};
}
Loading

0 comments on commit ac4171b

Please sign in to comment.