gramene-search 2.17.0 → 2.18.1

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/index.js CHANGED
@@ -7422,18 +7422,33 @@ function $541b8b0d8c5501d2$var$logAction(sugg) {
7422
7422
  label: sugg.name
7423
7423
  });
7424
7424
  }
7425
+ // The species label under a suggestion. Returns '' rather than throwing when the
7426
+ // taxonomy can't explain a taxon: this runs during render, so anything thrown here
7427
+ // takes down the whole suggestions panel and the search box looks broken.
7428
+ //
7429
+ // That is not hypothetical. `grameneTaxonomy` is persisted with a 24h staleAfter, so
7430
+ // after a data release adds genomes — v11 added 4558118/4558119/4558120 — every
7431
+ // browser still holding the previous release's taxonomy has suggestions referencing
7432
+ // taxa it has never heard of. Broad queries ("kinase", "sb") hit all three.
7425
7433
  function $541b8b0d8c5501d2$var$getLowestCommonAncestorName(tids, taxonomy) {
7434
+ if (!Array.isArray(tids) || !taxonomy) return '';
7426
7435
  let lca;
7427
7436
  tids.forEach((tid)=>{
7437
+ const node = taxonomy[tid];
7438
+ if (!node || !Array.isArray(node.ancestors)) return; // unknown taxon: ignore it
7428
7439
  if (!lca) lca = [
7429
- ...taxonomy[tid].ancestors
7440
+ ...node.ancestors
7430
7441
  ];
7431
7442
  else {
7432
- let ancestors = new Set(taxonomy[tid].ancestors);
7433
- while(!ancestors.has(lca[0]))lca.shift();
7443
+ let ancestors = new Set(node.ancestors);
7444
+ // `lca.length &&` matters: with no ancestor in common this shifted an empty
7445
+ // array forever, since ancestors.has(undefined) is never true.
7446
+ while(lca.length && !ancestors.has(lca[0]))lca.shift();
7434
7447
  }
7435
7448
  });
7436
- return taxonomy[lca[0]].short_name;
7449
+ if (!lca || !lca.length) return '';
7450
+ const root = taxonomy[lca[0]];
7451
+ return root ? root.short_name : '';
7437
7452
  }
7438
7453
  const $541b8b0d8c5501d2$var$TryPan = (props)=>{
7439
7454
  const query = props.query;
@@ -8999,6 +9014,7 @@ class $64fad37f770d2bfe$var$Homology extends (0, ($parcel$interopDefault($gXNCa$
8999
9014
  nodeOfInterest: this.gene._id,
9000
9015
  viewState: effectiveVS,
9001
9016
  onViewStateChange: onViewStateChange,
9017
+ densityControls: true,
9002
9018
  defaultOpenSections: {
9003
9019
  zones: true,
9004
9020
  search: true
@@ -20030,6 +20046,7 @@ const $15504f5eba8e73bd$var$TaxDistTbrowse = (props)=>{
20030
20046
  showHeader: true,
20031
20047
  rowHeight: 14,
20032
20048
  fontSize: 10,
20049
+ densityControls: true,
20033
20050
  autoHeight: true,
20034
20051
  defaultOpenSections: {
20035
20052
  search: true,