-
Notifications
You must be signed in to change notification settings - Fork 712
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
new(xychart): add annotations #938
Conversation
curve={curve} | ||
/> | ||
{!renderBarSeries && ( |
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.
this just makes it so we render 3 lines when we don't render a bar series, ditto on area below
/** Annotation component to render. */ | ||
AnnotationComponent: React.FC<AnnotationProps> | React.FC<EditableAnnotationProps>; | ||
/** Key for series to which datum belongs (used for x/yAccessors). Alternatively xAccessor + yAccessor may be specified. */ | ||
dataKey: string; |
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.
need to make this optional since we allow you to override x/yAccessors
@@ -42,14 +43,20 @@ type ProvidedProps = { | |||
y: Accessors; | |||
date: Accessor; | |||
}; | |||
animationTrajectory: AnimationTrajectory; | |||
annotationDataKey: keyof Accessors | null; |
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.
in this file, just added the annotation state + re-ordered several controls to group them more logically (lots of controls were added over time so it's a little overwhelming)
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
61a6ce6
to
677f03f
Compare
…bel types, export Connector props
…anEditSubject to Annotations
677f03f
to
fbed9f5
Compare
Pull Request Test Coverage Report for Build 383875944
💛 - Coveralls |
will add some tests in another PR to get coverage pack up |
🚀 Enhancements
This PR integrates the new
@visx/annotation
s into@visx/xychart
and updates the demo. Most of the work is wrappers around the annotation components to provide theme + dimensions fromXYChart
's context, and I also added anAnimatedAnnotation
variant so that they can animate upon data changes.A quick summary of components added for ease of review
private/BaseAnnotation
powersAnnotation
andAnimatedAnnotation
(mirrors howAnimatedSeries
work)Annotation
AnimatedAnnotation
Animation
Editable
Theme support
Horizontal line annotations
Noting that you can render an annotation per data point, so this PR fixes #903
Something like this
💥 Breaking Changes
This updates the shape of the
xychart
theme
, but since it's not released it's not technically breaking in a semantic version sense.@kristw @hshoff