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

even out tick distance in graph if value range is big #1093

Merged
merged 5 commits into from
Nov 9, 2019

Conversation

jfz
Copy link
Contributor

@jfz jfz commented Oct 8, 2019

@brharrington brharrington added this to the 1.7.0 milestone Oct 8, 2019
ticks.result()
}

def getLogMajorStepSize(min: Double, max: Double, n: Int): Int = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be private?

while (curr <= max) {
//show tick for 0 but not 1(10^0) if lower boundary is 0, because they are too close in log scale
val v = if (v1 == 0 && curr == 0) 0 else math.pow(10, curr)
//val v = math.pow(10, curr)
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove commented out code

@brharrington
Copy link
Contributor

brharrington commented Oct 23, 2019

This doesn't work correctly for negative values. The new rendering would give me the impression the smaller values are greater than 0 and less than 1.

Before

old

After

new

@jfz jfz force-pushed the improveLogTicks branch from f330e5e to 8e2750e Compare October 25, 2019 20:54
Copy link
Contributor

@brharrington brharrington left a comment

Choose a reason for hiding this comment

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

LGTM, I think we can improve the binary mode as a later follow up.

@@ -47,7 +47,7 @@ sealed trait ValueAxis extends Element with FixedWidth {
val numTicks = (y2 - y1) / minTickLabelHeight
plotDef.tickLabelMode match {
case TickLabelMode.BINARY => Ticks.binary(min, max, numTicks)
Copy link
Contributor

Choose a reason for hiding this comment

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

We can hit the same problem with the binary mode, example:

/api/v1/graph?q=10,100,1e5,1e8&scale=log&tick_labels=binary

binary

@brharrington brharrington merged commit 1c2ef40 into Netflix:master Nov 9, 2019
@jfz jfz deleted the improveLogTicks branch February 4, 2020 23:00
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.

2 participants