Created
December 19, 2017 02:16
-
-
Save mbejda/1a11326151e20173cf1b535e6a5c8cc3 to your computer and use it in GitHub Desktop.
Created with Copy 2 Gist
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
const exp = require('plotlychartexport'); | |
exports.handler = (event, context, callback) => { | |
/// define plot.ly data properties | |
let trace1 = { | |
x: [1, 2, 3, 4], | |
y: [10, 15, 13, 17], | |
type: 'scatter' | |
}; | |
let trace2 = { | |
x: [1, 2, 3, 4], | |
y: [16, 5, 11, 9], | |
type: 'scatter' | |
}; | |
/// define plot.ly layout | |
let layout = { | |
title: 'Line and Scatter Plot' | |
}; | |
/// run render command | |
exp.render([trace1, trace2], layout).then((base) => { | |
callback(null,base); | |
}, (error) => { | |
console.error(error); | |
callback(error); | |
}) | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment