@platforma-open/milaboratories.top-antibodies 4.2.2 → 4.3.0

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
@@ -13809,6 +13809,21 @@ function isProducedByLeadSelection(spec) {
13809
13809
  const trace = readAnnotationJson(spec, Annotation.Trace);
13810
13810
  return Array.isArray(trace) && trace.length > 0 && trace[trace.length - 1]?.type === LEAD_SELECTION_TRACE_TYPE;
13811
13811
  }
13812
+ /**
13813
+ * True when a column carries no readable value. Presence is the whole signal.
13814
+ *
13815
+ * Requires the annotation. Requires axes that are a subset of the anchor's. Axis identity
13816
+ * is name, type, domain and context-domain. An axis that differs in any of them is a
13817
+ * different axis. A column that carries one is not presence-only.
13818
+ *
13819
+ * `matchAxisId` accepts an extra domain key on the column axis. This check does not.
13820
+ * A column reached through a linker keeps its own axes and reads as not presence-only.
13821
+ */
13822
+ function isPresenceOnlyColumn(spec, anchorSpec) {
13823
+ if (spec.annotations?.[Annotation.IsSubset] !== "true") return false;
13824
+ const anchorAxes = new Set(anchorSpec.axesSpec.map(canonicalizeAxisId));
13825
+ return spec.axesSpec.every((axis) => anchorAxes.has(canonicalizeAxisId(axis)));
13826
+ }
13812
13827
  /** JS post-filter for the residual predicates that {@link discoveryExcludeSelectors}
13813
13828
  * can't express host-side: File value type (`File` is not a matchable `ValueType`)
13814
13829
  * and columns produced by a lead-selection block (last-trace-step check on parsed
@@ -13817,6 +13832,17 @@ function isSelectableMatch(c) {
13817
13832
  return !isProducedByLeadSelection(c.getSpec());
13818
13833
  }
13819
13834
  /**
13835
+ * Whether the ranking options include a discovered column.
13836
+ *
13837
+ * Presence-only columns carry nothing to order by. A column the saved ranking names stays
13838
+ * in the options. Dropping the last one resets the list to preset defaults.
13839
+ */
13840
+ function isRankableMatch(c, anchorSpec, rankedColumnIds) {
13841
+ if (!isSelectableMatch(c)) return false;
13842
+ if (rankedColumnIds.has(extractPObjectId(c.id))) return true;
13843
+ return !isPresenceOnlyColumn(c.getSpec(), anchorSpec);
13844
+ }
13845
+ /**
13820
13846
  * Collapses discovery results to one recipe per storage column, first hit wins.
13821
13847
  *
13822
13848
  * Restores the pre-migration shape of a discovery result. The old
@@ -14566,14 +14592,18 @@ const platforma$1 = BlockModelV3.create({
14566
14592
  }).getColumns()).filter(isSelectableMatch);
14567
14593
  const labels = deriveDistinctLabels(filterableMatches.map((c) => c.getSpec()), { includeNativeLabel: true });
14568
14594
  return {
14569
- options: filterableMatches.map((c, i) => ({
14570
- label: labels[i],
14571
- value: matchToColumnId(c, inputAnchor),
14572
- column: {
14573
- id: c.id,
14574
- spec: c.getSpec()
14575
- }
14576
- })),
14595
+ options: filterableMatches.map((c, i) => {
14596
+ const spec = c.getSpec();
14597
+ return {
14598
+ label: labels[i],
14599
+ value: matchToColumnId(c, inputAnchor),
14600
+ column: {
14601
+ id: c.id,
14602
+ spec
14603
+ },
14604
+ presenceOnly: isPresenceOnlyColumn(spec, result.anchorSpec)
14605
+ };
14606
+ }),
14577
14607
  defaults: result.meta.defaultFilters,
14578
14608
  inVivoDefaults: result.meta.inVivoDefaults.filters,
14579
14609
  inVitroDefaults: result.meta.inVitroDefaults.filters,
@@ -14583,10 +14613,11 @@ const platforma$1 = BlockModelV3.create({
14583
14613
  const inputAnchor = getInputAnchorRef(ctx.data);
14584
14614
  const result = buildCollection(inputAnchor);
14585
14615
  if (!result) return void 0;
14616
+ const rankedColumnIds = new Set(ctx.data.rankingOrder.flatMap((r) => r.value ? [r.value.column] : []));
14586
14617
  const rankableMatches = dedupByLeafId(result.collection.discover({
14587
14618
  anchors: { main: result.anchorSpec },
14588
14619
  exclude: [...discoveryExcludeSelectors(result.sampleAxisName), { type: "String" }]
14589
- }).getColumns()).filter(isSelectableMatch);
14620
+ }).getColumns()).filter((c) => isRankableMatch(c, result.anchorSpec, rankedColumnIds));
14590
14621
  const labels = deriveDistinctLabels(rankableMatches.map((c) => c.getSpec()), { includeNativeLabel: true });
14591
14622
  return {
14592
14623
  options: rankableMatches.map((c, i) => ({