@genome-spy/app 0.75.0 → 0.77.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AbortablePromiseCache-beUIcZcW.js +96 -0
- package/dist/agentApi-ClsLtELB.js +26994 -0
- package/dist/agentApi.es.js +11145 -0
- package/dist/agentShared.es.js +4742 -0
- package/dist/{blosc-oa0DlI6G.js → blosc-BX4BJ8sR.js} +1 -1
- package/dist/blosc-DL1kZHdE.js +692 -0
- package/dist/chunk-INHXZS53-Dx2aFznx.js +13 -0
- package/dist/componentStyles-CIXoKEp0.js +2182 -0
- package/dist/dialog.es.js +377 -0
- package/dist/esm-CHVYSGF2.js +1084 -0
- package/dist/esm-CZvS2Ldm.js +155 -0
- package/dist/esm-C_XrKaCY.js +137 -0
- package/dist/{esm-DCCYNvaz.js → esm-CqrZuhTF.js} +50 -50
- package/dist/{esm-D-WfYOx7.js → esm-Cz4iCfzF.js} +25 -25
- package/dist/esm-D-y0Ce1M.js +573 -0
- package/dist/esm-D2-C5ZzN.js +1084 -0
- package/dist/esm-DPS6pYKF.js +1248 -0
- package/dist/esm-Dfo2M18m.js +461 -0
- package/dist/esm-DjF6pKy5.js +369 -0
- package/dist/{esm-n0auOe11.js → esm-Q6nrd9vJ.js} +1 -1
- package/dist/esm-aOLxLL7A.js +121 -0
- package/dist/esm-id9DWBZW.js +137 -0
- package/dist/esm-kXhrPIYy.js +1426 -0
- package/dist/esm-s_SlArJ8.js +298 -0
- package/dist/index.es.js +15272 -37563
- package/dist/index.js +1202 -741
- package/dist/lit-ymUSmGBw.js +510 -0
- package/dist/{lz4-jZ0zyLBa.js → lz4-BSYl80V8.js} +1 -1
- package/dist/lz4-Csz5aoFA.js +626 -0
- package/dist/parquetRead-m8-8_SpH.js +1609 -0
- package/dist/schema.json +489 -85
- package/dist/style.css +1 -1
- package/dist/viewUtils-3_xHIxmy.js +14292 -0
- package/dist/{zstd-C6ksIG9r.js → zstd-BAfRM3IH.js} +1 -1
- package/dist/zstd-dJuUp1fl.js +583 -0
- package/package.json +30 -5
- package/src/agentApi/index.d.ts +147 -0
- package/src/agentShared/index.d.ts +97 -0
- package/src/agentShared/types.d.ts +8 -0
- package/src/appTypes.d.ts +75 -0
- package/src/bookmark/databaseSchema.d.ts +33 -0
- package/src/charts/boxplotTypes.d.ts +15 -0
- package/src/charts/sampleAttributePlotTypes.d.ts +149 -0
- package/src/coreSpecAugmentation.d.ts +29 -0
- package/src/dialog/index.d.ts +5 -0
- package/src/embedTypes.d.ts +9 -0
- package/src/index.d.ts +16 -0
- package/src/sampleView/sampleViewTypes.d.ts +176 -0
- package/src/sampleView/state/payloadTypes.d.ts +484 -0
- package/src/sampleView/state/sampleState.d.ts +76 -0
- package/src/sampleView/types.d.ts +128 -0
- package/src/spec/appSpec.d.ts +54 -0
- package/src/spec/sampleView.d.ts +545 -0
- package/src/spec/view.d.ts +124 -0
- package/src/state/paramProvenanceTypes.d.ts +215 -0
- package/src/state/selectionExpansionTypes.d.ts +77 -0
- package/src/state.d.ts +97 -0
- package/src/types/lz-string.d.ts +24 -0
- package/src/types/vega-loader.d.ts +1 -0
- package/src/utils/colorScaleSummary.d.ts +15 -0
- package/src/utils/statistics/fieldSummary.d.ts +49 -0
- package/src/vite-env.d.ts +6 -0
- package/dist/browser-Dvlo92rx.js +0 -126
- package/dist/esm-Cmo4qEPr.js +0 -1015
- /package/dist/{AbortablePromiseCache-3gHJdF3E.js → AbortablePromiseCache-BDH1cqFl.js} +0 -0
- /package/dist/{chunk-INHXZS53-fPMmEwMt.js → chunk-INHXZS53-DwEV9sMh.js} +0 -0
- /package/dist/{esm-BygJiwh0.js → esm-BL9SNSnj.js} +0 -0
- /package/dist/{esm-B8-vSu-c.js → esm-BwW--bVV.js} +0 -0
- /package/dist/{esm-CGX-qz1d.js → esm-Bz_92nH0.js} +0 -0
- /package/dist/{esm-CuMSzCHy.js → esm-D2_c7lXY.js} +0 -0
- /package/dist/{parquetRead-CJe1UPsz.js → parquetRead-C33mgLEo.js} +0 -0
|
@@ -0,0 +1,545 @@
|
|
|
1
|
+
import { Data, InlineData, UrlData } from "@genome-spy/core/spec/data.js";
|
|
2
|
+
import { Align, FontStyle, FontWeight } from "@genome-spy/core/spec/font.js";
|
|
3
|
+
import { Scale } from "@genome-spy/core/spec/scale.js";
|
|
4
|
+
import { ViewSpecBase, ViewBackground } from "@genome-spy/core/spec/view.js";
|
|
5
|
+
import {
|
|
6
|
+
AppConfigurableVisibilitySpec,
|
|
7
|
+
AppLayerSpec,
|
|
8
|
+
AppNestedViewSpec,
|
|
9
|
+
AppUnitSpec,
|
|
10
|
+
} from "./view.js";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* A view specification for a SampleView.
|
|
14
|
+
*/
|
|
15
|
+
export interface SampleSpec extends Omit<ViewSpecBase, "templates"> {
|
|
16
|
+
/**
|
|
17
|
+
* Is the SampleView visibility configurable from the GenomeSpy App toolbar.
|
|
18
|
+
*
|
|
19
|
+
* __Default value:__ `true`
|
|
20
|
+
*/
|
|
21
|
+
configurableVisibility?: AppConfigurableVisibilitySpec["configurableVisibility"];
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Sample identity and label configuration.
|
|
25
|
+
*
|
|
26
|
+
* If `identity` is omitted, sample identifiers are inferred from the data.
|
|
27
|
+
*/
|
|
28
|
+
samples: SampleDef;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Metadata sources and metadata matrix layout.
|
|
32
|
+
*/
|
|
33
|
+
metadata?: MetadataDef;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Layout settings for sample rows and sample groups.
|
|
37
|
+
*/
|
|
38
|
+
sampleLayout?: SampleLayoutDef;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* An object defining the view background and outline. The background is
|
|
42
|
+
* repeated for each group.
|
|
43
|
+
*/
|
|
44
|
+
view?: ViewBackground;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* The view specification to be repeated for each sample.
|
|
48
|
+
*/
|
|
49
|
+
spec: AppLayerSpec | AppUnitSpec;
|
|
50
|
+
|
|
51
|
+
// Templates inside a SampleSpec may only produce non-sample descendants.
|
|
52
|
+
// This keeps SampleView as a top-level/sibling concept instead of nestable.
|
|
53
|
+
templates?: Record<string, AppNestedViewSpec>;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Keep summary tracks visible while scrolling samples.
|
|
57
|
+
*
|
|
58
|
+
* __Default value:__ `true`
|
|
59
|
+
*/
|
|
60
|
+
stickySummaries?: boolean;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export type SampleAttributeType = "nominal" | "ordinal" | "quantitative";
|
|
64
|
+
|
|
65
|
+
export type SampleAttributeSemanticType =
|
|
66
|
+
| "subjectId"
|
|
67
|
+
| "modelSystemId"
|
|
68
|
+
| "timeToEvent"
|
|
69
|
+
| "eventStatus"
|
|
70
|
+
| "category";
|
|
71
|
+
|
|
72
|
+
export interface SampleAttributeDef {
|
|
73
|
+
/**
|
|
74
|
+
* User-facing description of the metadata attribute.
|
|
75
|
+
*/
|
|
76
|
+
description?: string;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* The attribute type. One of `"nominal"`, `"ordinal"`, or `"quantitative"`.
|
|
80
|
+
*/
|
|
81
|
+
type?: SampleAttributeType;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Domain-specific meaning of the metadata attribute.
|
|
85
|
+
*/
|
|
86
|
+
semanticType?: SampleAttributeSemanticType;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Color scale for metadata cells.
|
|
90
|
+
*/
|
|
91
|
+
scale?: Scale;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Scale for mapping quantitative values to metadata cell width.
|
|
95
|
+
*/
|
|
96
|
+
barScale?: Scale;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Color used for metadata cells whose value is missing.
|
|
100
|
+
*
|
|
101
|
+
* If `null`, no background is drawn for missing values in this attribute.
|
|
102
|
+
* If omitted, `metadata.missingValueColor` is used. If both are
|
|
103
|
+
* omitted, the default is `null` when `barScale` is configured and
|
|
104
|
+
* `"#f0f0f0"` otherwise.
|
|
105
|
+
*/
|
|
106
|
+
missingValueColor?: string | null;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Width of the column in pixels.
|
|
110
|
+
*/
|
|
111
|
+
width?: number;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Whether the attribute is visible when the view opens.
|
|
115
|
+
*/
|
|
116
|
+
visible?: boolean;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Attribute label shown in the metadata header.
|
|
120
|
+
*
|
|
121
|
+
* If omitted, the attribute name is used.
|
|
122
|
+
*/
|
|
123
|
+
title?: string;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export interface SampleIdentityDef {
|
|
127
|
+
/**
|
|
128
|
+
* Data source that defines the sample set for the view.
|
|
129
|
+
*
|
|
130
|
+
* The source must contain one row per sample. Metadata imports are matched
|
|
131
|
+
* against these sample ids.
|
|
132
|
+
*/
|
|
133
|
+
data: Data;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Field that contains the canonical sample id.
|
|
137
|
+
*
|
|
138
|
+
* __Default value:__ `"sample"`
|
|
139
|
+
*/
|
|
140
|
+
idField?: string;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Field containing a user-visible sample label.
|
|
144
|
+
*
|
|
145
|
+
* If omitted, sample ids are used.
|
|
146
|
+
*/
|
|
147
|
+
displayNameField?: string;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export interface ColumnIdentifierField {
|
|
151
|
+
/**
|
|
152
|
+
* Name of the identifier field shown in UI and diagnostics.
|
|
153
|
+
*
|
|
154
|
+
* Example values: `"symbol"`, `"ensembl"`, `"entrez"`.
|
|
155
|
+
*/
|
|
156
|
+
name: string;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Backend path to identifier values aligned to matrix columns.
|
|
160
|
+
*
|
|
161
|
+
* The array length must equal the number of columns in the matrix.
|
|
162
|
+
*/
|
|
163
|
+
path: string;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Marks this identifier as the primary, canonical identifier.
|
|
167
|
+
*/
|
|
168
|
+
primary?: boolean;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Enables case-insensitive matching for this identifier field.
|
|
172
|
+
*/
|
|
173
|
+
caseInsensitive?: boolean;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Remove version suffixes during matching (for example, ENSG...`.12`).
|
|
177
|
+
*
|
|
178
|
+
* Useful for identifiers such as Ensembl ids that may contain version
|
|
179
|
+
* suffixes in some datasets but not in user queries.
|
|
180
|
+
*/
|
|
181
|
+
stripVersionSuffix?: boolean;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export interface DataBackendDef {
|
|
185
|
+
backend: "data";
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Eager tabular metadata source.
|
|
189
|
+
*
|
|
190
|
+
* Supports `UrlData` and `InlineData`.
|
|
191
|
+
*/
|
|
192
|
+
data: UrlData | InlineData;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Field name in the table that matches sample ids in the view.
|
|
196
|
+
*
|
|
197
|
+
* __Default value:__ `"sample"`
|
|
198
|
+
*/
|
|
199
|
+
sampleIdField?: string;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export interface ZarrMatrixLayoutDef {
|
|
203
|
+
/**
|
|
204
|
+
* Path to matrix values, arranged as sample rows by metadata columns.
|
|
205
|
+
*
|
|
206
|
+
* __Default value:__ `"X"`
|
|
207
|
+
*/
|
|
208
|
+
valuesPath?: string;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Path to matrix row identifiers (sample ids).
|
|
212
|
+
*
|
|
213
|
+
* __Default value:__ `"obs_names"`
|
|
214
|
+
*/
|
|
215
|
+
rowIdsPath?: string;
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Path to matrix column identifiers.
|
|
219
|
+
*
|
|
220
|
+
* __Default value:__ `"var_names"`
|
|
221
|
+
*/
|
|
222
|
+
columnIdsPath?: string;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export interface ZarrBackendDef {
|
|
226
|
+
backend: "zarr";
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* URL to the root of the Zarr store.
|
|
230
|
+
*/
|
|
231
|
+
url: string;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Path overrides for the matrix layout.
|
|
235
|
+
*/
|
|
236
|
+
matrix?: ZarrMatrixLayoutDef;
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Identifier arrays used to resolve user queries to columns.
|
|
240
|
+
*
|
|
241
|
+
* If omitted, only primary column ids are used for lookup.
|
|
242
|
+
*/
|
|
243
|
+
identifiers?: ColumnIdentifierField[];
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export interface ParquetBackendDef {
|
|
247
|
+
backend: "parquet";
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* URL to a Parquet metadata source.
|
|
251
|
+
*
|
|
252
|
+
* Reserved for future use.
|
|
253
|
+
*/
|
|
254
|
+
url: string;
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Field containing sample ids.
|
|
258
|
+
*/
|
|
259
|
+
sampleIdField: string;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export interface ArrowBackendDef {
|
|
263
|
+
backend: "arrow";
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* URL to an Arrow metadata source.
|
|
267
|
+
*
|
|
268
|
+
* Reserved for future use.
|
|
269
|
+
*/
|
|
270
|
+
url: string;
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Field containing sample ids.
|
|
274
|
+
*/
|
|
275
|
+
sampleIdField: string;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export type MetadataBackendDef =
|
|
279
|
+
| DataBackendDef
|
|
280
|
+
| ZarrBackendDef
|
|
281
|
+
| ParquetBackendDef
|
|
282
|
+
| ArrowBackendDef;
|
|
283
|
+
|
|
284
|
+
export interface MetadataSourceDef {
|
|
285
|
+
/**
|
|
286
|
+
* Stable source identifier.
|
|
287
|
+
*
|
|
288
|
+
* Should remain stable across spec revisions if bookmarks/provenance replay
|
|
289
|
+
* must keep working.
|
|
290
|
+
*/
|
|
291
|
+
id?: string;
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* User-facing label shown in menus and dialogs.
|
|
295
|
+
*
|
|
296
|
+
* If omitted, UI falls back to `id`.
|
|
297
|
+
*/
|
|
298
|
+
name?: string;
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* User-facing description of what this source contains.
|
|
302
|
+
*
|
|
303
|
+
* Can be shown in UI and can help automated agents choose the correct
|
|
304
|
+
* source.
|
|
305
|
+
*/
|
|
306
|
+
description?: string;
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Startup loading behavior.
|
|
310
|
+
*
|
|
311
|
+
* - `false`: do not load at startup
|
|
312
|
+
* - `"*"`: load all columns allowed by this source
|
|
313
|
+
* - `string[]`: resolve and load only the listed columns
|
|
314
|
+
*
|
|
315
|
+
* If omitted, data backends load all columns and other backends do not
|
|
316
|
+
* load columns at startup.
|
|
317
|
+
*/
|
|
318
|
+
initialLoad?: false | "*" | string[];
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Column ids that must never be imported from this source.
|
|
322
|
+
*
|
|
323
|
+
* The data backend always excludes its `sampleIdField` automatically, so
|
|
324
|
+
* this property is only needed for other helper columns such as display
|
|
325
|
+
* labels.
|
|
326
|
+
*/
|
|
327
|
+
excludeColumns?: string[];
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* Default destination group path for imported attributes.
|
|
331
|
+
*
|
|
332
|
+
* Imported column names are placed under this path, which effectively
|
|
333
|
+
* creates (or reuses) a metadata hierarchy node.
|
|
334
|
+
*
|
|
335
|
+
* This value is parsed as a path using `attributeGroupSeparator` when that
|
|
336
|
+
* separator is defined for the source. Without an explicit separator, the
|
|
337
|
+
* whole value is treated as one group name (including any `/` characters).
|
|
338
|
+
*
|
|
339
|
+
* Users can override this per import in the dialog.
|
|
340
|
+
*/
|
|
341
|
+
groupPath?: string;
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Separator used by source-side attribute names to express hierarchy.
|
|
345
|
+
*
|
|
346
|
+
* Example: if separator is `"."`, column `clinical.OS` is interpreted as
|
|
347
|
+
* group `clinical` and attribute `OS`.
|
|
348
|
+
*/
|
|
349
|
+
attributeGroupSeparator?: string;
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Attribute definitions keyed by attribute/column id (and optionally by group path).
|
|
353
|
+
*
|
|
354
|
+
* Special key `""` defines source-level defaults for all imported columns.
|
|
355
|
+
* Path splitting is applied only when `attributeGroupSeparator` is defined.
|
|
356
|
+
*/
|
|
357
|
+
attributes?: Record<string, SampleAttributeDef>;
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* Source backend configuration.
|
|
361
|
+
*/
|
|
362
|
+
backend: MetadataBackendDef;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
export interface MetadataSourceImportDef {
|
|
366
|
+
/**
|
|
367
|
+
* URL to a standalone metadata source definition file.
|
|
368
|
+
*
|
|
369
|
+
* Imports are shallow: imported files must define exactly one source and
|
|
370
|
+
* cannot contain nested `import` entries.
|
|
371
|
+
*/
|
|
372
|
+
url: string;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
export type MetadataSourceEntry =
|
|
376
|
+
| MetadataSourceDef
|
|
377
|
+
| { import: MetadataSourceImportDef };
|
|
378
|
+
|
|
379
|
+
export interface MetadataDef {
|
|
380
|
+
/**
|
|
381
|
+
* Metadata source definitions used for startup and on-demand imports.
|
|
382
|
+
*
|
|
383
|
+
* Source order is significant for startup loading: eager startup imports
|
|
384
|
+
* are applied in declaration order.
|
|
385
|
+
*/
|
|
386
|
+
sources?: MetadataSourceEntry[];
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Default width of metadata columns in pixels.
|
|
390
|
+
*
|
|
391
|
+
* __Default value:__ `10`
|
|
392
|
+
*/
|
|
393
|
+
attributeWidth?: number;
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Default color for metadata cells whose value is missing.
|
|
397
|
+
*
|
|
398
|
+
* If `null`, missing-value colors are disabled unless overridden by an
|
|
399
|
+
* attribute definition.
|
|
400
|
+
*
|
|
401
|
+
* __Default value:__ `"#f0f0f0"`
|
|
402
|
+
*/
|
|
403
|
+
missingValueColor?: string | null;
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* Spacing between metadata columns in pixels.
|
|
407
|
+
*
|
|
408
|
+
* __Default value:__ `1`
|
|
409
|
+
*/
|
|
410
|
+
spacing?: number;
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* Font typeface for metadata attribute labels.
|
|
414
|
+
*
|
|
415
|
+
* __Default value:__ `"Lato"`
|
|
416
|
+
*/
|
|
417
|
+
labelFont?: string;
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* Font style for metadata attribute labels.
|
|
421
|
+
*
|
|
422
|
+
* __Default value:__ `"normal"`
|
|
423
|
+
*/
|
|
424
|
+
labelFontStyle?: FontStyle;
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* Font weight for metadata attribute labels.
|
|
428
|
+
*
|
|
429
|
+
* __Default value:__ `"regular"`
|
|
430
|
+
*/
|
|
431
|
+
labelFontWeight?: FontWeight;
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* Font size for metadata attribute labels in pixels.
|
|
435
|
+
*
|
|
436
|
+
* __Default value:__ `11`
|
|
437
|
+
*/
|
|
438
|
+
labelFontSize?: number;
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* Angle of metadata attribute labels in degrees.
|
|
442
|
+
*
|
|
443
|
+
* __Default value:__ `-90`
|
|
444
|
+
*/
|
|
445
|
+
labelAngle?: number;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
export interface SampleDef {
|
|
449
|
+
/**
|
|
450
|
+
* Defines the sample ids and optional display names for the sample view.
|
|
451
|
+
*
|
|
452
|
+
* If omitted, sample ids are inferred from the `sample` channel in the view
|
|
453
|
+
* data.
|
|
454
|
+
*/
|
|
455
|
+
identity?: SampleIdentityDef;
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* Title shown above sample labels.
|
|
459
|
+
* If omitted, the title defaults to `"Sample"`.
|
|
460
|
+
* Set to `null` to hide the title.
|
|
461
|
+
*/
|
|
462
|
+
labelTitle?: string | null;
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* Width reserved for sample labels in pixels.
|
|
466
|
+
*
|
|
467
|
+
* If omitted, the width is inferred from the sample labels.
|
|
468
|
+
*/
|
|
469
|
+
labelLength?: number;
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* The font typeface. GenomeSpy uses [SDF](https://github.com/Chlumsky/msdfgen)
|
|
473
|
+
* versions of [Google Fonts](https://fonts.google.com/). Check their
|
|
474
|
+
* availability at the [A-Frame
|
|
475
|
+
* Fonts](https://github.com/etiennepinchon/aframe-fonts/tree/master/fonts)
|
|
476
|
+
* repository. System fonts are **not** supported.
|
|
477
|
+
*
|
|
478
|
+
* **Default value:** `"Lato"`
|
|
479
|
+
*/
|
|
480
|
+
labelFont?: string;
|
|
481
|
+
|
|
482
|
+
/**
|
|
483
|
+
* The font style. Valid values: `"normal"` and `"italic"`.
|
|
484
|
+
*
|
|
485
|
+
* **Default value:** `"normal"`
|
|
486
|
+
*/
|
|
487
|
+
labelFontStyle?: FontStyle;
|
|
488
|
+
|
|
489
|
+
/**
|
|
490
|
+
* The font weight. The following strings and numbers are valid values:
|
|
491
|
+
* `"thin"` (`100`), `"light"` (`300`), `"regular"` (`400`),
|
|
492
|
+
* `"normal"` (`400`), `"medium"` (`500`), `"bold"` (`700`),
|
|
493
|
+
* `"black"` (`900`)
|
|
494
|
+
*
|
|
495
|
+
* **Default value:** `"regular"`
|
|
496
|
+
*/
|
|
497
|
+
labelFontWeight?: FontWeight;
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* The font size in pixels.
|
|
501
|
+
*
|
|
502
|
+
* **Default value:** `11`
|
|
503
|
+
*/
|
|
504
|
+
labelFontSize?: number;
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* The horizontal alignment of the text. One of `"left"`, `"center"`, or `"right"`.
|
|
508
|
+
*
|
|
509
|
+
* **Default value:** `"left"`
|
|
510
|
+
*/
|
|
511
|
+
labelAlign?: Align;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
export interface SampleLayoutDef {
|
|
515
|
+
/**
|
|
516
|
+
* Height of one sample row when the view is expanded for (close-up) inspection.
|
|
517
|
+
* In the birdseye overview, sample rows are automatically scaled to fit the available vertical space.
|
|
518
|
+
*
|
|
519
|
+
* __Default value:__ `35`
|
|
520
|
+
*/
|
|
521
|
+
sampleHeight?: number;
|
|
522
|
+
|
|
523
|
+
/**
|
|
524
|
+
* Spacing between sample groups in the fitted layout.
|
|
525
|
+
*
|
|
526
|
+
* __Default value:__ `5`
|
|
527
|
+
*/
|
|
528
|
+
groupSpacing?: number;
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* Spacing between sample groups in the expanded layout.
|
|
532
|
+
*
|
|
533
|
+
* __Default value:__ `15`
|
|
534
|
+
*/
|
|
535
|
+
peekGroupSpacing?: number;
|
|
536
|
+
|
|
537
|
+
/**
|
|
538
|
+
* Fraction of each sample row reserved as spacing between rendered sample contents.
|
|
539
|
+
*
|
|
540
|
+
* Spacing is reduced when rows are too short to render cleanly.
|
|
541
|
+
*
|
|
542
|
+
* __Default value:__ `0.2`
|
|
543
|
+
*/
|
|
544
|
+
sampleSpacingFactor?: number;
|
|
545
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ConcatSpec as CoreConcatSpec,
|
|
3
|
+
HConcatSpec as CoreHConcatSpec,
|
|
4
|
+
ImportSpec,
|
|
5
|
+
LayerSpec as CoreLayerSpec,
|
|
6
|
+
MultiscaleSpec as CoreMultiscaleSpec,
|
|
7
|
+
UnitSpec as CoreUnitSpec,
|
|
8
|
+
VConcatSpec as CoreVConcatSpec,
|
|
9
|
+
} from "@genome-spy/core/spec/view.js";
|
|
10
|
+
import { SampleSpec } from "./sampleView.js";
|
|
11
|
+
|
|
12
|
+
// App has two view unions:
|
|
13
|
+
// - AppNestedViewSpec: legal in recursive positions (templates, children)
|
|
14
|
+
// - AppViewSpec: root-level union that can additionally include SampleSpec
|
|
15
|
+
//
|
|
16
|
+
// This prevents nested SampleSpecs while still allowing a SampleSpec under
|
|
17
|
+
// app-level concat roots.
|
|
18
|
+
export type AggregatingSpec = AppUnitSpec | AppLayerSpec;
|
|
19
|
+
|
|
20
|
+
export interface AggregateSamplesSpec {
|
|
21
|
+
/**
|
|
22
|
+
* Specifies views that [aggregate](https://genomespy.app/docs/sample-collections/visualizing/#aggregation)
|
|
23
|
+
* multiple samples within the GenomeSpy App.
|
|
24
|
+
*/
|
|
25
|
+
aggregateSamples?: AggregatingSpec[];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* App-only visibility setting exposed in the view visibility menu.
|
|
30
|
+
*/
|
|
31
|
+
export interface AppVisibilityGroupSpec {
|
|
32
|
+
/**
|
|
33
|
+
* Name of a mutually exclusive visibility group.
|
|
34
|
+
*
|
|
35
|
+
* Views with the same group name in the same import scope are controlled
|
|
36
|
+
* with radio buttons in the view visibility menu.
|
|
37
|
+
*/
|
|
38
|
+
group: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* App-only visibility setting exposed in the view visibility menu.
|
|
43
|
+
*/
|
|
44
|
+
export interface AppConfigurableVisibilitySpec {
|
|
45
|
+
/**
|
|
46
|
+
* Is the visibility configurable from the GenomeSpy App view visibility menu.
|
|
47
|
+
*
|
|
48
|
+
* Configurability requires an explicit view name that is unique in its import
|
|
49
|
+
* scope.
|
|
50
|
+
*
|
|
51
|
+
* Set to an object with `group` to make configurable views mutually
|
|
52
|
+
* exclusive in the menu (radio buttons) within the same import scope.
|
|
53
|
+
*
|
|
54
|
+
* __Default value:__ `false` for children of `layer`, `true` for others
|
|
55
|
+
*/
|
|
56
|
+
configurableVisibility?: boolean | AppVisibilityGroupSpec;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export type AppUnitSpec = Omit<CoreUnitSpec, "aggregateSamples" | "templates"> &
|
|
60
|
+
AppConfigurableVisibilitySpec &
|
|
61
|
+
AggregateSamplesSpec & {
|
|
62
|
+
// Re-thread templates to the app union so nested views can use app-only
|
|
63
|
+
// fields (e.g. aggregateSamples), but still exclude nested SampleSpec.
|
|
64
|
+
templates?: Record<string, AppNestedViewSpec>;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export type AppLayerSpec = Omit<
|
|
68
|
+
CoreLayerSpec,
|
|
69
|
+
"layer" | "aggregateSamples" | "templates"
|
|
70
|
+
> &
|
|
71
|
+
AppConfigurableVisibilitySpec &
|
|
72
|
+
AggregateSamplesSpec & {
|
|
73
|
+
templates?: Record<string, AppNestedViewSpec>;
|
|
74
|
+
|
|
75
|
+
layer: (AppLayerSpec | AppUnitSpec | AppMultiscaleSpec | ImportSpec)[];
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export type AppMultiscaleSpec = Omit<
|
|
79
|
+
CoreMultiscaleSpec,
|
|
80
|
+
"multiscale" | "aggregateSamples" | "templates"
|
|
81
|
+
> &
|
|
82
|
+
AppConfigurableVisibilitySpec &
|
|
83
|
+
AggregateSamplesSpec & {
|
|
84
|
+
templates?: Record<string, AppNestedViewSpec>;
|
|
85
|
+
|
|
86
|
+
multiscale: (
|
|
87
|
+
| AppLayerSpec
|
|
88
|
+
| AppUnitSpec
|
|
89
|
+
| AppMultiscaleSpec
|
|
90
|
+
| ImportSpec
|
|
91
|
+
)[];
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export type AppVConcatSpec = Omit<CoreVConcatSpec, "templates" | "vconcat"> &
|
|
95
|
+
AppConfigurableVisibilitySpec & {
|
|
96
|
+
templates?: Record<string, AppNestedViewSpec>;
|
|
97
|
+
|
|
98
|
+
vconcat: (AppViewSpec | ImportSpec)[];
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export type AppHConcatSpec = Omit<CoreHConcatSpec, "templates" | "hconcat"> &
|
|
102
|
+
AppConfigurableVisibilitySpec & {
|
|
103
|
+
templates?: Record<string, AppNestedViewSpec>;
|
|
104
|
+
|
|
105
|
+
hconcat: (AppViewSpec | ImportSpec)[];
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export type AppConcatSpec = Omit<CoreConcatSpec, "templates" | "concat"> &
|
|
109
|
+
AppConfigurableVisibilitySpec & {
|
|
110
|
+
templates?: Record<string, AppNestedViewSpec>;
|
|
111
|
+
|
|
112
|
+
concat: (AppViewSpec | ImportSpec)[];
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export type AppNestedViewSpec =
|
|
116
|
+
| AppUnitSpec
|
|
117
|
+
| AppLayerSpec
|
|
118
|
+
| AppMultiscaleSpec
|
|
119
|
+
| AppVConcatSpec
|
|
120
|
+
| AppHConcatSpec
|
|
121
|
+
| AppConcatSpec;
|
|
122
|
+
|
|
123
|
+
// App root may contain SampleSpec, but recursive descendants cannot.
|
|
124
|
+
export type AppViewSpec = AppNestedViewSpec | SampleSpec;
|