-
Notifications
You must be signed in to change notification settings - Fork 29
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
Logarithmic scale #200
Comments
Hey @swharden! I think this makes sense, and would be something cool to have! Regarding the "checkbox" I don't really know where we could add it. I had some ideas to add some more "advanced" filters/options so I think this is another one for the bucket. I was leaning towards having either some sort of "expandable" component above the list of package/tags that one could expand to see all the "advanced" filters/options. Another alternative would be a dialog but.. not sure that's a good UI/UX. You could just start with it, and add the new option on the side of the drop-down for the period and we can see how to go from there. Another thing is we are using a prob old version of
The code that returns the data returns For ex: Say you select a period of 2 years and 2 packages. The second package only started existing on the second year. In this case, the line for the second package was being plotted at the start of the chart, and not exactly where it should be (middle). I remember i tried several things and the end we went with this approach. Here's an example: https://nugt.net/s/iIXU1a8 |
To explore these concepts I made a little WinForms application using ScottPlot.net and some of the JSON files retrieved using the NuGetTrends.com API: https://github.com/swharden/NuGet-Stats-Analysis This demonstrates what log scaling the data looks like, how it facilitates comparing download rates across multiple packages, and also what it looks like if you add a checkbox to align packages by the date of their first upload. I think this is sufficient to communicate what this type of functionality could look like if implemented in the web viewer.
I agree it will be important to get this right. An expanding panel with additional graph options is a good idea. Upgrading chart.js at the same time makes sense.
I'm not familiar enough with Angular (or talented enough with UI/UX) to feel like I'm the best person to implement this. I'm happy to leave this issue here as a reference for whoever wants to pick this up in the future, and it can be closed if it's not actionable. Thanks again for your input and all the work you do for this project! I really value the information it provides, and am very happy this web app exists 🚀✨ |
Whoa great stuff, thanks for the sample! No problem. Let's leave the issue open, I think this would be a good new feature. I can tackle it when I have some free cycles or someone else can of course. Also, if you want to learn Angular and etc I could also help you get started 😊 |
Download count for popular packages typically follows an exponential growth curve (e.g., screenshot in #189). By plotting exponential curves on a log-scaled Y axis they appear as straight lines, making it easier to compare multiple exponential curves to one another. It's hard to eyeball whether growth differs between curves that start at different time points (e.g., an old exponentially growing package vs. a newer one), and adding support for log-scaled vertical axes solves that problem.
Would you consider adding a checkbox to present data on a log-scaled axis? If there's interest in this I can try to figure out how to implement it properly and I'll open a PR. I'm not familiar with Angular, but I can try my best. If this feature isn't desired or you think the checkbox would be added UI clutter, no worries! I wanted to ask before I worked on this further.
Here's a quick mockup of what it could look like, although it looks like charts.js is struggling with missing data points (their log is being interpreted as zero).
To create the mockup I modified this file according to the Chart.js 2.9 Log axis docs
nuget-trends/src/NuGetTrends.Web/Portal/src/app/packages/packages.component.ts
Lines 157 to 159 in 62a481b
The text was updated successfully, but these errors were encountered: