Commit c2dd8800 by Valera Rozuvan Committed by Alexander Kryklia

Dynamic range part 1.

parent 51db556e
...@@ -27,8 +27,8 @@ define('Graph', ['logme'], function (logme) { ...@@ -27,8 +27,8 @@ define('Graph', ['logme'], function (logme) {
} }
// Configure some settings for the graph. // Configure some settings for the graph.
setGraphAxes();
setGraphXRange(); setGraphXRange();
setGraphAxes();
// Get the user defined functions. If there aren't any, don't do // Get the user defined functions. If there aren't any, don't do
// anything else. // anything else.
...@@ -135,15 +135,29 @@ define('Graph', ['logme'], function (logme) { ...@@ -135,15 +135,29 @@ define('Graph', ['logme'], function (logme) {
function setGraphXRange() { function setGraphXRange() {
var xRangeStr, xRangeBlobs, tempNum; var xRangeStr, xRangeBlobs, tempNum;
xrange = { xrange = {};
'start': 0,
'end': 10, if ($.isPlainObject(config.plot.xrange) === false) {
'step': 0.1 logme('ERROR: Expected config.plot.xrange to be an object. It is not.');
}; logme('config.plot.xrange = ', config.plot.xrange);
return false;
}
if (typeof config.plot.xrange.min !== 'string') {
logme('ERROR: Expected config.plot.xrange.min to be a string. It is not.');
logme('config.plot.xrange.min = ', config.plot.xrange.min);
return false;
}
if (typeof config.plot.xrange.max !== 'string') {
logme('ERROR: Expected config.plot.xrange.max to be a string. It is not.');
logme('config.plot.xrange.max = ', config.plot.xrange.max);
return false;
}
// The 'xrange' is a string containing two floating point numbers
// separated by a comma. The first number is the starting
// x-coordinate , the second number is the ending x-coordinate
if (typeof config.plot['xrange'] === 'string') { if (typeof config.plot['xrange'] === 'string') {
xRangeStr = config.plot['xrange']; xRangeStr = config.plot['xrange'];
xRangeBlobs = xRangeStr.split(','); xRangeBlobs = xRangeStr.split(',');
...@@ -193,6 +207,8 @@ define('Graph', ['logme'], function (logme) { ...@@ -193,6 +207,8 @@ define('Graph', ['logme'], function (logme) {
} else { } else {
logme('ERROR: num_points is not a string.'); logme('ERROR: num_points is not a string.');
} }
return true;
} }
function createFunctions() { function createFunctions() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment