Class: Spoom::Coverage::D3::Timeline::Calls
- Defined in:
- lib/spoom/coverage/d3/timeline.rb
Instance Method Summary collapse
-
#initialize(id, snapshots) ⇒ Calls
constructor
: (String id, Array snapshots) -> void.
-
#tooltip ⇒ Object
: -> String.
Methods inherited from Stacked
Methods inherited from Timeline
#commits_for_dates, #months, #ticks
Constructor Details
#initialize(id, snapshots) ⇒ Calls
: (String id, Array snapshots) -> void
444 445 446 447 448 449 450 451 452 453 454 455 |
# File 'lib/spoom/coverage/d3/timeline.rb', line 444 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
: -> String
459 460 461 462 463 464 465 |
# File 'lib/spoom/coverage/d3/timeline.rb', line 459 def tooltip <<~JS function tooltip_#{id}(d) { tooltipTimeline(d, "calls"); } JS end |