Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix discontinuous rendering issues #18

Merged
merged 2 commits into from

2 participants

Brian Stack Fred Hatfull
Brian Stack
Collaborator

This branch fixes the following issues with rendering:

issue #1: Discontinuous data sources that were rendered without other data were not emitting null data in unknown portions.
issue #15: Discontinuous portions were not being handled correctly by tooltips and guidedots.

bis12 added some commits
Brian Stack bis12 fix issue #1
Account for completely null data in data sources
11a31dd
Brian Stack bis12 fix issue #15
Account for discontinuities in guidedots and tooltips
efbd669
Fred Hatfull
Collaborator

Let's try this again

Fred Hatfull fhats merged commit 736de81 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 18, 2012
  1. Brian Stack

    fix issue #1

    bis12 authored
    Account for completely null data in data sources
  2. Brian Stack

    fix issue #15

    bis12 authored
    Account for discontinuities in guidedots and tooltips
This page is out of date. Refresh to see the latest.
5 firefly/data_sources/ganglia_rrd.py
View
@@ -82,9 +82,8 @@ def data(self, sources, start, end, width):
for v in row.findall("v"):
value = float(v.text)
values.append("%g" % value if not math.isnan(value) else None)
- if any(values):
- values_string = ",".join(v if v else "null" for v in values)
- data.append('{"t":%d,"v":[%s]}' % (time, values_string))
+ values_string = ",".join(v if v else "null" for v in values)
+ data.append('{"t":%d,"v":[%s]}' % (time, values_string))
except Exception, e:
raise tornado.web.HTTPError(500, log_message=str(e))
5 firefly/data_sources/test_data.py
View
@@ -35,9 +35,8 @@ def data(self, sources, start, end, width):
else:
disc = sine/2
val.append(disc)
- if any(val):
- values_string = ",".join("%0.4f"%(v,) if v else "null" for v in val)
- data.append('{"t":%d,"v":[%s]}' % (t, values_string))
+ values_string = ",".join("%0.4f"%(v,) if v else "null" for v in val)
+ data.append('{"t":%d,"v":[%s]}' % (t, values_string))
return "[%s]" % ','.join(data)
def legend(self, sources):
17 firefly/static/js/renderer.js
View
@@ -268,16 +268,23 @@ firefly.Renderer.prototype.getDataCoords_ = function(layers, axes, timeAtMouseX)
var closestPoint = layer.data[closestDataIndexToTime];
var closestDataPointX = this.xScale(closestPoint.x + layer.shift);
- var yVal = closestPoint.y + closestPoint.y0;
+ var dotX = dotY = null;
+ var yVal = (closestPoint.y + closestPoint.y0).toFixed(3);
+ if (closestPoint.y !== null) {
+ dotX = closestDataPointX;
+ dotY = this.yScale(yVal);
+ }
+ else {
+ yVal = 'undef';
+ }
dataPoints.push({
- 'dotX': closestDataPointX,
- 'dotY': this.yScale(yVal),
+ 'dotX': dotX,
+ 'dotY': dotY,
'date': new Date(closestPoint.x),
- 'value': yVal.toFixed(3)
+ 'value': yVal
});
}
-
return dataPoints;
};
Something went wrong with that request. Please try again.