Skip to content
Snippets Groups Projects
Commit d5d99c1b authored by cramakri's avatar cramakri
Browse files

BIS-151 SP-546 : Add methods for generating graphs

SVN: 28646
parent 1d9d3e34
No related branches found
No related tags found
No related merge requests found
...@@ -1522,6 +1522,46 @@ openbis.prototype.getValidationScriptForDataStore = function(dataSetTypeOrNull, ...@@ -1522,6 +1522,46 @@ openbis.prototype.getValidationScriptForDataStore = function(dataSetTypeOrNull,
}); });
} }
/**
* Get a url that will produce a graph with the given configuration.
*
* @method
*/
openbis.prototype.getGraphUrl = function(graphconfig, dataStoreCodeOrNull, action) {
function dssUrlAction = function(dssUrl) {
var graphUrl = dssUrl + "/graphservice/";
graphUrl += "?sessionID=" + context.getSessionId();
for (prop in graphconfig) {
graphUrl += "&" + prop + "=" + encodeURIComponent(graphconfig[prop]);
}
action(graphUrl);
}
this._internal.getDataStoreUrlForDataStoreCode(dataStoreCodeOrNull, dssUrlAction);
}
/**
* =====================
* OpenBIS graph config
* =====================
*
* Defines the configuration for a graph generated by the server's graphservice.
*
* To use, set properties on the object with keys that match the name of the servlet
* parameters of the graphservice and then call the method getGraphUrl on the openbis
* object. Do *not* set the sessionID paramter -- this will be filled in by the openbis
* object.
*
* The graphservice is documented here: https://wiki-bsse.ethz.ch/display/openBISDoc/Configuring+Graphs+and+Plots
*
* @class
*
*/
function openbisGraphConfig(filename, graphtype, title) {
this.file = filename;
this["graph-type"] = graphtype;
this.title = title;
}
/** /**
* ===================================================== * =====================================================
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment