 
     _.compact _.flatten(links)
 
+  similarity_exclusions: ->
+    $.makeArray( ScholarMapViz.$similarity_types.find('button:not(.active)') ).map (type) ->
+      $(type).data 'similarity-type'
+
+  active_similarity_types: ->
+    console.log @similarity_types()
+    console.log @similarity_exclusions()
+    @similarity_types().filter (type) =>
+      @similarity_exclusions().indexOf(type) < 0
+
 
 class ScholarMapViz.PeopleMap extends ScholarMapViz.Map
 

  node_size: (d) ->
    d3.max [10, Math.log( d.authors.length + 1 ) * 10]

  similarity_types: ->
    ['fields', 'methods', 'theories', 'venues', 'people']


class ScholarMapViz.CharacteristicsMap extends ScholarMapViz.Map

  constructor: ->
    @type = 'characteristics'
    super

  # node tooltips should display the characteristic names
  node_tip_html: (d) ->
    d.name

  similarity_types: ->
    ['people', 'references']


class ScholarMapViz.DataToggle

  constructor:  ->
    $('#map-types').on 'click', 'button', ->
      $current_button = $(@)
      choose_data $current_button, -> new ScholarMapViz[$current_button.data('map-type')]

  choose_data = ($current, activation_callback) ->
    unless $current.hasClass 'active'

          {
            source: nodes.indexOf node
            target: nodes.indexOf other_node
            similarities: @active_similarity_types().map (similarity_type) ->
              {
                type: similarity_type
                list: similarities[similarity_type]
