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

Revise textposition default for bar, histogram and waterfall #5638

Merged
merged 5 commits into from
May 11, 2021

Conversation

archmoj
Copy link
Contributor

@archmoj archmoj commented May 6, 2021

Resolves #5624.

@plotly/plotly_js

@archmoj archmoj added this to the NEXT milestone May 6, 2021
@archmoj archmoj requested a review from alexcjohnson May 6, 2021 22:17
@alexcjohnson
Copy link
Collaborator

Looking particularly at the histogram-offsetgroups mock, I'm wondering if we shouldn't be a little more nuanced about this: if text is an array, default textposition='auto'. But if text is a string, that was probably meant only to show in hover so default to textposition='none'.

We have no such logic for scatter, but in that case it's fairly common to want all markers in a trace to get the same text - the text may even BE the marker.

I could could go either way on this, just wanted to throw it out there. The "always auto" logic is nice for its simplicity, and I'd do it this way if starting fresh, it just may break more graphs than we would need to with the v2 upgrade. @nicolaskruchten @archmoj thoughts?

@nicolaskruchten
Copy link
Contributor

But if text is a string, that was probably meant only to show in hover

I can see what you mean, but this seems like really edge-case behaviour, probably used in cases where folks didn't want to rename the trace or something? Sure, let's carve something out for that.

@archmoj
Copy link
Contributor Author

archmoj commented May 8, 2021

Looking particularly at the histogram-offsetgroups mock, I'm wondering if we shouldn't be a little more nuanced about this: if text is an array, default textposition='auto'. But if text is a string, that was probably meant only to show in hover so default to textposition='none'.

We have no such logic for scatter, but in that case it's fairly common to want all markers in a trace to get the same text - the text may even BE the marker.

I could could go either way on this, just wanted to throw it out there. The "always auto" logic is nice for its simplicity, and I'd do it this way if starting fresh, it just may break more graphs than we would need to with the v2 upgrade. @nicolaskruchten @archmoj thoughts?

Bar and histogram do not have textinfo at the moment; but waterfall has.
BTW using textinfo or texttemplate people could include additional info such as values in the text.
I think depending on the type of text to be an array to enable so called auto behaviour is rather confusing.
Concerning the histogram baseline change, it seems to me the labels actually helped improve the graph.
Sure there might be cases that this may not be desirable; but then it would be as easy as using the none option.

Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

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

Right, thinking about this more, especially with all the other work we're doing to simplify defaults for v2, making this conditional default seems like a step backward.

So to me this is good to go 💃 unless @nicolaskruchten wants to argue for sticking with my previous suggestion 😅

@nicolaskruchten
Copy link
Contributor

I'm good, please merge :)

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.

Text position defaults in v2
3 participants