Skip to content

Commit

Permalink
Merge pull request #291 from VisActor/dev/0.14.0
Browse files Browse the repository at this point in the history
Dev/0.14.0
  • Loading branch information
neuqzxy authored Aug 9, 2023
2 parents 809a53e + d785714 commit 7b62f8b
Show file tree
Hide file tree
Showing 96 changed files with 3,563 additions and 705 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/bug-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
push:
branches: ['main']
pull_request:
branches: ['main', 'develop']
branches: ['main', 'develop', 'dev/**']

jobs:
build:
Expand All @@ -27,7 +27,7 @@ jobs:

- name: Print All Github Environment Variables
run: env

- name: Update rush
run: node common/scripts/install-run-rush.js update --bypass-policy

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Unit test CI

on:
pull_request:
branches: ['main', 'develop']
branches: ['main', 'develop', 'dev/**']

jobs:
build:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vrender-components",
"comment": "feat: add `verticalMinSize` and `containerAlign` for line type axis, `verticalMinSize` is used to set the minumum vertical size of axis, and `containerAlign` is to set the all labels's alignment in axis container, support https://github.com/VisActor/VChart/issues/380",
"type": "minor"
}
],
"packageName": "@visactor/vrender-components"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vrender-components",
"comment": "fix: the axis label's textAlign and textBaseline should auto adjust when angle is set, releate https://github.com/VisActor/VChart/issues/439",
"type": "patch"
}
],
"packageName": "@visactor/vrender-components"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vrender-components",
"comment": "fix: panel only works for line axis",
"type": "patch"
}
],
"packageName": "@visactor/vrender-components"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vrender-components",
"comment": "fix: line axis states should set default value",
"type": "patch"
}
],
"packageName": "@visactor/vrender-components"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vrender-components",
"comment": "feat(component): label component support avoidMarks",
"type": "patch"
}
],
"packageName": "@visactor/vrender-components"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vrender-components",
"comment": "refactor: rename global and window to vglobal and vwindow",
"type": "minor"
}
],
"packageName": "@visactor/vrender-components"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vrender",
"comment": "feat: add connect type to line and area",
"type": "minor"
}
],
"packageName": "@visactor/vrender"
}
10 changes: 10 additions & 0 deletions common/changes/@visactor/vrender/feat-layout_2023-08-04-07-38.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vrender",
"comment": "feat: support flex layout",
"type": "minor"
}
],
"packageName": "@visactor/vrender"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vrender",
"comment": "feat: support animate-bind event",
"type": "minor"
}
],
"packageName": "@visactor/vrender"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vrender",
"comment": "feat: support text word-break",
"type": "minor"
}
],
"packageName": "@visactor/vrender"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vrender",
"comment": "feat: support for vertical layout of text graphic",
"type": "minor"
}
],
"packageName": "@visactor/vrender"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vrender",
"comment": "refactor: rename global and window to vglobal and vwindow",
"type": "minor"
}
],
"packageName": "@visactor/vrender"
}
4 changes: 2 additions & 2 deletions docs/demos/src/contribution/env-canvas/window-contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type {
ICanvas,
IDomRectLike
} from '@visactor/vrender';
import { Generator, Global, BaseWindowHandlerContribution } from '@visactor/vrender';
import { Generator, VGlobal, BaseWindowHandlerContribution } from '@visactor/vrender';
import { NodeCanvas } from './canvas';
import type { IBoundsLike } from '@visactor/vutils';

Expand All @@ -21,7 +21,7 @@ export class NodeWindowHandlerContribution extends BaseWindowHandlerContribution
return null;
}

constructor(@inject(Global) private readonly global: IGlobal) {
constructor(@inject(VGlobal) private readonly global: IGlobal) {
super();
}

Expand Down
2 changes: 1 addition & 1 deletion docs/demos/src/core/stage.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createStage, container } from '@visactor/vrender';

export function createAStage() {
console.log(container.get(Symbol.for('Global')));
console.log(container.get(Symbol.for('VGlobal')));
const stage = createStage({});
console.log(stage);
// const stage = new Stage({
Expand Down
73 changes: 47 additions & 26 deletions docs/demos/src/pages/area.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const subP1 = [
[40, 60],
[60, 20],
[70, 30]
].map(item => ({ x: item[0], y: item[1], y1: 120, defined: item[0] !== 70 }));
].map(item => ({ x: item[0], y: item[1], y1: 120, defined: item[0] !== 20 }));

