2012-10-23 20:37:42 +02:00
|
|
|
# -*- encoding : utf-8 -*-
|
2012-10-20 00:30:00 +02:00
|
|
|
module GitStats
|
|
|
|
module StatsView
|
|
|
|
module Charts
|
|
|
|
class RepoCharts
|
|
|
|
def initialize(repo)
|
|
|
|
@repo = repo
|
|
|
|
end
|
|
|
|
|
2012-10-21 23:12:14 +02:00
|
|
|
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
|
|
|
|
)
|
2012-10-20 00:30:00 +02:00
|
|
|
end
|
2012-10-21 23:12:14 +02:00
|
|
|
end
|
2012-10-20 00:30:00 +02:00
|
|
|
|
2012-10-21 23:12:14 +02:00
|
|
|
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
|
|
|
|
|
2015-11-29 13:32:20 +01:00
|
|
|
def files_by_extension_by_date
|
|
|
|
Chart.new do |f|
|
|
|
|
f.multi_date_chart(
|
|
|
|
data: @repo.files_by_extension_by_date,
|
|
|
|
title: :files_by_extension_by_date.t,
|
|
|
|
y_text: :files.t
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def lines_by_extension_by_date
|
|
|
|
Chart.new do |f|
|
|
|
|
f.multi_date_chart(
|
|
|
|
data: @repo.lines_by_extension_by_date,
|
|
|
|
title: :lines_by_extension_by_date.t,
|
|
|
|
y_text: :files.t
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2012-10-21 23:12:14 +02:00
|
|
|
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
|
|
|
|
)
|
2012-10-20 00:30:00 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-11-17 22:39:00 +01:00
|
|
|
def comments_by_date
|
|
|
|
Chart.new do |f|
|
|
|
|
f.date_chart(
|
|
|
|
data: @repo.comments_count_by_date,
|
|
|
|
title: :comments_by_date.t,
|
|
|
|
y_text: :comments.t
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2012-10-20 00:30:00 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|