Class: Spoom::Coverage::D3::Pie::Calls

Inherits:
Pie
  • Object
show all
Defined in:
lib/spoom/coverage/d3/pie.rb

Instance Method Summary collapse

Constructor Details

#initialize(id, title, snapshot) ⇒ Calls

: (String id, String title, Snapshot snapshot) -> void



137
138
139
# File 'lib/spoom/coverage/d3/pie.rb', line 137

def initialize(id, title, snapshot)
  super(id, title, { true: snapshot.calls_typed, false: snapshot.calls_untyped })
end

Instance Method Details

#tooltipObject

: -> String



143
144
145
146
147
148
149
# File 'lib/spoom/coverage/d3/pie.rb', line 143

def tooltip
  <<~JS
    function tooltip_#{id}(d) {
      tooltipPie(d, d.data.key == "true" ? " checked" : " unchecked", "calls", sum_#{id})
    }
  JS
end