-
-
Save acurtis517/54c2556e47737bdec9df1c2913336516 to your computer and use it in GitHub Desktop.
Revisions
-
njoerd114 revised this gist
Jun 9, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,7 @@ - create the two files `code.gs` and `index.html` - insert the document ID from the URL on line 10, `code.gs` - select which sheet is the base for the sankey diagram - the layout of the table should be as shown in the [Example Spreadsheet](https://docs.google.com/spreadsheets/d/1IUmvhYuuBvfYEu8OfDczmW6LQW-xaeh5c6rklOg3x-o/) ## Usage - Open the same document -
njoerd114 revised this gist
Jun 9, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -18,4 +18,4 @@ - Click "Zusatzfunktionen" -> "SankeyDiagram" ## Example Spreadsheet https://docs.google.com/spreadsheets/d/1IUmvhYuuBvfYEu8OfDczmW6LQW-xaeh5c6rklOg3x-o/ -
njoerd114 revised this gist
Jun 9, 2020 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -17,4 +17,5 @@ - Open the same document - Click "Zusatzfunktionen" -> "SankeyDiagram" ## Example Spreadsheet https://docs.google.com/spreadsheets/d/1IUmvhYuuBvfYEu8OfDczmW6LQW-xaeh5c6rklOg3x-o/edit?usp=sharing -
njoerd114 revised this gist
Jun 9, 2020 . No changes.There are no files selected for viewing
-
njoerd114 revised this gist
Jun 9, 2020 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -12,4 +12,9 @@ - insert the document ID from the URL on line 10, `code.gs` - select which sheet is the base for the sankey diagram - the layout of the table should be ## Usage - Open the same document - Click "Zusatzfunktionen" -> "SankeyDiagram" source | destination | value -
njoerd114 created this gist
Jun 9, 2020 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ <!-- [](http://niklasbeinghaus.com) --> # Sankey Diagrams within Google Spreadsheets > This Gist is there to help you creating a Sankey Diagram from your Google Spreadsheets. ## Installation - Open a spreadsheet - Click "Tools" -> "Scripts" - create the two files `code.gs` and `index.html` - insert the document ID from the URL on line 10, `code.gs` - select which sheet is the base for the sankey diagram - the layout of the table should be source | destination | value This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ function onOpen() { SpreadsheetApp.getUi() // Or DocumentApp or FormApp. .createMenu('Zusatzfunktionen') .addItem('SankeyDiagram', 'openDialog') .addToUi(); } function getSpreadsheetData() { // ID of your Document, take from URL var ssID = "", // which Sheet? [0] is the first and so on... sheet = SpreadsheetApp.openById(ssID).getSheets()[0], data = sheet.getDataRange().getValues(); return data; } function openDialog() { var html = HtmlService.createHtmlOutputFromFile('index') .setHeight(300) .setWidth(1000); SpreadsheetApp.getUi() // Or DocumentApp or FormApp. .showModalDialog(html, 'Sankey Diagram'); } This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ <!DOCTYPE html> <html> <head> <base target="_top"> <script src="https://www.google.com/jsapi"></script> </head> <body> <div id="main"></div> <script type="text/javascript"> google.load('visualization', '1', { packages: ['corechart', 'sankey'] }); google.setOnLoadCallback(initialize); function initialize() { google.script.run.withSuccessHandler(drawChart).getSpreadsheetData(); } function drawChart(rows) { console.log(rows); var data = google.visualization.arrayToDataTable(rows); var chart = new google.visualization.Sankey(document.getElementById('main')); chart.draw(data, {width: 900, sankey: {iterations: 64}}); } </script> </body> </html>