Skip to content

Commit

Permalink
Merge pull request #172 from VisActor/feat/auto-scale
Browse files Browse the repository at this point in the history
feat: support auto scaleX/scaleY
  • Loading branch information
xiaoluoHe authored Dec 18, 2024
2 parents 4469895 + 319a2a0 commit 351136d
Show file tree
Hide file tree
Showing 57 changed files with 254 additions and 98 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vstory-core",
"comment": "feat: support `auto` for scaleX/scaleY in initParams",
"type": "none"
}
],
"packageName": "@visactor/vstory-core"
}
6 changes: 4 additions & 2 deletions docs/assets/examples/en/infographic/bar-chart-leftRight.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,10 @@ const dsl = {
};
const story = new VStory.Story(dsl, {
dom: CONTAINER_ID,
scaleX: 0.7,
scaleY: 0.7
scaleX: 'auto',
scaleY: 'auto',
width: 1280,
height: 720
});
const player = new VStory.Player(story);
story.init(player);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ async function loadDSL() {
};
}

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

Expand Down
6 changes: 4 additions & 2 deletions docs/assets/examples/en/infographic/bar-hiv-chart.md
Original file line number Diff line number Diff line change
Expand Up @@ -571,8 +571,10 @@ const dsl = {
};
const story = new VStory.Story(dsl, {
dom: CONTAINER_ID,
scaleX: 0.7,
scaleY: 0.7
scaleX: 'auto',
scaleY: 'auto',
width: 1056,
height: 814
});
const player = new VStory.Player(story);
story.init(player);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,10 @@ const dsl = {
};
const story = new VStory.Story(dsl, {
dom: CONTAINER_ID,
scaleX: 0.7,
scaleY: 0.7
scaleX: 'auto',
scaleY: 'auto',
width: 816,
height: 816
});
const player = new VStory.Player(story);
story.init(player);
Expand Down
6 changes: 4 additions & 2 deletions docs/assets/examples/en/infographic/big-data-wordcloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -1243,8 +1243,10 @@ const dsl = {
const story = new VStory.Story(dsl, {
dom: CONTAINER_ID,
background: '#ebecf0',
scaleX: 0.5,
scaleY: 0.5
scaleX: 'auto',
scaleY: 'auto',
width: 1280,
height: 720
});
const player = new VStory.Player(story);
story.init(player);
Expand Down
6 changes: 4 additions & 2 deletions docs/assets/examples/en/infographic/cat-stroke.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,10 @@ const dsl = {
};
const story = new VStory.Story(dsl, {
dom: CONTAINER_ID,
scaleX: 0.7,
scaleY: 0.7
scaleX: 'auto',
scaleY: 'auto',
width: 760,
height: 760
});
const player = new VStory.Player(story);
story.init(player);
Expand Down
6 changes: 4 additions & 2 deletions docs/assets/examples/en/infographic/client-breakdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,10 @@ const dsl = {
};
const story = new VStory.Story(dsl, {
dom: CONTAINER_ID,
scaleX: 0.7,
scaleY: 0.7
scaleX: 'auto',
scaleY: 'auto',
width: 1280,
height: 720
});
const player = new VStory.Player(story);
story.init(player);
Expand Down
6 changes: 4 additions & 2 deletions docs/assets/examples/en/infographic/line-chart-leftRight.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,10 @@ const dsl = {
};
const story = new VStory.Story(dsl, {
dom: CONTAINER_ID,
scaleX: 0.7,
scaleY: 0.7
scaleX: 'auto',
scaleY: 'auto',
width: 1280,
height: 720
});
const player = new VStory.Player(story);
story.init(player);
Expand Down
5 changes: 4 additions & 1 deletion docs/assets/examples/en/infographic/marking-wordcloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,10 @@ const dsl = {
};
const story = new VStory.Story(dsl, {
dom: CONTAINER_ID,
width: 1280, height: 720
width: 1280,
height: 720,
scaleX: 'auto',
scaleY: 'auto'
});
const player = new VStory.Player(story);
story.init(player);
Expand Down
6 changes: 4 additions & 2 deletions docs/assets/examples/en/infographic/pie-chart-leftRight.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,10 @@ const dsl = {
};
const story = new VStory.Story(dsl, {
dom: CONTAINER_ID,
scaleX: 0.7,
scaleY: 0.7
scaleX: 'auto',
scaleY: 'auto',
width: 1280,
height: 720
});
const player = new VStory.Player(story);
story.init(player);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ async function loadDSL() {
};
}

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

