Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add graph feature to show a star chart/graph of a repository #24

Open
hedyhli opened this issue Jun 28, 2020 · 18 comments
Open

Add graph feature to show a star chart/graph of a repository #24

hedyhli opened this issue Jun 28, 2020 · 18 comments
Labels
enhancement New feature or request good first issue Good for newcomers to try

Comments

@hedyhli
Copy link
Owner

hedyhli commented Jun 28, 2020

We can use probably a --graph option to display a graph of the star/fork/watcher or just the stars of one or more repositories, choosing a specific repository or display a graph for all repos fetched from search() is undecided. Play around and experiment with what you should do, if we are going to display a graph for every repo fetched, we should make the graph option one of the --layout choices.

Don't forget to update the help and usage both in __main__.py and also in the readme.

@hedyhli hedyhli added enhancement New feature or request good first issue Good for newcomers to try Up for grabs and removed Up for grabs labels Jun 28, 2020
@shivam212
Copy link
Contributor

Hey, I would like to work on this, I am a newcomer to open source, any pointers on how to start on this?

@hedyhli
Copy link
Owner Author

hedyhli commented Jul 8, 2020

You can setup your development environment using the tutorial in the contributing file, if it’s working properly you are good to go. This feature request is mainly about displaying a graph (or ASCII graph) in the terminal as described in the description above, you can try doing it locally on your computer, and push it and open a pull request. If you are stuck, feel free to ask 😃

Check this out for inspiration: https://starchart.cc/hedythedev/starcli
Stargazers over time

@shivam212
Copy link
Contributor

Thanks for the help!

@shivam212
Copy link
Contributor

@hedythedev I may have to scrape and form the data for stars collected over a period of time myself, and doing that may take a longer time for repos with a very high number of stars, and can cause the program to slow down, should we look at only displaying graphs for repos with just enough stars so that the data scraping does not slow the whole thing down?

You can see the same problem here, https://starchart.cc/torvalds/linux, because this repo has a whole lot stars, the graph does not load.

@hedyhli
Copy link
Owner Author

hedyhli commented Jul 8, 2020

Oh, I see. We could initially try getting all the star data, then after a timeout, it can display a message saying the star data is too much, and prompt the user to input a time range which to fetch the star info, if it's still after timeout, we can default it to probably one month. Is that better?

@hedyhli
Copy link
Owner Author

hedyhli commented Jul 8, 2020

And if you know how to, we could also cache the data (maybe when starcli is running something else concurrently) so we don't have to scrape it again and again

@shivam212
Copy link
Contributor

Oh, I see. We could initially try getting all the star data, then after a timeout, it can display a message saying the star data is too much, and prompt the user to input a time range which to fetch the star info, if it's still after timeout, we can default it to probably one month. Is that better?

Yes, could be done.

And if you know how to, we could also cache the data (maybe when starcli is running something else concurrently) so we don't have to scrape it again and again

I'll have a go at this.

@hedyhli
Copy link
Owner Author

hedyhli commented Jul 9, 2020

Take your time 😄

@shivam212
Copy link
Contributor

@hedythedev should we start off with making the graph listings as a new option? We can choose, say the 3 top repos, and show the graphs for them.

@hedyhli
Copy link
Owner Author

hedyhli commented Jul 14, 2020

Sure, we could probably start by creating a function that takes in a string of the repo name (user/repo), fetch the stats, then if possible, display the graph. If the above is achieved, then we can do the command line option so that, maybe, the user can call it like starcli --graph ‘psf/black’ (Or some other repo), and a graph is displayed. We might deal with displaying a graph for the repos fetched from search() later

@arcanearronax
Copy link
Contributor

If shivam212 isn't working on this anymore, I'd like to take this on.

@hedyhli
Copy link
Owner Author

hedyhli commented Aug 19, 2020

No he isn’t, I will assign you @arcanearronax, thanks for your interest

@arcanearronax
Copy link
Contributor

Sorry about the delay with this. I've been busy with work stuff and home life. I have put together what I would consider an MVP, but I do want to make some other changes to improve it. Would you want me to submit a pull request or start a new branch to make it available for further work?

@hedyhli
Copy link
Owner Author

hedyhli commented Sep 24, 2020

Sure @arcanearronax don't worry the delay

@26tanishabanik
Copy link

26tanishabanik commented Aug 26, 2021

@hedyhli I have the added a stargraph feature, #105

@fgsepter
Copy link

fgsepter commented Nov 16, 2021

Hi! My friend and I come up with some ideas to better improve this graph feature, but have not decided which detailed features to add here. Can we work on this?

@tongjin0521
Copy link

@hedyhli
I have added two graph features enabling star or fork graph.
Currently, we can choose to show the star/fork graph of a single repo or show the star/fork of multiple repos we got from the search() in one graph.
The content is shown in the draft pull request.
Please have a look at it and give some suggestions so that we can improve it :)
Thx!

@CristhianMotoche
Copy link

Hello there! Was this issue solved? Is it still open for contribution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers to try
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants