Comments (4)
It should be caused by someone revoked the star after starred. I noticed starred_url
, i.e. "https://api.github.com/users/nschlemm/starred{/owner}{/repo}" , but seems it doesn't work. And I didn't find a good v3 API to solve this problem.
StargazerConnection in v4, should be more powerful. Combining with other APIs, we can even solve #31.
from star-history.
https://star-history.t9t.io/#nosarthur/gita
I put in one of my project and it also has -30 stars in the beginning
from star-history.
@chinesedfan Thanks for finding the root cause, I will check it out when I got time.
To my experience, people don't unstar projects very often, so this seems not a big issue for me. We can find a workaround first and then consider if it worth the effort to migrate to GitHub API v4
from star-history.
@timqian After a night's thinking, I realized the real reason was something wrong in the codes.
// used to calculate total stars for this page
const pageIndexes = pageNum <= sampleNum ?
range(pageNum).slice(1, pageNum) :
range(sampleNum).map(n => Math.round(n / sampleNum * pageNum) - 1); // for bootstrap bug
// ...
starHistory = pageIndexes.map((p, i) => {
return {
date: resArray[i + 1].data[0].starred_at.slice(0, 10),
starNum: 30 * (p - 1),
};
});
Math.round
is not a stable method, which means it may select a smaller or larger value. Sometimes pageIndexes
will include 0 as the first element. That's why -30 is generated.
And I also find another place that using Math.round
. A better way should only consider the day part of new Date()
and calculate daysSinceRepoCreatedAt
by Math.ceil
.
const daysSinceRepoCreatedAt = Math.round((new Date()) - firstStarredAt) / (1000*60*60*24);
from star-history.
Related Issues (20)
- Display tags on horizontal axis
- Setup the Gitpod ready-to-code system HOT 1
- Image is blank when saving from firefox. HOT 1
- Annotations
- Consider adding support for other platforms HOT 1
- Star history stops working for my repo since May 8, 2023 HOT 8
- Printed style of star history graphs HOT 3
- star-history chrome plugin doesn't handle URL query parameters
- Sometimes it show error: "Unauthorized: Access Token Unauthorized" or "Forbidden: GitHub API rate limit exceeded" HOT 1
- Review added at repo-reviews.github.io
- the website blog page has a error? HOT 1
- Daily star count HOT 1
- Starlet #8 doesn't load HOT 1
- 'Invalid date' shown in bylines of Starlet issues #11 onward HOT 1
- [BUG] parameters should be url-encoded
- Upgrade to Vite 5?
- Link to GitHub repo
- Support for PNG via the API HOT 1
- Negative star count at project start HOT 2
- Add repo-analytics, also from tim qian HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from star-history.