Class: HeatmapBuilder::LinearHeatmapBuilder
- Includes:
- ValueConversion
- Defined in:
- lib/heatmap_builder/linear_heatmap_builder.rb
Constant Summary
Constants inherited from Builder
Builder::BLUE_OCEAN, Builder::DEFAULT_OPTIONS, Builder::GITHUB_GREEN, Builder::PURPLE_VIBES, Builder::RED_TO_GREEN, Builder::WARM_SUNSET
Instance Method Summary collapse
Methods inherited from Builder
Constructor Details
This class inherits a constructor from HeatmapBuilder::Builder
Instance Method Details
#build ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/heatmap_builder/linear_heatmap_builder.rb', line 8 def build svg_content = computed_scores.map.with_index do |score, index| cell_svg(score, index) end.join svg_container( width: computed_scores.length * [:cell_size] + (computed_scores.length - 1) * [:cell_spacing], height: [:cell_size] ) { svg_content } end |