timeflux / timeflux_ui

Timeflux web app engine
MIT License
11 stars 4 forks source link

Monitor smoothie charts can't handle NaN #9

Open jonathanjfshaw opened 4 years ago

jonathanjfshaw commented 4 years ago

If there are Nan values in a dataframe, and you pipe it to the monitor node, then nothing shows up in the monitor's smoothie chart.

Fixing this in the ui node wuld be trivial with df.dropna(), but it may be better to fix in the monitor's ui.js as some other apps may have uses for NaN values.

mesca commented 4 years ago

Good catch. I have to investigate if there is an actual JavaScript error or if it simply stops rendering for a while. Removing NaN in JavaScript is costly because you have to loop over every sample. And I am a bit reluctant to remove the problematic samples in the UI node because, as you said, it could be useful in other circumstances (and especially when we will have other widgets). For now, if you know that your data is likely to have NaN, maybe a very light custom node that just do something like: self.o.data = self.i.data.dropna() would be a good alternative? This would have a place in core, I guess.