Expand Down
7 changes: 4 additions & 3 deletions docs/assets/examples/en/infographic/project-goal.md
Original file line number Diff line number Diff line change
Expand Up @@ -443,9 +443,10 @@ const dsl = {

const story = new VStory.Story(dsl, {
dom: CONTAINER_ID,
background: '#ebecf0',
scaleX: 0.5,
scaleY: 0.5
scaleX: 'auto',
scaleY: 'auto',
width: 1280,
height: 720
});
const player = new VStory.Player(story);
story.init(player);
Expand Down
6 changes: 4 additions & 2 deletions docs/assets/examples/en/infographic/scatter-chart-matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,10 @@ const dsl = {
};
const story = new VStory.Story(dsl, {
dom: CONTAINER_ID,
scaleX: 0.7,
scaleY: 0.7
scaleX: 'auto',
scaleY: 'auto',
width: 1280,
height: 780
});
const player = new VStory.Player(story);
story.init(player);
Expand Down
6 changes: 4 additions & 2 deletions docs/assets/examples/en/infographic/scatter-income-obesity.md
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,10 @@ const dsl = {
};
const story = new VStory.Story(dsl, {
dom: CONTAINER_ID,
scaleX: 0.7,
scaleY: 0.7
scaleX: 'auto',
scaleY: 'auto',
width: 1280,
height: 720
});
const player = new VStory.Player(story);
story.init(player);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -795,8 +795,10 @@ const dsl = {

const story = new VStory.Story(dsl, {
dom: CONTAINER_ID,
scaleX: 0.7,
scaleY: 0.7
scaleX: 'auto',
scaleY: 'auto',
width: 1280,
height: 720
});
const player = new VStory.Player(story);
story.init(player);
Expand Down
6 changes: 4 additions & 2 deletions docs/assets/examples/en/infographic/social-media.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,10 @@ const dsl = {

const story = new VStory.Story(dsl, {
dom: CONTAINER_ID,
scaleX: 0.7,
scaleY: 0.7
scaleX: 'auto',
scaleY: 'auto',
width: 800,
height: 750
});
const player = new VStory.Player(story);
story.init(player);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,10 @@ const dsl = {
};
const story = new VStory.Story(dsl, {
dom: CONTAINER_ID,
width: 1280, height: 720
width: 1280,
height: 720,
scaleX: 'auto',
scaleY: 'auto'
});
const player = new VStory.Player(story);
story.init(player);
Expand Down
6 changes: 4 additions & 2 deletions docs/assets/examples/en/infographic/sprint-burndown.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,10 @@ const dsl = {

const story = new VStory.Story(dsl, {
dom: CONTAINER_ID,
scaleX: 0.7,
scaleY: 0.7
scaleX: 'auto',
scaleY: 'auto',
width: 1280,
height: 720
});
const player = new VStory.Player(story);
story.init(player);
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/examples/en/infographic/unit-infographic.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ const dsl = {
]
};

const story = new VStory.Story(dsl, { dom: CONTAINER_ID, scaleX: 0.5, scaleY: 0.5 });
const story = new VStory.Story(dsl, { dom: CONTAINER_ID, scaleX: 'auto', scaleY: 'auto', width: 1920, height: 1080 });
const player = new VStory.Player(story);
story.init(player);

Expand Down
6 changes: 4 additions & 2 deletions docs/assets/examples/en/infographic/usa-cancer-map.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,10 @@ const dsl = {

const story = new VStory.Story(dsl, {
dom: CONTAINER_ID,
scaleX: 0.7,
scaleY: 0.7
scaleX: 'auto',
scaleY: 'auto',
width: 1280,
height: 720
});
const player = new VStory.Player(story);
story.init(player);
Expand Down
6 changes: 4 additions & 2 deletions docs/assets/examples/en/infographic/venn-chart.md
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,10 @@ const dsl = {
};
const story = new VStory.Story(dsl, {
dom: CONTAINER_ID,
scaleX: 0.7,
scaleY: 0.7
scaleX: 'auto',
scaleY: 'auto',
width: 1280,
height: 720
});
const player = new VStory.Player(story);
story.init(player);
Expand Down
6 changes: 4 additions & 2 deletions docs/assets/examples/zh/infographic/bar-chart-leftRight.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,10 @@ const dsl = {
};
const story = new VStory.Story(dsl, {
dom: CONTAINER_ID,
scaleX: 0.7,
scaleY: 0.7
scaleX: 'auto',
scaleY: 'auto',
width: 1280,
height: 720
});
const player = new VStory.Player(story);
story.init(player);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ async function loadDSL() {
};
}

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

Expand Down
6 changes: 4 additions & 2 deletions docs/assets/examples/zh/infographic/bar-hiv-chart.md
Original file line number Diff line number Diff line change
Expand Up @@ -572,8 +572,10 @@ const dsl = {
};
const story = new VStory.Story(dsl, {
dom: CONTAINER_ID,
scaleX: 0.7,
scaleY: 0.7
scaleX: 'auto',
scaleY: 'auto',
width: 1056,
height: 814
});
const player = new VStory.Player(story);
story.init(player);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,10 @@ const dsl = {
};
const story = new VStory.Story(dsl, {
dom: CONTAINER_ID,
scaleX: 0.7,
scaleY: 0.7
scaleX: 'auto',
scaleY: 'auto',
width: 816,
height: 816
});
const player = new VStory.Player(story);
story.init(player);
Expand Down
7 changes: 4 additions & 3 deletions docs/assets/examples/zh/infographic/big-data-wordcloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -1242,9 +1242,10 @@ const dsl = {

const story = new VStory.Story(dsl, {
dom: CONTAINER_ID,
background: '#ebecf0',
scaleX: 0.5,
scaleY: 0.5
scaleX: 'auto',
scaleY: 'auto',
width: 1280,
height: 720
});
const player = new VStory.Player(story);
story.init(player);
Expand Down
6 changes: 4 additions & 2 deletions docs/assets/examples/zh/infographic/cat-stroke.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,10 @@ const dsl = {
};
const story = new VStory.Story(dsl, {
dom: CONTAINER_ID,
scaleX: 0.7,
scaleY: 0.7
scaleX: 'auto',
scaleY: 'auto',
width: 760,
height: 760
});
const player = new VStory.Player(story);
story.init(player);
Expand Down
6 changes: 4 additions & 2 deletions docs/assets/examples/zh/infographic/client-breakdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,10 @@ const dsl = {
};
const story = new VStory.Story(dsl, {
dom: CONTAINER_ID,
scaleX: 0.7,
scaleY: 0.7
scaleX: 'auto',
scaleY: 'auto',
width: 1280,
height: 720
});
const player = new VStory.Player(story);
story.init(player);
Expand Down
6 changes: 4 additions & 2 deletions docs/assets/examples/zh/infographic/line-chart-leftRight.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,10 @@ const dsl = {
};
const story = new VStory.Story(dsl, {
dom: CONTAINER_ID,
scaleX: 0.7,
scaleY: 0.7
scaleX: 'auto',
scaleY: 'auto',
width: 1280,
height: 720
});
const player = new VStory.Player(story);
story.init(player);
Expand Down
5 changes: 4 additions & 1 deletion docs/assets/examples/zh/infographic/marking-wordcloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,10 @@ const dsl = {
};
const story = new VStory.Story(dsl, {
dom: CONTAINER_ID,
width: 1280, height: 720
scaleX: 'auto',
scaleY: 'auto',
width: 1280,
height: 720
});
const player = new VStory.Player(story);
story.init(player);
Expand Down
6 changes: 4 additions & 2 deletions docs/assets/examples/zh/infographic/pie-chart-leftRight.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,10 @@ const dsl = {
};
const story = new VStory.Story(dsl, {
dom: CONTAINER_ID,
scaleX: 0.7,
scaleY: 0.7
scaleX: 'auto',
scaleY: 'auto',
width: 1280,
height: 720
});
const player = new VStory.Player(story);
story.init(player);
Expand Down
Loading

0 comments on commit 351136d

Please sign in to comment.