mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-11 09:40:19 -05:00
Contribution system: History heatmap for user #1
Closed
opened 2025-11-02 03:02:45 -06:00 by GiteaMirror
·
35 comments
No Branch/Tag Specified
main
release/v1.25
release/v1.24
release/v1.23
release/v1.22
release/v1.21
release/v1.20
release/v1.19
release/v1.18
release/v1.17
release/v1.16
release/v1.15
release/v1.14
release/v1.13
release/v1.12
release/v1.11
release/v1.10
release/v1.9
release/v1.8
v1.25.3
v1.25.2
v1.25.1
v1.25.0
v1.24.7
v1.25.0-rc0
v1.26.0-dev
v1.24.6
v1.24.5
v1.24.4
v1.24.3
v1.24.2
v1.24.1
v1.24.0
v1.23.8
v1.24.0-rc0
v1.25.0-dev
v1.23.7
v1.23.6
v1.23.5
v1.23.4
v1.23.3
v1.23.2
v1.23.1
v1.23.0
v1.23.0-rc0
v1.24.0-dev
v1.22.6
v1.22.5
v1.22.4
v1.22.3
v1.22.2
v1.22.1
v1.22.0
v1.23.0-dev
v1.22.0-rc1
v1.21.11
v1.22.0-rc0
v1.21.10
v1.21.9
v1.21.8
v1.21.7
v1.21.6
v1.21.5
v1.21.4
v1.21.3
v1.21.2
v1.20.6
v1.21.1
v1.21.0
v1.21.0-rc2
v1.21.0-rc1
v1.20.5
v1.22.0-dev
v1.21.0-rc0
v1.20.4
v1.20.3
v1.20.2
v1.20.1
v1.20.0
v1.19.4
v1.21.0-dev
v1.20.0-rc2
v1.20.0-rc1
v1.20.0-rc0
v1.19.3
v1.19.2
v1.19.1
v1.19.0
v1.19.0-rc1
v1.20.0-dev
v1.19.0-rc0
v1.18.5
v1.18.4
v1.18.3
v1.18.2
v1.18.1
v1.18.0
v1.17.4
v1.18.0-rc1
v1.19.0-dev
v1.18.0-rc0
v1.17.3
v1.17.2
v1.17.1
v1.17.0
v1.17.0-rc2
v1.16.9
v1.17.0-rc1
v1.18.0-dev
v1.16.8
v1.16.7
v1.16.6
v1.16.5
v1.16.4
v1.16.3
v1.16.2
v1.16.1
v1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
v1.3.2
v1.3.1
v1.3.0
v1.3.0-rc2
v1.3.0-rc1
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.2.0-rc3
v1.2.0-rc2
v1.1.4
v1.2.0-rc1
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.2
v1.0.1
v1.0.0
v0.9.99
Labels
Clear labels
$20
$250
$50
$500
backport/done
💎 Bounty
docs-update-needed
good first issue
hacktoberfest
issue/bounty
issue/confirmed
issue/critical
issue/duplicate
issue/needs-feedback
issue/not-a-bug
issue/regression
issue/stale
issue/workaround
lgtm/need 2
modifies/api
modifies/translation
outdated/backport/v1.18
outdated/theme/markdown
outdated/theme/timetracker
performance/bigrepo
performance/cpu
performance/memory
performance/speed
pr/breaking
proposal/accepted
proposal/rejected
pr/wip
pull-request
reviewed/wontfix
💰 Rewarded
skip-changelog
status/blocked
topic/accessibility
topic/api
topic/authentication
topic/build
topic/code-linting
topic/commit-signing
topic/content-rendering
topic/deployment
topic/distribution
topic/federation
topic/gitea-actions
topic/issues
topic/lfs
topic/mobile
topic/moderation
topic/packages
topic/pr
topic/projects
topic/repo
topic/repo-migration
topic/security
topic/theme
topic/ui
topic/ui-interaction
topic/ux
topic/webhooks
topic/wiki
type/bug
type/deprecation
type/docs
type/enhancement
type/feature
type/miscellaneous
type/proposal
type/question
type/refactoring
type/summary
type/testing
type/upstream
Mirrored from GitHub Pull Request
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/gitea#1
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @joubertredrat on GitHub (Nov 2, 2016).
Hi guys,
I think that is a possible feature, a history heatmap similar to github or gitlab.
Actually exists a plugin called Calendar HeatMap. I used this on mine project to heat application log and worked fine here.
Then, is only a idea, what you think? :)
http://cal-heatmap.com/
https://github.com/wa0x6e/cal-heatmap
Reference: https://github.com/gogits/gogs/issues/1640
@bkcsoft commented on GitHub (Nov 2, 2016):
I would prefer a solution that is in the backend, unless it's required to have it update without reloading. Unfortunately I can't seem to find anything that does that 😒
Also this would require caching, since it will fetch huge amounts of data from disk...
@joubertredrat commented on GitHub (Nov 2, 2016):
Yes, this plugin build on front-end, with backend I don't know too, but we can consider make component for this.
In my case I use ajax to get data, but build on frontend anyway
@xinity commented on GitHub (Nov 3, 2016):
following @bkcsoft retention strategy in cache is a must if we don't want gitea to waste ressources.
something like in the latest 15days could be enough don't you think ?
@bkcsoft commented on GitHub (Nov 4, 2016):
@xinity a simple LRU-cache should suffice in my opinion. Might be useful to be able to set the size of that cache though.
For my own projects I use hashicorp/golang-lru which works just fine and has a configurable size 🙂
@charlesreid1 commented on GitHub (Feb 22, 2018):
d3-calendar illustrates this really nicely and simply with javascript: https://bl.ocks.org/mbostock/4063318
git logis really flexible, so you can use it to output directly to JSON format, filter on users or dates, customize output format, etc (even has its own set of shortcodes). After an aggregation step, that data can be loaded into D3 calendar (basically just json objects with a key of the date and a value of the number of commits).Here is a single-user activity graph that illustrates embedding the Javascript visualization in the home template file: git.charlesreid1.com and modified home template.
@lunny commented on GitHub (Feb 22, 2018):
@charlesreid1 could you send a PR to gitea with your heatmap?
@charlesreid1 commented on GitHub (Feb 22, 2018):
I'm happy to put together a visualization in an PR, but a couple of things need to be worked out first:
Thoughts? Potential roadblocks?
@lunny commented on GitHub (Feb 22, 2018):
I would like put it under the

