@milaboratories/pl-model-common 1.19.16 → 1.19.18
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/drivers/blob.cjs.map +1 -1
- package/dist/drivers/blob.d.ts +0 -4
- package/dist/drivers/blob.d.ts.map +1 -1
- package/dist/drivers/blob.js.map +1 -1
- package/dist/drivers/pframe/spec/spec.cjs +2 -0
- package/dist/drivers/pframe/spec/spec.cjs.map +1 -1
- package/dist/drivers/pframe/spec/spec.d.ts +2 -0
- package/dist/drivers/pframe/spec/spec.d.ts.map +1 -1
- package/dist/drivers/pframe/spec/spec.js +2 -0
- package/dist/drivers/pframe/spec/spec.js.map +1 -1
- package/package.json +3 -3
- package/src/drivers/blob.ts +0 -12
- package/src/drivers/pframe/spec/spec.ts +3 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blob.cjs","sources":["../../src/drivers/blob.ts"],"sourcesContent":["import type { Branded } from '../branding';\nimport { z } from 'zod';\n\n/** Handle of locally downloaded blob. This handle is issued only after the\n * blob's content is downloaded locally, and ready for quick access. */\nexport type LocalBlobHandle = Branded<string, 'LocalBlobHandle'>;\n\n/** Handle of remote blob. This handle is issued as soon as the data becomes\n * available on the remote server. */\nexport type RemoteBlobHandle = Branded<string, 'RemoteBlobHandle'>;\n\n/** Being configured inside the output structure provides information about\n * blob's content and means to retrieve it when needed. */\nexport interface BlobHandleAndSize<\n H extends LocalBlobHandle | RemoteBlobHandle = | LocalBlobHandle\n | RemoteBlobHandle,\n> {\n /** Handle to retrieve block content using {@link BlobDriver.getContent()} */\n readonly handle: H;\n\n /** Blob size in bytes. */\n readonly size: number;\n}\n\n/** Range in bytes, from should be less than to. */\nexport const RangeBytes = z.object({\n /** Included left border. */\n from: z.number().min(0),\n /** Excluded right border. */\n to: z.number().min(1),\n});\n\nexport type RangeBytes = z.infer<typeof RangeBytes>;\n\nexport function newRangeBytesOpt(from?: number, to?: number): RangeBytes | undefined {\n if (from == undefined || to == undefined) {\n return undefined;\n }\n\n const range = { from, to };\n validateRangeBytes(range, 'newRangeBytesOpt');\n\n return range;\n}\n\nexport function validateRangeBytes(range: RangeBytes, errMsg: string) {\n if (range.from < 0 || range.from >= range.to) {\n throw new Error(`${errMsg}: invalid bytes range: ${range}`);\n }\n}\n\n/** Being configured inside the output structure provides information about\n * locally downloaded blob and means to retrieve it's content when needed. This\n * structure is created only after the blob's content is downloaded locally, and\n * ready for quick access. */\nexport type LocalBlobHandleAndSize = BlobHandleAndSize<LocalBlobHandle>;\n\n/** Being configured inside the output structure provides information about\n * remote blob and means to retrieve it's content when needed. This structure\n * is created as soon as remote blob becomes available. */\nexport type RemoteBlobHandleAndSize = BlobHandleAndSize<RemoteBlobHandle>;\n\nexport type GetContentOptions = {\n /** Byte range in [from, to) format. */\n range?: RangeBytes;\n /** Signal to abort the operation early. */\n signal?: AbortSignal;\n};\n\nexport type ContentHandler<T> = (content: ReadableStream, size: number) => Promise<T>;\n\n/** Defines API of blob driver as it is seen from the block UI code. */\nexport interface BlobDriver {\n /**\n * Given the blob handle returns its content.\n * Depending on the handle type, content will be served from locally downloaded file,\n * or directly from remote platforma storage.\n */\n getContent(\n handle: LocalBlobHandle | RemoteBlobHandle,\n
|
|
1
|
+
{"version":3,"file":"blob.cjs","sources":["../../src/drivers/blob.ts"],"sourcesContent":["import type { Branded } from '../branding';\nimport { z } from 'zod';\n\n/** Handle of locally downloaded blob. This handle is issued only after the\n * blob's content is downloaded locally, and ready for quick access. */\nexport type LocalBlobHandle = Branded<string, 'LocalBlobHandle'>;\n\n/** Handle of remote blob. This handle is issued as soon as the data becomes\n * available on the remote server. */\nexport type RemoteBlobHandle = Branded<string, 'RemoteBlobHandle'>;\n\n/** Being configured inside the output structure provides information about\n * blob's content and means to retrieve it when needed. */\nexport interface BlobHandleAndSize<\n H extends LocalBlobHandle | RemoteBlobHandle = | LocalBlobHandle\n | RemoteBlobHandle,\n> {\n /** Handle to retrieve block content using {@link BlobDriver.getContent()} */\n readonly handle: H;\n\n /** Blob size in bytes. */\n readonly size: number;\n}\n\n/** Range in bytes, from should be less than to. */\nexport const RangeBytes = z.object({\n /** Included left border. */\n from: z.number().min(0),\n /** Excluded right border. */\n to: z.number().min(1),\n});\n\nexport type RangeBytes = z.infer<typeof RangeBytes>;\n\nexport function newRangeBytesOpt(from?: number, to?: number): RangeBytes | undefined {\n if (from == undefined || to == undefined) {\n return undefined;\n }\n\n const range = { from, to };\n validateRangeBytes(range, 'newRangeBytesOpt');\n\n return range;\n}\n\nexport function validateRangeBytes(range: RangeBytes, errMsg: string) {\n if (range.from < 0 || range.from >= range.to) {\n throw new Error(`${errMsg}: invalid bytes range: ${range}`);\n }\n}\n\n/** Being configured inside the output structure provides information about\n * locally downloaded blob and means to retrieve it's content when needed. This\n * structure is created only after the blob's content is downloaded locally, and\n * ready for quick access. */\nexport type LocalBlobHandleAndSize = BlobHandleAndSize<LocalBlobHandle>;\n\n/** Being configured inside the output structure provides information about\n * remote blob and means to retrieve it's content when needed. This structure\n * is created as soon as remote blob becomes available. */\nexport type RemoteBlobHandleAndSize = BlobHandleAndSize<RemoteBlobHandle>;\n\nexport type GetContentOptions = {\n /** Byte range in [from, to) format. */\n range?: RangeBytes;\n /** Signal to abort the operation early. */\n signal?: AbortSignal;\n};\n\nexport type ContentHandler<T> = (content: ReadableStream, size: number) => Promise<T>;\n\n/** Defines API of blob driver as it is seen from the block UI code. */\nexport interface BlobDriver {\n /**\n * Given the blob handle returns its content.\n * Depending on the handle type, content will be served from locally downloaded file,\n * or directly from remote platforma storage.\n */\n getContent(\n handle: LocalBlobHandle | RemoteBlobHandle,\n range?: RangeBytes,\n ): Promise<Uint8Array>;\n}\n"],"names":["z"],"mappings":";;;;AAwBA;AACO,MAAM,UAAU,GAAGA,KAAC,CAAC,MAAM,CAAC;;IAEjC,IAAI,EAAEA,KAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;;IAEvB,EAAE,EAAEA,KAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AACtB,CAAA;AAIK,SAAU,gBAAgB,CAAC,IAAa,EAAE,EAAW,EAAA;IACzD,IAAI,IAAI,IAAI,SAAS,IAAI,EAAE,IAAI,SAAS,EAAE;AACxC,QAAA,OAAO,SAAS;IAClB;AAEA,IAAA,MAAM,KAAK,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE;AAC1B,IAAA,kBAAkB,CAAC,KAAK,EAAE,kBAAkB,CAAC;AAE7C,IAAA,OAAO,KAAK;AACd;AAEM,SAAU,kBAAkB,CAAC,KAAiB,EAAE,MAAc,EAAA;AAClE,IAAA,IAAI,KAAK,CAAC,IAAI,GAAG,CAAC,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,EAAE,EAAE;QAC5C,MAAM,IAAI,KAAK,CAAC,CAAA,EAAG,MAAM,CAAA,uBAAA,EAA0B,KAAK,CAAA,CAAE,CAAC;IAC7D;AACF;;;;;;"}
|
package/dist/drivers/blob.d.ts
CHANGED
|
@@ -53,10 +53,6 @@ export interface BlobDriver {
|
|
|
53
53
|
* Depending on the handle type, content will be served from locally downloaded file,
|
|
54
54
|
* or directly from remote platforma storage.
|
|
55
55
|
*/
|
|
56
|
-
getContent(handle: LocalBlobHandle | RemoteBlobHandle): Promise<Uint8Array>;
|
|
57
|
-
getContent(handle: LocalBlobHandle | RemoteBlobHandle, options?: GetContentOptions): Promise<Uint8Array>;
|
|
58
|
-
/** @deprecated Use {@link getContent} with {@link GetContentOptions} instead */
|
|
59
56
|
getContent(handle: LocalBlobHandle | RemoteBlobHandle, range?: RangeBytes): Promise<Uint8Array>;
|
|
60
|
-
getContent(handle: LocalBlobHandle | RemoteBlobHandle, optionsOrRange?: GetContentOptions | RangeBytes): Promise<Uint8Array>;
|
|
61
57
|
}
|
|
62
58
|
//# sourceMappingURL=blob.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blob.d.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BAAsB,GAAG,iBAAiB,CAAC,eAAe,CAAC,CAAC;AAExE;;0DAE0D;AAC1D,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;AAE1E,MAAM,MAAM,iBAAiB,GAAG;IAC9B,uCAAuC;IACvC,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,2CAA2C;IAC3C,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;AAEtF,uEAAuE;AACvE,MAAM,WAAW,UAAU;IACzB;;;;OAIG;IACH,UAAU,CACR,MAAM,EAAE,eAAe,GAAG,gBAAgB,EAC1C,KAAK,CAAC,EAAE,UAAU,GACjB,OAAO,CAAC,UAAU,CAAC,CAAC;CACxB"}
|
package/dist/drivers/blob.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blob.js","sources":["../../src/drivers/blob.ts"],"sourcesContent":["import type { Branded } from '../branding';\nimport { z } from 'zod';\n\n/** Handle of locally downloaded blob. This handle is issued only after the\n * blob's content is downloaded locally, and ready for quick access. */\nexport type LocalBlobHandle = Branded<string, 'LocalBlobHandle'>;\n\n/** Handle of remote blob. This handle is issued as soon as the data becomes\n * available on the remote server. */\nexport type RemoteBlobHandle = Branded<string, 'RemoteBlobHandle'>;\n\n/** Being configured inside the output structure provides information about\n * blob's content and means to retrieve it when needed. */\nexport interface BlobHandleAndSize<\n H extends LocalBlobHandle | RemoteBlobHandle = | LocalBlobHandle\n | RemoteBlobHandle,\n> {\n /** Handle to retrieve block content using {@link BlobDriver.getContent()} */\n readonly handle: H;\n\n /** Blob size in bytes. */\n readonly size: number;\n}\n\n/** Range in bytes, from should be less than to. */\nexport const RangeBytes = z.object({\n /** Included left border. */\n from: z.number().min(0),\n /** Excluded right border. */\n to: z.number().min(1),\n});\n\nexport type RangeBytes = z.infer<typeof RangeBytes>;\n\nexport function newRangeBytesOpt(from?: number, to?: number): RangeBytes | undefined {\n if (from == undefined || to == undefined) {\n return undefined;\n }\n\n const range = { from, to };\n validateRangeBytes(range, 'newRangeBytesOpt');\n\n return range;\n}\n\nexport function validateRangeBytes(range: RangeBytes, errMsg: string) {\n if (range.from < 0 || range.from >= range.to) {\n throw new Error(`${errMsg}: invalid bytes range: ${range}`);\n }\n}\n\n/** Being configured inside the output structure provides information about\n * locally downloaded blob and means to retrieve it's content when needed. This\n * structure is created only after the blob's content is downloaded locally, and\n * ready for quick access. */\nexport type LocalBlobHandleAndSize = BlobHandleAndSize<LocalBlobHandle>;\n\n/** Being configured inside the output structure provides information about\n * remote blob and means to retrieve it's content when needed. This structure\n * is created as soon as remote blob becomes available. */\nexport type RemoteBlobHandleAndSize = BlobHandleAndSize<RemoteBlobHandle>;\n\nexport type GetContentOptions = {\n /** Byte range in [from, to) format. */\n range?: RangeBytes;\n /** Signal to abort the operation early. */\n signal?: AbortSignal;\n};\n\nexport type ContentHandler<T> = (content: ReadableStream, size: number) => Promise<T>;\n\n/** Defines API of blob driver as it is seen from the block UI code. */\nexport interface BlobDriver {\n /**\n * Given the blob handle returns its content.\n * Depending on the handle type, content will be served from locally downloaded file,\n * or directly from remote platforma storage.\n */\n getContent(\n handle: LocalBlobHandle | RemoteBlobHandle,\n
|
|
1
|
+
{"version":3,"file":"blob.js","sources":["../../src/drivers/blob.ts"],"sourcesContent":["import type { Branded } from '../branding';\nimport { z } from 'zod';\n\n/** Handle of locally downloaded blob. This handle is issued only after the\n * blob's content is downloaded locally, and ready for quick access. */\nexport type LocalBlobHandle = Branded<string, 'LocalBlobHandle'>;\n\n/** Handle of remote blob. This handle is issued as soon as the data becomes\n * available on the remote server. */\nexport type RemoteBlobHandle = Branded<string, 'RemoteBlobHandle'>;\n\n/** Being configured inside the output structure provides information about\n * blob's content and means to retrieve it when needed. */\nexport interface BlobHandleAndSize<\n H extends LocalBlobHandle | RemoteBlobHandle = | LocalBlobHandle\n | RemoteBlobHandle,\n> {\n /** Handle to retrieve block content using {@link BlobDriver.getContent()} */\n readonly handle: H;\n\n /** Blob size in bytes. */\n readonly size: number;\n}\n\n/** Range in bytes, from should be less than to. */\nexport const RangeBytes = z.object({\n /** Included left border. */\n from: z.number().min(0),\n /** Excluded right border. */\n to: z.number().min(1),\n});\n\nexport type RangeBytes = z.infer<typeof RangeBytes>;\n\nexport function newRangeBytesOpt(from?: number, to?: number): RangeBytes | undefined {\n if (from == undefined || to == undefined) {\n return undefined;\n }\n\n const range = { from, to };\n validateRangeBytes(range, 'newRangeBytesOpt');\n\n return range;\n}\n\nexport function validateRangeBytes(range: RangeBytes, errMsg: string) {\n if (range.from < 0 || range.from >= range.to) {\n throw new Error(`${errMsg}: invalid bytes range: ${range}`);\n }\n}\n\n/** Being configured inside the output structure provides information about\n * locally downloaded blob and means to retrieve it's content when needed. This\n * structure is created only after the blob's content is downloaded locally, and\n * ready for quick access. */\nexport type LocalBlobHandleAndSize = BlobHandleAndSize<LocalBlobHandle>;\n\n/** Being configured inside the output structure provides information about\n * remote blob and means to retrieve it's content when needed. This structure\n * is created as soon as remote blob becomes available. */\nexport type RemoteBlobHandleAndSize = BlobHandleAndSize<RemoteBlobHandle>;\n\nexport type GetContentOptions = {\n /** Byte range in [from, to) format. */\n range?: RangeBytes;\n /** Signal to abort the operation early. */\n signal?: AbortSignal;\n};\n\nexport type ContentHandler<T> = (content: ReadableStream, size: number) => Promise<T>;\n\n/** Defines API of blob driver as it is seen from the block UI code. */\nexport interface BlobDriver {\n /**\n * Given the blob handle returns its content.\n * Depending on the handle type, content will be served from locally downloaded file,\n * or directly from remote platforma storage.\n */\n getContent(\n handle: LocalBlobHandle | RemoteBlobHandle,\n range?: RangeBytes,\n ): Promise<Uint8Array>;\n}\n"],"names":[],"mappings":";;AAwBA;AACO,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;;IAEjC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;;IAEvB,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AACtB,CAAA;AAIK,SAAU,gBAAgB,CAAC,IAAa,EAAE,EAAW,EAAA;IACzD,IAAI,IAAI,IAAI,SAAS,IAAI,EAAE,IAAI,SAAS,EAAE;AACxC,QAAA,OAAO,SAAS;IAClB;AAEA,IAAA,MAAM,KAAK,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE;AAC1B,IAAA,kBAAkB,CAAC,KAAK,EAAE,kBAAkB,CAAC;AAE7C,IAAA,OAAO,KAAK;AACd;AAEM,SAAU,kBAAkB,CAAC,KAAiB,EAAE,MAAc,EAAA;AAClE,IAAA,IAAI,KAAK,CAAC,IAAI,GAAG,CAAC,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,EAAE,EAAE;QAC5C,MAAM,IAAI,KAAK,CAAC,CAAA,EAAG,MAAM,CAAA,uBAAA,EAA0B,KAAK,CAAA,CAAE,CAAC;IAC7D;AACF;;;;"}
|
|
@@ -67,6 +67,7 @@ const Annotation = {
|
|
|
67
67
|
IsVirtual: 'pl7.app/graph/isVirtual',
|
|
68
68
|
},
|
|
69
69
|
HideDataFromUi: 'pl7.app/hideDataFromUi',
|
|
70
|
+
HideDataFromGraphs: 'pl7.app/hideDataFromGraphs',
|
|
70
71
|
IsLinkerColumn: 'pl7.app/isLinkerColumn',
|
|
71
72
|
Label: 'pl7.app/label',
|
|
72
73
|
Max: 'pl7.app/max',
|
|
@@ -89,6 +90,7 @@ const AnnotationJson = {
|
|
|
89
90
|
[Annotation.DiscreteValues]: zod.z.array(zod.z.string()).or(zod.z.array(zod.z.number())),
|
|
90
91
|
[Annotation.Graph.IsVirtual]: zod.z.boolean(),
|
|
91
92
|
[Annotation.HideDataFromUi]: zod.z.boolean(),
|
|
93
|
+
[Annotation.HideDataFromGraphs]: zod.z.boolean(),
|
|
92
94
|
[Annotation.IsLinkerColumn]: zod.z.boolean(),
|
|
93
95
|
[Annotation.Max]: zod.z.number(),
|
|
94
96
|
[Annotation.Min]: zod.z.number(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec.cjs","sources":["../../../../src/drivers/pframe/spec/spec.ts"],"sourcesContent":["import { ensureError } from '../../../errors';\nimport {\n canonicalizeJson,\n type CanonicalizedJson,\n type StringifiedJson,\n} from '../../../json';\nimport type {\n PObject,\n PObjectId,\n PObjectSpec,\n} from '../../../pool';\nimport { z } from 'zod';\n\nexport const ValueType = {\n Int: 'Int',\n Long: 'Long',\n Float: 'Float',\n Double: 'Double',\n String: 'String',\n Bytes: 'Bytes',\n} as const;\n\n/** PFrame columns and axes within them may store one of these types. */\nexport type ValueType = (typeof ValueType)[keyof typeof ValueType];\n\nexport type Metadata = Record<string, string>;\n\nexport function readMetadata<U extends Metadata, T extends keyof U = keyof U>(\n metadata: Metadata | undefined,\n key: T,\n): U[T] | undefined {\n return (metadata as U | undefined)?.[key];\n}\n\ntype MetadataJsonImpl<M> = {\n [P in keyof M as (M[P] extends StringifiedJson ? P : never)]: M[P] extends StringifiedJson<infer U> ? z.ZodType<U> : never;\n};\nexport type MetadataJson<M> = MetadataJsonImpl<Required<M>>;\n\nexport function readMetadataJsonOrThrow<M extends Metadata, T extends keyof MetadataJson<M>>(\n metadata: Metadata | undefined,\n metadataJson: MetadataJson<M>,\n key: T,\n methodNameInError: string = 'readMetadataJsonOrThrow',\n): z.infer<MetadataJson<M>[T]> | undefined {\n const json = readMetadata<M, T>(metadata, key);\n if (json === undefined) return undefined;\n\n const schema = metadataJson[key];\n try {\n const value = JSON.parse(json);\n return schema.parse(value);\n } catch (error: unknown) {\n throw new Error(\n `${methodNameInError} failed, `\n + `key: ${String(key)}, `\n + `value: ${json}, `\n + `error: ${ensureError(error)}`,\n );\n }\n}\n\nexport function readMetadataJson<M extends Metadata, T extends keyof MetadataJson<M>>(\n metadata: Metadata | undefined,\n metadataJson: MetadataJson<M>,\n key: T,\n): z.infer<MetadataJson<M>[T]> | undefined {\n try {\n return readMetadataJsonOrThrow(metadata, metadataJson, key);\n } catch {\n return undefined; // treat invalid values as unset\n }\n}\n\n/// Well-known domains\nexport const Domain = {\n Alphabet: 'pl7.app/alphabet',\n BlockId: 'pl7.app/blockId',\n} as const;\n\nexport type Domain = Metadata & Partial<{\n [Domain.Alphabet]: 'nucleotide' | 'aminoacid' | string;\n [Domain.BlockId]: string;\n}>;\n\nexport type DomainJson = MetadataJson<Domain>;\nexport const DomainJson: DomainJson = {};\n\n/// Helper function for reading plain domain values\nexport function readDomain<T extends keyof Domain>(\n spec: { domain?: Metadata | undefined } | undefined,\n key: T,\n): Domain[T] | undefined {\n return readMetadata<Domain, T>(spec?.domain, key);\n}\n\n/// Helper function for reading json-encoded domain values, throws on JSON parsing error\nexport function readDomainJsonOrThrow<T extends keyof DomainJson>(\n spec: { domain?: Metadata | undefined } | undefined,\n key: T,\n): z.infer<DomainJson[T]> | undefined {\n return readMetadataJsonOrThrow<Domain, T>(spec?.domain, DomainJson, key, 'readDomainJsonOrThrow');\n}\n\n/// Helper function for reading json-encoded domain values, returns undefined on JSON parsing error\nexport function readDomainJson<T extends keyof DomainJson>(\n spec: { domain?: Metadata | undefined } | undefined,\n key: T,\n): z.infer<DomainJson[T]> | undefined {\n return readMetadataJson<Domain, T>(spec?.domain, DomainJson, key);\n}\n\n/// Well-known annotations\nexport const Annotation = {\n Alphabet: 'pl7.app/alphabet',\n Description: 'pl7.app/description',\n DiscreteValues: 'pl7.app/discreteValues',\n Format: 'pl7.app/format',\n Graph: {\n IsVirtual: 'pl7.app/graph/isVirtual',\n },\n HideDataFromUi: 'pl7.app/hideDataFromUi',\n IsLinkerColumn: 'pl7.app/isLinkerColumn',\n Label: 'pl7.app/label',\n Max: 'pl7.app/max',\n Min: 'pl7.app/min',\n Parents: 'pl7.app/parents',\n Sequence: {\n Annotation: {\n Mapping: 'pl7.app/sequence/annotation/mapping',\n },\n IsAnnotation: 'pl7.app/sequence/isAnnotation',\n },\n Table: {\n FontFamily: 'pl7.app/table/fontFamily',\n OrderPriority: 'pl7.app/table/orderPriority',\n Visibility: 'pl7.app/table/visibility',\n },\n Trace: 'pl7.app/trace',\n} as const;\n\nexport type Annotation = Metadata & Partial<{\n [Annotation.Alphabet]: 'nucleotide' | 'aminoacid' | string;\n [Annotation.Description]: string;\n [Annotation.DiscreteValues]: StringifiedJson<number[]> | StringifiedJson<string[]>;\n [Annotation.Format]: string;\n [Annotation.Graph.IsVirtual]: StringifiedJson<boolean>;\n [Annotation.HideDataFromUi]: StringifiedJson<boolean>;\n [Annotation.IsLinkerColumn]: StringifiedJson<boolean>;\n [Annotation.Label]: string;\n [Annotation.Max]: StringifiedJson<number>;\n [Annotation.Min]: StringifiedJson<number>;\n [Annotation.Parents]: StringifiedJson<AxisSpec['name'][]>;\n [Annotation.Sequence.Annotation.Mapping]: StringifiedJson<Record<string, string>>;\n [Annotation.Sequence.IsAnnotation]: StringifiedJson<boolean>;\n [Annotation.Table.FontFamily]: string;\n [Annotation.Table.OrderPriority]: StringifiedJson<number>;\n [Annotation.Table.Visibility]: 'hidden' | 'optional' | string;\n [Annotation.Trace]: StringifiedJson<Record<string, unknown>>;\n}>;\n\n// export const AxisSpec = z.object({\n// type: z.nativeEnum(ValueType),\n// name: z.string(),\n// domain: z.record(z.string(), z.string()).optional(),\n// annotations: z.record(z.string(), z.string()).optional(),\n// parentAxes: z.array(z.number()).optional(),\n// }).passthrough();\n//\n// type Expect<T extends true> = T;\n// type Equal<X, Y> =\n// (<T>() => T extends X ? 1 : 2) extends (<T>() => T extends Y ? 1 : 2) ? true : false;\n//\n// type _test = Expect<Equal<\n// Readonly<z.infer<typeof AxisSpec>>,\n// Readonly<AxisSpec & Record<string, unknown>>\n// >>;\n\nexport type AnnotationJson = MetadataJson<Annotation>;\nexport const AnnotationJson: AnnotationJson = {\n [Annotation.DiscreteValues]: z.array(z.string()).or(z.array(z.number())),\n [Annotation.Graph.IsVirtual]: z.boolean(),\n [Annotation.HideDataFromUi]: z.boolean(),\n [Annotation.IsLinkerColumn]: z.boolean(),\n [Annotation.Max]: z.number(),\n [Annotation.Min]: z.number(),\n [Annotation.Parents]: z.array(z.string()),\n [Annotation.Sequence.Annotation.Mapping]: z.record(z.string(), z.string()),\n [Annotation.Sequence.IsAnnotation]: z.boolean(),\n [Annotation.Table.OrderPriority]: z.number(),\n [Annotation.Trace]: z.record(z.string(), z.unknown()),\n};\n\n/// Helper function for reading plain annotation values\nexport function readAnnotation<T extends keyof Annotation>(\n spec: { annotations?: Metadata | undefined } | undefined,\n key: T,\n): Annotation[T] | undefined {\n return readMetadata<Annotation, T>(spec?.annotations, key);\n}\n\n/// Helper function for reading json-encoded annotation values, throws on JSON parsing error\nexport function readAnnotationJsonOrThrow<T extends keyof AnnotationJson>(\n spec: { annotations?: Metadata | undefined } | undefined,\n key: T,\n): z.infer<AnnotationJson[T]> | undefined {\n return readMetadataJsonOrThrow<Annotation, T>(spec?.annotations, AnnotationJson, key, 'readAnnotationJsonOrThrow');\n}\n\n/// Helper function for reading json-encoded annotation values, returns undefined on JSON parsing error\nexport function readAnnotationJson<T extends keyof AnnotationJson>(\n spec: { annotations?: Metadata | undefined } | undefined,\n key: T,\n): z.infer<AnnotationJson[T]> | undefined {\n return readMetadataJson<Annotation, T>(spec?.annotations, AnnotationJson, key);\n}\n\n/**\n * Specification of an individual axis.\n *\n * Each axis is a part of a composite key that addresses data inside the PColumn.\n *\n * Each record inside a PColumn is addressed by a unique tuple of values set for\n * all the axes specified in the column spec.\n */\nexport interface AxisSpec {\n /** Type of the axis value. Should not use non-key types like float or double. */\n readonly type: ValueType;\n\n /** Name of the axis */\n readonly name: string;\n\n /** Adds auxiliary information to the axis name, type and parents to form a\n * unique identifier */\n readonly domain?: Record<string, string>;\n\n /** Any additional information attached to the axis that does not affect its\n * identifier */\n readonly annotations?: Record<string, string>;\n\n /**\n * Parent axes provide contextual grouping for the axis in question, establishing\n * a hierarchy where the current axis is dependent on one or more axes for its\n * full definition and meaning. For instance, in a data structure where each\n * \"container\" axis may contain multiple \"item\" axes, the `item` axis would\n * list the index of the `container` axis in this field to denote its dependency.\n *\n * This means that the identity or significance of the `item` axis is only\n * interpretable when combined with its parent `container` axis. An `item` axis\n * index by itself may be non-unique and only gains uniqueness within the context\n * of its parent `container`. Therefore, the `parentAxes` field is essential for\n * mapping these relationships and ensuring data coherence across nested or\n * multi-level data models.\n *\n * A list of zero-based indices of parent axes in the overall axes specification\n * from the column spec. Each index corresponds to the position of a parent axis\n * in the list that defines the structure of the data model.\n */\n readonly parentAxes?: number[];\n}\n\n/** Parents are specs, not indexes; normalized axis can be used considering its parents independently from column */\nexport interface AxisSpecNormalized extends Omit<AxisSpec, 'parentAxes'> {\n parentAxesSpec: AxisSpecNormalized[];\n}\n\n/** Tree: axis is a root, its parents are children */\nexport type AxisTree = {\n axis: AxisSpecNormalized;\n children: AxisTree[]; // parents\n};\n\nfunction makeAxisTree(axis: AxisSpecNormalized): AxisTree {\n return { axis, children: [] };\n}\n\n/** Build tree by axis parents annotations */\nexport function getAxesTree(rootAxis: AxisSpecNormalized): AxisTree {\n const root = makeAxisTree(rootAxis);\n let nodesQ = [root];\n while (nodesQ.length) {\n const nextNodes: AxisTree[] = [];\n for (const node of nodesQ) {\n node.children = node.axis.parentAxesSpec.map(makeAxisTree);\n nextNodes.push(...node.children);\n }\n nodesQ = nextNodes;\n }\n return root;\n}\n\n/** Get set of canonicalized axisIds from axisTree */\nexport function getSetFromAxisTree(tree: AxisTree): Set<CanonicalizedJson<AxisId>> {\n const set = new Set([canonicalizeJson(getAxisId(tree.axis))]);\n let nodesQ = [tree];\n while (nodesQ.length) {\n const nextNodes = [];\n for (const node of nodesQ) {\n for (const parent of node.children) {\n set.add(canonicalizeJson(getAxisId(parent.axis)));\n nextNodes.push(parent);\n }\n }\n nodesQ = nextNodes;\n }\n return set;\n}\n\n/** Get array of axisSpecs from axisTree */\nexport function getArrayFromAxisTree(tree: AxisTree): AxisSpecNormalized[] {\n const res = [tree.axis];\n let nodesQ = [tree];\n while (nodesQ.length) {\n const nextNodes = [];\n for (const node of nodesQ) {\n for (const parent of node.children) {\n res.push(parent.axis);\n nextNodes.push(parent);\n }\n }\n nodesQ = nextNodes;\n }\n return res;\n}\n\nexport function canonicalizeAxisWithParents(axis: AxisSpecNormalized) {\n return canonicalizeJson(getArrayFromAxisTree(getAxesTree(axis)).map(getAxisId));\n}\n\nfunction normalizingAxesComparator(axis1: AxisSpecNormalized, axis2: AxisSpecNormalized): 1 | -1 | 0 {\n if (axis1.name !== axis2.name) {\n return axis1.name < axis2.name ? 1 : -1;\n }\n if (axis1.type !== axis2.type) {\n return axis1.type < axis2.type ? 1 : -1;\n }\n const domain1 = canonicalizeJson(axis1.domain ?? {});\n const domain2 = canonicalizeJson(axis2.domain ?? {});\n if (domain1 !== domain2) {\n return domain1 < domain2 ? 1 : -1;\n }\n\n const parents1 = canonicalizeAxisWithParents(axis1);\n const parents2 = canonicalizeAxisWithParents(axis2);\n\n if (parents1 !== parents2) {\n return parents1 < parents2 ? 1 : -1;\n }\n\n const annotation1 = canonicalizeJson(axis1.annotations ?? {});\n const annotation2 = canonicalizeJson(axis2.annotations ?? {});\n if (annotation1 !== annotation2) {\n return annotation1 < annotation2 ? 1 : -1;\n }\n return 0;\n}\n\nfunction parseParentsFromAnnotations(axis: AxisSpec) {\n const parentsList = readAnnotationJson(axis, Annotation.Parents);\n if (parentsList === undefined) {\n return [];\n }\n return parentsList;\n}\n\nfunction sortParentsDeep(axisSpec: AxisSpecNormalized) {\n axisSpec.parentAxesSpec.forEach(sortParentsDeep);\n axisSpec.parentAxesSpec.sort(normalizingAxesComparator);\n}\n\nfunction hasCycleOfParents(axisSpec: AxisSpecNormalized) {\n const root = makeAxisTree(axisSpec);\n let nodesQ = [root];\n const ancestors = new Set(canonicalizeJson(getAxisId(axisSpec)));\n while (nodesQ.length) {\n const nextNodes: AxisTree[] = [];\n const levelIds = new Set<CanonicalizedJson<AxisId>>();\n for (const node of nodesQ) {\n node.children = node.axis.parentAxesSpec.map(makeAxisTree);\n for (const child of node.children) {\n const childId = canonicalizeJson(getAxisId(child.axis));\n if (!levelIds.has(childId)) {\n nextNodes.push(child);\n levelIds.add(childId);\n if (ancestors.has(childId)) {\n return true;\n }\n ancestors.add(childId);\n }\n }\n }\n nodesQ = nextNodes;\n }\n return false;\n}\n\n/** Create list of normalized axisSpec (parents are in array of specs, not indexes) */\nexport function getNormalizedAxesList(axes: AxisSpec[]): AxisSpecNormalized[] {\n if (!axes.length) {\n return [];\n }\n const modifiedAxes: AxisSpecNormalized[] = axes.map((axis) => {\n const { parentAxes: _, ...copiedRest } = axis;\n return { ...copiedRest, annotations: { ...copiedRest.annotations }, parentAxesSpec: [] };\n });\n\n axes.forEach((axis, idx) => {\n const modifiedAxis = modifiedAxes[idx];\n if (axis.parentAxes) { // if we have parents by indexes then take from the list\n modifiedAxis.parentAxesSpec = axis.parentAxes.map((idx) => modifiedAxes[idx]);\n } else { // else try to parse from annotation name\n const parents = parseParentsFromAnnotations(axis).map((name) => modifiedAxes.find((axis) => axis.name === name));\n modifiedAxis.parentAxesSpec = parents.some((p) => p === undefined) ? [] : parents as AxisSpecNormalized[];\n\n delete modifiedAxis.annotations?.[Annotation.Parents];\n }\n });\n\n if (modifiedAxes.some(hasCycleOfParents)) { // Axes list is broken\n modifiedAxes.forEach((axis) => {\n axis.parentAxesSpec = [];\n });\n } else {\n modifiedAxes.forEach((axis) => {\n sortParentsDeep(axis);\n });\n }\n\n return modifiedAxes;\n}\n\n/** Create list of regular axisSpec from normalized (parents are indexes, inside of current axes list) */\nexport function getDenormalizedAxesList(axesSpec: AxisSpecNormalized[]): AxisSpec[] {\n const idsList = axesSpec.map((axisSpec) => canonicalizeJson(getAxisId(axisSpec)));\n return axesSpec.map((axisSpec) => {\n const parentsIds = axisSpec.parentAxesSpec.map((axisSpec) => canonicalizeJson(getAxisId(axisSpec)));\n const parentIdxs = parentsIds.map((id) => idsList.indexOf(id));\n const { parentAxesSpec: _, ...copiedRest } = axisSpec;\n if (parentIdxs.length) {\n return { ...copiedRest, parentAxes: parentIdxs } as AxisSpec;\n }\n return copiedRest;\n });\n}\n\n/** Common type representing spec for all the axes in a column */\nexport type AxesSpec = AxisSpec[];\n\n/// Well-known column names\nexport const PColumnName = {\n Label: 'pl7.app/label',\n Table: {\n RowSelection: 'pl7.app/table/row-selection',\n },\n} as const;\n\n/**\n * Full column specification including all axes specs and specs of the column\n * itself.\n *\n * A PColumn in its essence represents a mapping from a fixed size, explicitly\n * typed tuple to an explicitly typed value.\n *\n * (axis1Value1, axis2Value1, ...) -> columnValue\n *\n * Each element in tuple correspond to the axis having the same index in axesSpec.\n */\nexport interface PUniversalColumnSpec extends PObjectSpec {\n /** Defines specific type of BObject, the most generic type of unit of\n * information in Platforma Project. */\n readonly kind: 'PColumn';\n\n /** Type of column values */\n readonly valueType: string;\n\n /** Column name */\n readonly name: string;\n\n /** Adds auxiliary information to the axis name, type and parents to form a\n * unique identifier */\n readonly domain?: Record<string, string>;\n\n /** Any additional information attached to the column that does not affect its\n * identifier */\n readonly annotations?: Record<string, string>;\n\n /** A list of zero-based indices of parent axes from the {@link axesSpec} array. */\n readonly parentAxes?: number[];\n\n /** Axes specifications */\n readonly axesSpec: AxesSpec;\n}\n\n/**\n * Specification of a data column.\n *\n * Data column is a specialized type of PColumn that stores only simple values (strings and numbers)\n * addressed by multiple keys. This is in contrast to other PColumn variants that can store more complex\n * values like files or other abstract data types. Data columns are optimized for storing and processing\n * basic tabular data.\n */\nexport interface PDataColumnSpec extends PUniversalColumnSpec {\n /** Type of column values */\n readonly valueType: ValueType;\n}\n\n// @todo: change this to PUniversalColumnSpec\nexport type PColumnSpec = PDataColumnSpec;\n\n/** Unique PColumnSpec identifier */\nexport type PColumnSpecId = {\n /** Defines specific type of BObject, the most generic type of unit of\n * information in Platforma Project. */\n readonly kind: 'PColumn';\n\n /** Type of column values */\n readonly valueType: ValueType;\n\n /** Column name */\n readonly name: string;\n\n /** Adds auxiliary information to the axis name, type and parents to form a\n * unique identifier */\n readonly domain?: Record<string, string>;\n\n /** A list of zero-based indices of parent axes from the {@link axesSpec} array. */\n readonly parentAxes?: number[];\n\n /** Axes id */\n readonly axesId: AxesId;\n};\n\nexport function getPColumnSpecId(spec: PColumnSpec): PColumnSpecId {\n return {\n kind: spec.kind,\n valueType: spec.valueType,\n name: spec.name,\n domain: spec.domain,\n parentAxes: spec.parentAxes,\n axesId: getAxesId(spec.axesSpec),\n };\n}\n\nexport interface PColumn<Data> extends PObject<Data> {\n /** PColumn spec, allowing it to be found among other PObjects */\n readonly spec: PColumnSpec;\n}\n\n/** Columns in a PFrame also have internal identifier, this object represents\n * combination of specs and such id */\nexport interface PColumnIdAndSpec {\n /** Internal column id within the PFrame */\n readonly columnId: PObjectId;\n\n /** Column spec */\n readonly spec: PColumnSpec;\n}\n\n/** Get column id and spec from a column */\nexport function getColumnIdAndSpec<Data>(column: PColumn<Data>): PColumnIdAndSpec {\n return {\n columnId: column.id,\n spec: column.spec,\n };\n}\n\n/** Information returned by {@link PFrame.listColumns} method */\nexport interface PColumnInfo extends PColumnIdAndSpec {\n /** True if data was associated with this PColumn */\n readonly hasData: boolean;\n}\n\nexport interface AxisId {\n /** Type of the axis or column value. For an axis should not use non-key\n * types like float or double. */\n readonly type: ValueType;\n\n /** Name of the axis or column */\n readonly name: string;\n\n /** Adds auxiliary information to the axis or column name and type to form a\n * unique identifier */\n readonly domain?: Record<string, string>;\n}\n\n/** Array of axis ids */\nexport type AxesId = AxisId[];\n\n/** Extracts axis ids from axis spec */\nexport function getAxisId(spec: AxisSpec): AxisId {\n const { type, name, domain } = spec;\n const result = { type, name };\n if (domain && Object.entries(domain).length > 0) {\n Object.assign(result, { domain });\n }\n return result;\n}\n\n/** Extracts axes ids from axes spec array from column spec */\nexport function getAxesId(spec: AxesSpec): AxesId {\n return spec.map(getAxisId);\n}\n\n/** Canonicalizes axis id */\nexport function canonicalizeAxisId(id: AxisId): CanonicalizedJson<AxisId> {\n return canonicalizeJson(getAxisId(id));\n}\n\n/** Returns true if all domains from query are found in target */\nfunction matchDomain(query?: Record<string, string>, target?: Record<string, string>) {\n if (query === undefined) return target === undefined;\n if (target === undefined) return true;\n for (const k in target) {\n if (query[k] !== target[k]) return false;\n }\n return true;\n}\n\n/** Returns whether \"match\" axis id is compatible with the \"query\" */\nexport function matchAxisId(query: AxisId, target: AxisId): boolean {\n return query.name === target.name && matchDomain(query.domain, target.domain);\n}\n"],"names":["ensureError","z","canonicalizeJson"],"mappings":";;;;;;AAaO,MAAM,SAAS,GAAG;AACvB,IAAA,GAAG,EAAE,KAAK;AACV,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,KAAK,EAAE,OAAO;;AAQV,SAAU,YAAY,CAC1B,QAA8B,EAC9B,GAAM,EAAA;AAEN,IAAA,OAAQ,QAA0B,GAAG,GAAG,CAAC;AAC3C;AAOM,SAAU,uBAAuB,CACrC,QAA8B,EAC9B,YAA6B,EAC7B,GAAM,EACN,iBAAA,GAA4B,yBAAyB,EAAA;IAErD,MAAM,IAAI,GAAG,YAAY,CAAO,QAAQ,EAAE,GAAG,CAAC;IAC9C,IAAI,IAAI,KAAK,SAAS;AAAE,QAAA,OAAO,SAAS;AAExC,IAAA,MAAM,MAAM,GAAG,YAAY,CAAC,GAAG,CAAC;AAChC,IAAA,IAAI;QACF,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;AAC9B,QAAA,OAAO,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC;IAC5B;IAAE,OAAO,KAAc,EAAE;AACvB,QAAA,MAAM,IAAI,KAAK,CACb,CAAA,EAAG,iBAAiB,CAAA,SAAA;AAClB,cAAA,CAAA,KAAA,E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C,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC;AAAE,YAAA,OAAO,KAAK;IAC1C;AACA,IAAA,OAAO,IAAI;AACb;AAEA;AACM,SAAU,WAAW,CAAC,KAAa,EAAE,MAAc,EAAA;AACvD,IAAA,OAAO,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI,IAAI,WAAW,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;AAC/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"spec.cjs","sources":["../../../../src/drivers/pframe/spec/spec.ts"],"sourcesContent":["import { ensureError } from '../../../errors';\nimport {\n canonicalizeJson,\n type CanonicalizedJson,\n type StringifiedJson,\n} from '../../../json';\nimport type {\n PObject,\n PObjectId,\n PObjectSpec,\n} from '../../../pool';\nimport { z } from 'zod';\n\nexport const ValueType = {\n Int: 'Int',\n Long: 'Long',\n Float: 'Float',\n Double: 'Double',\n String: 'String',\n Bytes: 'Bytes',\n} as const;\n\n/** PFrame columns and axes within them may store one of these types. */\nexport type ValueType = (typeof ValueType)[keyof typeof ValueType];\n\nexport type Metadata = Record<string, string>;\n\nexport function readMetadata<U extends Metadata, T extends keyof U = keyof U>(\n metadata: Metadata | undefined,\n key: T,\n): U[T] | undefined {\n return (metadata as U | undefined)?.[key];\n}\n\ntype MetadataJsonImpl<M> = {\n [P in keyof M as (M[P] extends StringifiedJson ? P : never)]: M[P] extends StringifiedJson<infer U> ? z.ZodType<U> : never;\n};\nexport type MetadataJson<M> = MetadataJsonImpl<Required<M>>;\n\nexport function readMetadataJsonOrThrow<M extends Metadata, T extends keyof MetadataJson<M>>(\n metadata: Metadata | undefined,\n metadataJson: MetadataJson<M>,\n key: T,\n methodNameInError: string = 'readMetadataJsonOrThrow',\n): z.infer<MetadataJson<M>[T]> | undefined {\n const json = readMetadata<M, T>(metadata, key);\n if (json === undefined) return undefined;\n\n const schema = metadataJson[key];\n try {\n const value = JSON.parse(json);\n return schema.parse(value);\n } catch (error: unknown) {\n throw new Error(\n `${methodNameInError} failed, `\n + `key: ${String(key)}, `\n + `value: ${json}, `\n + `error: ${ensureError(error)}`,\n );\n }\n}\n\nexport function readMetadataJson<M extends Metadata, T extends keyof MetadataJson<M>>(\n metadata: Metadata | undefined,\n metadataJson: MetadataJson<M>,\n key: T,\n): z.infer<MetadataJson<M>[T]> | undefined {\n try {\n return readMetadataJsonOrThrow(metadata, metadataJson, key);\n } catch {\n return undefined; // treat invalid values as unset\n }\n}\n\n/// Well-known domains\nexport const Domain = {\n Alphabet: 'pl7.app/alphabet',\n BlockId: 'pl7.app/blockId',\n} as const;\n\nexport type Domain = Metadata & Partial<{\n [Domain.Alphabet]: 'nucleotide' | 'aminoacid' | string;\n [Domain.BlockId]: string;\n}>;\n\nexport type DomainJson = MetadataJson<Domain>;\nexport const DomainJson: DomainJson = {};\n\n/// Helper function for reading plain domain values\nexport function readDomain<T extends keyof Domain>(\n spec: { domain?: Metadata | undefined } | undefined,\n key: T,\n): Domain[T] | undefined {\n return readMetadata<Domain, T>(spec?.domain, key);\n}\n\n/// Helper function for reading json-encoded domain values, throws on JSON parsing error\nexport function readDomainJsonOrThrow<T extends keyof DomainJson>(\n spec: { domain?: Metadata | undefined } | undefined,\n key: T,\n): z.infer<DomainJson[T]> | undefined {\n return readMetadataJsonOrThrow<Domain, T>(spec?.domain, DomainJson, key, 'readDomainJsonOrThrow');\n}\n\n/// Helper function for reading json-encoded domain values, returns undefined on JSON parsing error\nexport function readDomainJson<T extends keyof DomainJson>(\n spec: { domain?: Metadata | undefined } | undefined,\n key: T,\n): z.infer<DomainJson[T]> | undefined {\n return readMetadataJson<Domain, T>(spec?.domain, DomainJson, key);\n}\n\n/// Well-known annotations\nexport const Annotation = {\n Alphabet: 'pl7.app/alphabet',\n Description: 'pl7.app/description',\n DiscreteValues: 'pl7.app/discreteValues',\n Format: 'pl7.app/format',\n Graph: {\n IsVirtual: 'pl7.app/graph/isVirtual',\n },\n HideDataFromUi: 'pl7.app/hideDataFromUi',\n HideDataFromGraphs: 'pl7.app/hideDataFromGraphs',\n IsLinkerColumn: 'pl7.app/isLinkerColumn',\n Label: 'pl7.app/label',\n Max: 'pl7.app/max',\n Min: 'pl7.app/min',\n Parents: 'pl7.app/parents',\n Sequence: {\n Annotation: {\n Mapping: 'pl7.app/sequence/annotation/mapping',\n },\n IsAnnotation: 'pl7.app/sequence/isAnnotation',\n },\n Table: {\n FontFamily: 'pl7.app/table/fontFamily',\n OrderPriority: 'pl7.app/table/orderPriority',\n Visibility: 'pl7.app/table/visibility',\n },\n Trace: 'pl7.app/trace',\n} as const;\n\nexport type Annotation = Metadata & Partial<{\n [Annotation.Alphabet]: 'nucleotide' | 'aminoacid' | string;\n [Annotation.Description]: string;\n [Annotation.DiscreteValues]: StringifiedJson<number[]> | StringifiedJson<string[]>;\n [Annotation.Format]: string;\n [Annotation.Graph.IsVirtual]: StringifiedJson<boolean>;\n [Annotation.HideDataFromUi]: StringifiedJson<boolean>;\n [Annotation.HideDataFromGraphs]: StringifiedJson<boolean>;\n [Annotation.IsLinkerColumn]: StringifiedJson<boolean>;\n [Annotation.Label]: string;\n [Annotation.Max]: StringifiedJson<number>;\n [Annotation.Min]: StringifiedJson<number>;\n [Annotation.Parents]: StringifiedJson<AxisSpec['name'][]>;\n [Annotation.Sequence.Annotation.Mapping]: StringifiedJson<Record<string, string>>;\n [Annotation.Sequence.IsAnnotation]: StringifiedJson<boolean>;\n [Annotation.Table.FontFamily]: string;\n [Annotation.Table.OrderPriority]: StringifiedJson<number>;\n [Annotation.Table.Visibility]: 'hidden' | 'optional' | string;\n [Annotation.Trace]: StringifiedJson<Record<string, unknown>>;\n}>;\n\n// export const AxisSpec = z.object({\n// type: z.nativeEnum(ValueType),\n// name: z.string(),\n// domain: z.record(z.string(), z.string()).optional(),\n// annotations: z.record(z.string(), z.string()).optional(),\n// parentAxes: z.array(z.number()).optional(),\n// }).passthrough();\n//\n// type Expect<T extends true> = T;\n// type Equal<X, Y> =\n// (<T>() => T extends X ? 1 : 2) extends (<T>() => T extends Y ? 1 : 2) ? true : false;\n//\n// type _test = Expect<Equal<\n// Readonly<z.infer<typeof AxisSpec>>,\n// Readonly<AxisSpec & Record<string, unknown>>\n// >>;\n\nexport type AnnotationJson = MetadataJson<Annotation>;\nexport const AnnotationJson: AnnotationJson = {\n [Annotation.DiscreteValues]: z.array(z.string()).or(z.array(z.number())),\n [Annotation.Graph.IsVirtual]: z.boolean(),\n [Annotation.HideDataFromUi]: z.boolean(),\n [Annotation.HideDataFromGraphs]: z.boolean(),\n [Annotation.IsLinkerColumn]: z.boolean(),\n [Annotation.Max]: z.number(),\n [Annotation.Min]: z.number(),\n [Annotation.Parents]: z.array(z.string()),\n [Annotation.Sequence.Annotation.Mapping]: z.record(z.string(), z.string()),\n [Annotation.Sequence.IsAnnotation]: z.boolean(),\n [Annotation.Table.OrderPriority]: z.number(),\n [Annotation.Trace]: z.record(z.string(), z.unknown()),\n};\n\n/// Helper function for reading plain annotation values\nexport function readAnnotation<T extends keyof Annotation>(\n spec: { annotations?: Metadata | undefined } | undefined,\n key: T,\n): Annotation[T] | undefined {\n return readMetadata<Annotation, T>(spec?.annotations, key);\n}\n\n/// Helper function for reading json-encoded annotation values, throws on JSON parsing error\nexport function readAnnotationJsonOrThrow<T extends keyof AnnotationJson>(\n spec: { annotations?: Metadata | undefined } | undefined,\n key: T,\n): z.infer<AnnotationJson[T]> | undefined {\n return readMetadataJsonOrThrow<Annotation, T>(spec?.annotations, AnnotationJson, key, 'readAnnotationJsonOrThrow');\n}\n\n/// Helper function for reading json-encoded annotation values, returns undefined on JSON parsing error\nexport function readAnnotationJson<T extends keyof AnnotationJson>(\n spec: { annotations?: Metadata | undefined } | undefined,\n key: T,\n): z.infer<AnnotationJson[T]> | undefined {\n return readMetadataJson<Annotation, T>(spec?.annotations, AnnotationJson, key);\n}\n\n/**\n * Specification of an individual axis.\n *\n * Each axis is a part of a composite key that addresses data inside the PColumn.\n *\n * Each record inside a PColumn is addressed by a unique tuple of values set for\n * all the axes specified in the column spec.\n */\nexport interface AxisSpec {\n /** Type of the axis value. Should not use non-key types like float or double. */\n readonly type: ValueType;\n\n /** Name of the axis */\n readonly name: string;\n\n /** Adds auxiliary information to the axis name, type and parents to form a\n * unique identifier */\n readonly domain?: Record<string, string>;\n\n /** Any additional information attached to the axis that does not affect its\n * identifier */\n readonly annotations?: Record<string, string>;\n\n /**\n * Parent axes provide contextual grouping for the axis in question, establishing\n * a hierarchy where the current axis is dependent on one or more axes for its\n * full definition and meaning. For instance, in a data structure where each\n * \"container\" axis may contain multiple \"item\" axes, the `item` axis would\n * list the index of the `container` axis in this field to denote its dependency.\n *\n * This means that the identity or significance of the `item` axis is only\n * interpretable when combined with its parent `container` axis. An `item` axis\n * index by itself may be non-unique and only gains uniqueness within the context\n * of its parent `container`. Therefore, the `parentAxes` field is essential for\n * mapping these relationships and ensuring data coherence across nested or\n * multi-level data models.\n *\n * A list of zero-based indices of parent axes in the overall axes specification\n * from the column spec. Each index corresponds to the position of a parent axis\n * in the list that defines the structure of the data model.\n */\n readonly parentAxes?: number[];\n}\n\n/** Parents are specs, not indexes; normalized axis can be used considering its parents independently from column */\nexport interface AxisSpecNormalized extends Omit<AxisSpec, 'parentAxes'> {\n parentAxesSpec: AxisSpecNormalized[];\n}\n\n/** Tree: axis is a root, its parents are children */\nexport type AxisTree = {\n axis: AxisSpecNormalized;\n children: AxisTree[]; // parents\n};\n\nfunction makeAxisTree(axis: AxisSpecNormalized): AxisTree {\n return { axis, children: [] };\n}\n\n/** Build tree by axis parents annotations */\nexport function getAxesTree(rootAxis: AxisSpecNormalized): AxisTree {\n const root = makeAxisTree(rootAxis);\n let nodesQ = [root];\n while (nodesQ.length) {\n const nextNodes: AxisTree[] = [];\n for (const node of nodesQ) {\n node.children = node.axis.parentAxesSpec.map(makeAxisTree);\n nextNodes.push(...node.children);\n }\n nodesQ = nextNodes;\n }\n return root;\n}\n\n/** Get set of canonicalized axisIds from axisTree */\nexport function getSetFromAxisTree(tree: AxisTree): Set<CanonicalizedJson<AxisId>> {\n const set = new Set([canonicalizeJson(getAxisId(tree.axis))]);\n let nodesQ = [tree];\n while (nodesQ.length) {\n const nextNodes = [];\n for (const node of nodesQ) {\n for (const parent of node.children) {\n set.add(canonicalizeJson(getAxisId(parent.axis)));\n nextNodes.push(parent);\n }\n }\n nodesQ = nextNodes;\n }\n return set;\n}\n\n/** Get array of axisSpecs from axisTree */\nexport function getArrayFromAxisTree(tree: AxisTree): AxisSpecNormalized[] {\n const res = [tree.axis];\n let nodesQ = [tree];\n while (nodesQ.length) {\n const nextNodes = [];\n for (const node of nodesQ) {\n for (const parent of node.children) {\n res.push(parent.axis);\n nextNodes.push(parent);\n }\n }\n nodesQ = nextNodes;\n }\n return res;\n}\n\nexport function canonicalizeAxisWithParents(axis: AxisSpecNormalized) {\n return canonicalizeJson(getArrayFromAxisTree(getAxesTree(axis)).map(getAxisId));\n}\n\nfunction normalizingAxesComparator(axis1: AxisSpecNormalized, axis2: AxisSpecNormalized): 1 | -1 | 0 {\n if (axis1.name !== axis2.name) {\n return axis1.name < axis2.name ? 1 : -1;\n }\n if (axis1.type !== axis2.type) {\n return axis1.type < axis2.type ? 1 : -1;\n }\n const domain1 = canonicalizeJson(axis1.domain ?? {});\n const domain2 = canonicalizeJson(axis2.domain ?? {});\n if (domain1 !== domain2) {\n return domain1 < domain2 ? 1 : -1;\n }\n\n const parents1 = canonicalizeAxisWithParents(axis1);\n const parents2 = canonicalizeAxisWithParents(axis2);\n\n if (parents1 !== parents2) {\n return parents1 < parents2 ? 1 : -1;\n }\n\n const annotation1 = canonicalizeJson(axis1.annotations ?? {});\n const annotation2 = canonicalizeJson(axis2.annotations ?? {});\n if (annotation1 !== annotation2) {\n return annotation1 < annotation2 ? 1 : -1;\n }\n return 0;\n}\n\nfunction parseParentsFromAnnotations(axis: AxisSpec) {\n const parentsList = readAnnotationJson(axis, Annotation.Parents);\n if (parentsList === undefined) {\n return [];\n }\n return parentsList;\n}\n\nfunction sortParentsDeep(axisSpec: AxisSpecNormalized) {\n axisSpec.parentAxesSpec.forEach(sortParentsDeep);\n axisSpec.parentAxesSpec.sort(normalizingAxesComparator);\n}\n\nfunction hasCycleOfParents(axisSpec: AxisSpecNormalized) {\n const root = makeAxisTree(axisSpec);\n let nodesQ = [root];\n const ancestors = new Set(canonicalizeJson(getAxisId(axisSpec)));\n while (nodesQ.length) {\n const nextNodes: AxisTree[] = [];\n const levelIds = new Set<CanonicalizedJson<AxisId>>();\n for (const node of nodesQ) {\n node.children = node.axis.parentAxesSpec.map(makeAxisTree);\n for (const child of node.children) {\n const childId = canonicalizeJson(getAxisId(child.axis));\n if (!levelIds.has(childId)) {\n nextNodes.push(child);\n levelIds.add(childId);\n if (ancestors.has(childId)) {\n return true;\n }\n ancestors.add(childId);\n }\n }\n }\n nodesQ = nextNodes;\n }\n return false;\n}\n\n/** Create list of normalized axisSpec (parents are in array of specs, not indexes) */\nexport function getNormalizedAxesList(axes: AxisSpec[]): AxisSpecNormalized[] {\n if (!axes.length) {\n return [];\n }\n const modifiedAxes: AxisSpecNormalized[] = axes.map((axis) => {\n const { parentAxes: _, ...copiedRest } = axis;\n return { ...copiedRest, annotations: { ...copiedRest.annotations }, parentAxesSpec: [] };\n });\n\n axes.forEach((axis, idx) => {\n const modifiedAxis = modifiedAxes[idx];\n if (axis.parentAxes) { // if we have parents by indexes then take from the list\n modifiedAxis.parentAxesSpec = axis.parentAxes.map((idx) => modifiedAxes[idx]);\n } else { // else try to parse from annotation name\n const parents = parseParentsFromAnnotations(axis).map((name) => modifiedAxes.find((axis) => axis.name === name));\n modifiedAxis.parentAxesSpec = parents.some((p) => p === undefined) ? [] : parents as AxisSpecNormalized[];\n\n delete modifiedAxis.annotations?.[Annotation.Parents];\n }\n });\n\n if (modifiedAxes.some(hasCycleOfParents)) { // Axes list is broken\n modifiedAxes.forEach((axis) => {\n axis.parentAxesSpec = [];\n });\n } else {\n modifiedAxes.forEach((axis) => {\n sortParentsDeep(axis);\n });\n }\n\n return modifiedAxes;\n}\n\n/** Create list of regular axisSpec from normalized (parents are indexes, inside of current axes list) */\nexport function getDenormalizedAxesList(axesSpec: AxisSpecNormalized[]): AxisSpec[] {\n const idsList = axesSpec.map((axisSpec) => canonicalizeJson(getAxisId(axisSpec)));\n return axesSpec.map((axisSpec) => {\n const parentsIds = axisSpec.parentAxesSpec.map((axisSpec) => canonicalizeJson(getAxisId(axisSpec)));\n const parentIdxs = parentsIds.map((id) => idsList.indexOf(id));\n const { parentAxesSpec: _, ...copiedRest } = axisSpec;\n if (parentIdxs.length) {\n return { ...copiedRest, parentAxes: parentIdxs } as AxisSpec;\n }\n return copiedRest;\n });\n}\n\n/** Common type representing spec for all the axes in a column */\nexport type AxesSpec = AxisSpec[];\n\n/// Well-known column names\nexport const PColumnName = {\n Label: 'pl7.app/label',\n Table: {\n RowSelection: 'pl7.app/table/row-selection',\n },\n} as const;\n\n/**\n * Full column specification including all axes specs and specs of the column\n * itself.\n *\n * A PColumn in its essence represents a mapping from a fixed size, explicitly\n * typed tuple to an explicitly typed value.\n *\n * (axis1Value1, axis2Value1, ...) -> columnValue\n *\n * Each element in tuple correspond to the axis having the same index in axesSpec.\n */\nexport interface PUniversalColumnSpec extends PObjectSpec {\n /** Defines specific type of BObject, the most generic type of unit of\n * information in Platforma Project. */\n readonly kind: 'PColumn';\n\n /** Type of column values */\n readonly valueType: string;\n\n /** Column name */\n readonly name: string;\n\n /** Adds auxiliary information to the axis name, type and parents to form a\n * unique identifier */\n readonly domain?: Record<string, string>;\n\n /** Any additional information attached to the column that does not affect its\n * identifier */\n readonly annotations?: Record<string, string>;\n\n /** A list of zero-based indices of parent axes from the {@link axesSpec} array. */\n readonly parentAxes?: number[];\n\n /** Axes specifications */\n readonly axesSpec: AxesSpec;\n}\n\n/**\n * Specification of a data column.\n *\n * Data column is a specialized type of PColumn that stores only simple values (strings and numbers)\n * addressed by multiple keys. This is in contrast to other PColumn variants that can store more complex\n * values like files or other abstract data types. Data columns are optimized for storing and processing\n * basic tabular data.\n */\nexport interface PDataColumnSpec extends PUniversalColumnSpec {\n /** Type of column values */\n readonly valueType: ValueType;\n}\n\n// @todo: change this to PUniversalColumnSpec\nexport type PColumnSpec = PDataColumnSpec;\n\n/** Unique PColumnSpec identifier */\nexport type PColumnSpecId = {\n /** Defines specific type of BObject, the most generic type of unit of\n * information in Platforma Project. */\n readonly kind: 'PColumn';\n\n /** Type of column values */\n readonly valueType: ValueType;\n\n /** Column name */\n readonly name: string;\n\n /** Adds auxiliary information to the axis name, type and parents to form a\n * unique identifier */\n readonly domain?: Record<string, string>;\n\n /** A list of zero-based indices of parent axes from the {@link axesSpec} array. */\n readonly parentAxes?: number[];\n\n /** Axes id */\n readonly axesId: AxesId;\n};\n\nexport function getPColumnSpecId(spec: PColumnSpec): PColumnSpecId {\n return {\n kind: spec.kind,\n valueType: spec.valueType,\n name: spec.name,\n domain: spec.domain,\n parentAxes: spec.parentAxes,\n axesId: getAxesId(spec.axesSpec),\n };\n}\n\nexport interface PColumn<Data> extends PObject<Data> {\n /** PColumn spec, allowing it to be found among other PObjects */\n readonly spec: PColumnSpec;\n}\n\n/** Columns in a PFrame also have internal identifier, this object represents\n * combination of specs and such id */\nexport interface PColumnIdAndSpec {\n /** Internal column id within the PFrame */\n readonly columnId: PObjectId;\n\n /** Column spec */\n readonly spec: PColumnSpec;\n}\n\n/** Get column id and spec from a column */\nexport function getColumnIdAndSpec<Data>(column: PColumn<Data>): PColumnIdAndSpec {\n return {\n columnId: column.id,\n spec: column.spec,\n };\n}\n\n/** Information returned by {@link PFrame.listColumns} method */\nexport interface PColumnInfo extends PColumnIdAndSpec {\n /** True if data was associated with this PColumn */\n readonly hasData: boolean;\n}\n\nexport interface AxisId {\n /** Type of the axis or column value. For an axis should not use non-key\n * types like float or double. */\n readonly type: ValueType;\n\n /** Name of the axis or column */\n readonly name: string;\n\n /** Adds auxiliary information to the axis or column name and type to form a\n * unique identifier */\n readonly domain?: Record<string, string>;\n}\n\n/** Array of axis ids */\nexport type AxesId = AxisId[];\n\n/** Extracts axis ids from axis spec */\nexport function getAxisId(spec: AxisSpec): AxisId {\n const { type, name, domain } = spec;\n const result = { type, name };\n if (domain && Object.entries(domain).length > 0) {\n Object.assign(result, { domain });\n }\n return result;\n}\n\n/** Extracts axes ids from axes spec array from column spec */\nexport function getAxesId(spec: AxesSpec): AxesId {\n return spec.map(getAxisId);\n}\n\n/** Canonicalizes axis id */\nexport function canonicalizeAxisId(id: AxisId): CanonicalizedJson<AxisId> {\n return canonicalizeJson(getAxisId(id));\n}\n\n/** Returns true if all domains from query are found in target */\nfunction matchDomain(query?: Record<string, string>, target?: Record<string, string>) {\n if (query === undefined) return target === undefined;\n if (target === undefined) return true;\n for (const k in target) {\n if (query[k] !== target[k]) return false;\n }\n return true;\n}\n\n/** Returns whether \"match\" axis id is compatible with the \"query\" */\nexport function matchAxisId(query: AxisId, target: AxisId): boolean {\n return query.name === target.name && matchDomain(query.domain, target.domain);\n}\n"],"names":["ensureError","z","canonicalizeJson"],"mappings":";;;;;;AAaO,MAAM,SAAS,GAAG;AACvB,IAAA,GAAG,EAAE,KAAK;AACV,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,KAAK,EAAE,OAAO;;AAQV,SAAU,YAAY,CAC1B,QAA8B,EAC9B,GAAM,EAAA;AAEN,IAAA,OAAQ,QAA0B,GAAG,GAAG,CAAC;AAC3C;AAOM,SAAU,uBAAuB,CACrC,QAA8B,EAC9B,YAA6B,EAC7B,GAAM,EACN,iBAAA,GAA4B,yBAAyB,EAAA;IAErD,MAAM,IAAI,GAAG,YAAY,CAAO,QAAQ,EAAE,GAAG,CAAC;IAC9C,IAAI,IAAI,KAAK,SAAS;AAAE,QAAA,OAAO,SAAS;AAExC,IAAA,MAAM,MAAM,GAA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AC,SAAS,CAAC;AAC5B;AAEA;AACM,SAAU,kBAAkB,CAAC,EAAU,EAAA;AAC3C,IAAA,OAAOA,qBAAgB,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;AACxC;AAEA;AACA,SAAS,WAAW,CAAC,KAA8B,EAAE,MAA+B,EAAA;IAClF,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,MAAM,KAAK,SAAS;IACpD,IAAI,MAAM,KAAK,SAAS;AAAE,QAAA,OAAO,IAAI;AACrC,IAAA,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE;QACtB,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC;AAAE,YAAA,OAAO,KAAK;IAC1C;AACA,IAAA,OAAO,IAAI;AACb;AAEA;AACM,SAAU,WAAW,CAAC,KAAa,EAAE,MAAc,EAAA;AACvD,IAAA,OAAO,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI,IAAI,WAAW,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;AAC/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -47,6 +47,7 @@ export declare const Annotation: {
|
|
|
47
47
|
readonly IsVirtual: "pl7.app/graph/isVirtual";
|
|
48
48
|
};
|
|
49
49
|
readonly HideDataFromUi: "pl7.app/hideDataFromUi";
|
|
50
|
+
readonly HideDataFromGraphs: "pl7.app/hideDataFromGraphs";
|
|
50
51
|
readonly IsLinkerColumn: "pl7.app/isLinkerColumn";
|
|
51
52
|
readonly Label: "pl7.app/label";
|
|
52
53
|
readonly Max: "pl7.app/max";
|
|
@@ -72,6 +73,7 @@ export type Annotation = Metadata & Partial<{
|
|
|
72
73
|
[Annotation.Format]: string;
|
|
73
74
|
[Annotation.Graph.IsVirtual]: StringifiedJson<boolean>;
|
|
74
75
|
[Annotation.HideDataFromUi]: StringifiedJson<boolean>;
|
|
76
|
+
[Annotation.HideDataFromGraphs]: StringifiedJson<boolean>;
|
|
75
77
|
[Annotation.IsLinkerColumn]: StringifiedJson<boolean>;
|
|
76
78
|
[Annotation.Label]: string;
|
|
77
79
|
[Annotation.Max]: StringifiedJson<number>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec.d.ts","sourceRoot":"","sources":["../../../../src/drivers/pframe/spec/spec.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACrB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EACV,OAAO,EACP,SAAS,EACT,WAAW,EACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,SAAS;;;;;;;CAOZ,CAAC;AAEX,wEAAwE;AACxE,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;AAEnE,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE9C,wBAAgB,YAAY,CAAC,CAAC,SAAS,QAAQ,EAAE,CAAC,SAAS,MAAM,CAAC,GAAG,MAAM,CAAC,EAC1E,QAAQ,EAAE,QAAQ,GAAG,SAAS,EAC9B,GAAG,EAAE,CAAC,GACL,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAElB;AAED,KAAK,gBAAgB,CAAC,CAAC,IAAI;KACxB,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,eAAe,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,eAAe,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK;CAC3H,CAAC;AACF,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC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AG,gBAAgB,CAKhF;AAED,gEAAgE;AAChE,MAAM,WAAW,WAAY,SAAQ,gBAAgB;IACnD,oDAAoD;IACpD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,MAAM;IACrB;qCACiC;IACjC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAEzB,iCAAiC;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;2BACuB;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC1C;AAED,wBAAwB;AACxB,MAAM,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC;AAE9B,uCAAuC;AACvC,wBAAgB,SAAS,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAOhD;AAED,8DAA8D;AAC9D,wBAAgB,SAAS,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAEhD;AAED,4BAA4B;AAC5B,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAExE;AAYD,qEAAqE;AACrE,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAElE"}
|
|
@@ -65,6 +65,7 @@ const Annotation = {
|
|
|
65
65
|
IsVirtual: 'pl7.app/graph/isVirtual',
|
|
66
66
|
},
|
|
67
67
|
HideDataFromUi: 'pl7.app/hideDataFromUi',
|
|
68
|
+
HideDataFromGraphs: 'pl7.app/hideDataFromGraphs',
|
|
68
69
|
IsLinkerColumn: 'pl7.app/isLinkerColumn',
|
|
69
70
|
Label: 'pl7.app/label',
|
|
70
71
|
Max: 'pl7.app/max',
|
|
@@ -87,6 +88,7 @@ const AnnotationJson = {
|
|
|
87
88
|
[Annotation.DiscreteValues]: z.array(z.string()).or(z.array(z.number())),
|
|
88
89
|
[Annotation.Graph.IsVirtual]: z.boolean(),
|
|
89
90
|
[Annotation.HideDataFromUi]: z.boolean(),
|
|
91
|
+
[Annotation.HideDataFromGraphs]: z.boolean(),
|
|
90
92
|
[Annotation.IsLinkerColumn]: z.boolean(),
|
|
91
93
|
[Annotation.Max]: z.number(),
|
|
92
94
|
[Annotation.Min]: z.number(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec.js","sources":["../../../../src/drivers/pframe/spec/spec.ts"],"sourcesContent":["import { ensureError } from '../../../errors';\nimport {\n canonicalizeJson,\n type CanonicalizedJson,\n type StringifiedJson,\n} from '../../../json';\nimport type {\n PObject,\n PObjectId,\n PObjectSpec,\n} from '../../../pool';\nimport { z } from 'zod';\n\nexport const ValueType = {\n Int: 'Int',\n Long: 'Long',\n Float: 'Float',\n Double: 'Double',\n String: 'String',\n Bytes: 'Bytes',\n} as const;\n\n/** PFrame columns and axes within them may store one of these types. */\nexport type ValueType = (typeof ValueType)[keyof typeof ValueType];\n\nexport type Metadata = Record<string, string>;\n\nexport function readMetadata<U extends Metadata, T extends keyof U = keyof U>(\n metadata: Metadata | undefined,\n key: T,\n): U[T] | undefined {\n return (metadata as U | undefined)?.[key];\n}\n\ntype MetadataJsonImpl<M> = {\n [P in keyof M as (M[P] extends StringifiedJson ? P : never)]: M[P] extends StringifiedJson<infer U> ? z.ZodType<U> : never;\n};\nexport type MetadataJson<M> = MetadataJsonImpl<Required<M>>;\n\nexport function readMetadataJsonOrThrow<M extends Metadata, T extends keyof MetadataJson<M>>(\n metadata: Metadata | undefined,\n metadataJson: MetadataJson<M>,\n key: T,\n methodNameInError: string = 'readMetadataJsonOrThrow',\n): z.infer<MetadataJson<M>[T]> | undefined {\n const json = readMetadata<M, T>(metadata, key);\n if (json === undefined) return undefined;\n\n const schema = metadataJson[key];\n try {\n const value = JSON.parse(json);\n return schema.parse(value);\n } catch (error: unknown) {\n throw new Error(\n `${methodNameInError} failed, `\n + `key: ${String(key)}, `\n + `value: ${json}, `\n + `error: ${ensureError(error)}`,\n );\n }\n}\n\nexport function readMetadataJson<M extends Metadata, T extends keyof MetadataJson<M>>(\n metadata: Metadata | undefined,\n metadataJson: MetadataJson<M>,\n key: T,\n): z.infer<MetadataJson<M>[T]> | undefined {\n try {\n return readMetadataJsonOrThrow(metadata, metadataJson, key);\n } catch {\n return undefined; // treat invalid values as unset\n }\n}\n\n/// Well-known domains\nexport const Domain = {\n Alphabet: 'pl7.app/alphabet',\n BlockId: 'pl7.app/blockId',\n} as const;\n\nexport type Domain = Metadata & Partial<{\n [Domain.Alphabet]: 'nucleotide' | 'aminoacid' | string;\n [Domain.BlockId]: string;\n}>;\n\nexport type DomainJson = MetadataJson<Domain>;\nexport const DomainJson: DomainJson = {};\n\n/// Helper function for reading plain domain values\nexport function readDomain<T extends keyof Domain>(\n spec: { domain?: Metadata | undefined } | undefined,\n key: T,\n): Domain[T] | undefined {\n return readMetadata<Domain, T>(spec?.domain, key);\n}\n\n/// Helper function for reading json-encoded domain values, throws on JSON parsing error\nexport function readDomainJsonOrThrow<T extends keyof DomainJson>(\n spec: { domain?: Metadata | undefined } | undefined,\n key: T,\n): z.infer<DomainJson[T]> | undefined {\n return readMetadataJsonOrThrow<Domain, T>(spec?.domain, DomainJson, key, 'readDomainJsonOrThrow');\n}\n\n/// Helper function for reading json-encoded domain values, returns undefined on JSON parsing error\nexport function readDomainJson<T extends keyof DomainJson>(\n spec: { domain?: Metadata | undefined } | undefined,\n key: T,\n): z.infer<DomainJson[T]> | undefined {\n return readMetadataJson<Domain, T>(spec?.domain, DomainJson, key);\n}\n\n/// Well-known annotations\nexport const Annotation = {\n Alphabet: 'pl7.app/alphabet',\n Description: 'pl7.app/description',\n DiscreteValues: 'pl7.app/discreteValues',\n Format: 'pl7.app/format',\n Graph: {\n IsVirtual: 'pl7.app/graph/isVirtual',\n },\n HideDataFromUi: 'pl7.app/hideDataFromUi',\n IsLinkerColumn: 'pl7.app/isLinkerColumn',\n Label: 'pl7.app/label',\n Max: 'pl7.app/max',\n Min: 'pl7.app/min',\n Parents: 'pl7.app/parents',\n Sequence: {\n Annotation: {\n Mapping: 'pl7.app/sequence/annotation/mapping',\n },\n IsAnnotation: 'pl7.app/sequence/isAnnotation',\n },\n Table: {\n FontFamily: 'pl7.app/table/fontFamily',\n OrderPriority: 'pl7.app/table/orderPriority',\n Visibility: 'pl7.app/table/visibility',\n },\n Trace: 'pl7.app/trace',\n} as const;\n\nexport type Annotation = Metadata & Partial<{\n [Annotation.Alphabet]: 'nucleotide' | 'aminoacid' | string;\n [Annotation.Description]: string;\n [Annotation.DiscreteValues]: StringifiedJson<number[]> | StringifiedJson<string[]>;\n [Annotation.Format]: string;\n [Annotation.Graph.IsVirtual]: StringifiedJson<boolean>;\n [Annotation.HideDataFromUi]: StringifiedJson<boolean>;\n [Annotation.IsLinkerColumn]: StringifiedJson<boolean>;\n [Annotation.Label]: string;\n [Annotation.Max]: StringifiedJson<number>;\n [Annotation.Min]: StringifiedJson<number>;\n [Annotation.Parents]: StringifiedJson<AxisSpec['name'][]>;\n [Annotation.Sequence.Annotation.Mapping]: StringifiedJson<Record<string, string>>;\n [Annotation.Sequence.IsAnnotation]: StringifiedJson<boolean>;\n [Annotation.Table.FontFamily]: string;\n [Annotation.Table.OrderPriority]: StringifiedJson<number>;\n [Annotation.Table.Visibility]: 'hidden' | 'optional' | string;\n [Annotation.Trace]: StringifiedJson<Record<string, unknown>>;\n}>;\n\n// export const AxisSpec = z.object({\n// type: z.nativeEnum(ValueType),\n// name: z.string(),\n// domain: z.record(z.string(), z.string()).optional(),\n// annotations: z.record(z.string(), z.string()).optional(),\n// parentAxes: z.array(z.number()).optional(),\n// }).passthrough();\n//\n// type Expect<T extends true> = T;\n// type Equal<X, Y> =\n// (<T>() => T extends X ? 1 : 2) extends (<T>() => T extends Y ? 1 : 2) ? true : false;\n//\n// type _test = Expect<Equal<\n// Readonly<z.infer<typeof AxisSpec>>,\n// Readonly<AxisSpec & Record<string, unknown>>\n// >>;\n\nexport type AnnotationJson = MetadataJson<Annotation>;\nexport const AnnotationJson: AnnotationJson = {\n [Annotation.DiscreteValues]: z.array(z.string()).or(z.array(z.number())),\n [Annotation.Graph.IsVirtual]: z.boolean(),\n [Annotation.HideDataFromUi]: z.boolean(),\n [Annotation.IsLinkerColumn]: z.boolean(),\n [Annotation.Max]: z.number(),\n [Annotation.Min]: z.number(),\n [Annotation.Parents]: z.array(z.string()),\n [Annotation.Sequence.Annotation.Mapping]: z.record(z.string(), z.string()),\n [Annotation.Sequence.IsAnnotation]: z.boolean(),\n [Annotation.Table.OrderPriority]: z.number(),\n [Annotation.Trace]: z.record(z.string(), z.unknown()),\n};\n\n/// Helper function for reading plain annotation values\nexport function readAnnotation<T extends keyof Annotation>(\n spec: { annotations?: Metadata | undefined } | undefined,\n key: T,\n): Annotation[T] | undefined {\n return readMetadata<Annotation, T>(spec?.annotations, key);\n}\n\n/// Helper function for reading json-encoded annotation values, throws on JSON parsing error\nexport function readAnnotationJsonOrThrow<T extends keyof AnnotationJson>(\n spec: { annotations?: Metadata | undefined } | undefined,\n key: T,\n): z.infer<AnnotationJson[T]> | undefined {\n return readMetadataJsonOrThrow<Annotation, T>(spec?.annotations, AnnotationJson, key, 'readAnnotationJsonOrThrow');\n}\n\n/// Helper function for reading json-encoded annotation values, returns undefined on JSON parsing error\nexport function readAnnotationJson<T extends keyof AnnotationJson>(\n spec: { annotations?: Metadata | undefined } | undefined,\n key: T,\n): z.infer<AnnotationJson[T]> | undefined {\n return readMetadataJson<Annotation, T>(spec?.annotations, AnnotationJson, key);\n}\n\n/**\n * Specification of an individual axis.\n *\n * Each axis is a part of a composite key that addresses data inside the PColumn.\n *\n * Each record inside a PColumn is addressed by a unique tuple of values set for\n * all the axes specified in the column spec.\n */\nexport interface AxisSpec {\n /** Type of the axis value. Should not use non-key types like float or double. */\n readonly type: ValueType;\n\n /** Name of the axis */\n readonly name: string;\n\n /** Adds auxiliary information to the axis name, type and parents to form a\n * unique identifier */\n readonly domain?: Record<string, string>;\n\n /** Any additional information attached to the axis that does not affect its\n * identifier */\n readonly annotations?: Record<string, string>;\n\n /**\n * Parent axes provide contextual grouping for the axis in question, establishing\n * a hierarchy where the current axis is dependent on one or more axes for its\n * full definition and meaning. For instance, in a data structure where each\n * \"container\" axis may contain multiple \"item\" axes, the `item` axis would\n * list the index of the `container` axis in this field to denote its dependency.\n *\n * This means that the identity or significance of the `item` axis is only\n * interpretable when combined with its parent `container` axis. An `item` axis\n * index by itself may be non-unique and only gains uniqueness within the context\n * of its parent `container`. Therefore, the `parentAxes` field is essential for\n * mapping these relationships and ensuring data coherence across nested or\n * multi-level data models.\n *\n * A list of zero-based indices of parent axes in the overall axes specification\n * from the column spec. Each index corresponds to the position of a parent axis\n * in the list that defines the structure of the data model.\n */\n readonly parentAxes?: number[];\n}\n\n/** Parents are specs, not indexes; normalized axis can be used considering its parents independently from column */\nexport interface AxisSpecNormalized extends Omit<AxisSpec, 'parentAxes'> {\n parentAxesSpec: AxisSpecNormalized[];\n}\n\n/** Tree: axis is a root, its parents are children */\nexport type AxisTree = {\n axis: AxisSpecNormalized;\n children: AxisTree[]; // parents\n};\n\nfunction makeAxisTree(axis: AxisSpecNormalized): AxisTree {\n return { axis, children: [] };\n}\n\n/** Build tree by axis parents annotations */\nexport function getAxesTree(rootAxis: AxisSpecNormalized): AxisTree {\n const root = makeAxisTree(rootAxis);\n let nodesQ = [root];\n while (nodesQ.length) {\n const nextNodes: AxisTree[] = [];\n for (const node of nodesQ) {\n node.children = node.axis.parentAxesSpec.map(makeAxisTree);\n nextNodes.push(...node.children);\n }\n nodesQ = nextNodes;\n }\n return root;\n}\n\n/** Get set of canonicalized axisIds from axisTree */\nexport function getSetFromAxisTree(tree: AxisTree): Set<CanonicalizedJson<AxisId>> {\n const set = new Set([canonicalizeJson(getAxisId(tree.axis))]);\n let nodesQ = [tree];\n while (nodesQ.length) {\n const nextNodes = [];\n for (const node of nodesQ) {\n for (const parent of node.children) {\n set.add(canonicalizeJson(getAxisId(parent.axis)));\n nextNodes.push(parent);\n }\n }\n nodesQ = nextNodes;\n }\n return set;\n}\n\n/** Get array of axisSpecs from axisTree */\nexport function getArrayFromAxisTree(tree: AxisTree): AxisSpecNormalized[] {\n const res = [tree.axis];\n let nodesQ = [tree];\n while (nodesQ.length) {\n const nextNodes = [];\n for (const node of nodesQ) {\n for (const parent of node.children) {\n res.push(parent.axis);\n nextNodes.push(parent);\n }\n }\n nodesQ = nextNodes;\n }\n return res;\n}\n\nexport function canonicalizeAxisWithParents(axis: AxisSpecNormalized) {\n return canonicalizeJson(getArrayFromAxisTree(getAxesTree(axis)).map(getAxisId));\n}\n\nfunction normalizingAxesComparator(axis1: AxisSpecNormalized, axis2: AxisSpecNormalized): 1 | -1 | 0 {\n if (axis1.name !== axis2.name) {\n return axis1.name < axis2.name ? 1 : -1;\n }\n if (axis1.type !== axis2.type) {\n return axis1.type < axis2.type ? 1 : -1;\n }\n const domain1 = canonicalizeJson(axis1.domain ?? {});\n const domain2 = canonicalizeJson(axis2.domain ?? {});\n if (domain1 !== domain2) {\n return domain1 < domain2 ? 1 : -1;\n }\n\n const parents1 = canonicalizeAxisWithParents(axis1);\n const parents2 = canonicalizeAxisWithParents(axis2);\n\n if (parents1 !== parents2) {\n return parents1 < parents2 ? 1 : -1;\n }\n\n const annotation1 = canonicalizeJson(axis1.annotations ?? {});\n const annotation2 = canonicalizeJson(axis2.annotations ?? {});\n if (annotation1 !== annotation2) {\n return annotation1 < annotation2 ? 1 : -1;\n }\n return 0;\n}\n\nfunction parseParentsFromAnnotations(axis: AxisSpec) {\n const parentsList = readAnnotationJson(axis, Annotation.Parents);\n if (parentsList === undefined) {\n return [];\n }\n return parentsList;\n}\n\nfunction sortParentsDeep(axisSpec: AxisSpecNormalized) {\n axisSpec.parentAxesSpec.forEach(sortParentsDeep);\n axisSpec.parentAxesSpec.sort(normalizingAxesComparator);\n}\n\nfunction hasCycleOfParents(axisSpec: AxisSpecNormalized) {\n const root = makeAxisTree(axisSpec);\n let nodesQ = [root];\n const ancestors = new Set(canonicalizeJson(getAxisId(axisSpec)));\n while (nodesQ.length) {\n const nextNodes: AxisTree[] = [];\n const levelIds = new Set<CanonicalizedJson<AxisId>>();\n for (const node of nodesQ) {\n node.children = node.axis.parentAxesSpec.map(makeAxisTree);\n for (const child of node.children) {\n const childId = canonicalizeJson(getAxisId(child.axis));\n if (!levelIds.has(childId)) {\n nextNodes.push(child);\n levelIds.add(childId);\n if (ancestors.has(childId)) {\n return true;\n }\n ancestors.add(childId);\n }\n }\n }\n nodesQ = nextNodes;\n }\n return false;\n}\n\n/** Create list of normalized axisSpec (parents are in array of specs, not indexes) */\nexport function getNormalizedAxesList(axes: AxisSpec[]): AxisSpecNormalized[] {\n if (!axes.length) {\n return [];\n }\n const modifiedAxes: AxisSpecNormalized[] = axes.map((axis) => {\n const { parentAxes: _, ...copiedRest } = axis;\n return { ...copiedRest, annotations: { ...copiedRest.annotations }, parentAxesSpec: [] };\n });\n\n axes.forEach((axis, idx) => {\n const modifiedAxis = modifiedAxes[idx];\n if (axis.parentAxes) { // if we have parents by indexes then take from the list\n modifiedAxis.parentAxesSpec = axis.parentAxes.map((idx) => modifiedAxes[idx]);\n } else { // else try to parse from annotation name\n const parents = parseParentsFromAnnotations(axis).map((name) => modifiedAxes.find((axis) => axis.name === name));\n modifiedAxis.parentAxesSpec = parents.some((p) => p === undefined) ? [] : parents as AxisSpecNormalized[];\n\n delete modifiedAxis.annotations?.[Annotation.Parents];\n }\n });\n\n if (modifiedAxes.some(hasCycleOfParents)) { // Axes list is broken\n modifiedAxes.forEach((axis) => {\n axis.parentAxesSpec = [];\n });\n } else {\n modifiedAxes.forEach((axis) => {\n sortParentsDeep(axis);\n });\n }\n\n return modifiedAxes;\n}\n\n/** Create list of regular axisSpec from normalized (parents are indexes, inside of current axes list) */\nexport function getDenormalizedAxesList(axesSpec: AxisSpecNormalized[]): AxisSpec[] {\n const idsList = axesSpec.map((axisSpec) => canonicalizeJson(getAxisId(axisSpec)));\n return axesSpec.map((axisSpec) => {\n const parentsIds = axisSpec.parentAxesSpec.map((axisSpec) => canonicalizeJson(getAxisId(axisSpec)));\n const parentIdxs = parentsIds.map((id) => idsList.indexOf(id));\n const { parentAxesSpec: _, ...copiedRest } = axisSpec;\n if (parentIdxs.length) {\n return { ...copiedRest, parentAxes: parentIdxs } as AxisSpec;\n }\n return copiedRest;\n });\n}\n\n/** Common type representing spec for all the axes in a column */\nexport type AxesSpec = AxisSpec[];\n\n/// Well-known column names\nexport const PColumnName = {\n Label: 'pl7.app/label',\n Table: {\n RowSelection: 'pl7.app/table/row-selection',\n },\n} as const;\n\n/**\n * Full column specification including all axes specs and specs of the column\n * itself.\n *\n * A PColumn in its essence represents a mapping from a fixed size, explicitly\n * typed tuple to an explicitly typed value.\n *\n * (axis1Value1, axis2Value1, ...) -> columnValue\n *\n * Each element in tuple correspond to the axis having the same index in axesSpec.\n */\nexport interface PUniversalColumnSpec extends PObjectSpec {\n /** Defines specific type of BObject, the most generic type of unit of\n * information in Platforma Project. */\n readonly kind: 'PColumn';\n\n /** Type of column values */\n readonly valueType: string;\n\n /** Column name */\n readonly name: string;\n\n /** Adds auxiliary information to the axis name, type and parents to form a\n * unique identifier */\n readonly domain?: Record<string, string>;\n\n /** Any additional information attached to the column that does not affect its\n * identifier */\n readonly annotations?: Record<string, string>;\n\n /** A list of zero-based indices of parent axes from the {@link axesSpec} array. */\n readonly parentAxes?: number[];\n\n /** Axes specifications */\n readonly axesSpec: AxesSpec;\n}\n\n/**\n * Specification of a data column.\n *\n * Data column is a specialized type of PColumn that stores only simple values (strings and numbers)\n * addressed by multiple keys. This is in contrast to other PColumn variants that can store more complex\n * values like files or other abstract data types. Data columns are optimized for storing and processing\n * basic tabular data.\n */\nexport interface PDataColumnSpec extends PUniversalColumnSpec {\n /** Type of column values */\n readonly valueType: ValueType;\n}\n\n// @todo: change this to PUniversalColumnSpec\nexport type PColumnSpec = PDataColumnSpec;\n\n/** Unique PColumnSpec identifier */\nexport type PColumnSpecId = {\n /** Defines specific type of BObject, the most generic type of unit of\n * information in Platforma Project. */\n readonly kind: 'PColumn';\n\n /** Type of column values */\n readonly valueType: ValueType;\n\n /** Column name */\n readonly name: string;\n\n /** Adds auxiliary information to the axis name, type and parents to form a\n * unique identifier */\n readonly domain?: Record<string, string>;\n\n /** A list of zero-based indices of parent axes from the {@link axesSpec} array. */\n readonly parentAxes?: number[];\n\n /** Axes id */\n readonly axesId: AxesId;\n};\n\nexport function getPColumnSpecId(spec: PColumnSpec): PColumnSpecId {\n return {\n kind: spec.kind,\n valueType: spec.valueType,\n name: spec.name,\n domain: spec.domain,\n parentAxes: spec.parentAxes,\n axesId: getAxesId(spec.axesSpec),\n };\n}\n\nexport interface PColumn<Data> extends PObject<Data> {\n /** PColumn spec, allowing it to be found among other PObjects */\n readonly spec: PColumnSpec;\n}\n\n/** Columns in a PFrame also have internal identifier, this object represents\n * combination of specs and such id */\nexport interface PColumnIdAndSpec {\n /** Internal column id within the PFrame */\n readonly columnId: PObjectId;\n\n /** Column spec */\n readonly spec: PColumnSpec;\n}\n\n/** Get column id and spec from a column */\nexport function getColumnIdAndSpec<Data>(column: PColumn<Data>): PColumnIdAndSpec {\n return {\n columnId: column.id,\n spec: column.spec,\n };\n}\n\n/** Information returned by {@link PFrame.listColumns} method */\nexport interface PColumnInfo extends PColumnIdAndSpec {\n /** True if data was associated with this PColumn */\n readonly hasData: boolean;\n}\n\nexport interface AxisId {\n /** Type of the axis or column value. For an axis should not use non-key\n * types like float or double. */\n readonly type: ValueType;\n\n /** Name of the axis or column */\n readonly name: string;\n\n /** Adds auxiliary information to the axis or column name and type to form a\n * unique identifier */\n readonly domain?: Record<string, string>;\n}\n\n/** Array of axis ids */\nexport type AxesId = AxisId[];\n\n/** Extracts axis ids from axis spec */\nexport function getAxisId(spec: AxisSpec): AxisId {\n const { type, name, domain } = spec;\n const result = { type, name };\n if (domain && Object.entries(domain).length > 0) {\n Object.assign(result, { domain });\n }\n return result;\n}\n\n/** Extracts axes ids from axes spec array from column spec */\nexport function getAxesId(spec: AxesSpec): AxesId {\n return spec.map(getAxisId);\n}\n\n/** Canonicalizes axis id */\nexport function canonicalizeAxisId(id: AxisId): CanonicalizedJson<AxisId> {\n return canonicalizeJson(getAxisId(id));\n}\n\n/** Returns true if all domains from query are found in target */\nfunction matchDomain(query?: Record<string, string>, target?: Record<string, string>) {\n if (query === undefined) return target === undefined;\n if (target === undefined) return true;\n for (const k in target) {\n if (query[k] !== target[k]) return false;\n }\n return true;\n}\n\n/** Returns whether \"match\" axis id is compatible with the \"query\" */\nexport function matchAxisId(query: AxisId, target: AxisId): boolean {\n return query.name === target.name && matchDomain(query.domain, target.domain);\n}\n"],"names":[],"mappings":";;;;AAaO,MAAM,SAAS,GAAG;AACvB,IAAA,GAAG,EAAE,KAAK;AACV,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,KAAK,EAAE,OAAO;;AAQV,SAAU,YAAY,CAC1B,QAA8B,EAC9B,GAAM,EAAA;AAEN,IAAA,OAAQ,QAA0B,GAAG,GAAG,CAAC;AAC3C;AAOM,SAAU,uBAAuB,CACrC,QAA8B,EAC9B,YAA6B,EAC7B,GAAM,EACN,iBAAA,GAA4B,yBAAyB,EAAA;IAErD,MAAM,IAAI,GAAG,YAAY,CAAO,QAAQ,EAAE,GAAG,CAAC;IAC9C,IAAI,IAAI,KAAK,SAAS;AAAE,QAAA,OAAO,SAAS;AAExC,IAAA,MAAM,MAAM,GAAG,YAAY,CAAC,GAAG,CAAC;AAChC,IAAA,IAAI;QACF,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;AAC9B,QAAA,OAAO,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC;IAC5B;IAAE,OAAO,KAAc,EAAE;AACvB,QAAA,MAAM,IAAI,KAAK,CACb,CAAA,EAAG,iBAAiB,CAA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,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC;AAAE,YAAA,OAAO,KAAK;IAC1C;AACA,IAAA,OAAO,IAAI;AACb;AAEA;AACM,SAAU,WAAW,CAAC,KAAa,EAAE,MAAc,EAAA;AACvD,IAAA,OAAO,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI,IAAI,WAAW,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;AAC/E;;;;"}
|
|
1
|
+
{"version":3,"file":"spec.js","sources":["../../../../src/drivers/pframe/spec/spec.ts"],"sourcesContent":["import { ensureError } from '../../../errors';\nimport {\n canonicalizeJson,\n type CanonicalizedJson,\n type StringifiedJson,\n} from '../../../json';\nimport type {\n PObject,\n PObjectId,\n PObjectSpec,\n} from '../../../pool';\nimport { z } from 'zod';\n\nexport const ValueType = {\n Int: 'Int',\n Long: 'Long',\n Float: 'Float',\n Double: 'Double',\n String: 'String',\n Bytes: 'Bytes',\n} as const;\n\n/** PFrame columns and axes within them may store one of these types. */\nexport type ValueType = (typeof ValueType)[keyof typeof ValueType];\n\nexport type Metadata = Record<string, string>;\n\nexport function readMetadata<U extends Metadata, T extends keyof U = keyof U>(\n metadata: Metadata | undefined,\n key: T,\n): U[T] | undefined {\n return (metadata as U | undefined)?.[key];\n}\n\ntype MetadataJsonImpl<M> = {\n [P in keyof M as (M[P] extends StringifiedJson ? P : never)]: M[P] extends StringifiedJson<infer U> ? z.ZodType<U> : never;\n};\nexport type MetadataJson<M> = MetadataJsonImpl<Required<M>>;\n\nexport function readMetadataJsonOrThrow<M extends Metadata, T extends keyof MetadataJson<M>>(\n metadata: Metadata | undefined,\n metadataJson: MetadataJson<M>,\n key: T,\n methodNameInError: string = 'readMetadataJsonOrThrow',\n): z.infer<MetadataJson<M>[T]> | undefined {\n const json = readMetadata<M, T>(metadata, key);\n if (json === undefined) return undefined;\n\n const schema = metadataJson[key];\n try {\n const value = JSON.parse(json);\n return schema.parse(value);\n } catch (error: unknown) {\n throw new Error(\n `${methodNameInError} failed, `\n + `key: ${String(key)}, `\n + `value: ${json}, `\n + `error: ${ensureError(error)}`,\n );\n }\n}\n\nexport function readMetadataJson<M extends Metadata, T extends keyof MetadataJson<M>>(\n metadata: Metadata | undefined,\n metadataJson: MetadataJson<M>,\n key: T,\n): z.infer<MetadataJson<M>[T]> | undefined {\n try {\n return readMetadataJsonOrThrow(metadata, metadataJson, key);\n } catch {\n return undefined; // treat invalid values as unset\n }\n}\n\n/// Well-known domains\nexport const Domain = {\n Alphabet: 'pl7.app/alphabet',\n BlockId: 'pl7.app/blockId',\n} as const;\n\nexport type Domain = Metadata & Partial<{\n [Domain.Alphabet]: 'nucleotide' | 'aminoacid' | string;\n [Domain.BlockId]: string;\n}>;\n\nexport type DomainJson = MetadataJson<Domain>;\nexport const DomainJson: DomainJson = {};\n\n/// Helper function for reading plain domain values\nexport function readDomain<T extends keyof Domain>(\n spec: { domain?: Metadata | undefined } | undefined,\n key: T,\n): Domain[T] | undefined {\n return readMetadata<Domain, T>(spec?.domain, key);\n}\n\n/// Helper function for reading json-encoded domain values, throws on JSON parsing error\nexport function readDomainJsonOrThrow<T extends keyof DomainJson>(\n spec: { domain?: Metadata | undefined } | undefined,\n key: T,\n): z.infer<DomainJson[T]> | undefined {\n return readMetadataJsonOrThrow<Domain, T>(spec?.domain, DomainJson, key, 'readDomainJsonOrThrow');\n}\n\n/// Helper function for reading json-encoded domain values, returns undefined on JSON parsing error\nexport function readDomainJson<T extends keyof DomainJson>(\n spec: { domain?: Metadata | undefined } | undefined,\n key: T,\n): z.infer<DomainJson[T]> | undefined {\n return readMetadataJson<Domain, T>(spec?.domain, DomainJson, key);\n}\n\n/// Well-known annotations\nexport const Annotation = {\n Alphabet: 'pl7.app/alphabet',\n Description: 'pl7.app/description',\n DiscreteValues: 'pl7.app/discreteValues',\n Format: 'pl7.app/format',\n Graph: {\n IsVirtual: 'pl7.app/graph/isVirtual',\n },\n HideDataFromUi: 'pl7.app/hideDataFromUi',\n HideDataFromGraphs: 'pl7.app/hideDataFromGraphs',\n IsLinkerColumn: 'pl7.app/isLinkerColumn',\n Label: 'pl7.app/label',\n Max: 'pl7.app/max',\n Min: 'pl7.app/min',\n Parents: 'pl7.app/parents',\n Sequence: {\n Annotation: {\n Mapping: 'pl7.app/sequence/annotation/mapping',\n },\n IsAnnotation: 'pl7.app/sequence/isAnnotation',\n },\n Table: {\n FontFamily: 'pl7.app/table/fontFamily',\n OrderPriority: 'pl7.app/table/orderPriority',\n Visibility: 'pl7.app/table/visibility',\n },\n Trace: 'pl7.app/trace',\n} as const;\n\nexport type Annotation = Metadata & Partial<{\n [Annotation.Alphabet]: 'nucleotide' | 'aminoacid' | string;\n [Annotation.Description]: string;\n [Annotation.DiscreteValues]: StringifiedJson<number[]> | StringifiedJson<string[]>;\n [Annotation.Format]: string;\n [Annotation.Graph.IsVirtual]: StringifiedJson<boolean>;\n [Annotation.HideDataFromUi]: StringifiedJson<boolean>;\n [Annotation.HideDataFromGraphs]: StringifiedJson<boolean>;\n [Annotation.IsLinkerColumn]: StringifiedJson<boolean>;\n [Annotation.Label]: string;\n [Annotation.Max]: StringifiedJson<number>;\n [Annotation.Min]: StringifiedJson<number>;\n [Annotation.Parents]: StringifiedJson<AxisSpec['name'][]>;\n [Annotation.Sequence.Annotation.Mapping]: StringifiedJson<Record<string, string>>;\n [Annotation.Sequence.IsAnnotation]: StringifiedJson<boolean>;\n [Annotation.Table.FontFamily]: string;\n [Annotation.Table.OrderPriority]: StringifiedJson<number>;\n [Annotation.Table.Visibility]: 'hidden' | 'optional' | string;\n [Annotation.Trace]: StringifiedJson<Record<string, unknown>>;\n}>;\n\n// export const AxisSpec = z.object({\n// type: z.nativeEnum(ValueType),\n// name: z.string(),\n// domain: z.record(z.string(), z.string()).optional(),\n// annotations: z.record(z.string(), z.string()).optional(),\n// parentAxes: z.array(z.number()).optional(),\n// }).passthrough();\n//\n// type Expect<T extends true> = T;\n// type Equal<X, Y> =\n// (<T>() => T extends X ? 1 : 2) extends (<T>() => T extends Y ? 1 : 2) ? true : false;\n//\n// type _test = Expect<Equal<\n// Readonly<z.infer<typeof AxisSpec>>,\n// Readonly<AxisSpec & Record<string, unknown>>\n// >>;\n\nexport type AnnotationJson = MetadataJson<Annotation>;\nexport const AnnotationJson: AnnotationJson = {\n [Annotation.DiscreteValues]: z.array(z.string()).or(z.array(z.number())),\n [Annotation.Graph.IsVirtual]: z.boolean(),\n [Annotation.HideDataFromUi]: z.boolean(),\n [Annotation.HideDataFromGraphs]: z.boolean(),\n [Annotation.IsLinkerColumn]: z.boolean(),\n [Annotation.Max]: z.number(),\n [Annotation.Min]: z.number(),\n [Annotation.Parents]: z.array(z.string()),\n [Annotation.Sequence.Annotation.Mapping]: z.record(z.string(), z.string()),\n [Annotation.Sequence.IsAnnotation]: z.boolean(),\n [Annotation.Table.OrderPriority]: z.number(),\n [Annotation.Trace]: z.record(z.string(), z.unknown()),\n};\n\n/// Helper function for reading plain annotation values\nexport function readAnnotation<T extends keyof Annotation>(\n spec: { annotations?: Metadata | undefined } | undefined,\n key: T,\n): Annotation[T] | undefined {\n return readMetadata<Annotation, T>(spec?.annotations, key);\n}\n\n/// Helper function for reading json-encoded annotation values, throws on JSON parsing error\nexport function readAnnotationJsonOrThrow<T extends keyof AnnotationJson>(\n spec: { annotations?: Metadata | undefined } | undefined,\n key: T,\n): z.infer<AnnotationJson[T]> | undefined {\n return readMetadataJsonOrThrow<Annotation, T>(spec?.annotations, AnnotationJson, key, 'readAnnotationJsonOrThrow');\n}\n\n/// Helper function for reading json-encoded annotation values, returns undefined on JSON parsing error\nexport function readAnnotationJson<T extends keyof AnnotationJson>(\n spec: { annotations?: Metadata | undefined } | undefined,\n key: T,\n): z.infer<AnnotationJson[T]> | undefined {\n return readMetadataJson<Annotation, T>(spec?.annotations, AnnotationJson, key);\n}\n\n/**\n * Specification of an individual axis.\n *\n * Each axis is a part of a composite key that addresses data inside the PColumn.\n *\n * Each record inside a PColumn is addressed by a unique tuple of values set for\n * all the axes specified in the column spec.\n */\nexport interface AxisSpec {\n /** Type of the axis value. Should not use non-key types like float or double. */\n readonly type: ValueType;\n\n /** Name of the axis */\n readonly name: string;\n\n /** Adds auxiliary information to the axis name, type and parents to form a\n * unique identifier */\n readonly domain?: Record<string, string>;\n\n /** Any additional information attached to the axis that does not affect its\n * identifier */\n readonly annotations?: Record<string, string>;\n\n /**\n * Parent axes provide contextual grouping for the axis in question, establishing\n * a hierarchy where the current axis is dependent on one or more axes for its\n * full definition and meaning. For instance, in a data structure where each\n * \"container\" axis may contain multiple \"item\" axes, the `item` axis would\n * list the index of the `container` axis in this field to denote its dependency.\n *\n * This means that the identity or significance of the `item` axis is only\n * interpretable when combined with its parent `container` axis. An `item` axis\n * index by itself may be non-unique and only gains uniqueness within the context\n * of its parent `container`. Therefore, the `parentAxes` field is essential for\n * mapping these relationships and ensuring data coherence across nested or\n * multi-level data models.\n *\n * A list of zero-based indices of parent axes in the overall axes specification\n * from the column spec. Each index corresponds to the position of a parent axis\n * in the list that defines the structure of the data model.\n */\n readonly parentAxes?: number[];\n}\n\n/** Parents are specs, not indexes; normalized axis can be used considering its parents independently from column */\nexport interface AxisSpecNormalized extends Omit<AxisSpec, 'parentAxes'> {\n parentAxesSpec: AxisSpecNormalized[];\n}\n\n/** Tree: axis is a root, its parents are children */\nexport type AxisTree = {\n axis: AxisSpecNormalized;\n children: AxisTree[]; // parents\n};\n\nfunction makeAxisTree(axis: AxisSpecNormalized): AxisTree {\n return { axis, children: [] };\n}\n\n/** Build tree by axis parents annotations */\nexport function getAxesTree(rootAxis: AxisSpecNormalized): AxisTree {\n const root = makeAxisTree(rootAxis);\n let nodesQ = [root];\n while (nodesQ.length) {\n const nextNodes: AxisTree[] = [];\n for (const node of nodesQ) {\n node.children = node.axis.parentAxesSpec.map(makeAxisTree);\n nextNodes.push(...node.children);\n }\n nodesQ = nextNodes;\n }\n return root;\n}\n\n/** Get set of canonicalized axisIds from axisTree */\nexport function getSetFromAxisTree(tree: AxisTree): Set<CanonicalizedJson<AxisId>> {\n const set = new Set([canonicalizeJson(getAxisId(tree.axis))]);\n let nodesQ = [tree];\n while (nodesQ.length) {\n const nextNodes = [];\n for (const node of nodesQ) {\n for (const parent of node.children) {\n set.add(canonicalizeJson(getAxisId(parent.axis)));\n nextNodes.push(parent);\n }\n }\n nodesQ = nextNodes;\n }\n return set;\n}\n\n/** Get array of axisSpecs from axisTree */\nexport function getArrayFromAxisTree(tree: AxisTree): AxisSpecNormalized[] {\n const res = [tree.axis];\n let nodesQ = [tree];\n while (nodesQ.length) {\n const nextNodes = [];\n for (const node of nodesQ) {\n for (const parent of node.children) {\n res.push(parent.axis);\n nextNodes.push(parent);\n }\n }\n nodesQ = nextNodes;\n }\n return res;\n}\n\nexport function canonicalizeAxisWithParents(axis: AxisSpecNormalized) {\n return canonicalizeJson(getArrayFromAxisTree(getAxesTree(axis)).map(getAxisId));\n}\n\nfunction normalizingAxesComparator(axis1: AxisSpecNormalized, axis2: AxisSpecNormalized): 1 | -1 | 0 {\n if (axis1.name !== axis2.name) {\n return axis1.name < axis2.name ? 1 : -1;\n }\n if (axis1.type !== axis2.type) {\n return axis1.type < axis2.type ? 1 : -1;\n }\n const domain1 = canonicalizeJson(axis1.domain ?? {});\n const domain2 = canonicalizeJson(axis2.domain ?? {});\n if (domain1 !== domain2) {\n return domain1 < domain2 ? 1 : -1;\n }\n\n const parents1 = canonicalizeAxisWithParents(axis1);\n const parents2 = canonicalizeAxisWithParents(axis2);\n\n if (parents1 !== parents2) {\n return parents1 < parents2 ? 1 : -1;\n }\n\n const annotation1 = canonicalizeJson(axis1.annotations ?? {});\n const annotation2 = canonicalizeJson(axis2.annotations ?? {});\n if (annotation1 !== annotation2) {\n return annotation1 < annotation2 ? 1 : -1;\n }\n return 0;\n}\n\nfunction parseParentsFromAnnotations(axis: AxisSpec) {\n const parentsList = readAnnotationJson(axis, Annotation.Parents);\n if (parentsList === undefined) {\n return [];\n }\n return parentsList;\n}\n\nfunction sortParentsDeep(axisSpec: AxisSpecNormalized) {\n axisSpec.parentAxesSpec.forEach(sortParentsDeep);\n axisSpec.parentAxesSpec.sort(normalizingAxesComparator);\n}\n\nfunction hasCycleOfParents(axisSpec: AxisSpecNormalized) {\n const root = makeAxisTree(axisSpec);\n let nodesQ = [root];\n const ancestors = new Set(canonicalizeJson(getAxisId(axisSpec)));\n while (nodesQ.length) {\n const nextNodes: AxisTree[] = [];\n const levelIds = new Set<CanonicalizedJson<AxisId>>();\n for (const node of nodesQ) {\n node.children = node.axis.parentAxesSpec.map(makeAxisTree);\n for (const child of node.children) {\n const childId = canonicalizeJson(getAxisId(child.axis));\n if (!levelIds.has(childId)) {\n nextNodes.push(child);\n levelIds.add(childId);\n if (ancestors.has(childId)) {\n return true;\n }\n ancestors.add(childId);\n }\n }\n }\n nodesQ = nextNodes;\n }\n return false;\n}\n\n/** Create list of normalized axisSpec (parents are in array of specs, not indexes) */\nexport function getNormalizedAxesList(axes: AxisSpec[]): AxisSpecNormalized[] {\n if (!axes.length) {\n return [];\n }\n const modifiedAxes: AxisSpecNormalized[] = axes.map((axis) => {\n const { parentAxes: _, ...copiedRest } = axis;\n return { ...copiedRest, annotations: { ...copiedRest.annotations }, parentAxesSpec: [] };\n });\n\n axes.forEach((axis, idx) => {\n const modifiedAxis = modifiedAxes[idx];\n if (axis.parentAxes) { // if we have parents by indexes then take from the list\n modifiedAxis.parentAxesSpec = axis.parentAxes.map((idx) => modifiedAxes[idx]);\n } else { // else try to parse from annotation name\n const parents = parseParentsFromAnnotations(axis).map((name) => modifiedAxes.find((axis) => axis.name === name));\n modifiedAxis.parentAxesSpec = parents.some((p) => p === undefined) ? [] : parents as AxisSpecNormalized[];\n\n delete modifiedAxis.annotations?.[Annotation.Parents];\n }\n });\n\n if (modifiedAxes.some(hasCycleOfParents)) { // Axes list is broken\n modifiedAxes.forEach((axis) => {\n axis.parentAxesSpec = [];\n });\n } else {\n modifiedAxes.forEach((axis) => {\n sortParentsDeep(axis);\n });\n }\n\n return modifiedAxes;\n}\n\n/** Create list of regular axisSpec from normalized (parents are indexes, inside of current axes list) */\nexport function getDenormalizedAxesList(axesSpec: AxisSpecNormalized[]): AxisSpec[] {\n const idsList = axesSpec.map((axisSpec) => canonicalizeJson(getAxisId(axisSpec)));\n return axesSpec.map((axisSpec) => {\n const parentsIds = axisSpec.parentAxesSpec.map((axisSpec) => canonicalizeJson(getAxisId(axisSpec)));\n const parentIdxs = parentsIds.map((id) => idsList.indexOf(id));\n const { parentAxesSpec: _, ...copiedRest } = axisSpec;\n if (parentIdxs.length) {\n return { ...copiedRest, parentAxes: parentIdxs } as AxisSpec;\n }\n return copiedRest;\n });\n}\n\n/** Common type representing spec for all the axes in a column */\nexport type AxesSpec = AxisSpec[];\n\n/// Well-known column names\nexport const PColumnName = {\n Label: 'pl7.app/label',\n Table: {\n RowSelection: 'pl7.app/table/row-selection',\n },\n} as const;\n\n/**\n * Full column specification including all axes specs and specs of the column\n * itself.\n *\n * A PColumn in its essence represents a mapping from a fixed size, explicitly\n * typed tuple to an explicitly typed value.\n *\n * (axis1Value1, axis2Value1, ...) -> columnValue\n *\n * Each element in tuple correspond to the axis having the same index in axesSpec.\n */\nexport interface PUniversalColumnSpec extends PObjectSpec {\n /** Defines specific type of BObject, the most generic type of unit of\n * information in Platforma Project. */\n readonly kind: 'PColumn';\n\n /** Type of column values */\n readonly valueType: string;\n\n /** Column name */\n readonly name: string;\n\n /** Adds auxiliary information to the axis name, type and parents to form a\n * unique identifier */\n readonly domain?: Record<string, string>;\n\n /** Any additional information attached to the column that does not affect its\n * identifier */\n readonly annotations?: Record<string, string>;\n\n /** A list of zero-based indices of parent axes from the {@link axesSpec} array. */\n readonly parentAxes?: number[];\n\n /** Axes specifications */\n readonly axesSpec: AxesSpec;\n}\n\n/**\n * Specification of a data column.\n *\n * Data column is a specialized type of PColumn that stores only simple values (strings and numbers)\n * addressed by multiple keys. This is in contrast to other PColumn variants that can store more complex\n * values like files or other abstract data types. Data columns are optimized for storing and processing\n * basic tabular data.\n */\nexport interface PDataColumnSpec extends PUniversalColumnSpec {\n /** Type of column values */\n readonly valueType: ValueType;\n}\n\n// @todo: change this to PUniversalColumnSpec\nexport type PColumnSpec = PDataColumnSpec;\n\n/** Unique PColumnSpec identifier */\nexport type PColumnSpecId = {\n /** Defines specific type of BObject, the most generic type of unit of\n * information in Platforma Project. */\n readonly kind: 'PColumn';\n\n /** Type of column values */\n readonly valueType: ValueType;\n\n /** Column name */\n readonly name: string;\n\n /** Adds auxiliary information to the axis name, type and parents to form a\n * unique identifier */\n readonly domain?: Record<string, string>;\n\n /** A list of zero-based indices of parent axes from the {@link axesSpec} array. */\n readonly parentAxes?: number[];\n\n /** Axes id */\n readonly axesId: AxesId;\n};\n\nexport function getPColumnSpecId(spec: PColumnSpec): PColumnSpecId {\n return {\n kind: spec.kind,\n valueType: spec.valueType,\n name: spec.name,\n domain: spec.domain,\n parentAxes: spec.parentAxes,\n axesId: getAxesId(spec.axesSpec),\n };\n}\n\nexport interface PColumn<Data> extends PObject<Data> {\n /** PColumn spec, allowing it to be found among other PObjects */\n readonly spec: PColumnSpec;\n}\n\n/** Columns in a PFrame also have internal identifier, this object represents\n * combination of specs and such id */\nexport interface PColumnIdAndSpec {\n /** Internal column id within the PFrame */\n readonly columnId: PObjectId;\n\n /** Column spec */\n readonly spec: PColumnSpec;\n}\n\n/** Get column id and spec from a column */\nexport function getColumnIdAndSpec<Data>(column: PColumn<Data>): PColumnIdAndSpec {\n return {\n columnId: column.id,\n spec: column.spec,\n };\n}\n\n/** Information returned by {@link PFrame.listColumns} method */\nexport interface PColumnInfo extends PColumnIdAndSpec {\n /** True if data was associated with this PColumn */\n readonly hasData: boolean;\n}\n\nexport interface AxisId {\n /** Type of the axis or column value. For an axis should not use non-key\n * types like float or double. */\n readonly type: ValueType;\n\n /** Name of the axis or column */\n readonly name: string;\n\n /** Adds auxiliary information to the axis or column name and type to form a\n * unique identifier */\n readonly domain?: Record<string, string>;\n}\n\n/** Array of axis ids */\nexport type AxesId = AxisId[];\n\n/** Extracts axis ids from axis spec */\nexport function getAxisId(spec: AxisSpec): AxisId {\n const { type, name, domain } = spec;\n const result = { type, name };\n if (domain && Object.entries(domain).length > 0) {\n Object.assign(result, { domain });\n }\n return result;\n}\n\n/** Extracts axes ids from axes spec array from column spec */\nexport function getAxesId(spec: AxesSpec): AxesId {\n return spec.map(getAxisId);\n}\n\n/** Canonicalizes axis id */\nexport function canonicalizeAxisId(id: AxisId): CanonicalizedJson<AxisId> {\n return canonicalizeJson(getAxisId(id));\n}\n\n/** Returns true if all domains from query are found in target */\nfunction matchDomain(query?: Record<string, string>, target?: Record<string, string>) {\n if (query === undefined) return target === undefined;\n if (target === undefined) return true;\n for (const k in target) {\n if (query[k] !== target[k]) return false;\n }\n return true;\n}\n\n/** Returns whether \"match\" axis id is compatible with the \"query\" */\nexport function matchAxisId(query: AxisId, target: AxisId): boolean {\n return query.name === target.name && matchDomain(query.domain, target.domain);\n}\n"],"names":[],"mappings":";;;;AAaO,MAAM,SAAS,GAAG;AACvB,IAAA,GAAG,EAAE,KAAK;AACV,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,KAAK,EAAE,OAAO;;AAQV,SAAU,YAAY,CAC1B,QAA8B,EAC9B,GAAM,EAAA;AAEN,IAAA,OAAQ,QAA0B,GAAG,GAAG,CAAC;AAC3C;AAOM,SAAU,uBAAuB,CACrC,QAA8B,EAC9B,YAA6B,EAC7B,GAAM,EACN,iBAAA,GAA4B,yBAAyB,EAAA;IAErD,MAAM,IAAI,GAAG,YAAY,CAAO,QAAQ,EAAE,GAAG,CAAC;IAC9C,IAAI,IAAI,KAAK,SAAS;AAAE,QAAA,OAAO,SAAS;AAExC,IAAA,MAAM,MAAM,GAAG,YAAY,CAAC,GAAG,CAAC;AAChC,IAAA,IAAI;QACF,M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OAAO,gBAAgB,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;AACxC;AAEA;AACA,SAAS,WAAW,CAAC,KAA8B,EAAE,MAA+B,EAAA;IAClF,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,MAAM,KAAK,SAAS;IACpD,IAAI,MAAM,KAAK,SAAS;AAAE,QAAA,OAAO,IAAI;AACrC,IAAA,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE;QACtB,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC;AAAE,YAAA,OAAO,KAAK;IAC1C;AACA,IAAA,OAAO,IAAI;AACb;AAEA;AACM,SAAU,WAAW,CAAC,KAAa,EAAE,MAAc,EAAA;AACvD,IAAA,OAAO,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI,IAAI,WAAW,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;AAC/E;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/pl-model-common",
|
|
3
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.18",
|
|
4
4
|
"description": "Platforma SDK Model",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"eslint": "^9.25.1",
|
|
26
26
|
"typescript": "~5.6.3",
|
|
27
27
|
"vitest": "^2.1.9",
|
|
28
|
-
"@platforma-sdk/eslint-config": "1.0.3",
|
|
29
28
|
"@milaboratories/build-configs": "1.0.8",
|
|
29
|
+
"@milaboratories/ts-builder": "1.0.5",
|
|
30
30
|
"@milaboratories/ts-configs": "1.0.6",
|
|
31
|
-
"@
|
|
31
|
+
"@platforma-sdk/eslint-config": "1.1.0"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
34
|
"type-check": "ts-builder types --target node",
|
package/src/drivers/blob.ts
CHANGED
|
@@ -76,20 +76,8 @@ export interface BlobDriver {
|
|
|
76
76
|
* Depending on the handle type, content will be served from locally downloaded file,
|
|
77
77
|
* or directly from remote platforma storage.
|
|
78
78
|
*/
|
|
79
|
-
getContent(
|
|
80
|
-
handle: LocalBlobHandle | RemoteBlobHandle,
|
|
81
|
-
): Promise<Uint8Array>;
|
|
82
|
-
getContent(
|
|
83
|
-
handle: LocalBlobHandle | RemoteBlobHandle,
|
|
84
|
-
options?: GetContentOptions,
|
|
85
|
-
): Promise<Uint8Array>;
|
|
86
|
-
/** @deprecated Use {@link getContent} with {@link GetContentOptions} instead */
|
|
87
79
|
getContent(
|
|
88
80
|
handle: LocalBlobHandle | RemoteBlobHandle,
|
|
89
81
|
range?: RangeBytes,
|
|
90
82
|
): Promise<Uint8Array>;
|
|
91
|
-
getContent(
|
|
92
|
-
handle: LocalBlobHandle | RemoteBlobHandle,
|
|
93
|
-
optionsOrRange?: GetContentOptions | RangeBytes,
|
|
94
|
-
): Promise<Uint8Array>;
|
|
95
83
|
}
|
|
@@ -120,6 +120,7 @@ export const Annotation = {
|
|
|
120
120
|
IsVirtual: 'pl7.app/graph/isVirtual',
|
|
121
121
|
},
|
|
122
122
|
HideDataFromUi: 'pl7.app/hideDataFromUi',
|
|
123
|
+
HideDataFromGraphs: 'pl7.app/hideDataFromGraphs',
|
|
123
124
|
IsLinkerColumn: 'pl7.app/isLinkerColumn',
|
|
124
125
|
Label: 'pl7.app/label',
|
|
125
126
|
Max: 'pl7.app/max',
|
|
@@ -146,6 +147,7 @@ export type Annotation = Metadata & Partial<{
|
|
|
146
147
|
[Annotation.Format]: string;
|
|
147
148
|
[Annotation.Graph.IsVirtual]: StringifiedJson<boolean>;
|
|
148
149
|
[Annotation.HideDataFromUi]: StringifiedJson<boolean>;
|
|
150
|
+
[Annotation.HideDataFromGraphs]: StringifiedJson<boolean>;
|
|
149
151
|
[Annotation.IsLinkerColumn]: StringifiedJson<boolean>;
|
|
150
152
|
[Annotation.Label]: string;
|
|
151
153
|
[Annotation.Max]: StringifiedJson<number>;
|
|
@@ -181,6 +183,7 @@ export const AnnotationJson: AnnotationJson = {
|
|
|
181
183
|
[Annotation.DiscreteValues]: z.array(z.string()).or(z.array(z.number())),
|
|
182
184
|
[Annotation.Graph.IsVirtual]: z.boolean(),
|
|
183
185
|
[Annotation.HideDataFromUi]: z.boolean(),
|
|
186
|
+
[Annotation.HideDataFromGraphs]: z.boolean(),
|
|
184
187
|
[Annotation.IsLinkerColumn]: z.boolean(),
|
|
185
188
|
[Annotation.Max]: z.number(),
|
|
186
189
|
[Annotation.Min]: z.number(),
|