-
-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
In the star-history user.js script:
async function insertStarHistory() {
const { user, repo } = getUserAndRepoOfCurrentPage()
try { // to load/insert star history chart
// Fetch image as blob
const imgURL = sanitizeImgURL('https://api.star-history.com/svg?repos='
+ `${user}/${repo}&type=Date` + (isDarkMode() ? '&theme=dark' : ''))
const response = await new Promise((resolve, reject) => xhr({
method: 'GET', url: imgURL, responseType: 'blob', onload: resolve, onerror: reject
}))
if (response.status != 200) throw new Error('>> Failed to fetch image')
if (!document.querySelector('#star-history')) {Could you add a setting option we could set for &type=Date that lets us change it to type=timeline.
You could also use a few other settings if you want, for example: &legend=top-left vs &legend=bottom-right.
You could also add option for &logscale
for example this is valid:
https://api.star-history.com/svg?repos=name/repo&type=timeline&logscale&legend=bottom-right
## Star History
[](https://www.star-history.com/#adamlui/userscripts&type=timeline&logscale&legend=bottom-right)
## Star History
<a href="https://www.star-history.com/#adamlui/userscripts&type=timeline&logscale&legend=bottom-right">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=adamlui/userscripts&type=timeline&theme=dark&logscale&legend=bottom-right" />
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=adamlui/userscripts&type=timeline&logscale&legend=bottom-right" />
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=adamlui/userscripts&type=timeline&logscale&legend=bottom-right" />
</picture>
</a>
Etc
Example of diff settings:
I can create a PR if you want
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels