-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add "tickpadding" property to control distance between ticks when tickmode is auto #303
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
Conversation
Thanks for the PR. I think this could be a valuable addition. As you mentioned, That said, we must make sure that the In other words, we don't want to give users multiple ways of describing the same graph. |
Thanks for the feedback. In the current implementation, Also, I'd like to add a chart with |
Hey @john-soklaski - Would you mind reaching us through this form so we can contact you by email? |
@jackparmer Yep! I submitted through the form. |
Updated with added image test for tickpadding. |
@john-soklaski After a more thorough review, I noticed a few things left to address, most importantly, Axis attribute logic is reused by the colorbar component and gl3d axes. To make the the So, going forward:
Moreover,
|
The most straightforward way I found was to continue to define |
Thanks, this feels much cleaner. |
As I was adding a colorbar test, I realized that For a categorical axis, it works great because dtick varies linearly with roughDTick:
But for a linear axis, the behavior is unintuitive, as dtick gets rounded to base 10 multiples of 2, 5, and 10:
What do you think about limiting this to just categorical axes? Or, alternatively, what do you think of applying |
@john-soklaski I apologize for the wait. I've been on a tight schedule this week.
I'd vote 👎 on this. Adding ghost attributes to the Instead, you could add You're correct about the colorbar ticks behaving a little bit differently in this case. I don't think Therefore, maybe you could try to implement to same sort of trickery mentioned ⏫ in the colorbar code as for |
@etpinard Thanks for your feedback!
Gotcha, that makes sense, I'll implement it that way.
I need to take another look at this, but as far as I know, the unintuitive behavior occurs for any axis with Although, I'd like for I'll have more time to take a look at this in about a week. |
…pagate tickpadding property into colorbar.
bd04f01
to
a29d4b9
Compare
Sorry it took me so long to get back to this. I updated with the changes mentioned for both gl3d and colorbar. Is this along the lines that you were thinking? |
@@ -25,8 +26,11 @@ var gridLightness = 100 * (204 - 0x44) / (255 - 0x44); | |||
module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, options) { | |||
var containerIn, containerOut; | |||
|
|||
//gl3d doesn't currently implement tickpadding property, but it is a required attribute of a cartesian axis | |||
var cartesianLayoutAttributes = Lib.extendFlat({}, layoutAttributes, { tickpadding: cartesianAxesAttrs.tickpadding }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, exactly. Nicely done.
Following on what @alexcjohnson wrote on #1812 - please add the #1812 feature into this pull request (once it resolves the conflicts). Thanks! |
@john-soklaski any chance you would be able to give this a look? |
Bump. |
Hi @talgalili - Does your research group have a budget to sponsor or purchase software? I can't speak for John, but the plotly.js team is flat out right now with other projects. I don't expect to see this merged this month without a sponsor. Seems like your research group is doing some really nice work with plotly.js, so thought I'd share a realistic idea of timeline and priority. |
Hi @jackparmer With regards, |
Closing this thing (unfortunately). Those merge conflicts are probably too hard to try to solve on this branch. If anyone subscribed to this is still interested in this feature, please open a new issue. |
... actually #1965 is probably the best place to discuss "tickpadding" |
I have a resizeable chart that I want Plotly to automatically manage the ticks for. But, the ticks are positioned too closely together. To address this, I added a tickpadding property to the axis object.
Before
After (with tickpadding:20)
http://codepen.io/john-soklaski/pen/LNEqWW