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

feat(partition): stroke configuration and linked label value font format #602

Merged
merged 12 commits into from
Mar 26, 2020

Conversation

monfera
Copy link
Contributor

@monfera monfera commented Mar 24, 2020

Summary

Feat: closes #603 by adding border color configurability, might be useful for non-white backgrounds.

With the former, white-only borders:
image

With new border color configuration, set to the almost-black background:
image

On a black background, with black borders, the sunburst may look more balanced with lighter colors.

Feat: closes #600 by adding value font formatting for linked labels
image

Closes #598 too (compare the new story before and after the 2nd commit)
Also closes #597 (5th commit)

Thanks @cchaos for the feature request and bug reports

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

  • [ ] Any consumer-facing exports were added to src/index.ts (and stories only import from ../src except for test data & storybook)
  • This was checked for cross-browser compatibility, including a check against IE11
  • Proper documentation or storybook story was added for features that require explanation or tutorials
  • [ ] Unit tests were updated or added to match the most common scenarios
  • Each commit follows the convention

@monfera monfera self-assigned this Mar 24, 2020
Copy link
Member

@markov00 markov00 left a comment

Choose a reason for hiding this comment

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

Checked locally and LGTM.
I've added a comment to improve the storybook

stories/sunburst/29_custom_stroke.tsx Outdated Show resolved Hide resolved
@codecov-io
Copy link

codecov-io commented Mar 24, 2020

Codecov Report

Merging #602 into master will decrease coverage by 0.28%.
The diff coverage is 40.96%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #602      +/-   ##
==========================================
- Coverage   70.63%   70.35%   -0.29%     
==========================================
  Files         220      220              
  Lines        6409     6432      +23     
  Branches     1228     1225       -3     
==========================================
- Hits         4527     4525       -2     
- Misses       1863     1888      +25     
  Partials       19       19              
Impacted Files Coverage Δ
..._types/partition_chart/layout/circline_geometry.ts 3.12% <ø> (ø)
src/chart_types/partition_chart/layout/geometry.ts 44.44% <ø> (ø)
...types/partition_chart/layout/types/config_types.ts 100.00% <ø> (ø)
...es/partition_chart/layout/types/viewmodel_types.ts 80.00% <ø> (ø)
.../chart_types/partition_chart/layout/utils/calcs.ts 27.77% <ø> (ø)
...art_types/partition_chart/layout/utils/d3_utils.ts 54.54% <ø> (ø)
...es/partition_chart/layout/utils/group_by_rollup.ts 26.82% <ø> (ø)
...c/chart_types/partition_chart/layout/utils/math.ts 75.00% <ø> (ø)
...hart_types/partition_chart/layout/utils/measure.ts 28.57% <ø> (ø)
...art_types/partition_chart/layout/utils/sunburst.ts 11.11% <ø> (ø)
... and 191 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 433d2cd...84bb9d8. Read the comment docs.

@monfera monfera requested a review from markov00 March 24, 2020 14:49
@monfera
Copy link
Contributor Author

monfera commented Mar 24, 2020

retest

@monfera
Copy link
Contributor Author

monfera commented Mar 24, 2020

Jenkins retest

@monfera
Copy link
Contributor Author

monfera commented Mar 24, 2020

jenkins retest this

@monfera
Copy link
Contributor Author

monfera commented Mar 24, 2020

jenkins test this

@monfera monfera changed the title feat(partition): stroke color feat(partition): stroke configuration and linked label value font format Mar 24, 2020
Copy link
Member

@markov00 markov00 left a comment

Choose a reason for hiding this comment

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

LGTM, good to merge on green 💚

@monfera monfera merged commit 7dce0a3 into elastic:master Mar 26, 2020
@monfera monfera deleted the partition-stroke branch March 26, 2020 14:02
@@ -233,6 +234,7 @@ export const configMetadata = {
// other
backgroundColor: { dflt: '#ffffff', type: 'color' },
sectorLineWidth: { dflt: 1, min: 0, max: 4, type: 'number' },
sectorLineStroke: { dflt: 'white', type: 'string' },
Copy link
Contributor

Choose a reason for hiding this comment

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

@monfera Sorry for looking at this late, but I'm confused by the name of this property and it's value. Does the stroke allow for more than just color?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cchaos at the moment it's just flat color; Canvas2d would allow pattern and gradient colors too, but it doesn't look super useful so it's not exposed. You're right, the name is not super specific, it's patterned after the CSS property https://css-tricks.com/almanac/properties/s/stroke/ and the current TypeScript is:

sectorLineStroke: StrokeStyle
...
type Color = string;
type StrokeStyle = Color; // now narrower than string | CanvasGradient | CanvasPattern
...

Copy link
Contributor

Choose a reason for hiding this comment

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

K, thanks for the explanation!

markov00 pushed a commit that referenced this pull request Mar 26, 2020
# [18.2.0](v18.1.0...v18.2.0) (2020-03-26)

### Bug Fixes

* **line_annotation:** keep the spec in state after chart rerender ([#605](#605)) ([43c13f1](43c13f1)), closes [#604](#604)

### Features

* **partition:** stroke configuration and linked label value font format ([#602](#602)) ([7dce0a3](7dce0a3))
@markov00
Copy link
Member

🎉 This PR is included in version 18.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@markov00 markov00 added the released Issue released publicly label Mar 26, 2020
AMoo-Miki pushed a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this pull request Feb 10, 2022
# [18.2.0](elastic/elastic-charts@v18.1.0...v18.2.0) (2020-03-26)

### Bug Fixes

* **line_annotation:** keep the spec in state after chart rerender ([opensearch-project#605](elastic/elastic-charts#605)) ([22296c6](elastic/elastic-charts@22296c6)), closes [opensearch-project#604](elastic/elastic-charts#604)

### Features

* **partition:** stroke configuration and linked label value font format ([opensearch-project#602](elastic/elastic-charts#602)) ([24d0e71](elastic/elastic-charts@24d0e71))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Issue released publicly
Projects
None yet
4 participants