fix(axis): truncate title longer then the available space#1905
Merged
markov00 merged 4 commits intoelastic:mainfrom Dec 19, 2022
Merged
fix(axis): truncate title longer then the available space#1905markov00 merged 4 commits intoelastic:mainfrom
markov00 merged 4 commits intoelastic:mainfrom
Conversation
Collaborator
Author
|
@nickofthyme does that interfere with your work on small multiples? |
Collaborator
|
Not at all, this is great! I can adapt the heatmap rendering to implement this as well. |
nickofthyme
approved these changes
Dec 16, 2022
Collaborator
nickofthyme
left a comment
There was a problem hiding this comment.
LGTM, tested on storybook.
nickofthyme
reviewed
Dec 16, 2022
nickofthyme
pushed a commit
that referenced
this pull request
Dec 19, 2022
# [51.2.0](v51.1.1...v51.2.0) (2022-12-19) ### Bug Fixes * **axis:** truncate titles longer then the available space ([#1905](#1905)) ([3526a69](3526a69)) * **deps:** update dependency @elastic/eui to ^70.4.0 ([#1893](#1893)) ([6576041](6576041)) * **deps:** update dependency @elastic/eui to v71 ([#1898](#1898)) ([da596a5](da596a5)) ### Features * **legend:** add custom legend component ([#1889](#1889)) ([2e1648d](2e1648d))
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.
Summary
Very small change to improve the titles on small multiples: the title are now truncated to the max size available.

The max size consider only the size of the projection of one dimension and doesn't expand further. This because we want the title to be always aligned to the axis center and not to the panel center.
Details
I've applied a 1 line text truncation function on every title directly at the renderer level.
Issues
Partially fix this #1008 (comment)
This PR only addresses Axis titles truncation and not tick label truncation.
Checklist
:xy,:partition):interactions,:axis):themelabel has been added and the@elastic/eui-designteam has been pinged when there areThemeAPI changescloses #123,fixes #123)packages/charts/src/index.tsdark,light,eui-dark&eui-light