fix bug
This commit is contained in:
parent
53783025e2
commit
78b916c3a7
11
plot_gen.py
11
plot_gen.py
@ -1,5 +1,6 @@
|
||||
from datetime import datetime
|
||||
from datetime import timezone
|
||||
import numpy
|
||||
|
||||
|
||||
class TimeSeriesAccumulator:
|
||||
@ -26,19 +27,15 @@ class TimeSeriesAccumulator:
|
||||
result = []
|
||||
for i in self.data:
|
||||
new = f(i)
|
||||
if new == numpy.nan:
|
||||
if numpy.isnan(new):
|
||||
result.append(prev)
|
||||
else:
|
||||
result.append(new)
|
||||
prev = new
|
||||
return result
|
||||
|
||||
|
||||
return [f(i) for i in self.data]
|
||||
|
||||
|
||||
def get_ts(self):
|
||||
return [datetime.utcfromtimestamp(self.start_timestamp+(i+1)*self.bin_time) for i in range(self.n_bins)]
|
||||
def get_ts(self):
|
||||
return [datetime.utcfromtimestamp(self.start_timestamp+(i+1)*self.bin_time) for i in range(self.n_bins)]
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@ -430,9 +430,9 @@
|
||||
<script src="./dist/js/tabler.min.js"></script>
|
||||
|
||||
<script>
|
||||
$.get("/stat", function (data) {
|
||||
// @formatter:off
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
var load_stat = function(){
|
||||
$.getJSON("/stat", function (data) {
|
||||
// @formatter:off
|
||||
window.ApexCharts && (new ApexCharts(document.getElementById('chart-mentions'), {
|
||||
chart: {
|
||||
type: "line",
|
||||
@ -516,9 +516,10 @@
|
||||
},
|
||||
},
|
||||
})).render();
|
||||
});
|
||||
// @formatter:on
|
||||
});
|
||||
};
|
||||
load_stat();
|
||||
</script>
|
||||
|
||||
|
||||
@ -601,4 +602,4 @@
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user