Skip to content

feat: enhanced graph with color gradients, sparkline, trend, and peak marker - #10

Merged
simplynadaf merged 1 commit into
mainfrom
feature/enhanced-graph
Aug 20, 2026
Merged

feat: enhanced graph with color gradients, sparkline, trend, and peak marker#10
simplynadaf merged 1 commit into
mainfrom
feature/enhanced-graph

Conversation

@simplynadaf

Copy link
Copy Markdown
Owner

What does this PR do?

Upgrades devpub stats --graph from basic single-color bars to a visually rich terminal chart with professional-grade enhancements.

Enhancements

Feature Description
Color gradient bars Bars fade from blue (low) to cyan to green to gold (peak) based on value
Sparkline one-liner Compact trend: line below chart for quick pattern recognition
Trend indicator Arrow + percentage comparing last 7 days vs previous 7 days
Average line Dotted line across chart showing mean, with label
Peak marker Bold gold peak value with date in summary
Box-drawing axes Proper tick marks with Unicode box characters
12-row height More vertical resolution (was 10)
4 Y-axis labels Shows 25%, 50%, 75%, 100% marks (was 3)

Example output

  Views (last 7 days)  +23%

     770 |    X
         |    X
         | X  XX
     577 | X  XXX
         | XX.XXX. <- avg (532)
         |XXX XXX
     385 |XXX XXXX
         |XXXXXXXX
         |XXXXXXXX
     192 |XXXXXXXX
         |XXXXXXXX
         |XXXXXXXX
         ----------
          Aug 13 Aug 17 Aug 20

  trend: .......

  Total: 4.3K | Avg: 532/day | Peak: 770 ^ Aug 17

(With Rich colors: gradient blue to gold, avg line in dim)

Zero new dependencies

All rendering uses Rich (already a dependency) and pure Python. No external charting libraries added.

Tests

41 tests passing (18 new tests for color, sparkline, and trend helpers):

pytest tests/test_analytics.py -v
41 passed in 0.07s

Checklist

  • Tests pass (pytest)
  • No em dashes used anywhere
  • New functionality has tests
  • Zero new dependencies
  • Backwards compatible (same CLI interface)

@simplynadaf
simplynadaf merged commit d5f9ff6 into main Aug 20, 2026
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant