Bar text constraint configuration#1931
Merged
Merged
Conversation
alexcjohnson
reviewed
Aug 5, 2017
| expect(traceOut.texfont).toBeUndefined(); | ||
| expect(traceOut.insidetexfont).toBeUndefined(); | ||
| expect(traceOut.outsidetexfont).toBeUndefined(); | ||
| expect(traceOut.constraintext).toBe(); |
Collaborator
There was a problem hiding this comment.
This looks odd... toBeUndefined?
alexcjohnson
reviewed
Aug 5, 2017
|
|
||
| // apply text padding if possible | ||
| // Keep the padding so the text doesn't sit right against | ||
| // the bars, but don't factor it into barWidth |
alexcjohnson
reviewed
Aug 5, 2017
|
|
||
| // compute rotation and scale | ||
| var rotate = false, | ||
| var rotate = false; |
Collaborator
There was a problem hiding this comment.
This may be a silly question but... why do we have an if(rotate) below if rotate = false and is never changed?
Contributor
Author
There was a problem hiding this comment.
Good catch. I'll clean it up.
Collaborator
|
Looks great. I had also suggested expanding to fill the bar gap for outside text in stacked mode or with only one bar, but that seems a good deal tricker to implement and this is already a big win, so 💃 |
Contributor
Author
|
Ah, yeah. So just to confirm, sounds like this wins on pragmatism. Merging, but open to second thoughts if it's worth attacking a more complicated approach. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR does two things:
constraintext: 'both' | 'none' | 'inside' | 'outside'in order to resolve this comment on 'marker+text' mode for bar charts #34.textpadfor outside text in that it keeps the padding but does not factor it into the width of the bar. That means the text is still offset from the bar just a bit but can grow slightly larger before it's constrained.