-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
140 lines (127 loc) · 3.05 KB
/
types.ts
File metadata and controls
140 lines (127 loc) · 3.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
import {
ColumnTypes, Table, TableRow, UserSpec,
} from 'multinet';
import { Provenance } from '@visdesignlab/trrack';
export interface Dimensions {
height: number;
width: number;
}
export interface Node extends TableRow {
type: string;
neighbors: string[];
degreeCount: number;
children?: Node[];
parentPosition?: number;
[propName: string]: unknown;
}
export interface Edge extends TableRow {
_from: string;
_to: string;
[propName: string]: unknown;
}
export interface Network {
nodes: Node[];
edges: Edge[];
}
export interface Cell {
x: number;
y: number;
z: number;
spark: number[];
rowCellType: string;
colCellType: string;
rowID: string;
colID: string;
cellName: string;
correspondingCell: string;
}
export interface ConnectivityCell {
x: number;
y: number;
z: number;
startingNode: string;
endingNode: string;
cellName: string;
nodePosition: number;
paths: number[];
label: string;
keys: string[];
}
export interface LoadError {
message: string;
href: string;
}
export interface ArangoAttributes {
[key: string]: unknown[];
}
export interface ArangoPath {
vertices: Node[];
edges: Edge[];
}
export interface SlicedNetwork {
network: Network;
slice: number;
time: number[] | Date[];
category: string;
}
export interface State {
workspaceName: string | null;
networkName: string | null;
networkOnLoad: Network | null;
slicedNetwork: SlicedNetwork[];
network: Network | null;
loadError: LoadError;
userInfo: UserSpec | null;
cellSize: number;
selectedNodes: Set<string>;
selectedCell: string | null;
hoveredNodes: string[];
sortOrder: number[];
directionalEdges: boolean;
selectNeighbors: boolean;
showGridLines: boolean;
aggregated: boolean;
maxConnections: {
unAggr: number;
parent: number;
};
provenance: Provenance<State, ProvenanceEventTypes, unknown> | null;
showProvenanceVis: boolean;
nodeAttributes: ArangoAttributes;
edgeAttributes: ArangoAttributes;
showIntNodeVis: boolean;
connectivityMatrixPaths: {nodes: Node[]; paths: ArangoPath[]};
selectedConnectivityPaths: ArangoPath[];
showPathTable: boolean;
maxIntConnections: number;
intAggregatedBy: string | undefined;
networkTables: Table[];
columnTypes: { [tableName: string]: ColumnTypes } | null;
labelVariable: string | undefined;
rightClickMenu: {
show: boolean;
top: number;
left: number;
};
isDate: boolean;
controlsWidth: number;
selectedHops: number;
nodeDegreeDict: { [key: string]: number };
maxDegree: number;
networkPreFilter: Network | null;
queriedNetwork: boolean;
filteredNetwork: boolean;
lineupIsNested: boolean;
}
export type ProvenanceEventTypes =
'Set Select Neighbors' |
'Set Show Grid Lines' |
'Set Directional Edges' |
'Select Cell' |
'De-Select Cell' |
'Select Node(s)' |
'De-select Node(s)' |
'Clear Selection' |
'Set Label Variable';
export const internalFieldNames = ['_from', '_to', '_id', '_rev', '_key', 'neighbors', 'children'] as const;
export type InternalField = (typeof internalFieldNames)[number];