feat(partition): treemap padding#660
Conversation
Codecov Report
@@ Coverage Diff @@
## master #660 +/- ##
==========================================
+ Coverage 72.94% 72.97% +0.03%
==========================================
Files 266 266
Lines 8618 8630 +12
Branches 1695 1696 +1
==========================================
+ Hits 6286 6298 +12
Misses 2293 2293
Partials 39 39
Continue to review full report at Codecov.
|
| } | ||
|
|
||
| type GetShapeRowGeometry = ( | ||
| container: any, // fixme RectangleConstruction | RingSector, |
There was a problem hiding this comment.
This type centralizes a number of old references and replaces the former ...args: any[] blanket so it's an improvement; I'm planning to revisit this sole remaining parameter, likely in a next treemap PR, to make this config available asap
There was a problem hiding this comment.
This could be also something like
type GetShapeRowGeometry<C> = (
container: C,
...
markov00
left a comment
There was a problem hiding this comment.
Code LGTM,
nit: if you can add a set of knobs to the groove text story it will give the reader a good idea on how the padding play a role in the rendering
| } | ||
|
|
||
| type GetShapeRowGeometry = ( | ||
| container: any, // fixme RectangleConstruction | RingSector, |
There was a problem hiding this comment.
This could be also something like
type GetShapeRowGeometry<C> = (
container: C,
...
# [19.2.0](v19.1.2...v19.2.0) (2020-05-05) ### Features * **partition:** treemap padding ([#660](#660)) ([ed1e8be](ed1e8be))
|
🎉 This PR is included in version 19.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# [19.2.0](elastic/elastic-charts@v19.1.2...v19.2.0) (2020-05-05) ### Features * **partition:** treemap padding ([opensearch-project#660](elastic/elastic-charts#660)) ([b462a38](elastic/elastic-charts@b462a38))
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #660 +/- ##
==========================================
+ Coverage 72.94% 72.98% +0.04%
==========================================
Files 266 266
Lines 8618 8632 +14
Branches 1695 1697 +2
==========================================
+ Hits 6286 6300 +14
Misses 2293 2293
Partials 39 39 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
Adds treemap text padding configurability by specifying
fillLabel: { padding: 3 }for the perimeter in pixels, orfillLabel: {padding: { top: 0, bottom: 0, left: 2, right: 2 } }to allow per-side configurationCloses #659
The default value is minimal, but non-zero (2px), to avoid minor text bleeding. This is in effect if
paddingis omitted altogether, or for unspecified sides ifpaddingis an object.It's a per-layer configuration, because constraints, font sizes etc. may vary per layer.
In particular, it's good practice to have very small (0..2px)
topandbottompadding for in-groove group texts, while there's more freedom to adjust eg.left(and less importantly,right) to horizontally align the left edge of the groove text withThe story
8_groove_text.tsxshows an example for horizontal alignment with the ink.Reviewer notes:
8_groove_text.tsxthe other treemap mock changes are due to the use of a 2px padding rather than reusing the overhang padding, the change is small thoughChecklist
Delete any items that are not applicable to this PR.
src/index.ts(and stories only import from../srcexcept for test data & storybook)