Skip to content

Commit

Permalink
Merge pull request #117 from identity-research-lab/stats-get-edge-count
Browse files Browse the repository at this point in the history
Add node and edge counts to stats page
  • Loading branch information
CoralineAda committed Aug 28, 2024
2 parents b787391 + 96aa451 commit 6605766
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/controllers/stats_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ def index
code_count = Code.count
category_count = Category.count
keyword_count = Keyword.count
node_count = ActiveGraph::Base.query('WITH count{()} AS ct RETURN ct').first.values.first
edge_count = ActiveGraph::Base.query('WITH count{()-[]-()} AS ct RETURN ct').first.values.first

@total_datapoints = survey_response_count + (question_count * survey_response_count) + identity_count + code_count + category_count + keyword_count + sentiments.compact.count
@total_datapoints = survey_response_count + (question_count * survey_response_count) + identity_count + code_count + category_count + keyword_count + sentiments.compact.count + edge_count

@stats = {
"Participant survey responses" => survey_response_count,
Expand All @@ -26,7 +28,9 @@ def index
"Self-expressed identities" => identity_count,
"Codes" => code_count,
"Derived categories" => category_count,
"Derived keywords" => keyword_count
"Derived keywords" => keyword_count,
"Graph nodes" => node_count,
"Graph edges" => edge_count
}
end

Expand Down

0 comments on commit 6605766

Please sign in to comment.