def findRanges(self):
for axis in list(self.axes.values()):
cols = [col for col in list(self.columns.values()) if col.axis == axis]
- low = None
- high = None
- all_in_range = True
+ values = []
for col in cols:
- values = np.array([row[col.name] for row in self.rows if row[col.name] != None], np.float64)
- if low == None and high == None:
- lastmonth = values[-30:]
- median = np.median(lastmonth)
- low = median * 0.95
- high = median * 1.05
-
- if (values > high).any() or (values < low).any():
- all_in_range = False
- if all_in_range:
- axis.yrange_max = high
- axis.yrange_min = low
- else:
- axis.yrange_max = None
- axis.yrange_min = None
+ allvalues = np.array([row[col.name] for row in self.rows if row[col.name] != None], np.float64)
+ lastmonth = allvalues[-30:]
+ values.extend(lastmonth);
+ if len(values) > 0:
+ axis.minrange = np.mean(values)/10.0
def fixupAxisNumbers(self):
# Sort axes according to the columns and number them
},
'plotOptions': {
'series': {
- 'events': {
+ 'events': {
'click': "FUN(series_onclick)END",
- }
+ },
+ 'dataGrouping' : {
+ 'enabled' : False,
+ },
}
},
'yAxis': [{
'labels': { 'align': 'right',
'x': -3 },
'title': { 'text': axis.getLabel() },
- 'min': axis.yrange_min,
- 'max': axis.yrange_max,
+ 'minRange': axis.minrange,
} for axis in self.axes_ordered],
'series': [{ 'name': '%s [%s]' % (col.name, col.units),
'yAxis': col.axis.num }
return s;
}
function series_onclick(event) {
- var lastpoint = null;
+ var prevpoint = null;
for (var i in this.data) {
if (event.point == this.data[i]) {
- if (i > 0) lastpoint = this.data[i-1];
+ if (i > 0) prevpoint = this.data[i-1];
break;
}
}
- if (lastpoint)
- window.location = "http://os.inf.tu-dresden.de/~jsteckli/cgi-bin/cgit.cgi/nul/log/?qt=range&q="+date2commit[lastpoint.x]+'..'+date2commit[event.point.x].hash;
+ if (prevpoint && date2commit[prevpoint.x] != date2commit[event.point.x])
+ window.location = "https://github.com/TUD-OS/NUL/compare/"+date2commit[prevpoint.x]+'...'+date2commit[event.point.x];
else
- window.location = "http://os.inf.tu-dresden.de/~jsteckli/cgi-bin/cgit.cgi/nul/log/?id="+date2commit[event.point.x];
+ window.location = "https://github.com/TUD-OS/NUL/commit/"+date2commit[event.point.x];
}""")
def make_int_keys(json):