I am new to google apps scripts and coding but I created a Sankey diagram in google apps script using the google visualization HTML code. I am using the data from a google sheet because it is dynamic data. Currently I successfully deployed the diagram as a web app that updates when refreshed. However, I am wondering if it's possible to put the sheet IN the google sheet - maybe as a separate tab? I want to be able to share the google sheet and have the data and Sankey diagram immediately available. Here is my code for grabbing the spreadsheet data and publishing it as a web app:
function doGet(e) {
return HtmlService
.createTemplateFromFile("Index")
.evaluate()
.setTitle("Google Spreadsheet Chart")
.setSandboxMode(HtmlService.SandboxMode.IFRAME);
}
function getSpreadsheetData() {
var ssID = "XXXXXXXXXXXXXXX",
sheet = SpreadsheetApp.openById(ssID).getSheets()[0],
data = sheet.getDataRange().getValues();
return data;
}