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

Tough to read years from the main plot when showing multiple years. #181

Open
KristofferStrube opened this issue Dec 20, 2021 · 5 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@KristofferStrube
Copy link

Problem

When plotting the downloads for a package over multiple years we have a 'MMM d' format as the label for the x-axis and the same for the tooltip title when hovering over a specific data-point. This can make it tough to read which year a specific data point is for.

Solutions

Simple solution

The most simple solution that would require minimal changes would be to set the title of the tooltip explicitly to include the year.
This can be done here in packages.ts by adding a title property. This keeps the plot simple on the surface but makes it possible to inspect the full date if you can't figure out the year.

Less simple solution

Have the x-axis labels depend on whether or not we are plotting for 1 year or more. I can't figure out specifically where this should be done but should be doable with more changes to the packages.ts code. I'm not sure how pretty this will be code-quality-wise.

@bruno-garcia
Copy link
Member

Agreed! This is something that I always noticed too but never got around to change.

I personally don't have an opinion on which route to take as a solution (@joaopgrassi might have one). But happy to review a PR and get this changed and released.

@bruno-garcia bruno-garcia added the enhancement New feature or request label Jan 11, 2022
@joaopgrassi
Copy link
Member

@KristofferStrube if you have time to send a PR, we can go with the simple solution first and see how it looks.

@joaopgrassi joaopgrassi added good first issue Good for newcomers help wanted Extra attention is needed labels Jan 16, 2022
@KristofferStrube
Copy link
Author

Hey @joaopgrassi and @bruno-garcia ,
I have tried to load the PostgreSQL data in, in order to try out the simple approach, but I don't seem to get any data points in my test project. I get the different package names, but not the download counts themselves, so I can't test if my approach would work.
Is there something specifically I have to do with the database backup to get this or am I just unlucky?

@joaopgrassi
Copy link
Member

Hum strange. I guess you used the contrib db from here: https://github.com/dotnet/nuget-trends#database-backup-for-contributors?

I haven't use it in a while, but last time I did it worked. My "go-to" packages to try-out things are usually the popular ones like EntityFramework, Dapper or xUnit and the like. Maybe try one of those?

If I have time this week I'll try setting up from scratch to see if I run into problems.

@KristofferStrube
Copy link
Author

Yep @joaopgrassi I used that backup.

I will try to look at using one of those packages to check the import again.

And thanks. There were some hoops to jump through to get it to work without prior setup, but I think I got there.

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 help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants