gorilla-repl
gorilla-repl copied to clipboard
Difficulty plotting Infinity and NaN
This may be a Vega issue, if so I'll move it, but there are definite issues plotting extreme values.
Consider this function & plot,
(defn g [x] (Math/log (inc x)))
(plot g [-5 5])
Oh, yes, that's not very good! I'm not really sure what the solution is, as I think the underlying problem is that JSON has no way of representing NaN or Infinity. At the moment Cheshire is converting them to strings in the JSON it outputs, which seems sensible, but it doesn't look as though Vega is handling them well.
I guess the options are:
- check to see if Vega has a particular way it would like non-numeric values represented.
- if not, strip them from the data before we transform to JSON.