-
-
Notifications
You must be signed in to change notification settings - Fork 374
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(TypeScript): rewrite Gephi parser into TypeScript (#39)
- Loading branch information
Showing
16 changed files
with
1,096 additions
and
227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
export declare type Id = number | string; | ||
export interface ColorObject { | ||
background: string; | ||
border: string; | ||
highlight: { | ||
background: string; | ||
border: string; | ||
}; | ||
hover: { | ||
background: string; | ||
border: string; | ||
}; | ||
} | ||
export interface GephiData { | ||
nodes: GephiNode[]; | ||
edges: GephiEdge[]; | ||
} | ||
export interface GephiParseOptions { | ||
fixed?: boolean; | ||
inheritColor?: boolean; | ||
parseColor?: boolean; | ||
} | ||
export interface GephiNode { | ||
id: Id; | ||
attributes?: { | ||
title?: string; | ||
}; | ||
color?: string; | ||
label?: string; | ||
size?: number; | ||
title?: string; | ||
x?: number; | ||
y?: number; | ||
} | ||
export interface GephiEdge { | ||
id: Id; | ||
source: Id; | ||
target: Id; | ||
attributes?: { | ||
title?: string; | ||
}; | ||
color?: string; | ||
label?: string; | ||
type?: string; | ||
} | ||
export interface VisData { | ||
nodes: VisNode[]; | ||
edges: VisEdge[]; | ||
} | ||
export interface VisNode { | ||
id: Id; | ||
fixed: boolean; | ||
color?: string | ColorObject; | ||
label?: string; | ||
size?: number; | ||
title?: string; | ||
x?: number; | ||
y?: number; | ||
attributes?: unknown; | ||
} | ||
export interface VisEdge { | ||
id: Id; | ||
from: Id; | ||
to: Id; | ||
arrows?: 'to'; | ||
color?: string; | ||
label?: string; | ||
title?: string; | ||
attributes?: unknown; | ||
} | ||
/** | ||
* Convert Gephi to Vis. | ||
* | ||
* @param gephiJSON - The parsed JSON data in Gephi format. | ||
* @param optionsObj - Additional options. | ||
* | ||
* @returns The converted data ready to be used in Vis. | ||
*/ | ||
export declare function parseGephi(gephiJSON: GephiData, optionsObj?: GephiParseOptions): VisData; | ||
//# sourceMappingURL=gephiParser.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.