-
Notifications
You must be signed in to change notification settings - Fork 42
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
Why are xTicks and yTicks set using Math.pow #72
Comments
In my case, using 5 (as actual input to d3) shows the best results. I cannot get similar results by setting:
I recommend to also test different data. For example short routes, with a lot of elevation change, can result in a different result than a long segment, with almost no elevation change. In my case, I am also using a smaller width and height of the diagram. If you look at routes, for example try some in the Alps and some in the Nederlands.
Well you can get very close to almost every number, if you use floating point inputs like 2.33. Sorry but I still don't understand why this breaking change was necessary? IMHO, it would be best to revert this change. Changes in minor versions should be non breaking. If there is a benefit of introducing non-linear axis scaling, we should probably do this in a major version or keep it configurable as opt-in, to have a smooth update experience. WDYT? |
I didn't consider this a breaking change, as during my testing nothing did change. That's why i only did a minor bump. But in this case we really should postpone this to a major version.
This is a good point. Would you be so kind to provide some input data (best as geojson input for the heightgraph) where you experienced differences in the ticks? The dimensions you are using are 400x180 i guess ?
I never really worked with d3 myself. To me it appeared that most of the values settable for the Ticks are not necessary. |
Sorry this issues somehow slipped through :). Here are some samples for a randomly chosen route by Kurviger. x/yTicks = 2 My choice was 2.33 which seems to show the best results for a lot of different cases I tested
Yes, these are the dimension I use. I attached a sample zip with the json data from the sample above. |
@boldtrn I just wanted to keep you in the loop: It is still possible to set x and y Ticks to overwrite the automatic handling. Best regards |
I was wondering if there was a specific reason to change the x- and yTick implementation to use the power of 2? This makes it a) more complicated for to understand how it works, b) makes setting any tick values that are no multiples of 2 more complicated and c) seems like an unnecessary breaking change.
For users of d3 this is also a bit counter-intuitive. If you are used to the exiting x- and yTick arguments of d3, using exponentially growing ticks is probably a bit irritating.
I used to set the tick values to 5. With the new ticks, the almost equivalent value would be 2.33, but I had to look at the implementation to understand what is happening.
The text was updated successfully, but these errors were encountered: