Class: Lyra::Visualization::TimelineHtmlBuilder
- Inherits:
-
Object
- Object
- Lyra::Visualization::TimelineHtmlBuilder
- Defined in:
- lib/lyra/visualization/timeline.rb
Overview
HTML builder for timeline visualization (replaces Phlex dependency)
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(events) ⇒ TimelineHtmlBuilder
constructor
A new instance of TimelineHtmlBuilder.
Constructor Details
#initialize(events) ⇒ TimelineHtmlBuilder
Returns a new instance of TimelineHtmlBuilder.
229 230 231 |
# File 'lib/lyra/visualization/timeline.rb', line 229 def initialize(events) @events = events.sort_by { |e| (e) } end |
Instance Method Details
#build ⇒ Object
233 234 235 236 237 238 239 240 241 |
# File 'lib/lyra/visualization/timeline.rb', line 233 def build html = [] html << '<div class="lyra-timeline">' html << "<style>#{timeline_styles}</style>" html << build_header html << build_body html << '</div>' html.join("\n") end |