MCPcopy Create free account
hub / github.com/KentBeck/BPlusTree3 / create_comprehensive_visualization

Function create_comprehensive_visualization

visualize_programming_time.py:116–348  ·  view source on GitHub ↗

Create comprehensive visualizations.

(sessions, daily_data)

Source from the content-addressed store, hash-verified

114
115
116def create_comprehensive_visualization(sessions, daily_data):
117 """Create comprehensive visualizations."""
118
119 # Set up the figure with subplots
120 fig = plt.figure(figsize=(20, 16))
121 fig.suptitle(
122 "Programming Time Analysis for BPlusTree Repository",
123 fontsize=20,
124 fontweight="bold",
125 )
126
127 # Calculate total stats for title
128 total_hours = sum(s["duration_minutes"] for s in sessions) / 60
129 total_commits = sum(len(s["commits"]) for s in sessions)
130
131 fig.text(
132 0.5,
133 0.95,
134 f"Total: {total_hours:.1f} hours • {total_commits} commits • {len(daily_data)} days",
135 ha="center",
136 fontsize=14,
137 style="italic",
138 )
139
140 # 1. Daily programming time (top left)
141 ax1 = plt.subplot(3, 3, (1, 2))
142 dates = sorted(daily_data.keys())
143 daily_hours = [daily_data[date]["duration_minutes"] / 60 for date in dates]
144
145 bars = ax1.bar(
146 dates,
147 daily_hours,
148 alpha=0.8,
149 color="steelblue",
150 edgecolor="navy",
151 linewidth=0.5,
152 )
153 ax1.set_title("Daily Programming Time", fontsize=14, fontweight="bold")
154 ax1.set_ylabel("Hours", fontsize=12)
155 ax1.grid(True, alpha=0.3)
156 ax1.tick_params(axis="x", rotation=45)
157
158 # Add value labels on bars
159 for bar, hours in zip(bars, daily_hours):
160 if hours > 0.5: # Only label significant bars
161 ax1.text(
162 bar.get_x() + bar.get_width() / 2,
163 bar.get_height() + 0.1,
164 f"{hours:.1f}h",
165 ha="center",
166 va="bottom",
167 fontsize=9,
168 )
169
170 # 2. Session timeline (top right)
171 ax2 = plt.subplot(3, 3, 3)
172 session_starts = [s["start"] for s in sessions]
173 session_durations = [s["duration_minutes"] / 60 for s in sessions]

Callers 1

mainFunction · 0.85

Calls 2

keysMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected