mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
52 lines
1.8 KiB
Plaintext
52 lines
1.8 KiB
Plaintext
<div class="row">
|
|
<div class="col s12">
|
|
<h1>Character creations</h1>
|
|
<%= line_chart Character.group_by_day(:created_at) %>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col s4">
|
|
<h2>Characters per user</h1>
|
|
<%= column_chart User.joins(:characters).group(:user_id).count().group_by { |n| n.last }.each_with_object({}) { |(content_count, ids), h| h[content_count] = ids.count } %>
|
|
</div>
|
|
<div class="col s4">
|
|
<h2>Characters per universe</h1>
|
|
<%= column_chart Universe.joins(:characters).group(:universe_id).count().group_by { |n| n.last }.each_with_object({}) { |(content_count, ids), h| h[content_count] = ids.count } %>
|
|
</div>
|
|
<div class="col s4">
|
|
<h2>Character privacy</h1>
|
|
<%= pie_chart Character.where.not(privacy: "").group(:privacy).count() %>
|
|
</div>
|
|
</div>
|
|
|
|
<h1>Character usage data</h1>
|
|
<div class="row">
|
|
<div class="col s4">
|
|
<h2>Most common names</h2>
|
|
<%= bar_chart Character.where.not(name: "").group(:name).order('count_all desc').limit(5).count() %>
|
|
</div>
|
|
<div class="col s4">
|
|
<h2>Most common age</h2>
|
|
<%= bar_chart Character.where.not(age: "").group(:age).order('count_all desc').limit(5).count() %>
|
|
</div>
|
|
<div class="col s4">
|
|
<h2>Most common gender</h2>
|
|
<%= pie_chart Character.where.not(gender: "").group(:gender).order('count_all desc').limit(5).count() %>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col s4">
|
|
<h2>Most common occupation</h2>
|
|
<%= bar_chart Character.where.not(occupation: "").group(:occupation).order('count_all desc').limit(5).count() %>
|
|
</div>
|
|
<div class="col s4">
|
|
<h2>Most-favorite weapons</h2>
|
|
<%= bar_chart Character.where.not(fave_weapon: "").group(:fave_weapon).order('count_all desc').limit(5).count() %>
|
|
</div>
|
|
<div class="col s4">
|
|
<h2>Most common eye color</h2>
|
|
<%= pie_chart Character.where.not(eyecolor: "").group(:eyecolor).order('count_all desc').limit(5).count() %>
|
|
</div>
|
|
</div> |