Skip to content

Instantly share code, notes, and snippets.

@sethvincent
Created August 6, 2016 20:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sethvincent/559622ec6f2576a792714a324e29dae4 to your computer and use it in GitHub Desktop.
Save sethvincent/559622ec6f2576a792714a324e29dae4 to your computer and use it in GitHub Desktop.
lightning-line example
var Line = require('lightning-line')
var html = require('yo-yo')
function render () {
return html`
<div id="app">
${viz()}
</div>
`
}
function update () {
var tree = render()
yo.update(app, tree)
}
function viz () {
var el = html`<div class="viz-wrapper"></div>`
var line = new Line(el, {
series: [[1, 3, 5, 2, 4, 5, 7, 9], [2, 1, 9, 0, 0, 1.3, 1], [8.6, 3, 4.7, 7, 5, 6.6]],
index: [10, 11, 12, 13, 14, 15, 16, 17],
thickness: [5, 10, 20],
xaxis: 'example x-axis label',
yaxis: 'example y-axis label'
}, null, {
zoom: true,
width: 400,
height: 300
})
return el
}
var tree = render()
document.body.appendChild(tree)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment