<% full_width_breakdowns = current_user.content.keys.length > 6 # todo page superlatives (most-edited page, oldest page, etc) # todo image upload usage % %>

<%= link_to data_vault_path, class: 'grey-text tooltipped', style: 'position: relative; top: 4px;', data: { position: 'bottom', enterDelay: '500', tooltip: "Back to your Data Vault" } do %> arrow_back <% end %> Your Notebook.ai usage

Page updates per month
<%= area_chart current_user.content_change_events.group_by_month(:created_at).map { |date, count| [date.split(' ').first, count] }, download: true %> Every field you edit on a page counts as one update. For example, editing a character's age and birthday counts as two updates, even if done at the same time.
Page type counts
<%= bar_chart current_user.content.map { |n, l| [n.pluralize(l.count), l = l.count] }.sort { |a, b| a[1] <=> b[1] }.reverse, download: true %>
Type breakdown
<%= pie_chart current_user.content.map { |n, l| [n.pluralize(l.count), l = l.count] }, download: true, legend: "left" %> You can click a page type in the key to toggle it on/off in the pie chart.
<% if current_user.thredded_posts.any? %>
Posts on the forums per month
<%= area_chart [ { name: 'New threads', data: current_user.thredded_topics.group_by_month(:created_at).map { |date, count| [date.split(' ').first, count] } }, { name: 'Responses', data: current_user.thredded_posts.group_by_month(:created_at).map { |date, count| [date.split(' ').first, count] } } ], download: true %>
<% end %> <% if current_user.thredded_private_posts.any? %>
Private messages per month
<% private_postable_ids = current_user.thredded_private_topics.pluck(:id)%> <%= area_chart [ { name: "Sent", data: current_user.thredded_private_posts.group_by_month(:created_at).map { |date, count| [date.split(' ').first, count] } }, { name: "Received", data: Thredded::PrivatePost.where.not(user_id: current_user.id).where(postable_id: private_postable_ids).group_by_month(:created_at).map { |date, count| [date.split(' ').first, count] } }, ], download: true %>
<% end %>