src/heatmap.h

changeset 81
1ff88eb9555c
parent 75
857af79337d5
--- a/src/heatmap.h	Fri Feb 27 14:38:01 2026 +0100
+++ b/src/heatmap.h	Thu Mar 12 12:00:50 2026 +0100
@@ -45,20 +45,31 @@
                 std::chrono::year_month_day, // date
                 commits
     >>> m_heatmap;
+    std::map<
+        std::string, // dummy string - so that both maps have the same type
+        std::map<
+            std::string, // author
+            std::map<
+                std::chrono::year_month_day, // date
+                commits
+    >>>  m_aggregated_heatmap;
     std::string m_current_repo;
-    bool m_separate;
+
+    static constexpr auto aggregated_repo_label = "All Repositories";
 public:
-    explicit heatmap(bool separate) noexcept : m_separate(separate) {}
-
     void set_repo(const std::string& repo) {
         m_current_repo.assign(repo);
     }
     void add(const settings &settings, const std::string& log);
 
-    [[nodiscard]] const auto& data() const {
+    [[nodiscard]] const auto& separated() const {
         return m_heatmap;
     }
 
+    [[nodiscard]] const auto& aggregated() const {
+        return m_aggregated_heatmap;
+    }
+
     [[nodiscard]] std::array<commit_summary, 12> commits_per_month(
         const std::string &repo,
         const std::string& author,

mercurial