Skip to content

Commit

Permalink
Use vis' Data type instead of the custom graphData type. Depends on #112
Browse files Browse the repository at this point in the history
.
  • Loading branch information
notourist committed Apr 27, 2021
1 parent 434037a commit 5bc7e31
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
declare module "react-graph-vis" {
import { Network, NetworkEvents, Options, Node, Edge, DataSet } from "vis";
import { Network, NetworkEvents, Options, Node, Edge, DataSet, Data } from "vis";
import { Component } from "react";

export { Network, NetworkEvents, Options, Node, Edge, DataSet } from "vis";
export { Network, NetworkEvents, Options, Node, Edge, DataSet, Data } from "vis";

export type graphEvents = {
export type GraphEvents = {
[event in NetworkEvents]?: (params?: any) => void;
};

//Doesn't appear that this module supports passing in a vis.DataSet directly. Once it does graph can just use the Data object from vis.
export interface graphData {
nodes: Node[];
edges: Edge[];
}

export interface NetworkGraphProps {
graph: graphData;
graph: Data;
options?: Options;
events?: graphEvents;
events?: GraphEvents;
getNetwork?: (network: Network) => void;
identifier?: string;
style?: React.CSSProperties;
Expand Down

0 comments on commit 5bc7e31

Please sign in to comment.