tycho-components 0.1.0-SNAPSHOT-7 → 0.2.0-SNAPSHOT
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AppPicture/AppPicture.js +4 -3
- package/dist/Comments/CommentAdd.d.ts +1 -1
- package/dist/Comments/types/CommentService.d.ts +1 -1
- package/dist/Header/types/CorpusService.d.ts +1 -1
- package/dist/TreeView/TreeView.d.ts +11 -0
- package/dist/TreeView/TreeView.js +104 -0
- package/dist/TreeView/cytoscape/Configuration.d.ts +18 -0
- package/dist/TreeView/cytoscape/Configuration.js +22 -0
- package/dist/TreeView/cytoscape/CytoscapePositionCalculator.d.ts +10 -0
- package/dist/TreeView/cytoscape/CytoscapePositionCalculator.js +63 -0
- package/dist/TreeView/cytoscape/CytoscapeStylesheet.d.ts +2 -0
- package/dist/TreeView/cytoscape/CytoscapeStylesheet.js +104 -0
- package/dist/TreeView/cytoscape/CytoscapeTreeConverter.d.ts +29 -0
- package/dist/TreeView/cytoscape/CytoscapeTreeConverter.js +331 -0
- package/dist/TreeView/cytoscape/NodeBounds.d.ts +7 -0
- package/dist/TreeView/cytoscape/NodeBounds.js +1 -0
- package/dist/TreeView/cytoscape/NodeCalculation.d.ts +14 -0
- package/dist/TreeView/cytoscape/NodeCalculation.js +1 -0
- package/dist/TreeView/cytoscape/NormalizedPosition.d.ts +8 -0
- package/dist/TreeView/cytoscape/NormalizedPosition.js +13 -0
- package/dist/TreeView/cytoscape/SyntreesCytoscape.d.ts +6 -0
- package/dist/TreeView/cytoscape/SyntreesCytoscape.js +49 -0
- package/dist/TreeView/cytoscape/TreeLayout.d.ts +64 -0
- package/dist/TreeView/cytoscape/TreeLayout.js +353 -0
- package/dist/TreeView/index.d.ts +2 -0
- package/dist/TreeView/index.js +2 -0
- package/dist/TreeView/style.scss +36 -0
- package/dist/TreeView/types/TreeViewExample.d.ts +2 -0
- package/dist/TreeView/types/TreeViewExample.js +261 -0
- package/dist/configs/Localization.d.ts +195 -86
- package/dist/configs/Localization.js +12 -4
- package/dist/configs/localization/CommentsTexts.d.ts +31 -0
- package/dist/configs/localization/CommentsTexts.js +31 -0
- package/dist/configs/localization/ParticipantsTexts.d.ts +26 -0
- package/dist/configs/localization/ParticipantsTexts.js +26 -0
- package/dist/configs/localization/TreeTexts.d.ts +21 -0
- package/dist/configs/localization/TreeTexts.js +21 -0
- package/dist/configs/store/actions.d.ts +2 -2
- package/dist/configs/store/types.d.ts +2 -2
- package/dist/configs/types/Struct.d.ts +44 -0
- package/dist/configs/types/Struct.js +1 -0
- package/dist/configs/types/Tree.d.ts +12 -0
- package/dist/configs/types/Tree.js +1 -0
- package/dist/configs/useCorpusUtils.d.ts +1 -1
- package/dist/configs/useCorpusUtils.js +1 -1
- package/dist/configs/useLoggedUtils.d.ts +1 -1
- package/dist/configs/useLoggedUtils.js +1 -1
- package/dist/functions/SecurityUtils.d.ts +1 -1
- package/dist/functions/SecurityUtils.js +1 -1
- package/dist/functions/SentenceUtils.d.ts +6 -0
- package/dist/functions/SentenceUtils.js +32 -0
- package/dist/index.d.ts +9 -5
- package/dist/index.js +4 -2
- package/package.json +5 -1
- /package/dist/configs/{Corpus.d.ts → types/Corpus.d.ts} +0 -0
- /package/dist/configs/{Corpus.js → types/Corpus.js} +0 -0
- /package/dist/configs/{CorpusImage.d.ts → types/CorpusImage.d.ts} +0 -0
- /package/dist/configs/{CorpusImage.js → types/CorpusImage.js} +0 -0
- /package/dist/configs/{User.d.ts → types/User.d.ts} +0 -0
- /package/dist/configs/{User.js → types/User.js} +0 -0
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
import CytoscapePositionCalculator from './CytoscapePositionCalculator';
|
|
2
|
+
import TreeLayout from './TreeLayout';
|
|
3
|
+
class CytoscapeTreeConverter {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.ID_SPLITTER = '|';
|
|
6
|
+
this.extraInfo = false;
|
|
7
|
+
}
|
|
8
|
+
execute(struct, extraInfo) {
|
|
9
|
+
if (!this.validate(struct))
|
|
10
|
+
return undefined;
|
|
11
|
+
const tree = this.initTree(struct);
|
|
12
|
+
this.extraInfo = extraInfo;
|
|
13
|
+
this.inflate(tree, struct);
|
|
14
|
+
this.calculatePositions(tree);
|
|
15
|
+
return {
|
|
16
|
+
nodes: tree.nodes.map((n) => ({
|
|
17
|
+
data: n.data,
|
|
18
|
+
position: n.position,
|
|
19
|
+
id: n.id,
|
|
20
|
+
})),
|
|
21
|
+
edges: tree.edges,
|
|
22
|
+
root: {
|
|
23
|
+
data: tree.root.data,
|
|
24
|
+
position: tree.root.position,
|
|
25
|
+
id: tree.root.id,
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
getLabelLeaf(token) {
|
|
30
|
+
if (this.extraInfo && token.attributes) {
|
|
31
|
+
const attrLines = Object.values(token.attributes)
|
|
32
|
+
.map((v) => v)
|
|
33
|
+
.join('\n');
|
|
34
|
+
return `${token.v}\n${attrLines}`;
|
|
35
|
+
}
|
|
36
|
+
return token.v;
|
|
37
|
+
}
|
|
38
|
+
validate(struct) {
|
|
39
|
+
if (!struct.chunks || struct.chunks.length === 0)
|
|
40
|
+
return false;
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
calculatePositions(cytoscape) {
|
|
44
|
+
const converter = new CytoscapePositionCalculator();
|
|
45
|
+
const positions = converter.calculatePositions(cytoscape);
|
|
46
|
+
for (const node of cytoscape.nodes) {
|
|
47
|
+
const rect = positions.get(node.id);
|
|
48
|
+
if (!rect)
|
|
49
|
+
continue;
|
|
50
|
+
node.position = {
|
|
51
|
+
x: rect.x,
|
|
52
|
+
y: rect.y,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
this.checkLastTokenPosition(cytoscape.nodes);
|
|
57
|
+
}
|
|
58
|
+
catch (e) {
|
|
59
|
+
// do nothing
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
checkLastTokenPosition(nodes) {
|
|
63
|
+
const last = nodes[nodes.length - 1];
|
|
64
|
+
const penult = nodes[nodes.length - 2];
|
|
65
|
+
const antepenult = nodes[nodes.length - 3];
|
|
66
|
+
if (last.position?.x < antepenult.position?.x) {
|
|
67
|
+
last.position = {
|
|
68
|
+
y: last.position?.y,
|
|
69
|
+
x: antepenult.position?.x + TreeLayout.MIN_NODE_WIDTH,
|
|
70
|
+
};
|
|
71
|
+
penult.position = {
|
|
72
|
+
y: penult.position?.y,
|
|
73
|
+
x: antepenult.position?.x + TreeLayout.MIN_NODE_WIDTH,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
inflate(tree, struct) {
|
|
78
|
+
const chunks = struct.chunks.filter((c) => c.l !== 0);
|
|
79
|
+
for (const chunk of chunks) {
|
|
80
|
+
this.convertChunk(tree, struct, chunk);
|
|
81
|
+
this.removeTemporaryEdges(tree, struct, chunk);
|
|
82
|
+
}
|
|
83
|
+
struct.tokens
|
|
84
|
+
.filter((t) => t.ec)
|
|
85
|
+
.forEach((t) => {
|
|
86
|
+
const associated = struct.chunks.find((c) => this.isEmptyCategoryInChunk(c, t));
|
|
87
|
+
if (associated) {
|
|
88
|
+
this.convertEmptyCategory(tree, associated, t);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
isEmptyCategoryInChunk(chunk, token) {
|
|
93
|
+
if (chunk.l !== token.l)
|
|
94
|
+
return false;
|
|
95
|
+
if (token.p >= chunk.i && token.p <= chunk.f)
|
|
96
|
+
return true;
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
convertEmptyCategory(tree, chunk, token) {
|
|
100
|
+
const id = this.generateLeafId(token);
|
|
101
|
+
const node = {
|
|
102
|
+
id,
|
|
103
|
+
data: {
|
|
104
|
+
id,
|
|
105
|
+
empty: true,
|
|
106
|
+
leaf: true,
|
|
107
|
+
label: this.getLabelValue(token.v, token.coidx),
|
|
108
|
+
token,
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
tree.nodes.push(node);
|
|
112
|
+
const source = this.generateChunkId(chunk);
|
|
113
|
+
// adds empty attribute to the chunk
|
|
114
|
+
const nodeChunk = tree.nodes.find((n) => n.id === source);
|
|
115
|
+
if (nodeChunk)
|
|
116
|
+
nodeChunk.data.chunk.empty = true;
|
|
117
|
+
tree.edges.push({
|
|
118
|
+
data: {
|
|
119
|
+
id: this.uuid(),
|
|
120
|
+
source: source,
|
|
121
|
+
target: node.id,
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
convertChunk(tree, struct, chunk) {
|
|
126
|
+
const nodeId = this.generateChunkId(chunk);
|
|
127
|
+
tree.nodes.push({
|
|
128
|
+
id: nodeId,
|
|
129
|
+
data: {
|
|
130
|
+
id: nodeId,
|
|
131
|
+
label: this.getLabelValue(chunk.t, chunk.coidx),
|
|
132
|
+
chunk: { ...chunk },
|
|
133
|
+
},
|
|
134
|
+
});
|
|
135
|
+
const parent = this.findParent(struct, chunk);
|
|
136
|
+
if (!parent)
|
|
137
|
+
return;
|
|
138
|
+
const parentId = this.generateChunkId(parent);
|
|
139
|
+
tree.edges.push({
|
|
140
|
+
data: {
|
|
141
|
+
id: this.uuid(),
|
|
142
|
+
source: parentId,
|
|
143
|
+
target: nodeId,
|
|
144
|
+
},
|
|
145
|
+
});
|
|
146
|
+
const tokens = this.getTokens(struct, chunk);
|
|
147
|
+
for (const token of tokens) {
|
|
148
|
+
if (token.ec)
|
|
149
|
+
continue;
|
|
150
|
+
tree.edges.push({
|
|
151
|
+
data: {
|
|
152
|
+
id: this.uuid(),
|
|
153
|
+
source: nodeId,
|
|
154
|
+
target: this.generateTokenId(token),
|
|
155
|
+
},
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
removeTemporaryEdges(tree, struct, chunk) {
|
|
160
|
+
let levelCount = 1;
|
|
161
|
+
let leveledChunks = this.getChunksByLevel(struct, chunk, levelCount);
|
|
162
|
+
while (leveledChunks.length > 0) {
|
|
163
|
+
for (const upperChunk of leveledChunks) {
|
|
164
|
+
const upperChunkId = this.generateChunkId(upperChunk);
|
|
165
|
+
for (const token of this.getTokens(struct, chunk)) {
|
|
166
|
+
const tokenId = this.generateTokenId(token);
|
|
167
|
+
tree.edges = [
|
|
168
|
+
...tree.edges.filter((e) => !(e.data.source === upperChunkId && e.data.target === tokenId)),
|
|
169
|
+
];
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
leveledChunks = this.getChunksByLevel(struct, chunk, levelCount);
|
|
173
|
+
levelCount++;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
generateChunkId(chunk) {
|
|
177
|
+
return `${chunk.i}${this.ID_SPLITTER}${chunk.f}${this.ID_SPLITTER}${chunk.l}${this.ID_SPLITTER}${chunk.t}`;
|
|
178
|
+
}
|
|
179
|
+
generateTokenId(token) {
|
|
180
|
+
const sb = [];
|
|
181
|
+
if (token.p === null)
|
|
182
|
+
return '0';
|
|
183
|
+
sb.push(`${token.p}`);
|
|
184
|
+
if (token.idx) {
|
|
185
|
+
sb.push('-');
|
|
186
|
+
sb.push(`${token.idx}`);
|
|
187
|
+
}
|
|
188
|
+
if (token.t) {
|
|
189
|
+
sb.push('+');
|
|
190
|
+
sb.push(token.t);
|
|
191
|
+
}
|
|
192
|
+
return sb.join('');
|
|
193
|
+
}
|
|
194
|
+
generateLeafId(token) {
|
|
195
|
+
if (token.p === null)
|
|
196
|
+
return '0';
|
|
197
|
+
return `${token.p}`;
|
|
198
|
+
}
|
|
199
|
+
findParent(struct, chunk) {
|
|
200
|
+
const chunks = this.getChunksByLevel(struct, chunk, 1);
|
|
201
|
+
if (chunks.length === 0)
|
|
202
|
+
return null;
|
|
203
|
+
for (const parent of chunks) {
|
|
204
|
+
const tf = chunk.f;
|
|
205
|
+
const ti = chunk.i;
|
|
206
|
+
const ptf = parent.f;
|
|
207
|
+
const pti = parent.i;
|
|
208
|
+
if (tf <= ptf && ti >= pti)
|
|
209
|
+
return parent;
|
|
210
|
+
}
|
|
211
|
+
return null;
|
|
212
|
+
}
|
|
213
|
+
initTree(struct) {
|
|
214
|
+
this.sortChunks(struct);
|
|
215
|
+
const chunkRoot = struct.chunks.length === 1
|
|
216
|
+
? struct.chunks[0]
|
|
217
|
+
: struct.chunks.find((c) => c.l === 0);
|
|
218
|
+
if (!chunkRoot)
|
|
219
|
+
throw new Error('struct.root.notfound');
|
|
220
|
+
chunkRoot.l = 0;
|
|
221
|
+
const rootId = this.generateChunkId(chunkRoot);
|
|
222
|
+
const root = {
|
|
223
|
+
id: rootId,
|
|
224
|
+
data: {
|
|
225
|
+
id: rootId,
|
|
226
|
+
label: this.getLabelValue(chunkRoot.t, chunkRoot.coidx),
|
|
227
|
+
chunk: chunkRoot,
|
|
228
|
+
},
|
|
229
|
+
};
|
|
230
|
+
const tree = {
|
|
231
|
+
nodes: [root],
|
|
232
|
+
edges: [],
|
|
233
|
+
root,
|
|
234
|
+
};
|
|
235
|
+
for (let i = chunkRoot.i; i < chunkRoot.f + 1; i++) {
|
|
236
|
+
const token = struct.tokens.find((t) => t.p === i);
|
|
237
|
+
if (!token)
|
|
238
|
+
continue;
|
|
239
|
+
this.convertToken(tree, token);
|
|
240
|
+
}
|
|
241
|
+
return tree;
|
|
242
|
+
}
|
|
243
|
+
sortChunks(struct) {
|
|
244
|
+
struct.chunks.sort((chunk1, chunk2) => {
|
|
245
|
+
if (chunk1.l !== chunk2.l) {
|
|
246
|
+
return chunk1.l - chunk2.l;
|
|
247
|
+
}
|
|
248
|
+
if (chunk1.i !== chunk2.i) {
|
|
249
|
+
return chunk1.i - chunk2.i;
|
|
250
|
+
}
|
|
251
|
+
return chunk1.f - chunk2.f;
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
convertToken(tree, token) {
|
|
255
|
+
if (token.ec)
|
|
256
|
+
return;
|
|
257
|
+
let id = this.generateTokenId(token);
|
|
258
|
+
const tag = {
|
|
259
|
+
id,
|
|
260
|
+
data: {
|
|
261
|
+
id,
|
|
262
|
+
label: this.getLabelValue(token.t, token.coidx),
|
|
263
|
+
token: JSON.parse(JSON.stringify(token)),
|
|
264
|
+
},
|
|
265
|
+
};
|
|
266
|
+
tree.nodes.push(tag);
|
|
267
|
+
tree.edges.push({
|
|
268
|
+
data: {
|
|
269
|
+
id: this.uuid(),
|
|
270
|
+
source: tree.root.id,
|
|
271
|
+
target: tag.id,
|
|
272
|
+
},
|
|
273
|
+
});
|
|
274
|
+
id = this.generateLeafId(token);
|
|
275
|
+
const word = {
|
|
276
|
+
id,
|
|
277
|
+
data: {
|
|
278
|
+
id,
|
|
279
|
+
leaf: true,
|
|
280
|
+
label: this.getLabelLeaf(token),
|
|
281
|
+
token: JSON.parse(JSON.stringify(token)),
|
|
282
|
+
},
|
|
283
|
+
};
|
|
284
|
+
tree.nodes.push(word);
|
|
285
|
+
tree.edges.push({
|
|
286
|
+
data: {
|
|
287
|
+
id: this.uuid(),
|
|
288
|
+
source: tag.id,
|
|
289
|
+
target: word.id,
|
|
290
|
+
},
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
getTokens(struct, chunk) {
|
|
294
|
+
const ti = chunk.i;
|
|
295
|
+
const tf = chunk.f;
|
|
296
|
+
if (ti === null || tf === null || tf < ti)
|
|
297
|
+
return [];
|
|
298
|
+
const tokens = this.sortTokens(struct.tokens);
|
|
299
|
+
return tokens.slice(ti - 1, tf);
|
|
300
|
+
}
|
|
301
|
+
getLabelValue(value, coidx) {
|
|
302
|
+
let idxLabel = '';
|
|
303
|
+
if (coidx) {
|
|
304
|
+
for (const idx of coidx) {
|
|
305
|
+
idxLabel += `-${idx.toString()}`;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
return value ?? '' + idxLabel;
|
|
309
|
+
}
|
|
310
|
+
getChunksByLevel(struct, chunk, level) {
|
|
311
|
+
return struct.chunks.filter((c) => c.l === chunk.l - level);
|
|
312
|
+
}
|
|
313
|
+
sortTokens(tokens) {
|
|
314
|
+
return tokens
|
|
315
|
+
.slice() // Create a shallow copy to avoid modifying the original array
|
|
316
|
+
.sort((o1, o2) => {
|
|
317
|
+
if (o1.p === null || o2.p === null)
|
|
318
|
+
return -1;
|
|
319
|
+
return o1.p - o2.p;
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
uuid() {
|
|
323
|
+
return 'xxxxxxxx'.replace(/[xy]/g, (c) => {
|
|
324
|
+
/* eslint-disable */
|
|
325
|
+
const r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
|
|
326
|
+
/* eslint-enable */
|
|
327
|
+
return v.toString(16);
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
export default CytoscapeTreeConverter;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { EdgeDefinition, NodeDataDefinition, Position } from 'cytoscape';
|
|
2
|
+
export type CytoscapeTreeCalculation = {
|
|
3
|
+
nodes: NodeCalculation[];
|
|
4
|
+
edges: EdgeDefinition[];
|
|
5
|
+
root: NodeCalculation;
|
|
6
|
+
};
|
|
7
|
+
type NodeCalculation = {
|
|
8
|
+
id: string;
|
|
9
|
+
data: NodeDataDefinition;
|
|
10
|
+
position?: Position;
|
|
11
|
+
parent?: NodeCalculation;
|
|
12
|
+
children?: NodeCalculation[];
|
|
13
|
+
};
|
|
14
|
+
export default NodeCalculation;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
class NormalizedPosition {
|
|
2
|
+
constructor(xRelativeToRoot, yRelativeToRoot) {
|
|
3
|
+
this.xRelativeToRoot = xRelativeToRoot;
|
|
4
|
+
this.yRelativeToRoot = yRelativeToRoot;
|
|
5
|
+
}
|
|
6
|
+
getX(boundsLeft) {
|
|
7
|
+
return this.xRelativeToRoot - boundsLeft;
|
|
8
|
+
}
|
|
9
|
+
getY(boundsTop) {
|
|
10
|
+
return this.yRelativeToRoot - boundsTop;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export default NormalizedPosition;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import cytoscape from 'cytoscape';
|
|
2
|
+
import stylesheet from './CytoscapeStylesheet';
|
|
3
|
+
const init = (selector, tree, onReady) => {
|
|
4
|
+
destroy(selector);
|
|
5
|
+
const cy = cytoscape({
|
|
6
|
+
container: document.getElementById(selector),
|
|
7
|
+
layout: { name: 'preset' },
|
|
8
|
+
elements: { nodes: tree.nodes || [], edges: tree.edges || [] },
|
|
9
|
+
style: stylesheet,
|
|
10
|
+
zoom: 2,
|
|
11
|
+
pan: tree.pan || { x: 100, y: 100 },
|
|
12
|
+
minZoom: 1e-50,
|
|
13
|
+
maxZoom: 1e50,
|
|
14
|
+
zoomingEnabled: true,
|
|
15
|
+
userZoomingEnabled: true,
|
|
16
|
+
userPanningEnabled: true,
|
|
17
|
+
boxSelectionEnabled: true,
|
|
18
|
+
selectionType: 'single',
|
|
19
|
+
touchTapThreshold: 8,
|
|
20
|
+
desktopTapThreshold: 4,
|
|
21
|
+
autolock: false,
|
|
22
|
+
autoungrabify: true,
|
|
23
|
+
autounselectify: false,
|
|
24
|
+
headless: false,
|
|
25
|
+
styleEnabled: true,
|
|
26
|
+
hideEdgesOnViewport: false,
|
|
27
|
+
hideLabelsOnViewport: false,
|
|
28
|
+
textureOnViewport: false,
|
|
29
|
+
motionBlur: false,
|
|
30
|
+
motionBlurOpacity: 0.2,
|
|
31
|
+
wheelSensitivity: 0.3,
|
|
32
|
+
pixelRatio: 1,
|
|
33
|
+
});
|
|
34
|
+
cy.ready(() => {
|
|
35
|
+
cy.fit();
|
|
36
|
+
cy.center();
|
|
37
|
+
onReady && onReady(cy);
|
|
38
|
+
});
|
|
39
|
+
return cy;
|
|
40
|
+
};
|
|
41
|
+
const destroy = (selector) => {
|
|
42
|
+
const el = document.getElementById(selector);
|
|
43
|
+
if (el)
|
|
44
|
+
el.innerHTML = '';
|
|
45
|
+
};
|
|
46
|
+
const SyntreesCytoscape = {
|
|
47
|
+
init,
|
|
48
|
+
};
|
|
49
|
+
export default SyntreesCytoscape;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import NodeBounds from './NodeBounds';
|
|
2
|
+
import NodeCalculation from './NodeCalculation';
|
|
3
|
+
declare class TreeLayout {
|
|
4
|
+
static MIN_NODE_WIDTH: number;
|
|
5
|
+
static MIN_NODE_HEIGHT: number;
|
|
6
|
+
private configuration;
|
|
7
|
+
private boundsLeft;
|
|
8
|
+
private boundsTop;
|
|
9
|
+
private boundsRight;
|
|
10
|
+
private boundsBottom;
|
|
11
|
+
private sizeOfLevel;
|
|
12
|
+
private nodeBounds;
|
|
13
|
+
private mod;
|
|
14
|
+
private thread;
|
|
15
|
+
private prelim;
|
|
16
|
+
private change;
|
|
17
|
+
private shift;
|
|
18
|
+
private ancestor;
|
|
19
|
+
private number;
|
|
20
|
+
private positions;
|
|
21
|
+
constructor(root: NodeCalculation);
|
|
22
|
+
getNodeBounds(): Map<string, NodeBounds>;
|
|
23
|
+
private getSizeOfLevel;
|
|
24
|
+
private getMod;
|
|
25
|
+
private setMod;
|
|
26
|
+
private getThread;
|
|
27
|
+
private setThread;
|
|
28
|
+
private getAncestor;
|
|
29
|
+
private setAncestor;
|
|
30
|
+
private getPrelim;
|
|
31
|
+
private setPrelim;
|
|
32
|
+
private getChange;
|
|
33
|
+
private setChange;
|
|
34
|
+
private getShift;
|
|
35
|
+
private setShift;
|
|
36
|
+
private getDistance;
|
|
37
|
+
private nextLeft;
|
|
38
|
+
private nextRight;
|
|
39
|
+
private getNumber;
|
|
40
|
+
private getChildren;
|
|
41
|
+
private detectAncestor;
|
|
42
|
+
private moveSubtree;
|
|
43
|
+
private apportion;
|
|
44
|
+
private executeShifts;
|
|
45
|
+
private cloneMap;
|
|
46
|
+
private firstWalk;
|
|
47
|
+
private secondWalk;
|
|
48
|
+
private getNodeHeight;
|
|
49
|
+
private getNodeWidth;
|
|
50
|
+
private getWidthOrHeightOfNode;
|
|
51
|
+
private getNodeThickness;
|
|
52
|
+
private getNodeSize;
|
|
53
|
+
private isLevelChangeInYAxis;
|
|
54
|
+
private getLevelChangeSign;
|
|
55
|
+
private updateBounds;
|
|
56
|
+
private calcSizeOfLevels;
|
|
57
|
+
private getLevelCount;
|
|
58
|
+
private isLeaf;
|
|
59
|
+
private isChildOfParent;
|
|
60
|
+
private getChildrenReverse;
|
|
61
|
+
private getFirstChild;
|
|
62
|
+
private getLastChild;
|
|
63
|
+
}
|
|
64
|
+
export default TreeLayout;
|