-
Notifications
You must be signed in to change notification settings - Fork 114
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
Introduce onActionCallback
prop in Kedro-Viz react component
#2027
Conversation
Signed-off-by: Jitendra Gundaniya <[email protected]>
Signed-off-by: Jitendra Gundaniya <[email protected]>
Signed-off-by: Jitendra Gundaniya <[email protected]>
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.
hey generally the PR is looking pretty good and simple, thank you @jitu5 . My first thought would be what happens if we introduce another callback? eg: for slicing, run command etc. Would it be better to have a group for all the callback? Let me know your thought
<KedroViz
data={data}
options={...}
callbacks={
onNodeClick={(node) => {
console.log('Node clicked:', node);
}}
onRunCommandClick={(runCommand) => ...}
}
/>
Signed-off-by: Jitendra Gundaniya <[email protected]>
Signed-off-by: Jitendra Gundaniya <[email protected]>
onNodeClickCallback
prop in Kedro-Viz react componentonActionCallback
prop in Kedro-Viz react component
@Huongg I made changes to accept any event or action if we want to use a callback, as shown below.
Below is the action format, which will be pass as argument to call back function
|
# Conflicts: # RELEASE.md
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.
Look's great!. thanks @jitu5
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.
thanks for the update @jitu5 . looks good to me too
Signed-off-by: Jitendra Gundaniya <[email protected]>
Description
Resolves #2022
This PR addresses a requirement for users of Kedro-Viz as a React component in embedded mode. It allows displaying node metadata in a custom UI. Additionally, it supports the VSCode extension use case where clicking on a node passes the node data to the extension to open the relevant file.
Below is the action format, which will be pass as argument to call back function
Note: We can not put
onNodeClickCallback
under aoptions
prop asonActionCallback
is a callback function and options are Redux state, it should only contain plain JavaScript objects, arrays, and primitives.Development notes
configureStore
in App.jscreateCallbackMiddleware
TOGGLE_NODE_CLICKED
action intercept in middleware, using clicked node id andstate.graph.nodes
entire node object is pass as an argument to callback.QA notes
You can test new prop in src/components/container.js as is the entry point or top level component for a standalone use case.
Checklist
RELEASE.md
file