@platforma-sdk/model 1.69.0 → 1.71.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/columns/column_collection_builder.cjs +1 -4
- package/dist/columns/column_collection_builder.cjs.map +1 -1
- package/dist/columns/column_collection_builder.d.ts +0 -2
- package/dist/columns/column_collection_builder.d.ts.map +1 -1
- package/dist/columns/column_collection_builder.js +1 -4
- package/dist/columns/column_collection_builder.js.map +1 -1
- package/dist/columns/column_snapshot_provider.cjs +26 -2
- package/dist/columns/column_snapshot_provider.cjs.map +1 -1
- package/dist/columns/column_snapshot_provider.d.ts +2 -1
- package/dist/columns/column_snapshot_provider.d.ts.map +1 -1
- package/dist/columns/column_snapshot_provider.js +25 -2
- package/dist/columns/column_snapshot_provider.js.map +1 -1
- package/dist/columns/ctx_column_sources.cjs +5 -8
- package/dist/columns/ctx_column_sources.cjs.map +1 -1
- package/dist/columns/ctx_column_sources.d.ts +4 -7
- package/dist/columns/ctx_column_sources.d.ts.map +1 -1
- package/dist/columns/ctx_column_sources.js +5 -8
- package/dist/columns/ctx_column_sources.js.map +1 -1
- package/dist/components/PlDataTable/createPlDataTable/createPlDataTableV3.cjs +41 -24
- package/dist/components/PlDataTable/createPlDataTable/createPlDataTableV3.cjs.map +1 -1
- package/dist/components/PlDataTable/createPlDataTable/createPlDataTableV3.d.ts.map +1 -1
- package/dist/components/PlDataTable/createPlDataTable/createPlDataTableV3.js +42 -25
- package/dist/components/PlDataTable/createPlDataTable/createPlDataTableV3.js.map +1 -1
- package/dist/components/PlDataTable/createPlDataTable/discoverColumns.cjs +1 -2
- package/dist/components/PlDataTable/createPlDataTable/discoverColumns.cjs.map +1 -1
- package/dist/components/PlDataTable/createPlDataTable/discoverColumns.js +1 -2
- package/dist/components/PlDataTable/createPlDataTable/discoverColumns.js.map +1 -1
- package/dist/components/PlDataTable/createPlDataTable/utils.cjs +16 -4
- package/dist/components/PlDataTable/createPlDataTable/utils.cjs.map +1 -1
- package/dist/components/PlDataTable/createPlDataTable/utils.js +16 -5
- package/dist/components/PlDataTable/createPlDataTable/utils.js.map +1 -1
- package/dist/components/PlDatasetSelector/build_dataset_options.cjs +23 -11
- package/dist/components/PlDatasetSelector/build_dataset_options.cjs.map +1 -1
- package/dist/components/PlDatasetSelector/build_dataset_options.d.ts +9 -2
- package/dist/components/PlDatasetSelector/build_dataset_options.d.ts.map +1 -1
- package/dist/components/PlDatasetSelector/build_dataset_options.js +22 -11
- package/dist/components/PlDatasetSelector/build_dataset_options.js.map +1 -1
- package/dist/components/PlDatasetSelector/dataset_selection.cjs +20 -0
- package/dist/components/PlDatasetSelector/dataset_selection.cjs.map +1 -0
- package/dist/components/PlDatasetSelector/dataset_selection.d.ts +23 -0
- package/dist/components/PlDatasetSelector/dataset_selection.d.ts.map +1 -0
- package/dist/components/PlDatasetSelector/dataset_selection.js +19 -0
- package/dist/components/PlDatasetSelector/dataset_selection.js.map +1 -0
- package/dist/components/PlDatasetSelector/enrichment_discovery.cjs +75 -0
- package/dist/components/PlDatasetSelector/enrichment_discovery.cjs.map +1 -0
- package/dist/components/PlDatasetSelector/enrichment_discovery.js +73 -0
- package/dist/components/PlDatasetSelector/enrichment_discovery.js.map +1 -0
- package/dist/components/PlDatasetSelector/index.cjs +1 -0
- package/dist/components/PlDatasetSelector/index.d.ts +1 -0
- package/dist/components/PlDatasetSelector/index.js +1 -0
- package/dist/components/index.cjs +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/index.cjs +3 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/labels/derive_distinct_tooltips.cjs +0 -3
- package/dist/labels/derive_distinct_tooltips.cjs.map +1 -1
- package/dist/labels/derive_distinct_tooltips.js +0 -3
- package/dist/labels/derive_distinct_tooltips.js.map +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.js +1 -1
- package/dist/render/api.cjs +3 -14
- package/dist/render/api.cjs.map +1 -1
- package/dist/render/api.d.ts.map +1 -1
- package/dist/render/api.js +4 -15
- package/dist/render/api.js.map +1 -1
- package/dist/render/index.cjs +1 -1
- package/dist/render/index.js +1 -1
- package/package.json +9 -9
- package/src/columns/column_collection_builder.ts +0 -3
- package/src/columns/column_snapshot_provider.ts +30 -14
- package/src/columns/ctx_column_sources.ts +6 -12
- package/src/components/PlDataTable/createPlDataTable/createPlDataTableV3.ts +58 -44
- package/src/components/PlDataTable/createPlDataTable/discoverColumns.ts +0 -1
- package/src/components/PlDataTable/createPlDataTable/utils.ts +25 -3
- package/src/components/PlDatasetSelector/build_dataset_options.ts +48 -17
- package/src/components/PlDatasetSelector/dataset_selection.ts +37 -0
- package/src/components/PlDatasetSelector/enrichment_discovery.ts +111 -0
- package/src/components/PlDatasetSelector/index.ts +1 -0
- package/src/labels/derive_distinct_tooltips.test.ts +6 -16
- package/src/labels/derive_distinct_tooltips.ts +0 -3
- package/src/render/api.ts +5 -17
|
@@ -34,12 +34,8 @@ function linkerSnapshot(name: string, label?: string): ColumnSnapshot<PObjectId>
|
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
function pathStep(
|
|
38
|
-
|
|
39
|
-
qualifications: AxisQualification[],
|
|
40
|
-
label?: string,
|
|
41
|
-
): MatchVariant["path"][number] {
|
|
42
|
-
return { linker: linkerSnapshot(linkerName, label), qualifications };
|
|
37
|
+
function pathStep(linkerName: string, label?: string): MatchVariant["path"][number] {
|
|
38
|
+
return { linker: linkerSnapshot(linkerName, label) };
|
|
43
39
|
}
|
|
44
40
|
|
|
45
41
|
describe("deriveDistinctTooltips", () => {
|
|
@@ -63,16 +59,13 @@ describe("deriveDistinctTooltips", () => {
|
|
|
63
59
|
const entries: TooltipEntry[] = [
|
|
64
60
|
{
|
|
65
61
|
spec: createSpec("hit_col", "Hit Col"),
|
|
66
|
-
linkerPath: [
|
|
67
|
-
pathStep("linker_a", [axisQualification("sample", { batch: "A" })], "Linker A"),
|
|
68
|
-
],
|
|
62
|
+
linkerPath: [pathStep("linker_a", "Linker A")],
|
|
69
63
|
},
|
|
70
64
|
];
|
|
71
65
|
const [tooltip] = deriveDistinctTooltips(entries);
|
|
72
66
|
expect(tooltip).toBeDefined();
|
|
73
67
|
expect(tooltip).toContain("Origin path");
|
|
74
68
|
expect(tooltip).toContain("linker 1: Linker A");
|
|
75
|
-
expect(tooltip).toContain("qualifies: sample context: batch=A");
|
|
76
69
|
expect(tooltip).toContain("hit column: Hit Col");
|
|
77
70
|
});
|
|
78
71
|
|
|
@@ -146,7 +139,7 @@ describe("deriveDistinctTooltips", () => {
|
|
|
146
139
|
{
|
|
147
140
|
spec: createSpec("col1", "Col 1"),
|
|
148
141
|
qualifications: { forQueries: {}, forHit: [] },
|
|
149
|
-
linkerPath: [pathStep("linker_a",
|
|
142
|
+
linkerPath: [pathStep("linker_a", "Linker A")],
|
|
150
143
|
},
|
|
151
144
|
];
|
|
152
145
|
const [tooltip] = deriveDistinctTooltips(entries);
|
|
@@ -157,10 +150,7 @@ describe("deriveDistinctTooltips", () => {
|
|
|
157
150
|
const entries: TooltipEntry[] = [
|
|
158
151
|
{
|
|
159
152
|
spec: createSpec("hit_col", "Hit Col"),
|
|
160
|
-
linkerPath: [
|
|
161
|
-
pathStep("linker_a", [], "Linker A"),
|
|
162
|
-
pathStep("linker_b", [axisQualification("sample", { batch: "B" })], "Linker B"),
|
|
163
|
-
],
|
|
153
|
+
linkerPath: [pathStep("linker_a", "Linker A"), pathStep("linker_b", "Linker B")],
|
|
164
154
|
},
|
|
165
155
|
];
|
|
166
156
|
const [tooltip] = deriveDistinctTooltips(entries);
|
|
@@ -174,7 +164,7 @@ describe("deriveDistinctTooltips", () => {
|
|
|
174
164
|
spec: createSpec("hit_col", "Hit"),
|
|
175
165
|
variantIndex: 2,
|
|
176
166
|
variantCount: 2,
|
|
177
|
-
linkerPath: [pathStep("linker_a",
|
|
167
|
+
linkerPath: [pathStep("linker_a", "LA")],
|
|
178
168
|
qualifications: {
|
|
179
169
|
forQueries: { ["main" as PObjectId]: [axisQualification("sample", { batch: "B" })] },
|
|
180
170
|
forHit: [axisQualification("sample", { batch: "B" })],
|
|
@@ -46,7 +46,6 @@ function formatTooltip(entry: TooltipEntry): undefined | string {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
const BULLET_1 = " • ";
|
|
49
|
-
const SUB_BULLET = " ";
|
|
50
49
|
|
|
51
50
|
function formatHeader(entry: TooltipEntry): undefined | string {
|
|
52
51
|
const lines: string[] = [];
|
|
@@ -67,8 +66,6 @@ function formatOriginPath(entry: TooltipEntry): undefined | string {
|
|
|
67
66
|
readAnnotation(step.linker.spec, Annotation.Label) ??
|
|
68
67
|
step.linker.spec.name;
|
|
69
68
|
lines.push(`${BULLET_1}linker ${i + 1}: ${label}`);
|
|
70
|
-
const qs = formatAxisQualifications(step.qualifications);
|
|
71
|
-
if (qs !== undefined) lines.push(`${SUB_BULLET}qualifies: ${qs}`);
|
|
72
69
|
});
|
|
73
70
|
const hitName = readAnnotation(entry.spec, Annotation.Label) ?? entry.spec.name;
|
|
74
71
|
lines.push(`${BULLET_1}hit column: ${hitName}`);
|
package/src/render/api.ts
CHANGED
|
@@ -29,10 +29,8 @@ import type {
|
|
|
29
29
|
} from "@milaboratories/pl-model-common";
|
|
30
30
|
import {
|
|
31
31
|
AnchoredIdDeriver,
|
|
32
|
-
collectSpecQueryColumns,
|
|
33
32
|
ensurePColumn,
|
|
34
33
|
parseJson,
|
|
35
|
-
extractAllColumns,
|
|
36
34
|
isDataInfo,
|
|
37
35
|
isPColumn,
|
|
38
36
|
isPColumnSpec,
|
|
@@ -46,6 +44,7 @@ import {
|
|
|
46
44
|
readAnnotation,
|
|
47
45
|
withEnrichments,
|
|
48
46
|
legacyColumnSelectorsToPredicate,
|
|
47
|
+
extractAllColumns,
|
|
49
48
|
} from "@milaboratories/pl-model-common";
|
|
50
49
|
import canonicalize from "canonicalize";
|
|
51
50
|
import type { Optional } from "utility-types";
|
|
@@ -70,9 +69,9 @@ import type { LabelDerivationOps } from "./util/label";
|
|
|
70
69
|
import { deriveLabels } from "./util/label";
|
|
71
70
|
import type { APColumnSelectorWithSplit } from "./util/split_selectors";
|
|
72
71
|
import { patchInSetFilters } from "./util/pframe_upgraders";
|
|
73
|
-
import { allPColumnsReady } from "./util/pcolumn_data";
|
|
74
72
|
import type { PColumnDataUniversal } from "./internal";
|
|
75
73
|
import { getService } from "../services";
|
|
74
|
+
import { allPColumnsReady } from "./util";
|
|
76
75
|
|
|
77
76
|
/**
|
|
78
77
|
* Helper function to match domain objects
|
|
@@ -97,7 +96,7 @@ export type UniversalColumnOption = { label: string; value: SUniversalPColumnId
|
|
|
97
96
|
* @returns Transformed data compatible with platform API
|
|
98
97
|
*/
|
|
99
98
|
function transformPColumnData(
|
|
100
|
-
data: PColumn<PColumnDataUniversal> | PColumnLazy<PColumnDataUniversal>,
|
|
99
|
+
data: PColumn<undefined | PColumnDataUniversal> | PColumnLazy<undefined | PColumnDataUniversal>,
|
|
101
100
|
): PColumn<PColumnValues | AccessorHandle | DataInfo<AccessorHandle>> {
|
|
102
101
|
return mapPObjectData(data, (d) => {
|
|
103
102
|
if (d instanceof TreeNodeAccessor) {
|
|
@@ -105,7 +104,7 @@ function transformPColumnData(
|
|
|
105
104
|
} else if (isDataInfo(d)) {
|
|
106
105
|
return mapDataInfo(d, (accessor) => accessor.handle);
|
|
107
106
|
} else {
|
|
108
|
-
return d;
|
|
107
|
+
return d ?? [];
|
|
109
108
|
}
|
|
110
109
|
});
|
|
111
110
|
}
|
|
@@ -663,8 +662,6 @@ export abstract class RenderCtxBase<Args = unknown, Data = unknown> {
|
|
|
663
662
|
PColumn<undefined | PColumnDataUniversal> | PColumnLazy<undefined | PColumnDataUniversal>
|
|
664
663
|
>,
|
|
665
664
|
): PFrameHandle | undefined {
|
|
666
|
-
if (!allPColumnsReady(def)) return undefined;
|
|
667
|
-
this.verifyInlineAndExplicitColumnsSupport(def);
|
|
668
665
|
return this.ctx.createPFrame(def.map((c) => transformPColumnData(c)));
|
|
669
666
|
}
|
|
670
667
|
|
|
@@ -709,16 +706,7 @@ export abstract class RenderCtxBase<Args = unknown, Data = unknown> {
|
|
|
709
706
|
public createPTableV2(
|
|
710
707
|
def: PTableDefV2<PColumn<undefined | PColumnDataUniversal>>,
|
|
711
708
|
): PTableHandle | undefined {
|
|
712
|
-
|
|
713
|
-
if (!allPColumnsReady(columns)) return undefined;
|
|
714
|
-
this.verifyInlineAndExplicitColumnsSupport(columns);
|
|
715
|
-
return this.ctx.createPTableV2(
|
|
716
|
-
mapPTableDefV2(def, (po) => {
|
|
717
|
-
if (po.data === undefined)
|
|
718
|
-
throw new Error("unreachable: column data undefined after readiness check");
|
|
719
|
-
return transformPColumnData({ id: po.id, spec: po.spec, data: po.data });
|
|
720
|
-
}),
|
|
721
|
-
);
|
|
709
|
+
return this.ctx.createPTableV2(mapPTableDefV2(def, (po) => transformPColumnData(po)));
|
|
722
710
|
}
|
|
723
711
|
|
|
724
712
|
/** @deprecated scheduled for removal from SDK */
|