@platforma-sdk/model 1.53.10 → 1.53.13
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/annotations/converter.cjs +11 -11
- package/dist/annotations/converter.cjs.map +1 -1
- package/dist/annotations/converter.d.ts +1 -1
- package/dist/annotations/converter.d.ts.map +1 -1
- package/dist/annotations/converter.js +11 -11
- package/dist/annotations/converter.js.map +1 -1
- package/dist/annotations/index.d.ts +2 -2
- package/dist/annotations/types.d.ts +4 -4
- package/dist/bconfig/index.d.ts +5 -5
- package/dist/bconfig/lambdas.d.ts +7 -7
- package/dist/bconfig/lambdas.d.ts.map +1 -1
- package/dist/bconfig/normalization.cjs.map +1 -1
- package/dist/bconfig/normalization.d.ts +3 -3
- package/dist/bconfig/normalization.js.map +1 -1
- package/dist/bconfig/types.cjs.map +1 -1
- package/dist/bconfig/types.d.ts +2 -2
- package/dist/bconfig/types.d.ts.map +1 -1
- package/dist/bconfig/types.js.map +1 -1
- package/dist/bconfig/util.d.ts +4 -4
- package/dist/bconfig/v3.d.ts +3 -3
- package/dist/block_api_v1.d.ts +2 -2
- package/dist/block_api_v1.d.ts.map +1 -1
- package/dist/block_api_v2.d.ts +2 -2
- package/dist/block_api_v2.d.ts.map +1 -1
- package/dist/block_api_v3.d.ts +3 -3
- package/dist/block_migrations.cjs +10 -10
- package/dist/block_migrations.cjs.map +1 -1
- package/dist/block_migrations.d.ts.map +1 -1
- package/dist/block_migrations.js +10 -10
- package/dist/block_migrations.js.map +1 -1
- package/dist/block_model.cjs +11 -11
- package/dist/block_model.cjs.map +1 -1
- package/dist/block_model.d.ts +8 -8
- package/dist/block_model.d.ts.map +1 -1
- package/dist/block_model.js +11 -11
- package/dist/block_model.js.map +1 -1
- package/dist/block_state_patch.d.ts +2 -2
- package/dist/block_state_util.cjs +1 -1
- package/dist/block_state_util.cjs.map +1 -1
- package/dist/block_state_util.d.ts +3 -3
- package/dist/block_state_util.js +1 -1
- package/dist/block_state_util.js.map +1 -1
- package/dist/block_storage.cjs +10 -10
- package/dist/block_storage.cjs.map +1 -1
- package/dist/block_storage.d.ts +2 -2
- package/dist/block_storage.d.ts.map +1 -1
- package/dist/block_storage.js +10 -10
- package/dist/block_storage.js.map +1 -1
- package/dist/block_storage_vm.cjs +22 -22
- package/dist/block_storage_vm.cjs.map +1 -1
- package/dist/block_storage_vm.d.ts +1 -1
- package/dist/block_storage_vm.d.ts.map +1 -1
- package/dist/block_storage_vm.js +22 -22
- package/dist/block_storage_vm.js.map +1 -1
- package/dist/builder.cjs +32 -23
- package/dist/builder.cjs.map +1 -1
- package/dist/builder.d.ts +7 -7
- package/dist/builder.d.ts.map +1 -1
- package/dist/builder.js +32 -23
- package/dist/builder.js.map +1 -1
- package/dist/components/PFrameForGraphs.cjs +7 -6
- package/dist/components/PFrameForGraphs.cjs.map +1 -1
- package/dist/components/PFrameForGraphs.d.ts +4 -4
- package/dist/components/PFrameForGraphs.d.ts.map +1 -1
- package/dist/components/PFrameForGraphs.js +7 -6
- package/dist/components/PFrameForGraphs.js.map +1 -1
- package/dist/components/PlAnnotations/filter.d.ts +14 -14
- package/dist/components/PlAnnotations/filter.d.ts.map +1 -1
- package/dist/components/PlAnnotations/filters_ui.cjs +46 -46
- package/dist/components/PlAnnotations/filters_ui.cjs.map +1 -1
- package/dist/components/PlAnnotations/filters_ui.d.ts +10 -34
- package/dist/components/PlAnnotations/filters_ui.d.ts.map +1 -1
- package/dist/components/PlAnnotations/filters_ui.js +46 -46
- package/dist/components/PlAnnotations/filters_ui.js.map +1 -1
- package/dist/components/PlAnnotations/index.d.ts +2 -2
- package/dist/components/PlAnnotations/types.d.ts +2 -2
- package/dist/components/PlDataTable.cjs +19 -20
- package/dist/components/PlDataTable.cjs.map +1 -1
- package/dist/components/PlDataTable.d.ts +27 -27
- package/dist/components/PlDataTable.d.ts.map +1 -1
- package/dist/components/PlDataTable.js +19 -20
- package/dist/components/PlDataTable.js.map +1 -1
- package/dist/components/PlMultiSequenceAlignment.cjs +2 -2
- package/dist/components/PlMultiSequenceAlignment.cjs.map +1 -1
- package/dist/components/PlMultiSequenceAlignment.d.ts +6 -6
- package/dist/components/PlMultiSequenceAlignment.d.ts.map +1 -1
- package/dist/components/PlMultiSequenceAlignment.js +2 -2
- package/dist/components/PlMultiSequenceAlignment.js.map +1 -1
- package/dist/components/PlSelectionModel.cjs.map +1 -1
- package/dist/components/PlSelectionModel.d.ts +1 -1
- package/dist/components/PlSelectionModel.js.map +1 -1
- package/dist/components/index.d.ts +5 -5
- package/dist/config/actions.cjs +39 -39
- package/dist/config/actions.cjs.map +1 -1
- package/dist/config/actions.d.ts +9 -9
- package/dist/config/actions.d.ts.map +1 -1
- package/dist/config/actions.js +39 -39
- package/dist/config/actions.js.map +1 -1
- package/dist/config/actions_kinds.d.ts +30 -30
- package/dist/config/actions_kinds.d.ts.map +1 -1
- package/dist/config/index.d.ts +6 -6
- package/dist/config/model.d.ts +28 -28
- package/dist/config/model_meta.d.ts +1 -1
- package/dist/config/type_engine.d.ts +3 -3
- package/dist/config/type_util.d.ts +2 -2
- package/dist/env_value.cjs +1 -1
- package/dist/env_value.cjs.map +1 -1
- package/dist/env_value.js +1 -1
- package/dist/env_value.js.map +1 -1
- package/dist/filters/converter.cjs +36 -32
- package/dist/filters/converter.cjs.map +1 -1
- package/dist/filters/converter.d.ts +2 -2
- package/dist/filters/converter.d.ts.map +1 -1
- package/dist/filters/converter.js +36 -32
- package/dist/filters/converter.js.map +1 -1
- package/dist/filters/index.d.ts +2 -2
- package/dist/filters/types.d.ts +33 -33
- package/dist/filters/types.d.ts.map +1 -1
- package/dist/index.d.ts +24 -24
- package/dist/internal.cjs +7 -7
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.ts +4 -4
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +7 -7
- package/dist/internal.js.map +1 -1
- package/dist/package.json.cjs +1 -1
- package/dist/package.json.js +1 -1
- package/dist/pframe.cjs +1 -1
- package/dist/pframe.cjs.map +1 -1
- package/dist/pframe.d.ts +1 -1
- package/dist/pframe.js +1 -1
- package/dist/pframe.js.map +1 -1
- package/dist/pframe_utils/columns.cjs +23 -15
- package/dist/pframe_utils/columns.cjs.map +1 -1
- package/dist/pframe_utils/columns.d.ts +3 -3
- package/dist/pframe_utils/columns.d.ts.map +1 -1
- package/dist/pframe_utils/columns.js +23 -15
- package/dist/pframe_utils/columns.js.map +1 -1
- package/dist/pframe_utils/index.cjs +25 -25
- package/dist/pframe_utils/index.cjs.map +1 -1
- package/dist/pframe_utils/index.d.ts +3 -3
- package/dist/pframe_utils/index.d.ts.map +1 -1
- package/dist/pframe_utils/index.js +25 -25
- package/dist/pframe_utils/index.js.map +1 -1
- package/dist/platforma.d.ts +7 -7
- package/dist/platforma.d.ts.map +1 -1
- package/dist/raw_globals.cjs +4 -1
- package/dist/raw_globals.cjs.map +1 -1
- package/dist/raw_globals.d.ts +2 -2
- package/dist/raw_globals.d.ts.map +1 -1
- package/dist/raw_globals.js +4 -1
- package/dist/raw_globals.js.map +1 -1
- package/dist/ref_util.cjs +4 -4
- package/dist/ref_util.cjs.map +1 -1
- package/dist/ref_util.d.ts +1 -1
- package/dist/ref_util.js +4 -4
- package/dist/ref_util.js.map +1 -1
- package/dist/render/accessor.cjs +24 -24
- package/dist/render/accessor.cjs.map +1 -1
- package/dist/render/accessor.d.ts +10 -10
- package/dist/render/accessor.d.ts.map +1 -1
- package/dist/render/accessor.js +24 -24
- package/dist/render/accessor.js.map +1 -1
- package/dist/render/api.cjs +23 -23
- package/dist/render/api.cjs.map +1 -1
- package/dist/render/api.d.ts +11 -11
- package/dist/render/api.d.ts.map +1 -1
- package/dist/render/api.js +23 -23
- package/dist/render/api.js.map +1 -1
- package/dist/render/future.cjs.map +1 -1
- package/dist/render/future.d.ts +1 -1
- package/dist/render/future.js.map +1 -1
- package/dist/render/index.d.ts +6 -6
- package/dist/render/internal.cjs +4 -4
- package/dist/render/internal.cjs.map +1 -1
- package/dist/render/internal.d.ts +7 -7
- package/dist/render/internal.d.ts.map +1 -1
- package/dist/render/internal.js +4 -4
- package/dist/render/internal.js.map +1 -1
- package/dist/render/traversal_ops.d.ts +1 -1
- package/dist/render/util/axis_filtering.cjs +48 -44
- package/dist/render/util/axis_filtering.cjs.map +1 -1
- package/dist/render/util/axis_filtering.d.ts +2 -2
- package/dist/render/util/axis_filtering.js +48 -44
- package/dist/render/util/axis_filtering.js.map +1 -1
- package/dist/render/util/column_collection.cjs +42 -35
- package/dist/render/util/column_collection.cjs.map +1 -1
- package/dist/render/util/column_collection.d.ts +4 -4
- package/dist/render/util/column_collection.d.ts.map +1 -1
- package/dist/render/util/column_collection.js +42 -35
- package/dist/render/util/column_collection.js.map +1 -1
- package/dist/render/util/index.d.ts +4 -4
- package/dist/render/util/label.cjs +15 -21
- package/dist/render/util/label.cjs.map +1 -1
- package/dist/render/util/label.d.ts +2 -2
- package/dist/render/util/label.d.ts.map +1 -1
- package/dist/render/util/label.js +15 -21
- package/dist/render/util/label.js.map +1 -1
- package/dist/render/util/pcolumn_data.cjs +56 -54
- package/dist/render/util/pcolumn_data.cjs.map +1 -1
- package/dist/render/util/pcolumn_data.d.ts +5 -5
- package/dist/render/util/pcolumn_data.d.ts.map +1 -1
- package/dist/render/util/pcolumn_data.js +56 -54
- package/dist/render/util/pcolumn_data.js.map +1 -1
- package/dist/render/util/pframe_upgraders.cjs +6 -6
- package/dist/render/util/pframe_upgraders.cjs.map +1 -1
- package/dist/render/util/pframe_upgraders.d.ts +1 -1
- package/dist/render/util/pframe_upgraders.d.ts.map +1 -1
- package/dist/render/util/pframe_upgraders.js +6 -6
- package/dist/render/util/pframe_upgraders.js.map +1 -1
- package/dist/render/util/split_selectors.d.ts +1 -1
- package/dist/render/util/split_selectors.d.ts.map +1 -1
- package/dist/sdk_info.cjs.map +1 -1
- package/dist/sdk_info.js.map +1 -1
- package/dist/version.cjs.map +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +23 -21
- package/src/annotations/converter.test.ts +98 -101
- package/src/annotations/converter.ts +21 -17
- package/src/annotations/index.ts +2 -2
- package/src/annotations/types.ts +4 -4
- package/src/bconfig/index.ts +5 -5
- package/src/bconfig/lambdas.ts +10 -12
- package/src/bconfig/normalization.ts +5 -5
- package/src/bconfig/types.ts +3 -5
- package/src/bconfig/util.ts +3 -3
- package/src/bconfig/v3.ts +3 -3
- package/src/block_api_v1.ts +7 -3
- package/src/block_api_v2.ts +7 -3
- package/src/block_api_v3.ts +3 -3
- package/src/block_migrations.test.ts +66 -67
- package/src/block_migrations.ts +16 -16
- package/src/block_model.ts +76 -140
- package/src/block_state_patch.ts +2 -2
- package/src/block_state_util.ts +4 -4
- package/src/block_storage.test.ts +106 -99
- package/src/block_storage.ts +22 -25
- package/src/block_storage_vm.ts +41 -35
- package/src/builder.ts +107 -95
- package/src/components/PFrameForGraphs.test.ts +261 -255
- package/src/components/PFrameForGraphs.ts +35 -22
- package/src/components/PlAnnotations/filter.ts +21 -15
- package/src/components/PlAnnotations/filters_ui.test.ts +230 -73
- package/src/components/PlAnnotations/filters_ui.ts +138 -105
- package/src/components/PlAnnotations/index.ts +2 -2
- package/src/components/PlAnnotations/types.ts +2 -2
- package/src/components/PlDataTable.ts +177 -164
- package/src/components/PlMultiSequenceAlignment.ts +11 -18
- package/src/components/PlSelectionModel.ts +1 -1
- package/src/components/index.ts +5 -5
- package/src/config/actions.ts +64 -59
- package/src/config/actions_kinds.ts +38 -34
- package/src/config/index.ts +6 -6
- package/src/config/model.ts +28 -28
- package/src/config/model_meta.ts +1 -1
- package/src/config/type_engine.ts +3 -3
- package/src/config/type_util.ts +2 -2
- package/src/env_value.ts +2 -2
- package/src/filters/converter.test.ts +185 -144
- package/src/filters/converter.ts +47 -35
- package/src/filters/index.ts +2 -2
- package/src/filters/types.ts +44 -39
- package/src/global.d.ts +1 -1
- package/src/index.ts +24 -24
- package/src/internal.ts +27 -17
- package/src/pframe.ts +3 -3
- package/src/pframe_utils/columns.ts +81 -31
- package/src/pframe_utils/index.ts +65 -43
- package/src/platforma.ts +44 -21
- package/src/raw_globals.ts +13 -7
- package/src/ref_util.ts +6 -6
- package/src/render/accessor.ts +43 -44
- package/src/render/api.ts +102 -78
- package/src/render/future.ts +2 -2
- package/src/render/index.ts +6 -6
- package/src/render/internal.ts +11 -12
- package/src/render/traversal_ops.ts +1 -1
- package/src/render/util/axis_filtering.ts +67 -52
- package/src/render/util/column_collection.ts +171 -91
- package/src/render/util/index.ts +4 -4
- package/src/render/util/label.test.ts +139 -139
- package/src/render/util/label.ts +42 -33
- package/src/render/util/pcolumn_data.ts +111 -75
- package/src/render/util/pframe_upgraders.ts +24 -13
- package/src/render/util/split_selectors.ts +6 -1
- package/src/sdk_info.ts +1 -1
- package/src/typing.test.ts +56 -56
- package/src/version.ts +1 -1
|
@@ -17,7 +17,7 @@ import type {
|
|
|
17
17
|
PTableRecordFilter,
|
|
18
18
|
PTableRecordSingleValueFilterV2,
|
|
19
19
|
PTableSorting,
|
|
20
|
-
} from
|
|
20
|
+
} from "@milaboratories/pl-model-common";
|
|
21
21
|
import {
|
|
22
22
|
Annotation,
|
|
23
23
|
canonicalizeJson,
|
|
@@ -29,20 +29,16 @@ import {
|
|
|
29
29
|
PColumnName,
|
|
30
30
|
readAnnotation,
|
|
31
31
|
uniqueBy,
|
|
32
|
-
} from
|
|
32
|
+
} from "@milaboratories/pl-model-common";
|
|
33
33
|
import type {
|
|
34
34
|
AxisLabelProvider,
|
|
35
35
|
ColumnProvider,
|
|
36
36
|
PColumnDataUniversal,
|
|
37
37
|
RenderCtxBase,
|
|
38
38
|
TreeNodeAccessor,
|
|
39
|
-
} from
|
|
40
|
-
import {
|
|
41
|
-
|
|
42
|
-
deriveLabels,
|
|
43
|
-
PColumnCollection,
|
|
44
|
-
} from '../render';
|
|
45
|
-
import { identity } from 'es-toolkit';
|
|
39
|
+
} from "../render";
|
|
40
|
+
import { allPColumnsReady, deriveLabels, PColumnCollection } from "../render";
|
|
41
|
+
import { identity } from "es-toolkit";
|
|
46
42
|
|
|
47
43
|
export type PlTableColumnId = {
|
|
48
44
|
/** Original column spec */
|
|
@@ -66,7 +62,7 @@ export type PlDataTableGridStateCore = {
|
|
|
66
62
|
/** Column Id to apply the sort to. */
|
|
67
63
|
colId: PlTableColumnIdJson;
|
|
68
64
|
/** Sort direction */
|
|
69
|
-
sort:
|
|
65
|
+
sort: "asc" | "desc";
|
|
70
66
|
}[];
|
|
71
67
|
};
|
|
72
68
|
/** Includes column visibility */
|
|
@@ -98,32 +94,7 @@ export type PlDataTableSheetState = {
|
|
|
98
94
|
export type PlDataTableStateV2 =
|
|
99
95
|
// Old versions of the state
|
|
100
96
|
| {
|
|
101
|
-
|
|
102
|
-
gridState: {
|
|
103
|
-
columnOrder?: {
|
|
104
|
-
orderedColIds: CanonicalizedJson<PTableColumnSpec>[];
|
|
105
|
-
};
|
|
106
|
-
sort?: {
|
|
107
|
-
sortModel: {
|
|
108
|
-
colId: CanonicalizedJson<PTableColumnSpec>;
|
|
109
|
-
sort: 'asc' | 'desc';
|
|
110
|
-
}[];
|
|
111
|
-
};
|
|
112
|
-
columnVisibility?: {
|
|
113
|
-
hiddenColIds: CanonicalizedJson<PTableColumnSpec>[];
|
|
114
|
-
};
|
|
115
|
-
sourceId?: string;
|
|
116
|
-
sheets?: Record<CanonicalizedJson<AxisId>, string | number>;
|
|
117
|
-
};
|
|
118
|
-
pTableParams?: {
|
|
119
|
-
sorting?: PTableSorting[];
|
|
120
|
-
filters?: PTableRecordFilter[];
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
| {
|
|
124
|
-
version: 2;
|
|
125
|
-
stateCache: {
|
|
126
|
-
sourceId: string;
|
|
97
|
+
// no version
|
|
127
98
|
gridState: {
|
|
128
99
|
columnOrder?: {
|
|
129
100
|
orderedColIds: CanonicalizedJson<PTableColumnSpec>[];
|
|
@@ -131,44 +102,69 @@ export type PlDataTableStateV2 =
|
|
|
131
102
|
sort?: {
|
|
132
103
|
sortModel: {
|
|
133
104
|
colId: CanonicalizedJson<PTableColumnSpec>;
|
|
134
|
-
sort:
|
|
105
|
+
sort: "asc" | "desc";
|
|
135
106
|
}[];
|
|
136
107
|
};
|
|
137
108
|
columnVisibility?: {
|
|
138
109
|
hiddenColIds: CanonicalizedJson<PTableColumnSpec>[];
|
|
139
110
|
};
|
|
111
|
+
sourceId?: string;
|
|
112
|
+
sheets?: Record<CanonicalizedJson<AxisId>, string | number>;
|
|
140
113
|
};
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
sorting: PTableSorting[];
|
|
147
|
-
};
|
|
148
|
-
}
|
|
114
|
+
pTableParams?: {
|
|
115
|
+
sorting?: PTableSorting[];
|
|
116
|
+
filters?: PTableRecordFilter[];
|
|
117
|
+
};
|
|
118
|
+
}
|
|
149
119
|
| {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
120
|
+
version: 2;
|
|
121
|
+
stateCache: {
|
|
122
|
+
sourceId: string;
|
|
123
|
+
gridState: {
|
|
124
|
+
columnOrder?: {
|
|
125
|
+
orderedColIds: CanonicalizedJson<PTableColumnSpec>[];
|
|
126
|
+
};
|
|
127
|
+
sort?: {
|
|
128
|
+
sortModel: {
|
|
129
|
+
colId: CanonicalizedJson<PTableColumnSpec>;
|
|
130
|
+
sort: "asc" | "desc";
|
|
131
|
+
}[];
|
|
132
|
+
};
|
|
133
|
+
columnVisibility?: {
|
|
134
|
+
hiddenColIds: CanonicalizedJson<PTableColumnSpec>[];
|
|
135
|
+
};
|
|
165
136
|
};
|
|
137
|
+
sheetsState: PlDataTableSheetState[];
|
|
138
|
+
}[];
|
|
139
|
+
pTableParams: {
|
|
140
|
+
hiddenColIds: PObjectId[] | null;
|
|
141
|
+
filters: PTableRecordFilter[];
|
|
142
|
+
sorting: PTableSorting[];
|
|
166
143
|
};
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
144
|
+
}
|
|
145
|
+
| {
|
|
146
|
+
version: 3;
|
|
147
|
+
stateCache: {
|
|
148
|
+
sourceId: string;
|
|
149
|
+
gridState: {
|
|
150
|
+
columnOrder?: {
|
|
151
|
+
orderedColIds: CanonicalizedJson<PTableColumnSpec>[];
|
|
152
|
+
};
|
|
153
|
+
sort?: {
|
|
154
|
+
sortModel: {
|
|
155
|
+
colId: CanonicalizedJson<PTableColumnSpec>;
|
|
156
|
+
sort: "asc" | "desc";
|
|
157
|
+
}[];
|
|
158
|
+
};
|
|
159
|
+
columnVisibility?: {
|
|
160
|
+
hiddenColIds: CanonicalizedJson<PTableColumnSpec>[];
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
sheetsState: PlDataTableSheetState[];
|
|
164
|
+
filtersState: PlDataTableFilterState[];
|
|
165
|
+
}[];
|
|
166
|
+
pTableParams: PTableParamsV2;
|
|
167
|
+
}
|
|
172
168
|
// Normalized state
|
|
173
169
|
| PlDataTableStateV2Normalized;
|
|
174
170
|
|
|
@@ -185,19 +181,19 @@ export type PlDataTableStateV2CacheEntry = {
|
|
|
185
181
|
|
|
186
182
|
export type PTableParamsV2 =
|
|
187
183
|
| {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
184
|
+
sourceId: null;
|
|
185
|
+
hiddenColIds: null;
|
|
186
|
+
partitionFilters: [];
|
|
187
|
+
filters: [];
|
|
188
|
+
sorting: [];
|
|
189
|
+
}
|
|
194
190
|
| {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
191
|
+
sourceId: string;
|
|
192
|
+
hiddenColIds: PObjectId[] | null;
|
|
193
|
+
partitionFilters: PTableRecordFilter[];
|
|
194
|
+
filters: PTableRecordFilter[];
|
|
195
|
+
sorting: PTableSorting[];
|
|
196
|
+
};
|
|
201
197
|
|
|
202
198
|
export type PlDataTableStateV2Normalized = {
|
|
203
199
|
/** Version for upgrades */
|
|
@@ -228,13 +224,15 @@ export function createPlDataTableStateV2(): PlDataTableStateV2Normalized {
|
|
|
228
224
|
}
|
|
229
225
|
|
|
230
226
|
/** Upgrade PlDataTableStateV2 to the latest version */
|
|
231
|
-
export function upgradePlDataTableStateV2(
|
|
227
|
+
export function upgradePlDataTableStateV2(
|
|
228
|
+
state: PlDataTableStateV2 | undefined,
|
|
229
|
+
): PlDataTableStateV2Normalized {
|
|
232
230
|
// Block just added, had no state, model started earlier than the UI
|
|
233
231
|
if (!state) {
|
|
234
232
|
return createPlDataTableStateV2();
|
|
235
233
|
}
|
|
236
234
|
// v1 -> v2
|
|
237
|
-
if (!(
|
|
235
|
+
if (!("version" in state)) {
|
|
238
236
|
// Non upgradeable as sourceId calculation algorithm has changed, resetting state to default
|
|
239
237
|
state = createPlDataTableStateV2();
|
|
240
238
|
}
|
|
@@ -269,13 +267,13 @@ export type PlDataTableFilterState = {
|
|
|
269
267
|
/** PlTableFilters filter entry */
|
|
270
268
|
export type PlTableFilterIsNotNA = {
|
|
271
269
|
/** Predicate type */
|
|
272
|
-
type:
|
|
270
|
+
type: "isNotNA";
|
|
273
271
|
};
|
|
274
272
|
|
|
275
273
|
/** PlTableFilters filter entry */
|
|
276
274
|
export type PlTableFilterIsNA = {
|
|
277
275
|
/** Predicate type */
|
|
278
|
-
type:
|
|
276
|
+
type: "isNA";
|
|
279
277
|
};
|
|
280
278
|
|
|
281
279
|
/** PlTableFilters filter entries applicable to both string and number values */
|
|
@@ -284,7 +282,7 @@ export type PlTableFilterCommon = PlTableFilterIsNotNA | PlTableFilterIsNA;
|
|
|
284
282
|
/** PlTableFilters numeric filter entry */
|
|
285
283
|
export type PlTableFilterNumberEquals = {
|
|
286
284
|
/** Predicate type */
|
|
287
|
-
type:
|
|
285
|
+
type: "number_equals";
|
|
288
286
|
/** Reference value */
|
|
289
287
|
reference: number;
|
|
290
288
|
};
|
|
@@ -292,7 +290,7 @@ export type PlTableFilterNumberEquals = {
|
|
|
292
290
|
/** PlTableFilters numeric filter entry */
|
|
293
291
|
export type PlTableFilterNumberNotEquals = {
|
|
294
292
|
/** Predicate type */
|
|
295
|
-
type:
|
|
293
|
+
type: "number_notEquals";
|
|
296
294
|
/** Reference value */
|
|
297
295
|
reference: number;
|
|
298
296
|
};
|
|
@@ -300,7 +298,7 @@ export type PlTableFilterNumberNotEquals = {
|
|
|
300
298
|
/** PlTableFilters numeric filter entry */
|
|
301
299
|
export type PlTableFilterNumberGreaterThan = {
|
|
302
300
|
/** Predicate type */
|
|
303
|
-
type:
|
|
301
|
+
type: "number_greaterThan";
|
|
304
302
|
/** Reference value */
|
|
305
303
|
reference: number;
|
|
306
304
|
};
|
|
@@ -308,7 +306,7 @@ export type PlTableFilterNumberGreaterThan = {
|
|
|
308
306
|
/** PlTableFilters numeric filter entry */
|
|
309
307
|
export type PlTableFilterNumberGreaterThanOrEqualTo = {
|
|
310
308
|
/** Predicate type */
|
|
311
|
-
type:
|
|
309
|
+
type: "number_greaterThanOrEqualTo";
|
|
312
310
|
/** Reference value */
|
|
313
311
|
reference: number;
|
|
314
312
|
};
|
|
@@ -316,7 +314,7 @@ export type PlTableFilterNumberGreaterThanOrEqualTo = {
|
|
|
316
314
|
/** PlTableFilters numeric filter entry */
|
|
317
315
|
export type PlTableFilterNumberLessThan = {
|
|
318
316
|
/** Predicate type */
|
|
319
|
-
type:
|
|
317
|
+
type: "number_lessThan";
|
|
320
318
|
/** Reference value */
|
|
321
319
|
reference: number;
|
|
322
320
|
};
|
|
@@ -324,7 +322,7 @@ export type PlTableFilterNumberLessThan = {
|
|
|
324
322
|
/** PlTableFilters numeric filter entry */
|
|
325
323
|
export type PlTableFilterNumberLessThanOrEqualTo = {
|
|
326
324
|
/** Predicate type */
|
|
327
|
-
type:
|
|
325
|
+
type: "number_lessThanOrEqualTo";
|
|
328
326
|
/** Reference value */
|
|
329
327
|
reference: number;
|
|
330
328
|
};
|
|
@@ -332,7 +330,7 @@ export type PlTableFilterNumberLessThanOrEqualTo = {
|
|
|
332
330
|
/** PlTableFilters numeric filter entry */
|
|
333
331
|
export type PlTableFilterNumberBetween = {
|
|
334
332
|
/** Predicate type */
|
|
335
|
-
type:
|
|
333
|
+
type: "number_between";
|
|
336
334
|
/** Reference value for the lower bound */
|
|
337
335
|
lowerBound: number;
|
|
338
336
|
/** Defines whether values equal to lower bound reference value should be matched */
|
|
@@ -354,12 +352,12 @@ export type PlTableFilterNumber =
|
|
|
354
352
|
| PlTableFilterNumberLessThanOrEqualTo
|
|
355
353
|
| PlTableFilterNumberBetween;
|
|
356
354
|
/** All types of PlTableFilters numeric filter entries */
|
|
357
|
-
export type PlTableFilterNumberType = PlTableFilterNumber[
|
|
355
|
+
export type PlTableFilterNumberType = PlTableFilterNumber["type"];
|
|
358
356
|
|
|
359
357
|
/** PlTableFilters string filter entry */
|
|
360
358
|
export type PlTableFilterStringEquals = {
|
|
361
359
|
/** Predicate type */
|
|
362
|
-
type:
|
|
360
|
+
type: "string_equals";
|
|
363
361
|
/** Reference value */
|
|
364
362
|
reference: string;
|
|
365
363
|
};
|
|
@@ -367,7 +365,7 @@ export type PlTableFilterStringEquals = {
|
|
|
367
365
|
/** PlTableFilters string filter entry */
|
|
368
366
|
export type PlTableFilterStringNotEquals = {
|
|
369
367
|
/** Predicate type */
|
|
370
|
-
type:
|
|
368
|
+
type: "string_notEquals";
|
|
371
369
|
/** Reference value */
|
|
372
370
|
reference: string;
|
|
373
371
|
};
|
|
@@ -375,7 +373,7 @@ export type PlTableFilterStringNotEquals = {
|
|
|
375
373
|
/** PlTableFilters string filter entry */
|
|
376
374
|
export type PlTableFilterStringContains = {
|
|
377
375
|
/** Predicate type */
|
|
378
|
-
type:
|
|
376
|
+
type: "string_contains";
|
|
379
377
|
/** Reference value */
|
|
380
378
|
reference: string;
|
|
381
379
|
};
|
|
@@ -383,7 +381,7 @@ export type PlTableFilterStringContains = {
|
|
|
383
381
|
/** PlTableFilters string filter entry */
|
|
384
382
|
export type PlTableFilterStringDoesNotContain = {
|
|
385
383
|
/** Predicate type */
|
|
386
|
-
type:
|
|
384
|
+
type: "string_doesNotContain";
|
|
387
385
|
/** Reference value */
|
|
388
386
|
reference: string;
|
|
389
387
|
};
|
|
@@ -391,7 +389,7 @@ export type PlTableFilterStringDoesNotContain = {
|
|
|
391
389
|
/** PlTableFilters string filter entry */
|
|
392
390
|
export type PlTableFilterStringMatches = {
|
|
393
391
|
/** Predicate type */
|
|
394
|
-
type:
|
|
392
|
+
type: "string_matches";
|
|
395
393
|
/** Reference value */
|
|
396
394
|
reference: string;
|
|
397
395
|
};
|
|
@@ -399,7 +397,7 @@ export type PlTableFilterStringMatches = {
|
|
|
399
397
|
/** PlTableFilters string filter entry */
|
|
400
398
|
export type PlTableFilterStringDoesNotMatch = {
|
|
401
399
|
/** Predicate type */
|
|
402
|
-
type:
|
|
400
|
+
type: "string_doesNotMatch";
|
|
403
401
|
/** Reference value */
|
|
404
402
|
reference: string;
|
|
405
403
|
};
|
|
@@ -407,7 +405,7 @@ export type PlTableFilterStringDoesNotMatch = {
|
|
|
407
405
|
/** PlTableFilters string filter entry */
|
|
408
406
|
export type PlTableFilterStringContainsFuzzyMatch = {
|
|
409
407
|
/** Predicate type */
|
|
410
|
-
type:
|
|
408
|
+
type: "string_containsFuzzyMatch";
|
|
411
409
|
/** Reference value */
|
|
412
410
|
reference: string;
|
|
413
411
|
/**
|
|
@@ -442,12 +440,12 @@ export type PlTableFilterString =
|
|
|
442
440
|
| PlTableFilterStringDoesNotMatch
|
|
443
441
|
| PlTableFilterStringContainsFuzzyMatch;
|
|
444
442
|
/** All types of PlTableFilters string filter entries */
|
|
445
|
-
export type PlTableFilterStringType = PlTableFilterString[
|
|
443
|
+
export type PlTableFilterStringType = PlTableFilterString["type"];
|
|
446
444
|
|
|
447
445
|
/** All PlTableFilters filter entries */
|
|
448
446
|
export type PlTableFilter = PlTableFilterNumber | PlTableFilterString;
|
|
449
447
|
/** All types of PlTableFilters filter entries */
|
|
450
|
-
export type PlTableFilterType = PlTableFilter[
|
|
448
|
+
export type PlTableFilterType = PlTableFilter["type"];
|
|
451
449
|
|
|
452
450
|
export type CreatePlDataTableOps = {
|
|
453
451
|
/** Filters for columns and non-partitioned axes */
|
|
@@ -474,7 +472,7 @@ export type CreatePlDataTableOps = {
|
|
|
474
472
|
*
|
|
475
473
|
* Default: 'full'
|
|
476
474
|
*/
|
|
477
|
-
coreJoinType?:
|
|
475
|
+
coreJoinType?: "inner" | "full";
|
|
478
476
|
};
|
|
479
477
|
|
|
480
478
|
/** Get all label columns from the result pool */
|
|
@@ -484,10 +482,13 @@ export function getAllLabelColumns(
|
|
|
484
482
|
return new PColumnCollection()
|
|
485
483
|
.addAxisLabelProvider(resultPool)
|
|
486
484
|
.addColumnProvider(resultPool)
|
|
487
|
-
.getColumns(
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
485
|
+
.getColumns(
|
|
486
|
+
{
|
|
487
|
+
name: PColumnName.Label,
|
|
488
|
+
axes: [{}], // exactly one axis
|
|
489
|
+
},
|
|
490
|
+
{ dontWaitAllData: true, overrideLabelAnnotation: false },
|
|
491
|
+
);
|
|
491
492
|
}
|
|
492
493
|
|
|
493
494
|
/** Get label columns matching the provided columns from the result pool */
|
|
@@ -569,11 +570,11 @@ export function getMatchingLabelColumns(
|
|
|
569
570
|
function createPTableDef(params: {
|
|
570
571
|
columns: PColumn<PColumnDataUniversal>[];
|
|
571
572
|
labelColumns: PColumn<PColumnDataUniversal>[];
|
|
572
|
-
coreJoinType:
|
|
573
|
+
coreJoinType: "inner" | "full";
|
|
573
574
|
partitionFilters: PTableRecordSingleValueFilterV2[];
|
|
574
575
|
filters: PTableRecordSingleValueFilterV2[];
|
|
575
576
|
sorting: PTableSorting[];
|
|
576
|
-
coreColumnPredicate?: (
|
|
577
|
+
coreColumnPredicate?: (spec: PColumnIdAndSpec) => boolean;
|
|
577
578
|
}): PTableDef<PColumn<TreeNodeAccessor | PColumnValues | DataInfo<TreeNodeAccessor>>> {
|
|
578
579
|
let coreColumns = params.columns;
|
|
579
580
|
const secondaryColumns: typeof params.columns = [];
|
|
@@ -589,12 +590,12 @@ function createPTableDef(params: {
|
|
|
589
590
|
|
|
590
591
|
return {
|
|
591
592
|
src: {
|
|
592
|
-
type:
|
|
593
|
+
type: "outer",
|
|
593
594
|
primary: {
|
|
594
595
|
type: params.coreJoinType,
|
|
595
|
-
entries: coreColumns.map((c) => ({ type:
|
|
596
|
+
entries: coreColumns.map((c) => ({ type: "column", column: c })),
|
|
596
597
|
},
|
|
597
|
-
secondary: secondaryColumns.map((c) => ({ type:
|
|
598
|
+
secondary: secondaryColumns.map((c) => ({ type: "column", column: c })),
|
|
598
599
|
},
|
|
599
600
|
partitionFilters: params.partitionFilters,
|
|
600
601
|
filters: params.filters,
|
|
@@ -614,12 +615,12 @@ export type PlDataTableModel = {
|
|
|
614
615
|
|
|
615
616
|
/** Check if column should be omitted from the table */
|
|
616
617
|
export function isColumnHidden(spec: { annotations?: Annotation }): boolean {
|
|
617
|
-
return readAnnotation(spec, Annotation.Table.Visibility) ===
|
|
618
|
+
return readAnnotation(spec, Annotation.Table.Visibility) === "hidden";
|
|
618
619
|
}
|
|
619
620
|
|
|
620
621
|
/** Check if column is hidden by default */
|
|
621
622
|
export function isColumnOptional(spec: { annotations?: Annotation }): boolean {
|
|
622
|
-
return readAnnotation(spec, Annotation.Table.Visibility) ===
|
|
623
|
+
return readAnnotation(spec, Annotation.Table.Visibility) === "optional";
|
|
623
624
|
}
|
|
624
625
|
|
|
625
626
|
/**
|
|
@@ -644,18 +645,20 @@ export function createPlDataTableV2<A, U>(
|
|
|
644
645
|
if (!allLabelColumns) return undefined;
|
|
645
646
|
|
|
646
647
|
let fullLabelColumns = getMatchingLabelColumns(columns.map(getColumnIdAndSpec), allLabelColumns);
|
|
647
|
-
fullLabelColumns = deriveLabels(fullLabelColumns, identity, { includeNativeLabel: true }).map(
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
648
|
+
fullLabelColumns = deriveLabels(fullLabelColumns, identity, { includeNativeLabel: true }).map(
|
|
649
|
+
(v) => {
|
|
650
|
+
return {
|
|
651
|
+
...v.value,
|
|
652
|
+
spec: {
|
|
653
|
+
...v.value.spec,
|
|
654
|
+
annotations: {
|
|
655
|
+
...v.value.spec.annotations,
|
|
656
|
+
[Annotation.Label]: v.label,
|
|
657
|
+
},
|
|
655
658
|
},
|
|
656
|
-
}
|
|
657
|
-
}
|
|
658
|
-
|
|
659
|
+
};
|
|
660
|
+
},
|
|
661
|
+
);
|
|
659
662
|
|
|
660
663
|
const fullColumns = [...columns, ...fullLabelColumns];
|
|
661
664
|
|
|
@@ -664,38 +667,41 @@ export function createPlDataTableV2<A, U>(
|
|
|
664
667
|
(a) => canonicalizeJson<AxisId>(a),
|
|
665
668
|
);
|
|
666
669
|
const fullColumnsIds: PTableColumnId[] = [
|
|
667
|
-
...fullColumnsAxes.map((a) => ({ type:
|
|
668
|
-
...fullColumns.map((c) => ({ type:
|
|
670
|
+
...fullColumnsAxes.map((a) => ({ type: "axis", id: a }) satisfies PTableColumnIdAxis),
|
|
671
|
+
...fullColumns.map((c) => ({ type: "column", id: c.id }) satisfies PTableColumnIdColumn),
|
|
669
672
|
];
|
|
670
673
|
const fullColumnsIdsSet = new Set(fullColumnsIds.map((c) => canonicalizeJson<PTableColumnId>(c)));
|
|
671
|
-
const isValidColumnId = (id: PTableColumnId): boolean =>
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
const
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
const valid = isValidColumnId(f.column);
|
|
678
|
-
if (!valid) ctx.logWarn(`Partition filter ${JSON.stringify(f)} does not match provided columns, skipping`);
|
|
679
|
-
return valid;
|
|
680
|
-
});
|
|
681
|
-
const filters: PTableRecordSingleValueFilterV2[]
|
|
682
|
-
= uniqueBy(
|
|
683
|
-
[...tableStateNormalized.pTableParams.filters, ...(ops?.filters ?? [])],
|
|
684
|
-
(f) => canonicalizeJson<PTableColumnId>(f.column),
|
|
685
|
-
).filter((f) => {
|
|
674
|
+
const isValidColumnId = (id: PTableColumnId): boolean =>
|
|
675
|
+
fullColumnsIdsSet.has(canonicalizeJson<PTableColumnId>(id));
|
|
676
|
+
|
|
677
|
+
const coreJoinType = ops?.coreJoinType ?? "full";
|
|
678
|
+
const partitionFilters: PTableRecordSingleValueFilterV2[] =
|
|
679
|
+
tableStateNormalized.pTableParams.partitionFilters.filter((f) => {
|
|
686
680
|
const valid = isValidColumnId(f.column);
|
|
687
|
-
if (!valid)
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
= uniqueBy(
|
|
692
|
-
[...tableStateNormalized.pTableParams.sorting, ...(ops?.sorting ?? [])],
|
|
693
|
-
(s) => canonicalizeJson<PTableColumnId>(s.column),
|
|
694
|
-
).filter((s) => {
|
|
695
|
-
const valid = isValidColumnId(s.column);
|
|
696
|
-
if (!valid) ctx.logWarn(`Sorting ${JSON.stringify(s)} does not match provided columns, skipping`);
|
|
681
|
+
if (!valid)
|
|
682
|
+
ctx.logWarn(
|
|
683
|
+
`Partition filter ${JSON.stringify(f)} does not match provided columns, skipping`,
|
|
684
|
+
);
|
|
697
685
|
return valid;
|
|
698
686
|
});
|
|
687
|
+
const filters: PTableRecordSingleValueFilterV2[] = uniqueBy(
|
|
688
|
+
[...tableStateNormalized.pTableParams.filters, ...(ops?.filters ?? [])],
|
|
689
|
+
(f) => canonicalizeJson<PTableColumnId>(f.column),
|
|
690
|
+
).filter((f) => {
|
|
691
|
+
const valid = isValidColumnId(f.column);
|
|
692
|
+
if (!valid)
|
|
693
|
+
ctx.logWarn(`Filter ${JSON.stringify(f)} does not match provided columns, skipping`);
|
|
694
|
+
return valid;
|
|
695
|
+
});
|
|
696
|
+
const sorting: PTableSorting[] = uniqueBy(
|
|
697
|
+
[...tableStateNormalized.pTableParams.sorting, ...(ops?.sorting ?? [])],
|
|
698
|
+
(s) => canonicalizeJson<PTableColumnId>(s.column),
|
|
699
|
+
).filter((s) => {
|
|
700
|
+
const valid = isValidColumnId(s.column);
|
|
701
|
+
if (!valid)
|
|
702
|
+
ctx.logWarn(`Sorting ${JSON.stringify(s)} does not match provided columns, skipping`);
|
|
703
|
+
return valid;
|
|
704
|
+
});
|
|
699
705
|
|
|
700
706
|
const fullDef = createPTableDef({
|
|
701
707
|
columns,
|
|
@@ -709,37 +715,44 @@ export function createPlDataTableV2<A, U>(
|
|
|
709
715
|
const fullHandle = ctx.createPTable(fullDef);
|
|
710
716
|
if (!fullHandle) return undefined;
|
|
711
717
|
|
|
712
|
-
const hiddenColumns = new Set<PObjectId>(
|
|
713
|
-
|
|
714
|
-
|
|
718
|
+
const hiddenColumns = new Set<PObjectId>(
|
|
719
|
+
((): PObjectId[] => {
|
|
720
|
+
// Inner join works as a filter - all columns must be present
|
|
721
|
+
if (coreJoinType === "inner") return [];
|
|
715
722
|
|
|
716
|
-
|
|
717
|
-
|
|
723
|
+
const hiddenColIds = tableStateNormalized.pTableParams.hiddenColIds;
|
|
724
|
+
if (hiddenColIds) return hiddenColIds;
|
|
718
725
|
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
})());
|
|
726
|
+
return columns.filter((c) => isColumnOptional(c.spec)).map((c) => c.id);
|
|
727
|
+
})(),
|
|
728
|
+
);
|
|
723
729
|
|
|
724
730
|
// Preserve linker columns
|
|
725
|
-
columns
|
|
726
|
-
.filter((c) => isLinkerColumn(c.spec))
|
|
727
|
-
.forEach((c) => hiddenColumns.delete(c.id));
|
|
731
|
+
columns.filter((c) => isLinkerColumn(c.spec)).forEach((c) => hiddenColumns.delete(c.id));
|
|
728
732
|
|
|
729
733
|
// Preserve core columns as they change the shape of join.
|
|
730
734
|
const coreColumnPredicate = ops?.coreColumnPredicate;
|
|
731
735
|
if (coreColumnPredicate) {
|
|
732
|
-
const coreColumns = columns.flatMap((c) =>
|
|
736
|
+
const coreColumns = columns.flatMap((c) =>
|
|
737
|
+
coreColumnPredicate(getColumnIdAndSpec(c)) ? [c.id] : [],
|
|
738
|
+
);
|
|
733
739
|
coreColumns.forEach((c) => hiddenColumns.delete(c));
|
|
734
740
|
}
|
|
735
741
|
|
|
736
742
|
// Filters decrease the number of result rows, sorting changes the order of result rows
|
|
737
|
-
[
|
|
738
|
-
.
|
|
743
|
+
[
|
|
744
|
+
...partitionFilters.map((f) => f.column),
|
|
745
|
+
...filters.map((f) => f.column),
|
|
746
|
+
...sorting.map((s) => s.column),
|
|
747
|
+
]
|
|
748
|
+
.filter((c): c is PTableColumnIdColumn => c.type === "column")
|
|
739
749
|
.forEach((c) => hiddenColumns.delete(c.id));
|
|
740
750
|
|
|
741
751
|
const visibleColumns = columns.filter((c) => !hiddenColumns.has(c.id));
|
|
742
|
-
const visibleLabelColumns = getMatchingLabelColumns(
|
|
752
|
+
const visibleLabelColumns = getMatchingLabelColumns(
|
|
753
|
+
visibleColumns.map(getColumnIdAndSpec),
|
|
754
|
+
allLabelColumns,
|
|
755
|
+
);
|
|
743
756
|
|
|
744
757
|
// if at least one column is not yet computed, we can't show the table
|
|
745
758
|
if (!allPColumnsReady([...visibleColumns, ...visibleLabelColumns])) return undefined;
|
|
@@ -5,7 +5,7 @@ import type {
|
|
|
5
5
|
PColumnValues,
|
|
6
6
|
PObjectId,
|
|
7
7
|
PTableColumnId,
|
|
8
|
-
} from
|
|
8
|
+
} from "@milaboratories/pl-model-common";
|
|
9
9
|
import {
|
|
10
10
|
Annotation,
|
|
11
11
|
isPTableAbsent,
|
|
@@ -13,12 +13,10 @@ import {
|
|
|
13
13
|
stringifyJson,
|
|
14
14
|
uniquePlId,
|
|
15
15
|
ValueType,
|
|
16
|
-
} from
|
|
17
|
-
import type { PlSelectionModel } from
|
|
16
|
+
} from "@milaboratories/pl-model-common";
|
|
17
|
+
import type { PlSelectionModel } from "./PlSelectionModel";
|
|
18
18
|
|
|
19
|
-
export type PColumnPredicate = (column: PColumnIdAndSpec) =>
|
|
20
|
-
| boolean
|
|
21
|
-
| { default: boolean };
|
|
19
|
+
export type PColumnPredicate = (column: PColumnIdAndSpec) => boolean | { default: boolean };
|
|
22
20
|
|
|
23
21
|
export interface PlMultiSequenceAlignmentSettings {
|
|
24
22
|
sequenceColumnIds?: PObjectId[];
|
|
@@ -32,26 +30,21 @@ export interface PlMultiSequenceAlignmentSettings {
|
|
|
32
30
|
};
|
|
33
31
|
}
|
|
34
32
|
|
|
35
|
-
export type PlMultiSequenceAlignmentWidget =
|
|
36
|
-
| 'consensus'
|
|
37
|
-
| 'seqLogo'
|
|
38
|
-
| 'tree'
|
|
39
|
-
| 'legend';
|
|
33
|
+
export type PlMultiSequenceAlignmentWidget = "consensus" | "seqLogo" | "tree" | "legend";
|
|
40
34
|
|
|
41
|
-
export interface PlMultiSequenceAlignmentModel
|
|
42
|
-
extends Partial<PlMultiSequenceAlignmentSettings> {
|
|
35
|
+
export interface PlMultiSequenceAlignmentModel extends Partial<PlMultiSequenceAlignmentSettings> {
|
|
43
36
|
version?: number;
|
|
44
37
|
}
|
|
45
38
|
|
|
46
39
|
export type PlMultiSequenceAlignmentColorSchemeOption =
|
|
47
|
-
| { type:
|
|
48
|
-
| { type:
|
|
49
|
-
| { type:
|
|
40
|
+
| { type: "no-color" }
|
|
41
|
+
| { type: "chemical-properties" }
|
|
42
|
+
| { type: "markup"; columnIds: PObjectId[] };
|
|
50
43
|
|
|
51
44
|
export function createRowSelectionColumn({
|
|
52
45
|
selection,
|
|
53
46
|
columnId = uniquePlId() as string as PObjectId,
|
|
54
|
-
label =
|
|
47
|
+
label = "Selection marker",
|
|
55
48
|
domain,
|
|
56
49
|
}: {
|
|
57
50
|
selection: PlSelectionModel | undefined;
|
|
@@ -71,7 +64,7 @@ export function createRowSelectionColumn({
|
|
|
71
64
|
return {
|
|
72
65
|
id: columnId,
|
|
73
66
|
spec: {
|
|
74
|
-
kind:
|
|
67
|
+
kind: "PColumn",
|
|
75
68
|
valueType: ValueType.Int,
|
|
76
69
|
name: PColumnName.Table.RowSelection,
|
|
77
70
|
axesSpec: selection.axesSpec,
|