Coder Social home page Coder Social logo

Comments (6)

yoshi389111 avatar yoshi389111 commented on May 18, 2024 3

I tried the following formula.

(log10(x*12/5+1)*72 + min(x,50)*3) / 2 + 3

It is uncomfortable to have a small number of contributes.

fig1

fig2

fig3

I thought of using the following formula.

log10(x/20+1)*144+3

It is a little smaller, but I think it is acceptable.

fig4

fig5

fig6

from github-profile-3d-contrib.

yoshi389111 avatar yoshi389111 commented on May 18, 2024

Hi formidablae. Thank you for your proposal.
I think the idea of using logarithms is good.

The formula for finding the height is as follows.

  • Previous height: h1(x) = min(50, x)*3 + 3
  • New height: h2(x) = log(x*N+1)*K + 3

To determine N and K, I set some constraints.

First, if there are fewer contributions, I want to make the difference smaller than before.

  • h2(0) = h1(0) = 3 and h2(1) = h1(1) = 6
  • h2(1) - h2(0) = 3
  • log(N+1)*K - log(1)*K = 3
  • K = 3 / log(N+1)
  • h2(x) = log(x*N+1) / log(N+1) * 3 + 3

Next, I want to display the number of possible contributions at about the previous maximum size.
I think it's about 1200 contributions a day.

  • h2(1200) = h1(50) = 153
  • log(1200*N+1) / log(N+1) = 50
  • N = 0.1008515...

Rounding off the fine numbers, we get the following.

  • h2(x) = log(x/10+1)*72 + 3

However, 1200 contributions per day may be too much.

from github-profile-3d-contrib.

formidablae avatar formidablae commented on May 18, 2024

You are welcome @yoshi389111 :)
Your adjusted solution is better. I didn't know about the max 1200 contributions per day.
Nicely done that reverse parameter calculation!

However, 1200 contributions per day may be too much.

Yeah, you are right. But, since the heights of all days will be recalculated, there shouldn't be unusual differences between them (even with way less contributions than 1200).

Did you do produce any 3d svg with the new formula? Are the heights too low or too high when compared to the heights obtained with the old formula?

from github-profile-3d-contrib.

yoshi389111 avatar yoshi389111 commented on May 18, 2024

I didn't know about the max 1200 contributions per day.

I may have misled you.

1200 is not the maximum number of contributions per day on github.
It is the maximum number of contributions that can be displayed in this tool without overlapping or overflowing.

Are the heights too low or too high when compared to the heights obtained with the old formula?

With this formula, the display seems to be too small.

I would like to adjust the formula so that it can be displayed a little larger.

from github-profile-3d-contrib.

formidablae avatar formidablae commented on May 18, 2024

1200 ... is the maximum number of contributions that can be displayed in this tool without overlapping or overflowing.

Oh ok, now I get it.

With this formula, the display seems to be too small.
I would like to adjust the formula so that it can be displayed a little larger.

Did you try doing an average of the old linear formula and the new logarithmic one?

from github-profile-3d-contrib.

formidablae avatar formidablae commented on May 18, 2024

Wow, the second one looks wonderful! Even though the absolute height of 51 contributions/day would now be lower than before, the differences between the heights of different days would still be very distinguishable, colors help too - so that last formula works perfect (for me at least :) ).

from github-profile-3d-contrib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.