Sha256: b9de67e060f546be21119aba4e178df7507ad4b027fd290bec47ff525c9eb9f6

Contents?: true

Size: 1.18 KB

Versions: 12

Compression:

Stored size: 1.18 KB

Contents

# -*- encoding : utf-8 -*-
module GitStats
  module StatsView
    module Charts
      class RepoCharts
        def initialize(repo)
          @repo = repo
        end

        def files_by_extension
          Chart.new do |f|
            f.column_hash_chart(
                data: @repo.files_by_extension_count,
                title: :files_by_extension.t,
                y_text: :files.t
            )
          end
        end

        def lines_by_extension
          Chart.new do |f|
            f.column_hash_chart(
                data: @repo.lines_by_extension,
                title: :lines_by_extension.t,
                y_text: :lines.t
            )
          end
        end

        def files_by_date
          Chart.new do |f|
            f.date_chart(
                data: @repo.files_count_by_date,
                title: :files_by_date.t,
                y_text: :files.t
            )
          end
        end

        def lines_by_date
          Chart.new do |f|
            f.date_chart(
                data: @repo.lines_count_by_date,
                title: :lines_by_date.t,
                y_text: :lines.t
            )
          end
        end

      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
git_stats-1.0.11 lib/git_stats/stats_view/charts/repo_charts.rb
git_stats-1.0.10 lib/git_stats/stats_view/charts/repo_charts.rb
git_stats-1.0.9 lib/git_stats/stats_view/charts/repo_charts.rb
git_stats-1.0.8 lib/git_stats/stats_view/charts/repo_charts.rb
git_stats-1.0.7 lib/git_stats/stats_view/charts/repo_charts.rb
git_stats-1.0.6 lib/git_stats/stats_view/charts/repo_charts.rb
git_stats-1.0.5 lib/git_stats/stats_view/charts/repo_charts.rb
git_stats-1.0.4 lib/git_stats/stats_view/charts/repo_charts.rb
git_stats-1.0.3 lib/git_stats/stats_view/charts/repo_charts.rb
git_stats-1.0.2 lib/git_stats/stats_view/charts/repo_charts.rb
git_stats-1.0.1 lib/git_stats/stats_view/charts/repo_charts.rb
git_stats-1.0.0 lib/git_stats/stats_view/charts/repo_charts.rb