tycho-components 0.28.4 → 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.
@@ -21,6 +21,7 @@ export default class CytoscapeTreeConverter {
21
21
  private findParent;
22
22
  private findContainingChunks;
23
23
  private findTightestContainingChunk;
24
+ private isXpScaffoldChunk;
24
25
  private tightestChunk;
25
26
  private initTree;
26
27
  private sortChunks;
@@ -245,7 +245,13 @@ export default class CytoscapeTreeConverter {
245
245
  return struct.chunks.filter((c) => c.l === level && i >= c.i && f <= c.f);
246
246
  }
247
247
  findTightestContainingChunk(struct, i, f, minLevel = 1) {
248
- return this.tightestChunk(struct.chunks.filter((c) => c.l >= minLevel && i >= c.i && f <= c.f));
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*';
249
255
  }
250
256
  tightestChunk(chunks) {
251
257
  if (chunks.length === 0)
@@ -257,6 +263,13 @@ export default class CytoscapeTreeConverter {
257
263
  return c;
258
264
  if (span > bestSpan)
259
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;
260
273
  return c.i > best.i ? c : best;
261
274
  });
262
275
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tycho-components",
3
3
  "private": false,
4
- "version": "0.28.4",
4
+ "version": "0.28.5",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {