Skip to content

Commit

Permalink
Merge branch 'develop' into feat/national-memorial
Browse files Browse the repository at this point in the history
  • Loading branch information
neuqzxy authored Dec 13, 2024
2 parents 29c9807 + f92d73b commit e8b10d5
Show file tree
Hide file tree
Showing 61 changed files with 4,772 additions and 267 deletions.
32 changes: 16 additions & 16 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.18","nextBump":"patch"}]
[{"definitionName":"lockStepVersion","policyName":"vstoryMain","version":"0.0.19","nextBump":"patch"}]
34 changes: 28 additions & 6 deletions docs/assets/examples/en/infographic/bar-chart-leftRight.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ cover: https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/vstory-infographic/pr

# Bar Chart Infographic(Left-right Layout)

## Demo Code
## Code Demo

```javascript livedemo template=vstory
VStory.registerAll();
Expand All @@ -22,10 +22,33 @@ const dsl = {
id: 'defaultScene',
actions: [
{
characterId: ['0', '1', '2', 'text-1', 'text-2'],
characterId: ['0', 'text-1', 'text-2'],
characterActions: [
{
action: 'appear'
action: 'appear',
payload: {
animation: {
duration: 500
}
}
}
]
},
{
characterId: ['1'],
characterActions: [
{
action: 'appear',
payload: [
{
selector: ':not(bar)',
animation: { duration: 2000 }
},
{
selector: 'bar',
animation: { duration: 2000, effect: 'barLeap', oneByOne: true, dimensionCount: 5 }
}
]
}
]
}
Expand Down Expand Up @@ -150,9 +173,8 @@ const dsl = {
};
const story = new VStory.Story(dsl, {
dom: CONTAINER_ID,
background: '#ebecf0',
scaleX: 0.5,
scaleY: 0.5
scaleX: 0.7,
scaleY: 0.7
});
const player = new VStory.Player(story);
story.init(player);
Expand Down
199 changes: 199 additions & 0 deletions docs/assets/examples/en/infographic/bar-chart-regional-sales.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
---
category: examples
group: infographic
title: Regional Sales
keywords: templates, visualization, bar, ranking
order: 1-8
cover: https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/vstory-infographic/preview/regional-sales.png
---

# Bar Chart Infographic(Regional Sales)

## Code Demo

```javascript livedemo template=vstory
VStory.registerAll();

async function loadDSL() {
const barSpec = {
type: 'bar',
color: [
'rgba(96, 182, 195)',
'rgba(112, 151, 169)',
'rgba(239, 149, 77)',
'rgba(239, 174, 117)',
'rgba(182, 78, 67)'
],
padding: {
left: 20,
bottom: 80
},
data: [
{
id: 'id0',
values: [
{
Region: 'Asia',
Sales: 23000
},
{
Region: 'South America',
Sales: 16000
},
{
Region: 'Europe',
Sales: 12000
},
{
Region: 'North America',
Sales: 8000
},
{
Region: 'Africa',
Sales: 7200
}
]
}
],
direction: 'horizontal',
xField: 'Sales',
yField: 'Region',
seriesField: 'Region',
title: {
visible: true,
text: 'Regional Sales',
align: 'center',
textStyle: {
fontSize: 50,
fill: '#fff'
}
},
axes: [
{
orient: 'left',
visible: false,
paddingInner: 0.3
},
{
orient: 'bottom',
visible: false
}
],
legends: [
{
visible: true,
orient: 'top',
item: {
label: {
style: {
fill: '#fff'
}
}
}
}
],
label: {
visible: true,
position: 'inside',
formatMethod: (text, datum) => {
return `${datum.Sales / 10000}M`;
},
smartInvert: false,
style: {
fill: '#fff',
fontSize: 20,
lineWidth: 0
}
},
background: 'rgba(0,0,0,0.2)'
};
return {
characters: [
{
type: 'VChart',
id: 'bar',
zIndex: 10,
position: {
top: 50,
left: 0,
width: 1280,
height: 720
},
options: {
spec: barSpec
}
},
{
id: '0',
type: 'Image',
zIndex: 0,
position: {
x: 0,
y: 0,
width: 1280,
height: 720
},
options: {
graphic: {
image:
'https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/vstory-infographic/resource/singleBar-background.jpg'
}
}
},
{
id: '1',
type: 'Rect',
zIndex: 1,
position: {
x: 0,
y: 0,
width: 1280,
height: 720
},
options: {
graphic: {
fill: 'black',
fillOpacity: 0.7
}
}
}
],
acts: [
{
id: 'default-chapter',
scenes: [
{
id: 'scene0',
actions: [
{
characterId: ['bar', '0', '1'],
characterActions: [
{
action: 'appear',
payload: {
animation: {
duration: 500
}
}
}
]
}
]
}
]
}
]
};
}

const story = new VStory.Story(null, { dom: CONTAINER_ID, width: 1280, height: 720, scaleX: 0.7, scaleY: 0.7 });
const player = new VStory.Player(story);
story.init(player);

loadDSL().then(dsl => {
story.load(dsl);
player.play(0);
});
window['story'] = story;
window['vstory'] = story;
```
Loading

0 comments on commit e8b10d5

Please sign in to comment.