Skip to content

Conversation

@Pbruun
Copy link
Contributor

@Pbruun Pbruun commented Jan 23, 2026

3 step graph, small data (smallest 1%), medium data (smallest 6%), then the default.

Math log to make the smaller data visible in graph.

This makes sure we can see even the smallest data in the graph. While still keeping the graph difference in the higher end.
The medium graph is there to smooth things between small and default.

…en the default.

Math log to make the smaller data visible in graph
@Pbruun Pbruun self-assigned this Jan 23, 2026
return 95 - ((getBaseLog(logBase, y + 1) - getBaseLog(logBase, minY + 1)) / rangeY) * 95;
}
function calculateDefaultDataCurve(logBase: number, y: number, minY: number, maxY: number, rangeY: number) {
if (y === 0) return 100;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally, in this repo, we've tried to avoid the if one-liners. So, in this case, the "correct" (its a stupid word here, but you get the meaning, we strive for coherence) would be

If(y === 0) {
return 100;
}

This goes for the 2 other if sentences below in this function too :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be "correct" now 😄

Copy link
Contributor

@jesperlauridsen jesperlauridsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks very nice. I only have a simple change request, thats only cosmetic :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants