-
Notifications
You must be signed in to change notification settings - Fork 121
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
feat(partition): linked text maximum length config #665
feat(partition): linked text maximum length config #665
Conversation
Codecov Report
@@ Coverage Diff @@
## master #665 +/- ##
==========================================
+ Coverage 72.94% 72.97% +0.03%
==========================================
Files 266 266
Lines 8618 8634 +16
Branches 1695 1698 +3
==========================================
+ Hits 6286 6301 +15
- Misses 2293 2294 +1
Partials 39 39
Continue to review full report at Codecov.
|
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.
LGTM, left a small side note
@@ -69,7 +70,8 @@ export function linkTextLayout( | |||
const stemFromY = y; | |||
const stemToX = x + north * west * cy - west * relativeY; | |||
const stemToY = cy; | |||
const text = rawTextGetter(node); | |||
const rawText = rawTextGetter(node); | |||
const text = rawText.length <= maxTextLength ? rawText : `${rawText.substr(0, maxTextLength - 1)}…`; // ellipsis is one char |
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.
it's fine for now, in the future we should account for RTL languages :)
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.
Indeed, thanks for the nudge, will incorporate in the follow-up.
🎉 This PR is included in version 19.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# [19.3.0](elastic/elastic-charts@v19.2.0...v19.3.0) (2020-05-08) ### Bug Fixes * build/type issue with DataGenerator ([opensearch-project#671](elastic/elastic-charts#671)) ([01844ac](elastic/elastic-charts@01844ac)) ### Features * **partition:** linked text maximum length config ([opensearch-project#665](elastic/elastic-charts#665)) ([e37cb8f](elastic/elastic-charts@e37cb8f))
Summary
Allows a configuration of maximum text length (in characters) for linked labels on pie and donut charts
Mitigates #633
Ticks a checkbox in #518
Checklist
Delete any items that are not applicable to this PR.
Any consumer-facing exports were added tosrc/index.ts
(and stories only import from../src
except for test data & storybook)Unit tests were updated or added to match the most common scenarios<- in follow-up PR for adaptive length constraints