Commit 2e7f89d
authored
fix(loc): use LoC count for tower intensity calculation (JhaSourav07#1601)
## Description
Fixes JhaSourav07#1600
This PR fixes a rendering logic issue in Lines of Code (LoC) mode where
tower color intensity was calculated using commit counts instead of LoC
values.
Previously, the intensity level for a day's tower was derived from the
number of commits, causing days with high LoC activity but few commits
to appear with low or flat shading. This resulted in a visualization
that did not accurately represent code volume.
### Changes Made
* Updated LoC mode intensity calculations to use the day's LoC value.
* Removed the dependency on commit counts when determining LoC tower
shading.
* Preserved existing behavior for commit-based rendering modes.
### Result
* Tower intensity now accurately reflects Lines of Code activity.
* High-LoC days receive stronger visual emphasis.
* LoC mode provides a more meaningful and accurate representation of
coding activity.
## Pillar
* [ ] 🎨 Pillar 1 - New Theme Design
* [ ] 📐 Pillar 2 - Geometric SVG Improvement
* [ ] 🕐 Pillar 3 - Timezone Logic Optimization
* [x] 🛠️ Other (Bug fix, refactoring, docs)
### Verification
* Generated SVG output in LoC mode using varying LoC values.
* Confirmed tower intensity scales according to LoC counts.
* Verified days with high LoC and low commit counts now render with
appropriate intensity.
* Confirmed non-LoC rendering modes remain unchanged.
## Checklist before requesting a review:
* [x] I have read the `CONTRIBUTING.md` file.
* [x] I have tested these changes locally
(`localhost:3000/api/streak?user=YOUR_USERNAME`).
* [x] I have run `npm run format` and `npm run lint` locally and
resolved all errors (CI will fail otherwise).
* [x] My commits follow the Conventional Commits format (e.g.,
`feat(themes): ...`, `fix(calculate): ...`).
* [ ] I have updated `README.md` if I added a new theme or URL
parameter.
* [x] I have starred the repo.
* [x] I have made sure that I have only one commit to merge in this PR.
* [x] The SVG output matches the CommitPulse "premium quality" aesthetic
standard (no raw elements, smooth animations, correct fonts).
* [ ] (Recommended) I joined the CommitPulse Discord community for
contributor discussions, mentorship, and faster PR support.2 files changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| 204 | + | |
| 205 | + | |
204 | 206 | | |
205 | 207 | | |
206 | 208 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
| 130 | + | |
131 | 131 | | |
132 | | - | |
| 132 | + | |
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| |||
0 commit comments