Public Activitytab and top of all the activities on user's profile. Like the below example image:@joubertredrat commented on GitHub (Feb 22, 2018):
@lunny I liked this approach, if possible to change color to green can be best.... or not, github is green too.
@charlesreid1 commented on GitHub (Feb 22, 2018):
Thanks @lunny for the suggestion, looks like a great spot for it.
@joubertredrat I'll do something plain and let the hipsters decide what color scheme to use. 🤓
@lafriks commented on GitHub (Feb 22, 2018):
Green would be more consistent with gitea theme
@charlesreid1 commented on GitHub (Feb 22, 2018):
I will use ColorBrewer's YlGn theme, which looks like the same one Github uses and is nicely consistent with Gitea green.
@charlesreid1 commented on GitHub (Feb 26, 2018):
It looks like gitea/models/graph.go may already implement a model for commit counts. Is that correct?
@charlesreid1 commented on GitHub (Feb 26, 2018):
Maybe not... But it looks like graph.go might be useful for implementing commit counts. There are a couple of files referring to a commit graph. Is this related to the heatmap/calendar idea, or is this referring to the timeline that shows up on a user's/organization's page?
@lunny commented on GitHub (Feb 26, 2018):
I think we need a new table to store the statistics information.
And all needed data could read from table
action.@thehowl commented on GitHub (Feb 26, 2018):
Could we not use a SQL
DATEinstead of achar(10)?@lafriks commented on GitHub (Feb 26, 2018):
Also if this is just activity from
actiontable than probably no new table is needed justselect user_id, date, count(1)withgroup by user_id, date?@lunny commented on GitHub (Feb 26, 2018):
@lafriks that maybe
select date, count(1) from action where user_id = ? and date >= ? and date < ? order by date group by date@lafriks commented on GitHub (Feb 26, 2018):
@lunny yes that what I meant but I don't know if xorm supports such queries
@lunny commented on GitHub (Feb 27, 2018):
@thehowl commented on GitHub (Feb 27, 2018):
would that work in all dialects?
@lafriks commented on GitHub (Feb 27, 2018):
If we have date column (do we?) than it should work
@lunny commented on GitHub (Feb 28, 2018):
@lafriks we can use created and remove the time parts.
@lafriks commented on GitHub (Feb 28, 2018):
@lunny don't think removing time part will be that easy so that it would perform good enaugh for such select
@akaia-shadowfox commented on GitHub (Jun 4, 2018):
It's possible to see this feature in near future?
@charlesreid1 commented on GitHub (Jun 4, 2018):
This effort was over my head, as there many decisions where I didn't have a clear sense of how to proceed, so I didn't get very far.
@kolaente commented on GitHub (Oct 18, 2018):
Any updates on this?
@lunny commented on GitHub (Oct 18, 2018):
@kolaente no people are working on this.
@kolaente commented on GitHub (Oct 20, 2018):
Someone created a nice article on how to implement this externally: https://medium.com/@markuman/gitea-contribution-heatmap-af4be1d7a0d5
@kolaente commented on GitHub (Oct 20, 2018):
I'll try to implement this.
@lafriks commented on GitHub (Oct 20, 2018):
Problem is with this part:
At least I did not find a way to implement it for sqlite
@kolaente commented on GitHub (Oct 20, 2018):
@lafriks I did find one:
I think I'll do it with a hard switch to provide another query if we are dealing with an sqlite db.
@lafriks commented on GitHub (Oct 20, 2018):
I think you will need different for mssql and Postgres also
@kolaente commented on GitHub (Oct 20, 2018):
PR is up: #5131
@naiba commented on GitHub (Oct 21, 2018):
Awesome, can't wait for release this.