Class: Spoom::Coverage::D3::Timeline::Calls
- Inherits:
-
Stacked
- Object
- Base
- Spoom::Coverage::D3::Timeline
- Stacked
- Spoom::Coverage::D3::Timeline::Calls
- Extended by:
- T::Sig
- Defined in:
- lib/spoom/coverage/d3/timeline.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(id, snapshots) ⇒ Calls
constructor
A new instance of Calls.
- #tooltip ⇒ Object
Methods inherited from Stacked
Methods inherited from Spoom::Coverage::D3::Timeline
#area, header_script, header_style, #line, #plot, #points, #script, #x_scale, #x_ticks, #y_scale, #y_ticks
Methods inherited from Base
header_script, header_style, #html, #script
Constructor Details
#initialize(id, snapshots) ⇒ Calls
Returns a new instance of Calls.
452 453 454 455 456 457 458 459 460 461 462 463 |
# File 'lib/spoom/coverage/d3/timeline.rb', line 452 def initialize(id, snapshots) keys = ["false", "true"] data = snapshots.map do |snapshot| { timestamp: snapshot., commit: snapshot.commit_sha, total: snapshot.calls_typed + snapshot.calls_untyped, values: { true: snapshot.calls_typed, false: snapshot.calls_untyped }, } end super(id, data, keys) end |
Instance Method Details
#tooltip ⇒ Object
466 467 468 469 470 471 472 |
# File 'lib/spoom/coverage/d3/timeline.rb', line 466 def tooltip <<~JS function tooltip_#{id}(d) { tooltipTimeline(d, "calls"); } JS end |