@platforma-sdk/model 1.53.11 → 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 +24 -22
- 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
|
@@ -1,59 +1,88 @@
|
|
|
1
1
|
// @DEPRECATED - use sdk/model/src/filters + sdk/model/src/annotations
|
|
2
|
-
import type { SUniversalPColumnId } from
|
|
3
|
-
import type { FilterSpecUi } from
|
|
4
|
-
import type { FilterSpec, FilterSpecLeaf } from
|
|
5
|
-
import type {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
2
|
+
import type { SUniversalPColumnId } from "@milaboratories/pl-model-common";
|
|
3
|
+
import type { FilterSpecUi } from "../../annotations";
|
|
4
|
+
import type { FilterSpec, FilterSpecLeaf } from "../../filters";
|
|
5
|
+
import type {
|
|
6
|
+
AnnotationFilter,
|
|
7
|
+
AnnotationMode,
|
|
8
|
+
AnnotationScript,
|
|
9
|
+
IsNA,
|
|
10
|
+
NotFilter,
|
|
11
|
+
NumericalComparisonFilter,
|
|
12
|
+
PatternFilter,
|
|
13
|
+
PatternPredicate,
|
|
14
|
+
ValueRank,
|
|
15
|
+
} from "./filter";
|
|
16
|
+
|
|
17
|
+
export type FilterUi = FilterSpec<
|
|
18
|
+
Extract<
|
|
19
|
+
FilterSpecLeaf,
|
|
20
|
+
// supported filters
|
|
21
|
+
{
|
|
22
|
+
type:
|
|
23
|
+
| "lessThan"
|
|
24
|
+
| "greaterThan"
|
|
25
|
+
| "lessThanOrEqual"
|
|
26
|
+
| "greaterThanOrEqual"
|
|
27
|
+
| "lessThanColumn"
|
|
28
|
+
| "lessThanColumnOrEqual"
|
|
29
|
+
| "patternContainSubsequence"
|
|
30
|
+
| "patternNotContainSubsequence"
|
|
31
|
+
| "patternEquals"
|
|
32
|
+
| "patternNotEquals"
|
|
33
|
+
| "topN"
|
|
34
|
+
| "bottomN"
|
|
35
|
+
| "isNA"
|
|
36
|
+
| "isNotNA";
|
|
37
|
+
}
|
|
38
|
+
>,
|
|
39
|
+
{ id: number; name?: string; isExpanded?: boolean }
|
|
40
|
+
>;
|
|
41
|
+
|
|
42
|
+
export type FilterUiType = Exclude<FilterUi, { type: undefined }>["type"];
|
|
29
43
|
|
|
30
44
|
export type FilterUiOfType<T extends FilterUiType> = Extract<FilterUi, { type: T }>;
|
|
31
45
|
|
|
32
46
|
// DEPRECATED - use lib/ui/uikit/src/composition/filters
|
|
33
47
|
export function unreachable(x: never): never {
|
|
34
48
|
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
|
|
35
|
-
throw new Error(
|
|
49
|
+
throw new Error("Unexpected object: " + x);
|
|
36
50
|
}
|
|
37
51
|
|
|
38
|
-
export type TypeToLiteral<T> =
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
export type TypeToLiteral<T> = [T] extends [FilterUiType]
|
|
53
|
+
? "FilterUiType"
|
|
54
|
+
: [T] extends [SUniversalPColumnId]
|
|
55
|
+
? "SUniversalPColumnId"
|
|
56
|
+
: [T] extends [PatternPredicate]
|
|
57
|
+
? "PatternPredicate"
|
|
58
|
+
: [T] extends [AnnotationFilter[]]
|
|
59
|
+
? "AnnotationFilter[]"
|
|
60
|
+
: [T] extends [AnnotationFilter]
|
|
61
|
+
? "AnnotationFilter"
|
|
62
|
+
: [T] extends [number]
|
|
63
|
+
? "number"
|
|
64
|
+
: [T] extends [number | undefined]
|
|
65
|
+
? "number?"
|
|
66
|
+
: [T] extends [string]
|
|
67
|
+
? "string"
|
|
68
|
+
: [T] extends [string | undefined]
|
|
69
|
+
? "string?"
|
|
70
|
+
: [T] extends [boolean]
|
|
71
|
+
? "boolean"
|
|
72
|
+
: [T] extends [boolean | undefined]
|
|
73
|
+
? "boolean?"
|
|
74
|
+
: [T] extends [unknown[]]
|
|
75
|
+
? "unknown[]"
|
|
76
|
+
: // this is special
|
|
77
|
+
T extends number
|
|
78
|
+
? "number"
|
|
79
|
+
: T extends string
|
|
80
|
+
? "string"
|
|
81
|
+
: T extends boolean
|
|
82
|
+
? "boolean"
|
|
83
|
+
: T extends Record<string, unknown>
|
|
84
|
+
? "form"
|
|
85
|
+
: "unknown";
|
|
57
86
|
|
|
58
87
|
// @TODO: "parse" option
|
|
59
88
|
export type TypeField<V> = {
|
|
@@ -62,23 +91,25 @@ export type TypeField<V> = {
|
|
|
62
91
|
defaultValue: () => V | undefined;
|
|
63
92
|
};
|
|
64
93
|
|
|
65
|
-
export type TypeFieldRecord<T extends FilterUi> = { [K in keyof T]: TypeField<T[K]
|
|
94
|
+
export type TypeFieldRecord<T extends FilterUi> = { [K in keyof T]: TypeField<T[K]> };
|
|
66
95
|
|
|
67
96
|
export type TypeForm<T> = {
|
|
68
|
-
[P in keyof T]: T[P] extends Record<string, unknown>
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
97
|
+
[P in keyof T]: T[P] extends Record<string, unknown>
|
|
98
|
+
? {
|
|
99
|
+
fieldType: "form";
|
|
100
|
+
label?: string;
|
|
101
|
+
form?: T[P] extends Record<string, unknown> ? TypeForm<T[P]> : undefined;
|
|
102
|
+
defaultValue: () => T[P];
|
|
103
|
+
}
|
|
104
|
+
: TypeField<T[P]>;
|
|
74
105
|
};
|
|
75
106
|
|
|
76
107
|
export type FormField =
|
|
77
|
-
{
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
108
|
+
| {
|
|
109
|
+
fieldType: "form";
|
|
110
|
+
form?: Record<string, FormField>;
|
|
111
|
+
defaultValue: () => Record<string, unknown>;
|
|
112
|
+
}
|
|
82
113
|
| TypeField<FilterUiType>
|
|
83
114
|
| TypeField<string>
|
|
84
115
|
| TypeField<number>
|
|
@@ -89,7 +120,9 @@ export type FormField =
|
|
|
89
120
|
|
|
90
121
|
export type AnyForm = Record<string, FormField>;
|
|
91
122
|
|
|
92
|
-
export type AnnotationStepUi = FilterSpecUi<Extract<FilterUi, { type:
|
|
123
|
+
export type AnnotationStepUi = FilterSpecUi<Extract<FilterUi, { type: "and" | "or" }>> & {
|
|
124
|
+
id: number;
|
|
125
|
+
};
|
|
93
126
|
|
|
94
127
|
export type AnnotationScriptUi = {
|
|
95
128
|
isCreated?: boolean;
|
|
@@ -99,90 +132,90 @@ export type AnnotationScriptUi = {
|
|
|
99
132
|
};
|
|
100
133
|
|
|
101
134
|
export function compileFilter(ui: FilterUi): AnnotationFilter {
|
|
102
|
-
if (ui.type ===
|
|
135
|
+
if (ui.type === "or") {
|
|
103
136
|
return {
|
|
104
|
-
type:
|
|
137
|
+
type: "or" as const,
|
|
105
138
|
filters: compileFilters(ui.filters),
|
|
106
139
|
};
|
|
107
140
|
}
|
|
108
141
|
|
|
109
|
-
if (ui.type ===
|
|
142
|
+
if (ui.type === "and") {
|
|
110
143
|
return {
|
|
111
|
-
type:
|
|
144
|
+
type: "and" as const,
|
|
112
145
|
filters: compileFilters(ui.filters),
|
|
113
146
|
};
|
|
114
147
|
}
|
|
115
148
|
|
|
116
|
-
if (ui.type ===
|
|
149
|
+
if (ui.type === "not") {
|
|
117
150
|
return {
|
|
118
|
-
type:
|
|
151
|
+
type: "not" as const,
|
|
119
152
|
filter: compileFilter(ui.filter),
|
|
120
153
|
};
|
|
121
154
|
}
|
|
122
155
|
|
|
123
|
-
if (ui.type ===
|
|
156
|
+
if (ui.type === "isNA") {
|
|
124
157
|
return {
|
|
125
|
-
type:
|
|
158
|
+
type: "isNA" as const,
|
|
126
159
|
column: ui.column,
|
|
127
160
|
};
|
|
128
161
|
}
|
|
129
162
|
|
|
130
|
-
if (ui.type ===
|
|
131
|
-
const isNAFilter: IsNA = { type:
|
|
132
|
-
const notFilter: NotFilter = { type:
|
|
163
|
+
if (ui.type === "isNotNA") {
|
|
164
|
+
const isNAFilter: IsNA = { type: "isNA", column: ui.column };
|
|
165
|
+
const notFilter: NotFilter = { type: "not", filter: isNAFilter };
|
|
133
166
|
return notFilter;
|
|
134
167
|
}
|
|
135
168
|
|
|
136
|
-
if (ui.type ===
|
|
169
|
+
if (ui.type === "patternEquals") {
|
|
137
170
|
return {
|
|
138
|
-
type:
|
|
171
|
+
type: "pattern" as const,
|
|
139
172
|
column: ui.column,
|
|
140
173
|
predicate: {
|
|
141
|
-
type:
|
|
174
|
+
type: "equals" as const,
|
|
142
175
|
value: ui.value,
|
|
143
176
|
},
|
|
144
177
|
};
|
|
145
178
|
}
|
|
146
179
|
|
|
147
|
-
if (ui.type ===
|
|
180
|
+
if (ui.type === "patternNotEquals") {
|
|
148
181
|
const patternFilter: PatternFilter = {
|
|
149
|
-
type:
|
|
182
|
+
type: "pattern",
|
|
150
183
|
column: ui.column,
|
|
151
|
-
predicate: { type:
|
|
184
|
+
predicate: { type: "equals", value: ui.value },
|
|
152
185
|
};
|
|
153
|
-
const notFilter: NotFilter = { type:
|
|
186
|
+
const notFilter: NotFilter = { type: "not", filter: patternFilter };
|
|
154
187
|
return notFilter;
|
|
155
188
|
}
|
|
156
189
|
|
|
157
|
-
if (ui.type ===
|
|
190
|
+
if (ui.type === "patternContainSubsequence") {
|
|
158
191
|
return {
|
|
159
|
-
type:
|
|
192
|
+
type: "pattern" as const,
|
|
160
193
|
column: ui.column,
|
|
161
194
|
predicate: {
|
|
162
|
-
type:
|
|
195
|
+
type: "containSubsequence" as const,
|
|
163
196
|
value: ui.value,
|
|
164
197
|
},
|
|
165
198
|
};
|
|
166
199
|
}
|
|
167
200
|
|
|
168
|
-
if (ui.type ===
|
|
201
|
+
if (ui.type === "patternNotContainSubsequence") {
|
|
169
202
|
const patternFilter: PatternFilter = {
|
|
170
|
-
type:
|
|
203
|
+
type: "pattern",
|
|
171
204
|
column: ui.column,
|
|
172
|
-
predicate: { type:
|
|
205
|
+
predicate: { type: "containSubsequence", value: ui.value },
|
|
173
206
|
};
|
|
174
|
-
const notFilter: NotFilter = { type:
|
|
207
|
+
const notFilter: NotFilter = { type: "not", filter: patternFilter };
|
|
175
208
|
return notFilter;
|
|
176
209
|
}
|
|
177
210
|
|
|
178
|
-
if (ui.type ===
|
|
211
|
+
if (ui.type === "topN") {
|
|
179
212
|
const rankTransform: ValueRank = {
|
|
180
|
-
transformer:
|
|
213
|
+
transformer: "rank",
|
|
181
214
|
column: ui.column,
|
|
182
215
|
descending: true,
|
|
183
216
|
};
|
|
184
217
|
const comparisonFilter: NumericalComparisonFilter = {
|
|
185
|
-
type:
|
|
218
|
+
type: "numericalComparison",
|
|
186
219
|
lhs: rankTransform,
|
|
187
220
|
rhs: ui.n,
|
|
188
221
|
allowEqual: true,
|
|
@@ -190,13 +223,13 @@ export function compileFilter(ui: FilterUi): AnnotationFilter {
|
|
|
190
223
|
return comparisonFilter;
|
|
191
224
|
}
|
|
192
225
|
|
|
193
|
-
if (ui.type ===
|
|
226
|
+
if (ui.type === "bottomN") {
|
|
194
227
|
const rankTransform: ValueRank = {
|
|
195
|
-
transformer:
|
|
228
|
+
transformer: "rank",
|
|
196
229
|
column: ui.column,
|
|
197
230
|
};
|
|
198
231
|
const comparisonFilter: NumericalComparisonFilter = {
|
|
199
|
-
type:
|
|
232
|
+
type: "numericalComparison",
|
|
200
233
|
lhs: rankTransform,
|
|
201
234
|
rhs: ui.n,
|
|
202
235
|
allowEqual: true,
|
|
@@ -204,43 +237,43 @@ export function compileFilter(ui: FilterUi): AnnotationFilter {
|
|
|
204
237
|
return comparisonFilter;
|
|
205
238
|
}
|
|
206
239
|
|
|
207
|
-
if (ui.type ===
|
|
240
|
+
if (ui.type === "lessThan") {
|
|
208
241
|
return {
|
|
209
|
-
type:
|
|
242
|
+
type: "numericalComparison" as const,
|
|
210
243
|
lhs: ui.column,
|
|
211
244
|
rhs: ui.x,
|
|
212
245
|
};
|
|
213
246
|
}
|
|
214
247
|
|
|
215
|
-
if (ui.type ===
|
|
248
|
+
if (ui.type === "greaterThan") {
|
|
216
249
|
return {
|
|
217
|
-
type:
|
|
250
|
+
type: "numericalComparison" as const,
|
|
218
251
|
rhs: ui.column,
|
|
219
252
|
lhs: ui.x,
|
|
220
253
|
};
|
|
221
254
|
}
|
|
222
255
|
|
|
223
|
-
if (ui.type ===
|
|
256
|
+
if (ui.type === "greaterThanOrEqual") {
|
|
224
257
|
return {
|
|
225
|
-
type:
|
|
258
|
+
type: "numericalComparison" as const,
|
|
226
259
|
rhs: ui.column,
|
|
227
260
|
lhs: ui.x,
|
|
228
261
|
allowEqual: true,
|
|
229
262
|
};
|
|
230
263
|
}
|
|
231
264
|
|
|
232
|
-
if (ui.type ===
|
|
265
|
+
if (ui.type === "lessThanOrEqual") {
|
|
233
266
|
return {
|
|
234
|
-
type:
|
|
267
|
+
type: "numericalComparison" as const,
|
|
235
268
|
lhs: ui.column,
|
|
236
269
|
rhs: ui.x,
|
|
237
270
|
allowEqual: true,
|
|
238
271
|
};
|
|
239
272
|
}
|
|
240
273
|
|
|
241
|
-
if (ui.type ===
|
|
274
|
+
if (ui.type === "lessThanColumn") {
|
|
242
275
|
return {
|
|
243
|
-
type:
|
|
276
|
+
type: "numericalComparison" as const,
|
|
244
277
|
lhs: ui.column,
|
|
245
278
|
rhs: ui.rhs,
|
|
246
279
|
minDiff: ui.minDiff,
|
|
@@ -248,9 +281,9 @@ export function compileFilter(ui: FilterUi): AnnotationFilter {
|
|
|
248
281
|
};
|
|
249
282
|
}
|
|
250
283
|
|
|
251
|
-
if (ui.type ===
|
|
284
|
+
if (ui.type === "lessThanColumnOrEqual") {
|
|
252
285
|
return {
|
|
253
|
-
type:
|
|
286
|
+
type: "numericalComparison" as const,
|
|
254
287
|
lhs: ui.column,
|
|
255
288
|
rhs: ui.rhs,
|
|
256
289
|
minDiff: ui.minDiff,
|
|
@@ -276,11 +309,11 @@ export function compileAnnotationScript(uiScript: AnnotationScriptUi): Annotatio
|
|
|
276
309
|
return false;
|
|
277
310
|
}
|
|
278
311
|
|
|
279
|
-
if (step.filter.type ===
|
|
312
|
+
if (step.filter.type === "or") {
|
|
280
313
|
return step.filter.filters.length > 0;
|
|
281
314
|
}
|
|
282
315
|
|
|
283
|
-
if (step.filter.type ===
|
|
316
|
+
if (step.filter.type === "and") {
|
|
284
317
|
return step.filter.filters.length > 0;
|
|
285
318
|
}
|
|
286
319
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @DEPRECATED - use sdk/model/src/filters + sdk/model/src/annotations
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
2
|
+
export * from "./filter";
|
|
3
|
+
export * from "./filters_ui";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @DEPRECATED - use sdk/model/src/filters + sdk/model/src/annotations
|
|
2
|
-
import type { PColumnSpec } from
|
|
2
|
+
import type { PColumnSpec } from "@milaboratories/pl-model-common";
|
|
3
3
|
|
|
4
|
-
export type SimplifiedPColumnSpec = Pick<PColumnSpec,
|
|
4
|
+
export type SimplifiedPColumnSpec = Pick<PColumnSpec, "valueType" | "annotations">;
|