-
Notifications
You must be signed in to change notification settings - Fork 120
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(annotations): render line annotations via LineAnnotation spec #126
feat(annotations): render line annotations via LineAnnotation spec #126
Conversation
Codecov Report
@@ Coverage Diff @@
## master #126 +/- ##
==========================================
+ Coverage 92.84% 93.67% +0.83%
==========================================
Files 31 32 +1
Lines 1481 1660 +179
Branches 163 194 +31
==========================================
+ Hits 1375 1555 +180
+ Misses 92 90 -2
- Partials 14 15 +1
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.
Tested locally and works fine now.
I've found just few minor things:
- on scale continuous, if you add an annotation with an empty string, it will be configured as an annotation on 0, this because d3-scale coerce values...
- I think you can keep the
LineAnnotation
style
prop as if was before: Partial and optional, as you will always merge it on chartState when adding the annotation spec.
Beside that last point, I think it's good to merge
# [3.6.0](v3.5.1...v3.6.0) (2019-04-04) ### Features * **annotations:** render line annotations via LineAnnotation spec ([#126](#126)) ([98ff170](98ff170))
🎉 This PR is included in version 3.6.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# [3.6.0](elastic/elastic-charts@v3.5.1...v3.6.0) (2019-04-04) ### Features * **annotations:** render line annotations via LineAnnotation spec ([opensearch-project#126](elastic/elastic-charts#126)) ([ac9313f](elastic/elastic-charts@ac9313f))
Summary
close #104
This PR introduces a LineAnnotation spec so the user can specify what annotations on a chart they want.
Since this is the first of the Annotation features, this also introduces a bit of scaffolding for the annotations overall. This implementation allows a user to define a set of annotations by defining one of three specs (LineAnnotation, RectangleAnnotation, and TextAnnotation).
Within a LineAnnotation spec a user may define:
dataValues
are defined in terms of data relevant to a scale within the chart. If thedomainType
is xDomain, then the annotation points will be scaled relative to the xDomain scale. If thedomainType
is yDomain, then the annotation points will be scaled relative to a yDomain scale; we get the relevant scale by lookup up againstthis.yScales
with thegroupId
defined on the spec.Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.