Skip to content

Instantly share code, notes, and snippets.



Last active Dec 28, 2015
What would you like to do?
Macro for downloading [spectral workbench]( curves as csvs
setup: function() {
$('body').append('<div class="modal fade" id="myModal" role="dialog"><div class="modal-content dl-btns"></div></div>');
$.each($, function(idx, data){
var $dlBtn = $('<a class="btn btn-success dl-btn">Download ' + (data.label || "") + ' csv<a>');
$dlBtn.css('margin', 5);
var csv = $.map(, function(row, idx){
return row.join(',');
$dlBtn.attr('href', window.URL.createObjectURL(new Blob([csv])));
$dlBtn.attr('download', (data.label || "data") + ".csv");
draw: function() {
// code to run every frame
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment