tycho-components 0.28.3 → 0.28.5
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.
|
@@ -179,6 +179,10 @@ export default class CytoscapeTreeConverter {
|
|
|
179
179
|
return (dominator !== null &&
|
|
180
180
|
this.generateChunkId(dominator) === this.generateChunkId(chunk));
|
|
181
181
|
}
|
|
182
|
+
const tightestDominator = this.findTightestContainingChunk(struct, token.p, token.p);
|
|
183
|
+
if (tightestDominator !== null) {
|
|
184
|
+
return (this.generateChunkId(tightestDominator) === this.generateChunkId(chunk));
|
|
185
|
+
}
|
|
182
186
|
if (token.l !== chunk.l)
|
|
183
187
|
return false;
|
|
184
188
|
const dominator = this.tightestChunk(this.findContainingChunks(struct, chunk.l, token.p, token.p));
|
|
@@ -241,7 +245,13 @@ export default class CytoscapeTreeConverter {
|
|
|
241
245
|
return struct.chunks.filter((c) => c.l === level && i >= c.i && f <= c.f);
|
|
242
246
|
}
|
|
243
247
|
findTightestContainingChunk(struct, i, f, minLevel = 1) {
|
|
244
|
-
return this.tightestChunk(struct.chunks.filter((c) => c.l >= minLevel &&
|
|
248
|
+
return this.tightestChunk(struct.chunks.filter((c) => c.l >= minLevel &&
|
|
249
|
+
i >= c.i &&
|
|
250
|
+
f <= c.f &&
|
|
251
|
+
!this.isXpScaffoldChunk(c)));
|
|
252
|
+
}
|
|
253
|
+
isXpScaffoldChunk(chunk) {
|
|
254
|
+
return chunk.t === '*XP*';
|
|
245
255
|
}
|
|
246
256
|
tightestChunk(chunks) {
|
|
247
257
|
if (chunks.length === 0)
|
|
@@ -253,6 +263,13 @@ export default class CytoscapeTreeConverter {
|
|
|
253
263
|
return c;
|
|
254
264
|
if (span > bestSpan)
|
|
255
265
|
return best;
|
|
266
|
+
if (c.l != null && best.l != null && c.l !== best.l) {
|
|
267
|
+
return c.l > best.l ? c : best;
|
|
268
|
+
}
|
|
269
|
+
if (this.isXpScaffoldChunk(c) && !this.isXpScaffoldChunk(best))
|
|
270
|
+
return best;
|
|
271
|
+
if (!this.isXpScaffoldChunk(c) && this.isXpScaffoldChunk(best))
|
|
272
|
+
return c;
|
|
256
273
|
return c.i > best.i ? c : best;
|
|
257
274
|
});
|
|
258
275
|
}
|