Created
August 6, 2016 20:41
-
-
Save sethvincent/559622ec6f2576a792714a324e29dae4 to your computer and use it in GitHub Desktop.
lightning-line example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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