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

Inherits:
Spoom::Coverage::D3::Pie show all
Extended by:
T::Sig
Defined in:
lib/spoom/coverage/d3/pie.rb

Instance Attribute Summary

Attributes inherited from Base

#id

Instance Method Summary collapse

Methods inherited from Spoom::Coverage::D3::Pie

header_script, header_style, #script

Methods inherited from Base

header_script, header_style, #html, #script

Constructor Details

#initialize(id, title, snapshot) ⇒ Calls

Returns a new instance of Calls.



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

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

Instance Method Details

#tooltipObject



150
151
152
153
154
155
156
# File 'lib/spoom/coverage/d3/pie.rb', line 150

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