Skip to content

Commit abce26e

Browse files
committed
move vis stuff to its own place
1 parent 291eef5 commit abce26e

File tree

2 files changed

+23
-26
lines changed

2 files changed

+23
-26
lines changed

src/techGraphRender.ts

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,29 @@
11
import * as vis from "vis-network/standalone";
2-
import { TechTemplate, VisNode, VisEdge, VisData, TemplateData } from './types';
2+
import { TechTemplate, TemplateData } from './types';
33
import { TechDb } from './utils/TechDb';
44

5-
// Types for vis-network internal structures
5+
export interface VisNode {
6+
label: string;
7+
id: string;
8+
shape: string;
9+
image: string;
10+
level: number;
11+
color: {
12+
border: string;
13+
};
14+
}
15+
16+
export interface VisEdge {
17+
id?: string;
18+
from: string;
19+
to: string;
20+
}
21+
22+
export interface VisData {
23+
nodes: vis.DataSet<VisNode>;
24+
edges: vis.DataSet<vis.Edge>;
25+
}
26+
627
interface VisNetworkNode {
728
id: string;
829
x: number;

src/types/index.ts

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import * as vis from "vis-network/standalone";
2-
31
// Basic data types
42
export interface LocalizationEntry {
53
[field: string]: string | { [faction: string]: string };
@@ -182,28 +180,6 @@ export interface ResourceGranted {
182180
value: number;
183181
}
184182

185-
export interface VisNode {
186-
label: string;
187-
id: string;
188-
shape: string;
189-
image: string;
190-
level: number;
191-
color: {
192-
border: string;
193-
};
194-
}
195-
196-
export interface VisEdge {
197-
id?: string;
198-
from: string;
199-
to: string;
200-
}
201-
202-
export interface VisData {
203-
nodes: vis.DataSet<VisNode>;
204-
edges: vis.DataSet<vis.Edge>;
205-
}
206-
207183
export interface ModuleTemplate {
208184
dataName: string;
209185
requiredProjectName?: string;

0 commit comments

Comments
 (0)