@platforma-sdk/model 1.45.23 → 1.45.30
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/components/PFrameForGraphs.cjs +10 -13
- package/dist/components/PFrameForGraphs.cjs.map +1 -1
- package/dist/components/PFrameForGraphs.d.ts +1 -2
- package/dist/components/PFrameForGraphs.d.ts.map +1 -1
- package/dist/components/PFrameForGraphs.js +7 -10
- package/dist/components/PFrameForGraphs.js.map +1 -1
- package/dist/components/PlAnnotations/filters_ui.cjs.map +1 -1
- package/dist/components/PlAnnotations/filters_ui.d.ts +1 -1
- package/dist/components/PlAnnotations/filters_ui.d.ts.map +1 -1
- package/dist/components/PlAnnotations/filters_ui.js.map +1 -1
- package/dist/components/PlDataTable.cjs +3 -9
- package/dist/components/PlDataTable.cjs.map +1 -1
- package/dist/components/PlDataTable.d.ts +1 -3
- package/dist/components/PlDataTable.d.ts.map +1 -1
- package/dist/components/PlDataTable.js +2 -7
- package/dist/components/PlDataTable.js.map +1 -1
- package/dist/index.cjs +1 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/package.json.cjs +1 -1
- package/dist/package.json.js +1 -1
- package/dist/render/api.cjs.map +1 -1
- package/dist/render/api.d.ts +2 -2
- package/dist/render/api.d.ts.map +1 -1
- package/dist/render/api.js.map +1 -1
- package/dist/render/internal.cjs.map +1 -1
- package/dist/render/internal.d.ts +1 -1
- package/dist/render/internal.d.ts.map +1 -1
- package/dist/render/internal.js.map +1 -1
- package/package.json +6 -6
- package/src/components/PFrameForGraphs.ts +15 -17
- package/src/components/PlAnnotations/filters_ui.ts +1 -1
- package/src/components/PlDataTable.ts +2 -7
- package/src/render/api.ts +2 -2
- package/src/render/internal.ts +1 -1
|
@@ -8,22 +8,23 @@ import type {
|
|
|
8
8
|
PObjectId,
|
|
9
9
|
} from '@milaboratories/pl-model-common';
|
|
10
10
|
import {
|
|
11
|
+
Annotation,
|
|
11
12
|
canonicalizeJson,
|
|
13
|
+
getArrayFromAxisTree,
|
|
14
|
+
getAxesTree,
|
|
12
15
|
getAxisId,
|
|
13
|
-
matchAxisId,
|
|
14
16
|
getColumnIdAndSpec,
|
|
15
|
-
Annotation,
|
|
16
|
-
readAnnotation,
|
|
17
17
|
getNormalizedAxesList,
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
isLabelColumn,
|
|
19
|
+
isLinkerColumn,
|
|
20
20
|
LinkerMap,
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
matchAxisId,
|
|
22
|
+
readAnnotation,
|
|
23
|
+
readAnnotationJson,
|
|
24
|
+
stringifyJson,
|
|
23
25
|
} from '@milaboratories/pl-model-common';
|
|
24
26
|
import type { PColumnDataUniversal, RenderCtx } from '../render';
|
|
25
27
|
import { allPColumnsReady, PColumnCollection } from '../render';
|
|
26
|
-
import { isLabelColumn } from './PlDataTable';
|
|
27
28
|
|
|
28
29
|
/** Create id for column copy with added keys in axes domains */
|
|
29
30
|
const colId = (id: PObjectId, domains: (Record<string, string> | undefined)[]) => {
|
|
@@ -55,12 +56,7 @@ function getKeysCombinations(idsLists: AxisId[][]) {
|
|
|
55
56
|
return result;
|
|
56
57
|
}
|
|
57
58
|
|
|
58
|
-
|
|
59
|
-
export function isLinkerColumn(column: PColumnSpec): boolean {
|
|
60
|
-
return !!readAnnotationJson(column, Annotation.IsLinkerColumn);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function isHiddenFromGraphColumn(column: PColumnSpec): boolean {
|
|
59
|
+
export function isHiddenFromGraphColumn(column: PColumnSpec): boolean {
|
|
64
60
|
return !!readAnnotationJson(column, Annotation.HideDataFromGraphs);
|
|
65
61
|
}
|
|
66
62
|
|
|
@@ -259,10 +255,11 @@ export function createPFrameForGraphs<A, U>(
|
|
|
259
255
|
allAxes.set(...item);
|
|
260
256
|
}
|
|
261
257
|
|
|
258
|
+
const blockAxesArr = Array.from(blockAxes.values());
|
|
262
259
|
// all compatible with block columns but without label columns
|
|
263
260
|
let compatibleWithoutLabels = (columns.getColumns((spec) => !isHiddenFromGraphColumn(spec) && spec.axesSpec.some((axisSpec) => {
|
|
264
261
|
const axisId = getAxisId(axisSpec);
|
|
265
|
-
return
|
|
262
|
+
return blockAxesArr.some((selectorAxisSpec) => matchAxisId(getAxisId(selectorAxisSpec), axisId));
|
|
266
263
|
}), { dontWaitAllData: true, overrideLabelAnnotation: false }) ?? []).filter((column) => !isLabelColumn(column.spec));
|
|
267
264
|
|
|
268
265
|
// if at least one column is not yet ready, we can't show the graph
|
|
@@ -278,16 +275,17 @@ export function createPFrameForGraphs<A, U>(
|
|
|
278
275
|
}
|
|
279
276
|
}
|
|
280
277
|
|
|
278
|
+
const allAxesArr = Array.from(allAxes.values());
|
|
281
279
|
// extend allowed columns - add columns thad doesn't have axes from block, but have all axes in 'allAxes' list (that means all axes from linkers or from 'hanging' of other selected columns)
|
|
282
280
|
compatibleWithoutLabels = (columns.getColumns((spec) => !isHiddenFromGraphColumn(spec) && spec.axesSpec.every((axisSpec) => {
|
|
283
281
|
const axisId = getAxisId(axisSpec);
|
|
284
|
-
return
|
|
282
|
+
return allAxesArr.some((selectorAxisSpec) => matchAxisId(getAxisId(selectorAxisSpec), axisId));
|
|
285
283
|
}), { dontWaitAllData: true, overrideLabelAnnotation: false }) ?? []).filter((column) => !isLabelColumn(column.spec));
|
|
286
284
|
|
|
287
285
|
// label columns must be compatible with full set of axes - block axes and axes from compatible columns from result pool
|
|
288
286
|
const compatibleLabels = (columns.getColumns((spec) => !isHiddenFromGraphColumn(spec) && spec.axesSpec.some((axisSpec) => {
|
|
289
287
|
const axisId = getAxisId(axisSpec);
|
|
290
|
-
return
|
|
288
|
+
return allAxesArr.some((selectorAxisSpec) => matchAxisId(getAxisId(selectorAxisSpec), axisId));
|
|
291
289
|
}), { dontWaitAllData: true, overrideLabelAnnotation: false }) ?? []).filter((column) => isLabelColumn(column.spec));
|
|
292
290
|
|
|
293
291
|
// if at least one column is not yet ready, we can't show the graph
|
|
@@ -23,7 +23,7 @@ export type FilterUi = FilterSpec<Extract<
|
|
|
23
23
|
| 'isNA'
|
|
24
24
|
| 'isNotNA';
|
|
25
25
|
}
|
|
26
|
-
>, { id
|
|
26
|
+
>, { id: number; name?: string; isExpanded?: boolean }>;
|
|
27
27
|
|
|
28
28
|
export type FilterUiType = Exclude<FilterUi, { type: undefined }>['type'];
|
|
29
29
|
|
|
@@ -6,7 +6,6 @@ import type {
|
|
|
6
6
|
ListOptionBase,
|
|
7
7
|
PColumn,
|
|
8
8
|
PColumnIdAndSpec,
|
|
9
|
-
PColumnSpec,
|
|
10
9
|
PColumnValues,
|
|
11
10
|
PObjectId,
|
|
12
11
|
PTableColumnId,
|
|
@@ -24,6 +23,8 @@ import {
|
|
|
24
23
|
canonicalizeJson,
|
|
25
24
|
getAxisId,
|
|
26
25
|
getColumnIdAndSpec,
|
|
26
|
+
isLabelColumn,
|
|
27
|
+
isLinkerColumn,
|
|
27
28
|
matchAxisId,
|
|
28
29
|
PColumnName,
|
|
29
30
|
readAnnotation,
|
|
@@ -40,7 +41,6 @@ import {
|
|
|
40
41
|
allPColumnsReady,
|
|
41
42
|
PColumnCollection,
|
|
42
43
|
} from '../render';
|
|
43
|
-
import { isLinkerColumn } from './PFrameForGraphs';
|
|
44
44
|
|
|
45
45
|
export type PlTableColumnId = {
|
|
46
46
|
/** Original column spec */
|
|
@@ -483,11 +483,6 @@ export type CreatePlDataTableOps = {
|
|
|
483
483
|
doNotSkipTechnicalColumns?: boolean;
|
|
484
484
|
};
|
|
485
485
|
|
|
486
|
-
/** Check if column is a label column */
|
|
487
|
-
export function isLabelColumn(column: PColumnSpec) {
|
|
488
|
-
return column.axesSpec.length === 1 && column.name === PColumnName.Label;
|
|
489
|
-
}
|
|
490
|
-
|
|
491
486
|
/** Get all label columns from the result pool */
|
|
492
487
|
export function getAllLabelColumns(
|
|
493
488
|
resultPool: AxisLabelProvider & ColumnProvider,
|
package/src/render/api.ts
CHANGED
|
@@ -55,7 +55,7 @@ import type { APColumnSelectorWithSplit } from './util/split_selectors';
|
|
|
55
55
|
import { patchInSetFilters } from './util/pframe_upgraders';
|
|
56
56
|
import { allPColumnsReady } from './util/pcolumn_data';
|
|
57
57
|
|
|
58
|
-
export type PColumnDataUniversal = TreeNodeAccessor | DataInfo<
|
|
58
|
+
export type PColumnDataUniversal<TreeEntry = TreeNodeAccessor> = TreeEntry | DataInfo<TreeEntry> | PColumnValues;
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* Helper function to match domain objects
|
|
@@ -619,7 +619,7 @@ export class RenderCtx<Args, UiState> {
|
|
|
619
619
|
}
|
|
620
620
|
|
|
621
621
|
// TODO remove all non-PColumn fields
|
|
622
|
-
public createPFrame(def: PFrameDef<PColumnDataUniversal
|
|
622
|
+
public createPFrame(def: PFrameDef<PColumn<PColumnDataUniversal>>): PFrameHandle | undefined {
|
|
623
623
|
this.verifyInlineAndExplicitColumnsSupport(def);
|
|
624
624
|
if (!allPColumnsReady(def)) return undefined;
|
|
625
625
|
return this.ctx.createPFrame(
|
package/src/render/internal.ts
CHANGED
|
@@ -143,7 +143,7 @@ export interface GlobalCfgRenderCtxMethods<AHandle = AccessorHandle, FHandle = F
|
|
|
143
143
|
// PFrame / PTable
|
|
144
144
|
//
|
|
145
145
|
|
|
146
|
-
createPFrame(def: PFrameDef<AHandle | PColumnValues | DataInfo<AHandle
|
|
146
|
+
createPFrame(def: PFrameDef<PColumn<AHandle | PColumnValues | DataInfo<AHandle>>>): PFrameHandle;
|
|
147
147
|
|
|
148
148
|
createPTable(def: PTableDef<PColumn<AHandle | PColumnValues | DataInfo<AHandle>>>): PTableHandle;
|
|
149
149
|
|