🤖 Merge PR #44866 react-d3-graph: Add onClickGraph GraphEventCallbacks interface by @santina

* Add onClickGraph GraphEventCallbacks interface

* Modify test
This commit is contained in:
Santina Lin 2020-05-22 08:08:34 -07:00 committed by GitHub
parent 391b3b74a0
commit 7df1c11046
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -114,6 +114,7 @@ export interface GraphData<N extends GraphNode, L extends GraphLink> {
}
export interface GraphEventCallbacks {
onClickGraph: (event: MouseEvent) => void;
onClickNode: (nodeId: string) => void;
onDoubleClickNode: (nodeId: string) => void;
onRightClickNode: (event: MouseEvent, nodeId: string) => void;

View File

@ -6,6 +6,7 @@ export class Example extends React.Component {
return (
<div>
<Graph
onClickGraph={() => {}}
id="test"
data={{
nodes: [