Skip to content

Logarithmic scale #200

@swharden

Description

@swharden

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).

Linear Y Axis Logarithmic Y Axis
image image

To create the mockup I modified this file according to the Chart.js 2.9 Log axis docs

yAxes: [{
display: true,
ticks: {

        yAxes: [{
          display: true,
          type: 'logarithmic',
          ticks: {

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions