Skip to content

Commit cc50a3a

Browse files
authored
Merge pull request #624 from vizzuhq/docs_examples_fix
Fix docs examples playing
2 parents 5dd2cd0 + f7df226 commit cc50a3a

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

docs/assets/javascripts/mdchart.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@ class MdChart {
77
this.id = id
88
}
99

10+
async createFromConfig(snippets) {
11+
this.create(await loadAnimations(snippets))
12+
}
13+
1014
async create(snippets) {
11-
const animations = await loadAnimations(snippets)
1215
let chart = Promise.resolve()
13-
for (let i = 0; i < animations.length; i++) {
16+
for (let i = 0; i < snippets.length; i++) {
1417
const number = i + 1
15-
chart = this.animate(('0' + number).slice(-2), animations[i], chart)
18+
chart = this.animate(('0' + number).slice(-2), snippets[i], chart)
1619
}
1720
}
1821

docs/tutorial/assets/snippet.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ Promise.all([mdChartLoaded, dataLoaded, configLoaded]).then((results) => {
1212
const config = results[2].default
1313
const MdChart = results[0].default
1414
const mdchart = new MdChart(data, 'tutorial')
15-
mdchart.create(config)
15+
mdchart.createFromConfig(config)
1616
})

0 commit comments

Comments
 (0)