Class: Spoom::Coverage::D3::Timeline::Sigils

Inherits:
Stacked show all
Extended by:
T::Sig
Defined in:
lib/spoom/coverage/d3/timeline.rb

Instance Attribute Summary

Attributes inherited from Base

#id

Instance Method Summary collapse

Methods inherited from Stacked

#line, #plot, #script

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) ⇒ Sigils

Returns a new instance of Sigils.



425
426
427
428
429
430
431
432
433
434
435
436
# File 'lib/spoom/coverage/d3/timeline.rb', line 425

def initialize(id, snapshots)
  keys = Snapshot::STRICTNESSES
  data = snapshots.map do |snapshot|
    {
      timestamp: snapshot.commit_timestamp,
      commit: snapshot.commit_sha,
      total: snapshot.files - snapshot.rbi_files,
      values: snapshot.sigils_excluding_rbis,
    }
  end
  super(id, data, keys)
end

Instance Method Details

#tooltipObject



439
440
441
442
443
444
445
# File 'lib/spoom/coverage/d3/timeline.rb', line 439

def tooltip
  <<~JS
    function tooltip_#{id}(d) {
      tooltipTimeline(d, "files excluding RBIs");
    }
  JS
end