Closed rsandor closed 9 years ago
@jamesarosen - Can you take a look at this and make sure I am not mad? Also, if you have any suggestions for how to clean up that line to make it more readable, I am entirely comprised of ears.
How about
isNonEmptyArray = (ary) ->
Epoch.isArray(ary) and ary.length > 0
redraw: ->
return unless isNonEmptyArray(@data) and isNonEmptyArray(@data[0].values)
Ooh, good call, could probably put that in Epoch.Util. Updates en route.
@jamesarosen - That should do it, thoughts?
+1
Yeah, while non-empty is a double negative, I think it is used quite often to describe the test. An alternative would be to replace it with not Epoch.isEmptyArray(ary)
but that just seems to make the test less clear. Should be good to go, from my perspective.
At the top of the
Epoch.Time.Heatmap.redraw
there is a series of checks that ensures the chart has data before fully redrawing chart. It was erroneously inspecting the@data
member when ensuring that the first layer had actual values to display.