const subP2 = [
[80, 80],
Expand All @@ -28,33 +28,40 @@ const points = [
[160, 40],
[200, 20],
[240, 50]
].map(item => ({ x: item[0], y: item[1], y1: 120, defined: item[0] !== 70 }));
].map(item => ({ x: item[0], y: item[1], y1: 120, defined: item[0] !== 40 && item[0] !== 70 }));

export const page = () => {
const graphics: IGraphic[] = [];
// ['linear', 'step', 'stepBefore', 'stepAfter', 'basis', 'monotoneX', 'monotoneY'].forEach((type, i) => {
// graphics.push(
// createArea({
// points,
// curveType: type as any,
// x: ((i * 300) % 900) + 100,
// y: Math.floor((i * 300) / 900) * 200,
// stroke: ['black', false],
// fill: {
// gradient: 'linear',
// x0: 0,
// y0: 0,
// x1: 1,
// y1: 0,
// stops: [
// { offset: 0, color: 'green' },
// { offset: 0.5, color: 'orange' },
// { offset: 1, color: 'red' }
// ]
// }
// })
// );
// });
['linear', 'step', 'stepBefore', 'stepAfter', 'basis', 'monotoneX', 'monotoneY'].forEach((type, i) => {
graphics.push(
createArea({
points,
curveType: type as any,
x: ((i * 300) % 900) + 100,
y: Math.floor((i * 300) / 900) * 200,
stroke: ['black', false],
fill: {
gradient: 'linear',
x0: 0,
y0: 0,
x1: 1,
y1: 0,
stops: [
{ offset: 0, color: 'green' },
{ offset: 0.5, color: 'orange' },
{ offset: 1, color: 'red' }
]
},
clipRange: 0.3,
connectedType: 'connect',
connectedX: null,
connectedY: 100,
connectedStyle: {
fill: 'grey'
}
})
);
});

['linear', 'step', 'stepBefore', 'stepAfter', 'basis', 'monotoneX', 'monotoneY'].forEach((type, i) => {
i += 7;
Expand All @@ -65,7 +72,16 @@ export const page = () => {
x: ((i * 300) % 900) + 100,
y: Math.floor((i * 300) / 900) * 200,
segments: [
{ points: subP1, fill: colorPools[3], stroke: ['red', false], lineWidth: 10 },
{
points: subP1,
fill: colorPools[3],
stroke: ['red', false],
lineWidth: 10,
connectedType: 'connect',
connectedStyle: {
fill: 'grey'
}
},
{
points: subP2,
stroke: ['red', false],
Expand All @@ -74,12 +90,17 @@ export const page = () => {
textureColor: 'grey'
}
],
connectedType: 'connect',
fill: true,
stroke: true
})
);
});

graphics.forEach(item => {
item.animate().to({ clipRange: 0 }, 0, 'linear').to({ clipRange: 1 }, 10000, 'linear');
});

const stage = createStage({
canvas: document.getElementById('main'),
autoRender: true
Expand Down
42 changes: 42 additions & 0 deletions docs/demos/src/pages/flex.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { createStage, createGroup, createRect, container, IGraphic, global } from '@visactor/vrender';

// container.load(roughModule);

export const page = () => {
const group = createGroup({
x: 100,
y: 100,
background: 'red',
width: 300,
height: 400,
display: 'flex',
flexWrap: 'wrap',
justifyContent: 'flex-start',
alignContent: 'center'
});

// 添加10个rect
new Array(10).fill(0).forEach(() => {
group.add(
createRect({
x: 10,
y: 10,
width: 70,
height: 60,
fill: 'green',
boundsPadding: [0, 6, 6, 0]
})
);
});

const stage = createStage({
canvas: 'main',
width: 1200,
height: 600,
enableLayout: true
});

stage.defaultLayer.add(group);

stage.render(undefined, { renderStyle: 'rough' });
};
4 changes: 4 additions & 0 deletions docs/demos/src/pages/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,5 +155,9 @@ export const pages = [
{
title: 'animate-3d',
path: 'animate-3d'
},
{
title: 'flex布局',
path: 'flex'
}
];
Loading

0 comments on commit 7b62f8b

Please sign in to comment.