Skip to content

Commit

Permalink
Merge pull request #117 from VisActor/release/0.0.14
Browse files Browse the repository at this point in the history
[Auto release] release 0.0.14
  • Loading branch information
neuqzxy authored Nov 27, 2024
2 parents e2cac46 + c756632 commit c4d12bc
Show file tree
Hide file tree
Showing 35 changed files with 228 additions and 98 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: '[Auto changelog] changlog of ${{ github.event.release.tag_name }}'
base: feat/vstory-next
base: develop
head: 'docs/generate-changelog-${{ github.event.release.tag_name }}'
labels: changelog
body: 'update changelog of ${{ github.event.release.tag_name }}'
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ jobs:
- name: Build vstory-player
run: node common/scripts/install-run-rush.js build --only @visactor/vstory-player

- name: Build vstory-external
run: node common/scripts/install-run-rush.js build --only @visactor/vstory-external

- name: Build vstory
env:
NODE_OPTIONS: "--max_old_space_size=4096"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync-main-to-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: '[Auto Sync] Sync the code from branch main to branch develop after release ${{ steps.package-version.outputs.current_version }}'
base: feat/vstory-next
base: develop
head: sync/main-${{ steps.package-version.outputs.current_version }}
reviewers: xile611
body: 'Sync the code from branch main to branch develop after release ${{ steps.package-version.outputs.current_version }}'
32 changes: 17 additions & 15 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":"vstoryMain","version":"0.0.13","nextBump":"patch"}]
[{"definitionName":"lockStepVersion","policyName":"vstoryMain","version":"0.0.14","nextBump":"patch"}]
4 changes: 2 additions & 2 deletions docs/assets/guide/menu.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
{
"path": "story-player",
"title": {
"zh": "Story-Player",
"en": "Story-Player"
"zh": "StoryPlayer",
"en": "Story and Player"
}
}
]
Expand Down
61 changes: 31 additions & 30 deletions docs/assets/guide/zh/tutorial_docs/Basic/A_Basic_DSL.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

一个仪表盘会包含多种图表、以及标题、表格等模块、这些模块一部分可以使用VStory中提供的特定character实现,还有一些可以通过VChart自行去配置。在本教程中,我们将简化物料准备过程,直接给到所有用到的图表spec。

1. 一个基于VChart的简单的柱状图
1. 一个基于`VChart`的简单的柱状图
```javascript livedemo template=vchart
const mockData: any = [];
const mockData = [];
const types = ['A', 'B', 'C'];

types.forEach(type => {
Expand Down Expand Up @@ -44,9 +44,9 @@ vchart.renderSync();
window['vchart'] = vchart;
```

2. 一个基于VChart的简单的面积图
2. 一个基于`VChart`的简单的面积图
```javascript livedemo template=vchart
const mockData: any = [];
const mockData = [];
const types = ['A', 'B', 'C'];

types.forEach(type => {
Expand All @@ -60,7 +60,7 @@ const spec = {
data: [
{
id: 'id0',
values: mockData.filter((item: any) => item.type !== 'C')
values: mockData.filter((item) => item.type !== 'C')
}
],
xField: 'month',
Expand All @@ -81,9 +81,9 @@ vchart.renderSync();
window['vchart'] = vchart;
```

3. 一个基于VChart的简单的雷达图
3. 一个基于`VChart`的简单的雷达图
```javascript livedemo template=vchart
const mockData: any = [];
const mockData = [];
const types = ['A', 'B', 'C'];

types.forEach(type => {
Expand Down Expand Up @@ -132,9 +132,9 @@ vchart.renderSync();
// Just for the convenience of console debugging, DO NOT COPY!
window['vchart'] = vchart;
```
4. 一个基于VChart的简单的玫瑰图
4. 一个基于`VChart`的简单的玫瑰图
```javascript livedemo template=vchart
const mockData: any = [];
const mockData = [];
const types = ['A', 'B', 'C'];

types.forEach(type => {
Expand Down Expand Up @@ -170,9 +170,9 @@ vchart.renderSync();
// Just for the convenience of console debugging, DO NOT COPY!
window['vchart'] = vchart;
```
5. 一个基于VChart的简单的仪表盘图
5. 一个基于`VChart`的简单的仪表盘图
```javascript livedemo template=vchart
const mockData: any = [];
const mockData = [];
const types = ['A', 'B', 'C'];

types.forEach(type => {
Expand Down Expand Up @@ -209,10 +209,15 @@ vchart.renderSync();
window['vchart'] = vchart;
```

6. 使用一个VStory的Text类型作为标题
6. 使用一个`VStory``Text`类型作为标题
```javascript livedemo template=vstory
// 注册所有需要的内容
VStory.registerAll();

const story = new VStory.Story(null, { dom: CONTAINER_ID, background: '#ebecf0' });
const player = new VStory.Player(story);
story.init(player);

story.addCharacterWithAppear({
type: 'Text',
id: 'title',
Expand All @@ -239,19 +244,15 @@ story.addCharacterWithAppear({
}
});

const story = new VStory.Story(null, { dom: CONTAINER_ID, background: '#ebecf0' });
const player = new VStory.Player(story);
story.init(player);

player.play(-1);
window.vstory = story;
```
7. 使用一个VStory的WaveScatter图表类型
7. 使用一个`VStory``WaveScatter`图表类型

