-
Notifications
You must be signed in to change notification settings - Fork 916
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
Add interfaces for layering data on Visualizations #3108
Add interfaces for layering data on Visualizations #3108
Conversation
Keeping as draft until #3107 has been reviewed & merged; I will then rebase this PR |
Codecov Report
@@ Coverage Diff @@
## feature/feature-anywhere #3108 +/- ##
=========================================================
Coverage 66.67% 66.67%
=========================================================
Files 3219 3220 +1
Lines 61450 61454 +4
Branches 9417 9417
=========================================================
+ Hits 40969 40973 +4
Misses 18234 18234
Partials 2247 2247
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
c22ecd2
to
c961d3f
Compare
342bc10
to
d42e4fe
Compare
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
c8e9ac3
to
9e1c51b
Compare
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
// used to determine what vis layer's interface is being implemented. | ||
// currently PointInTimeEventsLayer is the only interface extending VisLayer | ||
export const isPointInTimeEventsVisLayer = (obj: any) => { | ||
return 'events' in obj; | ||
}; |
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.
How are you imagining this to be used? It seems like it would be simpler to have a static type
string on the VisLayer
interface that you can specify when defining a particular type of VisLayer
, and then just access as a value. This type of convenient method may still be helpful, but it's actually implemented as more a capability check.
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.
Agreed, existing soln seemed hacky. Updated to use enums in latest commits. Also added a general isValidVisLayer
fn that can be ran when verifying the new saved object types are valid or not, based on expression function type
src/plugins/expressions/common/expression_types/specs/vis_layers.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
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.
Looks great, thanks for the improvements and the tests!
// used to determine what vis layer's interface is being implemented. | ||
// currently PointInTimeEventsLayer is the only interface extending VisLayer | ||
export const isPointInTimeEventsVisLayer = (obj: any) => { | ||
return 'events' in obj; | ||
return obj?.type === VisLayerTypes.PointInTimeEvents; | ||
}; | ||
|
||
export const isValidVisLayer = (obj: any) => { | ||
return obj?.type in VisLayerTypes; | ||
}; |
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.
nice, this seems much more clear to me.
Do we know why cypress tests are failing here or is it expected? |
Yes, cypress test failures are to be expected for feature branches right now, based on the way those workflows are configured. I also think we can ignore whitesource checks when merging to the feature branch target - that's something we can make sure of as we rebase the feature branch and when we merge it into main. |
@joshuarrrr #3107 will need to be merged to |
This shouldn't be backported - sorry, forgot we were working on a feature branch here. |
…t#3108) * Add vis layer interfaces Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
…t#3108) * Add vis layer interfaces Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
Description
This PR adds the interfaces related to layering data on top of a visualization. These are persisted in the new
vis_augmenter
plugin. Also defines the expressions function definition and expressions type for the new vis layers (details on the expression function design in the related issue)Note that currently the only implemented VisLayer is
PointInTimeEventsVisLayer
. Details on this design, as well as future possibleVisLayer
implementations, can be found in the related issue.Issues Resolved
Closes #2882
Closes #2894
Check List
yarn test:jest
yarn test:jest_integration
yarn test:ftr