-
Notifications
You must be signed in to change notification settings - Fork 0
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
Click annotations handler #1
base: add-annotations
Are you sure you want to change the base?
Click annotations handler #1
Conversation
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
@@ -21,6 +21,8 @@ import { | |||
HOVER_PARAM, | |||
} from '../'; | |||
|
|||
const showEventsFlyoutAction = 'show-events-flyout'; |
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.
Do you want to take on the view events flyout action, or just have the framework set up that I can build on top of? For example I already have the defined open flyout action in my draft PR here: https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3415/files#diff-e5581c4c9ed88d345c2fffa25e66f906e98b05d699e4c5614a87748e31996d4d
{ | ||
event: 'click', | ||
expressionFunction: 'visAugmenter.handlePointInTimeClick', | ||
}, |
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.
Recommend making the interaction handler an interface / typesafe. Also, expressionFunction
field could be renamed to just function
or something else, since it is not an expression function.
export const isPointInTimeView = (item: any) => { | ||
return item.datum.action === showEventsFlyoutAction; | ||
}; |
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.
not sure if you've played around much with the different scenarios, but what happens if user clicks at a blank space in the chart, or somewhere irrelevant within the canvas? (axes, legend, etc.). I'm assuming datum
would be empty, or action
within datum
would be empty, if clicking on other datapoints.
}; | ||
|
||
export const addPointInTimeInteractionHandlers = (spec: any) => { | ||
spec.interactionHandlers = [ |
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.
we can probably add this field as a nested field in kibana
, which is used in the vega parser to process things within the spec that aren't specific to vega itself. ref: opensearch-project#3145 (comment)
4fa4d70
to
3f4e1e1
Compare
Description
Adds small framework to allow adding event handlers on vega visualizations.
Check List
yarn test:jest
yarn test:jest_integration
yarn test:ftr