```javascript livedemo template=vstory
// 注册所有需要的内容
VStory.registerAll();
const mockData: any = [];
const mockData = [];
const types = ['A', 'B', 'C'];

types.forEach(type => {
Expand All @@ -260,6 +261,10 @@ types.forEach(type => {
}
});

const story = new VStory.Story(null, { dom: CONTAINER_ID, background: '#ebecf0' });
const player = new VStory.Player(story);
story.init(player);

story.addCharacterWithAppear({
type: 'WaveScatter',
id: 'wave-scatter',
Expand All @@ -272,7 +277,7 @@ story.addCharacterWithAppear({
},
options: {
data: {
values: mockData.filter((item: any) => item.type === 'A')
values: mockData.filter((item) => item.type === 'A')
},
categoryField: 'month',
valueField: 'value',
Expand All @@ -295,21 +300,17 @@ story.addCharacterWithAppear({
}
});

const story = new VStory.Story(null, { dom: CONTAINER_ID, background: '#ebecf0' });
const player = new VStory.Player(story);
story.init(player);

player.play(-1);
window.vstory = story;
```

## 2. 拼接

接下来,我们将这些素材拼接到VStory的大画布中,形成一个完整的作品,我们使用1920 * 1080作为画布的完整尺寸,图表之间的margin为30px,距离左右边界的margin也是30px。具体的布局如下图所示
接下来,我们将这些素材拼接到`VStory`的大画布中,形成一个完整的作品,我们使用1920 * 1080作为画布的完整尺寸,图表之间的`margin`为30px,距离左右边界的`margin`也是30px。具体的布局如下图所示

![](https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/vstory/dashboard_layout_detail.png)

完成了布局的设计之后,接下来我们开始DSL的编写,来实现上图中的效果,DSL核心包括一个character数组和一个acts数组,character数组包含了作品中的所有角色(元素),acts数组包含了作品中的各种角色的各种动作(动画),具体的接口定义如下:
完成了布局的设计之后,接下来我们开始DSL的编写,来实现上图中的效果,DSL核心包括一个`character`数组和一个`acts`数组,`character`数组包含了作品中的所有角色(元素),`acts`数组包含了作品中的各种角色的各种动作(动画),具体的接口定义如下:

```ts
interface IStoryDSL {
Expand Down Expand Up @@ -356,7 +357,7 @@ interface IAction {
```

### 2.1 character数组配置
根据我们提供的每个character的配置,以及接口定义,我们可以组装我们的character数组
根据我们提供的每个`character`的配置,以及接口定义,我们可以组装我们的`character`数组

```ts
const characters = [
Expand Down Expand Up @@ -394,7 +395,7 @@ const characters = [
},
options: {
data: {
values: mockData.filter((item: any) => item.type === 'A')
values: mockData.filter((item) => item.type === 'A')
},
categoryField: 'month',
valueField: 'value',
Expand Down Expand Up @@ -535,7 +536,7 @@ const characters = [
]
```
### 2.2 acts数组配置
characters数组中只是定义了作品中有这些元素可用,具体的动作还没有定义,如果不定义动作的话,元素将不会展示,所以接下来我们开始定义acts数组。我们期望作品中的元素有如下动作
`characters`数组中只是定义了作品中有这些元素可用,具体的动作还没有定义,如果不定义动作的话,元素将不会展示,所以接下来我们开始定义`acts`数组。我们期望作品中的元素有如下动作

1. 柱状图和玫瑰图会有`oneByOne`(图元一个接着一个)的`appear`(入场)动画效果,其他图表都是默认的`appear`(入场)的动画效果
2. 包含图表本身的面板也要有一个`bounce`(弹跳)的`appear`(入场)的动画效果
Expand Down Expand Up @@ -607,7 +608,7 @@ const acts = [

## 3. 播放

至此,我们已经完成了一个简易的仪表盘的制作步骤,接下来,我们将character和acts数组拼起来合成一个DSL,然后使用 VStory 进行播放。
至此,我们已经完成了一个简易的仪表盘的制作步骤,接下来,我们将`character``acts`数组拼起来合成一个DSL,然后使用 VStory 进行播放。

```ts
// 注册所有需要的内容
Expand Down Expand Up @@ -998,4 +999,4 @@ window['story'] = story;
window['vstory'] = story;
```

通过本教程,您已经了解了一份基础的 DSL 配置组成,后面你可以尝试更改Character和Acts,探索 VStory 的强大功能和灵活性,编绘出绚丽多彩的作品。祝您编码愉快!
通过本教程,您已经了解了一份基础的 DSL 配置组成,后面你可以尝试更改`character``acts`,探索 VStory 的强大功能和灵活性,编绘出绚丽多彩的作品。祝您编码愉快!
Loading

0 comments on commit c4d12bc

Please sign in to comment.