     Template.instance().loading.get()
 
   disableCases: ->
-    'cases' not in Template.instance().data.selectedIncidentTypes.get()
+    not _.findWhere(Template.instance().differentialIncidents.get(),
+      type: 'cases'
+    )
 
   disableDeaths: ->
-    'deaths' not in Template.instance().data.selectedIncidentTypes.get()
+    not _.findWhere(Template.instance().differentialIncidents.get(),
+      type: 'deaths'
+    )
 
 Template.eventResolvedIncidents.events
   "click .incident-type-selector .cases": (event, instance)->


  @autorun =>
    @incidents = EventIncidents.find(@data.filterQuery.get())
    allIncidents = @incidents.fetch()
    @hoveredIntervalClickEvent = null
    incidentType = @incidentType.get()

    @loading.set(true)
    @highlightedLocations.remove({})
    _.delay =>
      allIncidents = allIncidents.filter (i)->
        i.locations.every (l)-> l.featureCode
      differentials = convertAllIncidentsToDifferentials(allIncidents)
      differentials = _.where(differentials, type: incidentType)
      subIntervals = differentailIncidentsToSubIntervals(differentials)
      extendSubIntervalsWithValues(differentials, subIntervals)
      for subInterval in subIntervals

      @autorun =>
        renderPlot(differentials, locToSubintervals, locationTree, topLocations)
        @loading.set(false)

Template.eventResolvedIncidents.helpers
  activeMode: (value)->
