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(annotation): enable marker positioning on LineAnnotation #737

Conversation

markov00
Copy link
Member

@markov00 markov00 commented Jul 3, 2020

Summary

This PR allows changing the marker position on a line annotation. The position is absolute on
the screen space and doesn't depend on the chart rotation.
Screenshot 2020-07-03 at 17 18 14
Screenshot 2020-07-03 at 17 17 50

This PR adds a new optional props to the <LineAnnotation> component called markerPosition?: Position;
The default position, if this property is not specified, falls back to the linked axis position (if available).

  • If no axis present on the chart, the marker position is positioned by default on the bottom on the X domain
  • and on the left of the chart for the Y domain. The specified position is an absolute position and reflect
  • the spatial position of the marker independently from the chart rotation.

fix #701

Note: this PR doesn't change the fact that the size of the marker doesn't participate in the automatic calculation of the padding around the chart: this means that if the marker is bigger than the available padding the marker will overflow the chart component.

Checklist

Delete any items that are not applicable to this PR.

  • 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

This commit allows changing the marker position on a line annotation. The position is absolute on
the screen space and doesn't depend on the chart rotation

fix elastic#701
@markov00 markov00 added enhancement New feature or request :annotation Annotation (line, rect, text) related issue :xy Bar/Line/Area chart related labels Jul 3, 2020
@codecov-commenter
Copy link

Codecov Report

Merging #737 into master will decrease coverage by 0.54%.
The diff coverage is 75.17%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #737      +/-   ##
==========================================
- Coverage   74.80%   74.25%   -0.55%     
==========================================
  Files         265      282      +17     
  Lines        8541     8883     +342     
  Branches     1714     1788      +74     
==========================================
+ Hits         6389     6596     +207     
- Misses       2099     2227     +128     
- Partials       53       60       +7     
Impacted Files Coverage Δ
src/chart_types/goal_chart/state/chart_state.tsx 59.18% <0.00%> (ø)
src/chart_types/index.ts 100.00% <ø> (ø)
...types/partition_chart/layout/types/config_types.ts 100.00% <ø> (ø)
...es/partition_chart/layout/types/viewmodel_types.ts 83.33% <ø> (ø)
...artition_chart/renderer/canvas/canvas_renderers.ts 6.34% <0.00%> (ø)
.../chart_types/partition_chart/state/chart_state.tsx 74.50% <0.00%> (ø)
src/chart_types/xy_chart/utils/specs.ts 100.00% <ø> (ø)
src/components/portal/utils.ts 21.42% <0.00%> (-78.58%) ⬇️
src/scales/constants.ts 100.00% <ø> (ø)
src/specs/constants.ts 100.00% <ø> (ø)
... and 69 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 35b8caf...2e9481b. Read the comment docs.

@markov00 markov00 merged commit ab5e413 into elastic:master Jul 6, 2020
@markov00 markov00 deleted the 2020_06_30-configure_annotation_marker_position branch July 6, 2020 10:55
markov00 pushed a commit that referenced this pull request Jul 6, 2020
# [19.8.0](v19.7.0...v19.8.0) (2020-07-06)

### Bug Fixes

* set uninitialized state when removeSpec action is called ([#739](#739)) ([35b8caf](35b8caf)), closes [#723](#723) [#738](#738)

### Features

* **annotation:** enable marker positioning on LineAnnotation ([#737](#737)) ([ab5e413](ab5e413)), closes [#701](#701)
* add custom annotation tooltip ([#727](#727)) ([435c67c](435c67c))
@markov00
Copy link
Member Author

markov00 commented Jul 6, 2020

🎉 This PR is included in version 19.8.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@markov00 markov00 added the released Issue released publicly label Jul 6, 2020
AMoo-Miki pushed a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this pull request Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:annotation Annotation (line, rect, text) related issue enhancement New feature or request released Issue released publicly :xy Bar/Line/Area chart related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Annotation label] Line annotation label at top
2 participants