r5082 - in branches/noflash/cumin: python/cumin resources
by croberts@fedoraproject.org
Author: croberts
Date: 2011-10-19 19:32:25 +0000 (Wed, 19 Oct 2011)
New Revision: 5082
Modified:
branches/noflash/cumin/python/cumin/stat.strings
branches/noflash/cumin/resources/app.js
Log:
Fixing the alignment of the legends. Also adding functionality to allow toggling of each series by clicking on the series name in the legend.
Modified: branches/noflash/cumin/python/cumin/stat.strings
===================================================================
--- branches/noflash/cumin/python/cumin/stat.strings 2011-10-19 15:40:02 UTC (rev 5081)
+++ branches/noflash/cumin/python/cumin/stat.strings 2011-10-19 19:32:25 UTC (rev 5082)
@@ -224,15 +224,15 @@
return false;
} else {
var chart = cumin.getFlashChart(id);
- if ((chart == null) || (typeof $(chart).getParent().getElements('a')[3] == "undefined")) {
+ if ((chart == null) || (typeof $(chart).getParent().getElements('a')[chart_href] == "undefined")) {
if (typeof attempt == "undefined")
attempt = 1;
if (attempt < 10)
setTimeout(function () {changeDuration(state, a, id, attempt+1);}, 100);
return false;
}
- newurl = get_chart_url(id, $(chart).getParent().getElements('a')[3].get('href'), state);
- $(chart).getParent().getElements('a')[3].set('href', newurl);
+ newurl = get_chart_url(id, $(chart).getParent().getElements('a')[chart_href].get('href'), state);
+ $(chart).getParent().getElements('a')[chart_href].set('href', newurl);
drawSingleChart(chart);
}
return false;
@@ -296,13 +296,17 @@
<div>
<div class="StatValueChart{fullpageable}" id="{id}">
<h2>{title}</h2>
- <div class="duration">{duration}</div><br/> <!-- this br is bad...without it though, the scheduler::performance duration switch doesn't work....fix via CSS somehow -->
- <!-- don't put this data url inside the holder div, jqplot will kill it on a zoom -->
- <a rel="api" type="application/json" href="{href}" style="display:none">Data</a>
+ <div class="duration" style="float:left;">{duration}</div>
+ <div style="clear:both;"></div>
+ <div>
+ <!-- don't put this data url inside the holder div, jqplot will kill it on a zoom -->
+ <a rel="api" type="application/json" href="{href}" style="display:none">Data</a>
<div id="{id_nodots}_chart" class="jqplotgraph" style="height:150px;width:400px;">
<div class="loading" style="display:none;"><span>Loading...</span></div>
</div>
+ </div>
</div>
+
</div>
[GenericChart.css]
Modified: branches/noflash/cumin/resources/app.js
===================================================================
--- branches/noflash/cumin/resources/app.js 2011-10-19 15:40:02 UTC (rev 5081)
+++ branches/noflash/cumin/resources/app.js 2011-10-19 19:32:25 UTC (rev 5082)
@@ -562,6 +562,7 @@
}
var allCharts = new Object();
+chart_href = 0; //used if we rearrange the divs that show the charts
window.addEvent("domready", function() {
drawAllCharts();
});
@@ -573,13 +574,13 @@
}
drawSingleChart = function(id) {
- var jsonurl = $(id).getParent().getElements('a')[3].get('href');
+ var jsonurl = $(id).getParent().getElements('a')[chart_href].get('href');
var passback = "";
wooly.setIntervalUpdate(jsonurl, stathandler, 0, passback, true);
}
startChartMonitor = function(id) {
- setInterval(function() {drawSingleChart(id)}, 10000);
+ setInterval(function() {drawSingleChart(id)}, 120000);
}
stathandler = function(response) {
@@ -655,22 +656,30 @@
$j.jqplot.config.enablePlugins = true;
var chartOptionsObject = {
- grid: { background: '#FFFFFF' },
- legend: {show:true,
+ title: {
+ text: '',
+ show: false,
+ },
+ gridPadding: {top:25, right:20, bottom:20, left:20},
+ grid: { background: '#444444' },
+ legend: {
+ show:true,
location: 'n',
- renderer: $j.jqplot.horizontalLegendRenderer,
+ renderer: $j.jqplot.EnhancedLegendRenderer,
yoffset: 0,
xoffset: 0,
- placement: "outsideGrid"},
+ placement: "outside",
+ rendererOptions:{
+ numberColumns:6,
+ seriesToggle:"fast",
+ disableIEFading:true
+ }
+ },
axes: {
y2axis: {autoscale: true, min:0},
- xaxis: {autoscale: false, pad:0, min:dataopts['xmin'], max:dataopts['xmax'],
- // probably need to pass in min/max based on current selection
- // renderer:$j.jqplot.DateAxisRenderer,
- // tickOptions: {formatString: '%#M'},
- }
+ xaxis: {autoscale: false, pad:0, min:dataopts['xmin'], max:dataopts['xmax']}
},
- series: getSeries(dataContainer),
+ series: getSeries(dataContainer),
seriesColors: ['#00cc00','#cc0000','#0000cc'],
seriesDefaults: {
lineWidth:1,
12 years, 7 months
r5081 - branches/noflash/cumin/python/cumin
by croberts@fedoraproject.org
Author: croberts
Date: 2011-10-19 15:40:02 +0000 (Wed, 19 Oct 2011)
New Revision: 5081
Modified:
branches/noflash/cumin/python/cumin/stat.strings
Log:
Fix for the duration switch on the charts. This should eventually be handled by CSS, but for now, we are using an extra <br/> to prevent a floated chart from overlapping the duration switch and preventing clicks.
Modified: branches/noflash/cumin/python/cumin/stat.strings
===================================================================
--- branches/noflash/cumin/python/cumin/stat.strings 2011-10-19 13:38:42 UTC (rev 5080)
+++ branches/noflash/cumin/python/cumin/stat.strings 2011-10-19 15:40:02 UTC (rev 5081)
@@ -296,12 +296,12 @@
<div>
<div class="StatValueChart{fullpageable}" id="{id}">
<h2>{title}</h2>
- <div class="duration">{duration}</div>
+ <div class="duration">{duration}</div><br/> <!-- this br is bad...without it though, the scheduler::performance duration switch doesn't work....fix via CSS somehow -->
<!-- don't put this data url inside the holder div, jqplot will kill it on a zoom -->
<a rel="api" type="application/json" href="{href}" style="display:none">Data</a>
- <div id="{id_nodots}_chart" class="jqplotgraph" style="height:150px;width:400px;">
- <div class="loading" style="display:none;"><span>Loading...</span></div>
- </div>
+ <div id="{id_nodots}_chart" class="jqplotgraph" style="height:150px;width:400px;">
+ <div class="loading" style="display:none;"><span>Loading...</span></div>
+ </div>
</div>
</div>
12 years, 7 months
r5080 - branches/noflash/cumin/python/cumin
by croberts@fedoraproject.org
Author: croberts
Date: 2011-10-19 13:38:42 +0000 (Wed, 19 Oct 2011)
New Revision: 5080
Modified:
branches/noflash/cumin/python/cumin/stat.strings
Log:
When the duration of a chart is changed, it will now be reflected immediately in the graph.
Modified: branches/noflash/cumin/python/cumin/stat.strings
===================================================================
--- branches/noflash/cumin/python/cumin/stat.strings 2011-10-18 14:43:40 UTC (rev 5079)
+++ branches/noflash/cumin/python/cumin/stat.strings 2011-10-19 13:38:42 UTC (rev 5080)
@@ -233,6 +233,7 @@
}
newurl = get_chart_url(id, $(chart).getParent().getElements('a')[3].get('href'), state);
$(chart).getParent().getElements('a')[3].set('href', newurl);
+ drawSingleChart(chart);
}
return false;
}
12 years, 7 months
r5077 - branches/noflash/cumin/resources
by croberts@fedoraproject.org
Author: croberts
Date: 2011-10-18 13:33:28 +0000 (Tue, 18 Oct 2011)
New Revision: 5077
Modified:
branches/noflash/cumin/resources/app.js
Log:
Another stab at fixing the jqplot memory leak.
Modified: branches/noflash/cumin/resources/app.js
===================================================================
--- branches/noflash/cumin/resources/app.js 2011-10-17 20:31:37 UTC (rev 5076)
+++ branches/noflash/cumin/resources/app.js 2011-10-18 13:33:28 UTC (rev 5077)
@@ -696,6 +696,11 @@
}
var divName = $(holder).get('id');
if(allCharts[divName]) {
+ var parent = $(divName).getParent();
+ var newDiv = $(divName);
+ $(divName).empty();
+ $(divName).destroy();
+ newDiv.inject(parent);
allCharts[divName].destroy();
allCharts[divName] = $j.jqplot(holder, dataContainer['y_coordinate_values'],chartOptionsObject);
} else {
12 years, 7 months
r5076 - branches/noflash/cumin/resources
by croberts@fedoraproject.org
Author: croberts
Date: 2011-10-17 20:31:37 +0000 (Mon, 17 Oct 2011)
New Revision: 5076
Modified:
branches/noflash/cumin/resources/app.js
Log:
More efforts to kill a memory leak.
Modified: branches/noflash/cumin/resources/app.js
===================================================================
--- branches/noflash/cumin/resources/app.js 2011-10-17 19:16:13 UTC (rev 5075)
+++ branches/noflash/cumin/resources/app.js 2011-10-17 20:31:37 UTC (rev 5076)
@@ -568,13 +568,7 @@
drawAllCharts = function() {
$$('.jqplotgraph').each(function(thisdiv) {
- var jsonurl = $(thisdiv).getParent().getElements('a')[3].get('href');
- var passback = "";
- wooly.setIntervalUpdate(jsonurl, stathandler, 0, passback, true);
-// var jsonRequest = new Request.JSONP({
-// url : jsonurl,
-// callBackKey : "stathandler",
-// }).send(); // the .send() here fires-off the jsonp request
+ drawSingleChart(thisdiv);
});
}
@@ -585,14 +579,12 @@
}
startChartMonitor = function(id) {
- t = setTimeout(function() {drawSingleChart(id)}, 10000);
+ setInterval(function() {drawSingleChart(id)}, 10000);
}
stathandler = function(response) {
try {
response = JSON.decode(response);
-// console.info("In stathandler for: " + response["graph_div"]);
-// console.info(response);
var dataopts = new Object();
dataopts['xmin'] = response['duration'] * -1;
dataopts['xmax'] = 0;
12 years, 7 months
r5075 - branches/noflash/cumin/resources
by croberts@fedoraproject.org
Author: croberts
Date: 2011-10-17 19:16:13 +0000 (Mon, 17 Oct 2011)
New Revision: 5075
Modified:
branches/noflash/cumin/resources/app.js
Log:
Eliminating a giant memory leak in my graph update code. This version should no longer crash every browser in sight.
Modified: branches/noflash/cumin/resources/app.js
===================================================================
--- branches/noflash/cumin/resources/app.js 2011-10-17 16:52:55 UTC (rev 5074)
+++ branches/noflash/cumin/resources/app.js 2011-10-17 19:16:13 UTC (rev 5075)
@@ -576,9 +576,18 @@
// callBackKey : "stathandler",
// }).send(); // the .send() here fires-off the jsonp request
});
- t = setTimeout("drawAllCharts()", 10000);
}
+drawSingleChart = function(id) {
+ var jsonurl = $(id).getParent().getElements('a')[3].get('href');
+ var passback = "";
+ wooly.setIntervalUpdate(jsonurl, stathandler, 0, passback, true);
+}
+
+startChartMonitor = function(id) {
+ t = setTimeout(function() {drawSingleChart(id)}, 10000);
+}
+
stathandler = function(response) {
try {
response = JSON.decode(response);
@@ -699,6 +708,7 @@
allCharts[divName] = $j.jqplot(holder, dataContainer['y_coordinate_values'],chartOptionsObject);
} else {
allCharts[divName] = $j.jqplot(holder, dataContainer['y_coordinate_values'],chartOptionsObject);
+ startChartMonitor(divName);
}
}
12 years, 7 months
r5074 - branches/noflash/cumin/resources
by croberts@fedoraproject.org
Author: croberts
Date: 2011-10-17 16:52:55 +0000 (Mon, 17 Oct 2011)
New Revision: 5074
Modified:
branches/noflash/cumin/resources/app.js
Log:
changing order of colors for sequences to match old school graphs.
Modified: branches/noflash/cumin/resources/app.js
===================================================================
--- branches/noflash/cumin/resources/app.js 2011-10-14 20:33:08 UTC (rev 5073)
+++ branches/noflash/cumin/resources/app.js 2011-10-17 16:52:55 UTC (rev 5074)
@@ -670,7 +670,7 @@
}
},
series: getSeries(dataContainer),
- seriesColors: ['#cc0000', '#00cc00', '#0000cc'],
+ seriesColors: ['#00cc00','#cc0000','#0000cc'],
seriesDefaults: {
lineWidth:1,
fill:true,
12 years, 7 months
r5073 - branches/noflash/cumin/resources
by croberts@fedoraproject.org
Author: croberts
Date: 2011-10-14 20:33:08 +0000 (Fri, 14 Oct 2011)
New Revision: 5073
Modified:
branches/noflash/cumin/resources/app.js
Log:
Clear the previous graph before a redraw.
Modified: branches/noflash/cumin/resources/app.js
===================================================================
--- branches/noflash/cumin/resources/app.js 2011-10-14 20:28:04 UTC (rev 5072)
+++ branches/noflash/cumin/resources/app.js 2011-10-14 20:33:08 UTC (rev 5073)
@@ -695,7 +695,7 @@
}
var divName = $(holder).get('id');
if(allCharts[divName]) {
- allCharts[divName].replot();
+ allCharts[divName].destroy();
allCharts[divName] = $j.jqplot(holder, dataContainer['y_coordinate_values'],chartOptionsObject);
} else {
allCharts[divName] = $j.jqplot(holder, dataContainer['y_coordinate_values'],chartOptionsObject);
12 years, 7 months
r5072 - in branches/noflash/cumin: python/cumin resources
by croberts@fedoraproject.org
Author: croberts
Date: 2011-10-14 20:28:04 +0000 (Fri, 14 Oct 2011)
New Revision: 5072
Modified:
branches/noflash/cumin/python/cumin/stat.strings
branches/noflash/cumin/resources/app.js
Log:
First whack at making the durations for the javascript charts work.
Modified: branches/noflash/cumin/python/cumin/stat.strings
===================================================================
--- branches/noflash/cumin/python/cumin/stat.strings 2011-10-13 20:57:02 UTC (rev 5071)
+++ branches/noflash/cumin/python/cumin/stat.strings 2011-10-14 20:28:04 UTC (rev 5072)
@@ -224,19 +224,20 @@
return false;
} else {
var chart = cumin.getFlashChart(id);
- if ((chart == null) || (typeof chart.geturl == "undefined")) {
+ if ((chart == null) || (typeof $(chart).getParent().getElements('a')[3] == "undefined")) {
if (typeof attempt == "undefined")
attempt = 1;
if (attempt < 10)
setTimeout(function () {changeDuration(state, a, id, attempt+1);}, 100);
return false;
- }
- chart.geturl("got_chart_url", id, state);
+ }
+ newurl = get_chart_url(id, $(chart).getParent().getElements('a')[3].get('href'), state);
+ $(chart).getParent().getElements('a')[3].set('href', newurl);
}
return false;
}
// called by open-flash-chart.swf in response to chart.geturl()
-function got_chart_url(id, url, state) {
+function get_chart_url(id, url, state) {
var chart = cumin.getFlashChart(id);
if (chart == null)
return false;
@@ -247,10 +248,7 @@
branch['duration'] = state;
url = branch.marshal();
- if (typeof chart.reload != "undefined")
- chart.reload(url, true);
- else
- wooly.log("reload not definded for " + id);
+ return url;
}
function gotChartPoints(text, oImg) {
Modified: branches/noflash/cumin/resources/app.js
===================================================================
--- branches/noflash/cumin/resources/app.js 2011-10-13 20:57:02 UTC (rev 5071)
+++ branches/noflash/cumin/resources/app.js 2011-10-14 20:28:04 UTC (rev 5072)
@@ -366,7 +366,7 @@
}
cumin.getFlashChart = function (id) {
- var chart = $(id+"_chart");
+ var chart = $(id.replace(/\./g, "_")+"_chart");
return chart;
}
@@ -582,10 +582,10 @@
stathandler = function(response) {
try {
response = JSON.decode(response);
- console.info("In stathandler for: " + response["graph_div"]);
- console.info(response);
+// console.info("In stathandler for: " + response["graph_div"]);
+// console.info(response);
var dataopts = new Object();
- dataopts['xmin'] = -3600;
+ dataopts['xmin'] = response['duration'] * -1;
dataopts['xmax'] = 0;
dataContainer = parseJson(response);
drawChart(response["graph_div"], dataContainer, dataopts);
@@ -637,8 +637,8 @@
// console.log("end_secs: " + dataContainer['end_secs'] + " tnow: "
// + dataContainer['tnow']);
// console.log("x-axis vals: " + dataContainer['x_axis_values']);
- console.log("x_coord_vals: " + dataContainer['x_coordinate_values']);
- console.log("y_coord_vals: " + dataContainer['y_coordinate_values']);
+// console.log("x_coord_vals: " + dataContainer['x_coordinate_values']);
+// console.log("y_coord_vals: " + dataContainer['y_coordinate_values']);
return dataContainer;
}
@@ -695,7 +695,7 @@
}
var divName = $(holder).get('id');
if(allCharts[divName]) {
- allCharts[divName].redraw(true);
+ allCharts[divName].replot();
allCharts[divName] = $j.jqplot(holder, dataContainer['y_coordinate_values'],chartOptionsObject);
} else {
allCharts[divName] = $j.jqplot(holder, dataContainer['y_coordinate_values'],chartOptionsObject);
12 years, 7 months
r5071 - in branches/noflash/cumin: python/cumin resources
by croberts@fedoraproject.org
Author: croberts
Date: 2011-10-13 20:57:02 +0000 (Thu, 13 Oct 2011)
New Revision: 5071
Modified:
branches/noflash/cumin/python/cumin/stat.py
branches/noflash/cumin/resources/app.js
Log:
Now using our built-in wooly javascript to fetch chart data.
Modified: branches/noflash/cumin/python/cumin/stat.py
===================================================================
--- branches/noflash/cumin/python/cumin/stat.py 2011-10-13 20:06:52 UTC (rev 5070)
+++ branches/noflash/cumin/python/cumin/stat.py 2011-10-13 20:57:02 UTC (rev 5071)
@@ -938,7 +938,7 @@
chart = self.get_chart(session, adapter, stats, samples, time_span, max_value, min_value, append, end_seconds_ago)
#print "**********\n"+chart.create()
chart.graph_div = "%s_chart" % chart.id.replace(".", "_")
- return "stathandler(%s)" % chart.create()
+ return chart.create()
def get_y_labels(self, absy, intervals, step):
y_step = absy / intervals
Modified: branches/noflash/cumin/resources/app.js
===================================================================
--- branches/noflash/cumin/resources/app.js 2011-10-13 20:06:52 UTC (rev 5070)
+++ branches/noflash/cumin/resources/app.js 2011-10-13 20:57:02 UTC (rev 5071)
@@ -569,17 +569,21 @@
drawAllCharts = function() {
$$('.jqplotgraph').each(function(thisdiv) {
var jsonurl = $(thisdiv).getParent().getElements('a')[3].get('href');
- var jsonRequest = new Request.JSONP({
- url : jsonurl,
- callBackKey : "stathandler",
- }).send(); // the .send() here fires-off the jsonp request
+ var passback = "";
+ wooly.setIntervalUpdate(jsonurl, stathandler, 0, passback, true);
+// var jsonRequest = new Request.JSONP({
+// url : jsonurl,
+// callBackKey : "stathandler",
+// }).send(); // the .send() here fires-off the jsonp request
});
- t = setTimeout("drawAllCharts()", 1000000);
+ t = setTimeout("drawAllCharts()", 10000);
}
stathandler = function(response) {
try {
+ response = JSON.decode(response);
console.info("In stathandler for: " + response["graph_div"]);
+ console.info(response);
var dataopts = new Object();
dataopts['xmin'] = -3600;
dataopts['xmax'] = 0;
12 years, 7 months