@genome-spy/app 0.76.0 → 0.78.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.
Files changed (39) hide show
  1. package/LICENSE +21 -0
  2. package/dist/{agentApi-CzdacisO.js → agentApi-BwbEWjvl.js} +6362 -4470
  3. package/dist/agentApi.es.js +3315 -1561
  4. package/dist/agentShared.es.js +20 -20
  5. package/dist/blosc-DL1kZHdE.js +692 -0
  6. package/dist/chunk-INHXZS53-Dx2aFznx.js +13 -0
  7. package/dist/{esm-Cr7pLUfG.js → esm-BHjeb8gt.js} +2 -2
  8. package/dist/{esm-BH0wx5y-.js → esm-BI-plmf6.js} +2 -2
  9. package/dist/esm-BgpwI2cq.js +1221 -0
  10. package/dist/{esm-BWsx1OJ2.js → esm-BkagIzhP.js} +2 -2
  11. package/dist/esm-CHVYSGF2.js +1084 -0
  12. package/dist/esm-COzpU5N8.js +1221 -0
  13. package/dist/{esm-CdIesJ1z.js → esm-CPufCnsG.js} +2 -2
  14. package/dist/esm-C_XrKaCY.js +137 -0
  15. package/dist/esm-D2-C5ZzN.js +1084 -0
  16. package/dist/{esm-BLfLaJtE.js → esm-Daho46bY.js} +2 -2
  17. package/dist/esm-id9DWBZW.js +137 -0
  18. package/dist/{esm-DHOMWRoL.js → esm-sPWfZg9X.js} +2 -2
  19. package/dist/index.es.js +14184 -15233
  20. package/dist/index.js +598 -485
  21. package/dist/lz4-Csz5aoFA.js +626 -0
  22. package/dist/schema.json +1008 -137
  23. package/dist/{viewUtils-C5htqZCm.js → viewUtils-B7-F_Ae-.js} +2516 -2314
  24. package/dist/zstd-dJuUp1fl.js +583 -0
  25. package/package.json +4 -4
  26. package/src/agentApi/index.d.ts +24 -0
  27. package/src/bookmark/databaseSchema.d.ts +11 -1
  28. package/src/charts/sampleAttributePlotTypes.d.ts +26 -1
  29. package/src/sampleView/sampleViewTypes.d.ts +2 -0
  30. package/src/sampleView/state/payloadTypes.d.ts +84 -0
  31. package/src/sampleView/types.d.ts +3 -0
  32. package/src/spec/sampleView.d.ts +58 -0
  33. package/dist/esm-BDFRLEuD.js +0 -1248
  34. package/dist/esm-BY4T8YoD.js +0 -142
  35. package/dist/esm-DJUb6vy0.js +0 -1015
  36. package/dist/esm-DPS6pYKF.js +0 -1248
  37. package/dist/esm-DRZ5LLNH.js +0 -142
  38. package/dist/esm-PDPkTR1_.js +0 -1015
  39. /package/dist/{parquetRead-BuEN-6yG.js → parquetRead-C33mgLEo.js} +0 -0
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "contributors": [],
9
9
  "license": "MIT",
10
10
  "homepage": "https://genomespy.app/",
11
- "version": "0.76.0",
11
+ "version": "0.78.0",
12
12
  "main": "dist/index.js",
13
13
  "module": "dist/index.es.js",
14
14
  "type": "module",
@@ -70,7 +70,7 @@
70
70
  "@fortawesome/fontawesome-free": "^6.4.2",
71
71
  "@fortawesome/fontawesome-svg-core": "^6.4.2",
72
72
  "@fortawesome/free-solid-svg-icons": "^6.4.2",
73
- "@genome-spy/core": "^0.76.0",
73
+ "@genome-spy/core": "^0.78.0",
74
74
  "@reduxjs/toolkit": "^2.11.0",
75
75
  "d3-color": "^3.1.0",
76
76
  "idb": "^7.1.1",
@@ -82,7 +82,7 @@
82
82
  "zarrita": "^0.6.1"
83
83
  },
84
84
  "devDependencies": {
85
- "@genome-spy/app-agent": "^0.76.0"
85
+ "@genome-spy/app-agent": "^0.78.0"
86
86
  },
87
- "gitHead": "34d821cf5e864972afaa65a3290719e2fdb209c2"
87
+ "gitHead": "54041db3a590ae8df78fa43aa755b9e07fe3503c"
88
88
  }
@@ -23,12 +23,36 @@ import type {
23
23
  } from "../charts/sampleAttributePlotTypes.d.ts";
24
24
  import type { ScaleResolutionApi } from "@genome-spy/core/types/scaleResolutionApi.js";
25
25
  import type UnitView from "@genome-spy/core/view/unitView.js";
26
+
27
+ export interface AgentMetadataSourceIdentifierSummary {
28
+ name: string;
29
+ primary?: boolean;
30
+ caseInsensitive?: boolean;
31
+ stripVersionSuffix?: boolean;
32
+ examples: string[];
33
+ }
34
+
35
+ export interface AgentMetadataSourceSummary {
36
+ sourceId?: string;
37
+ name?: string;
38
+ description?: string;
39
+ attributeDefaults?: {
40
+ dataType?: string;
41
+ description?: string;
42
+ };
43
+ identifiers: AgentMetadataSourceIdentifierSummary[];
44
+ }
45
+
26
46
  export interface AgentApi {
27
47
  /**
28
48
  * Returns the current sample hierarchy used by the agent context.
29
49
  */
30
50
  getSampleHierarchy(): SampleHierarchy | undefined;
31
51
 
52
+ getMetadataSourceSummaries(
53
+ signal?: AbortSignal
54
+ ): Promise<AgentMetadataSourceSummary[]>;
55
+
32
56
  getAttributeInfo(attribute: AttributeIdentifier): AttributeInfo | undefined;
33
57
 
34
58
  /**
@@ -2,10 +2,15 @@ import { DBSchema } from "idb";
2
2
  import { ChromosomalLocus } from "@genome-spy/core/genome/genome.js";
3
3
  import { ViewSettingsPayload } from "../state.js";
4
4
  import { Action } from "../state/provenance.js";
5
+ import { SampleAttributePlotDefinition } from "../charts/sampleAttributePlotTypes.js";
6
+
7
+ export interface BookmarkPlotAttachment {
8
+ kind: "sample_attribute_plot";
9
+ definition: SampleAttributePlotDefinition;
10
+ }
5
11
 
6
12
  export interface BookmarkEntry {
7
13
  name: string;
8
- timestamp?: number;
9
14
 
10
15
  notes?: string;
11
16
 
@@ -23,6 +28,11 @@ export interface BookmarkEntry {
23
28
  * Settings such as view visibilities
24
29
  */
25
30
  viewSettings?: ViewSettingsPayload;
31
+
32
+ /**
33
+ * Plots attached to the bookmark.
34
+ */
35
+ plots?: BookmarkPlotAttachment[];
26
36
  }
27
37
 
28
38
  export interface BookmarkDB extends DBSchema {
@@ -100,6 +100,7 @@ export type SampleAttributePlotCharacterization =
100
100
  export interface SampleAttributePlot {
101
101
  kind: "sample_attribute_plot";
102
102
  plotType: SampleAttributePlotType;
103
+ request: SampleAttributePlotDefinition;
103
104
  title: string;
104
105
  spec: RootSpec;
105
106
  namedData: RenderablePlotNamedData[];
@@ -129,9 +130,13 @@ export interface HierarchyScatterplotRequest {
129
130
  colorScaleRange?: string[];
130
131
  }
131
132
 
133
+ /**
134
+ * User/API-facing plot request. This accepts convenience aliases and label
135
+ * hints that may be useful while resolving a plot, but are not persisted.
136
+ */
132
137
  export type SampleAttributePlotRequest =
133
138
  | {
134
- plotType: "bar";
139
+ plotType: "bar" | "barplot";
135
140
  attribute: AttributeIdentifier;
136
141
  attributeLabel?: string;
137
142
  }
@@ -147,3 +152,23 @@ export type SampleAttributePlotRequest =
147
152
  xAttributeLabel?: string;
148
153
  yAttributeLabel?: string;
149
154
  };
155
+
156
+ /**
157
+ * Normalized plot definition that is safe to persist in generated plots and
158
+ * bookmarks. It uses canonical plot type names and stores only stable attribute
159
+ * identifiers.
160
+ */
161
+ export type SampleAttributePlotDefinition =
162
+ | {
163
+ plotType: "barplot";
164
+ attribute: AttributeIdentifier;
165
+ }
166
+ | {
167
+ plotType: "boxplot";
168
+ attribute: AttributeIdentifier;
169
+ }
170
+ | {
171
+ plotType: "scatterplot";
172
+ xAttribute: AttributeIdentifier;
173
+ yAttribute: AttributeIdentifier;
174
+ };
@@ -6,6 +6,7 @@ import { Scalar } from "@genome-spy/core/spec/channel.js";
6
6
  import { ComplexDomain, NumericDomain } from "@genome-spy/core/spec/scale.js";
7
7
  import { AggregationSpec, Interval } from "./types.js";
8
8
  import ViewContext from "@genome-spy/core/types/viewContext.js";
9
+ import { SampleLayoutDef } from "@genome-spy/app/spec/sampleView.js";
9
10
  import type {
10
11
  ParamSelector,
11
12
  ViewSelector,
@@ -54,6 +55,7 @@ export interface LocationContext {
54
55
  onLocationUpdate: (arg: { sampleHeight: number }) => void;
55
56
  viewContext: ViewContext;
56
57
  isStickySummaries: () => boolean;
58
+ sampleLayout?: SampleLayoutDef;
57
59
  }
58
60
 
59
61
  export interface BaseSpecifier {
@@ -329,6 +329,90 @@ export interface RemoveGroup {
329
329
  path: string[];
330
330
  }
331
331
 
332
+ export interface RetainGroupsByRank {
333
+ /**
334
+ * One-based grouping level to filter.
335
+ *
336
+ * `1` targets top-level groups under ROOT. `2` targets direct children of
337
+ * level-1 groups, and so on. For top-level categories such as cancer type,
338
+ * use `1`.
339
+ *
340
+ * @minimum 1
341
+ */
342
+ level: number;
343
+
344
+ /**
345
+ * Group-level measure used for ranking.
346
+ *
347
+ * Only `"size"` is supported. Size means group abundance: the number of
348
+ * descendant visible samples in the group.
349
+ */
350
+ measure: "size";
351
+
352
+ /**
353
+ * Number of ranked groups to retain within each ancestor partition.
354
+ *
355
+ * This is k in top-k or bottom-k requests. For example, use `5` to keep
356
+ * the five largest or five smallest groups.
357
+ *
358
+ * @minimum 1
359
+ */
360
+ limit: number;
361
+
362
+ /**
363
+ * Ranking direction.
364
+ *
365
+ * Use `"descending"` for top-k, highest values, largest groups by size, or
366
+ * most abundant groups. Use `"ascending"` for bottom-k, lowest values,
367
+ * smallest groups by size, or least abundant groups.
368
+ */
369
+ order: "descending" | "ascending";
370
+ }
371
+
372
+ export interface RetainGroupsBySize {
373
+ /**
374
+ * One-based grouping level to filter.
375
+ *
376
+ * `1` targets top-level groups under ROOT. `2` targets direct children of
377
+ * level-1 groups, and so on. For top-level categories such as cancer type,
378
+ * use `1`.
379
+ *
380
+ * @minimum 1
381
+ */
382
+ level: number;
383
+
384
+ /**
385
+ * Group-level measure used for thresholding.
386
+ *
387
+ * Only `"size"` is supported. Size means group abundance: the number of
388
+ * descendant visible samples in the group.
389
+ */
390
+ measure: "size";
391
+
392
+ /**
393
+ * Threshold comparison applied as `measure operator operand`.
394
+ */
395
+ operator: ComparisonOperatorType;
396
+
397
+ /**
398
+ * Numeric group-size threshold.
399
+ */
400
+ operand: number;
401
+ }
402
+
403
+ export interface Ungroup {
404
+ /**
405
+ * One-based grouping level to collapse.
406
+ *
407
+ * `1` collapses top-level groups under ROOT and all deeper levels into one
408
+ * flat ROOT sample group. `2` keeps level-1 groups but collapses their
409
+ * children and all deeper levels into sample lists.
410
+ *
411
+ * @minimum 1
412
+ */
413
+ level: number;
414
+ }
415
+
332
416
  /**
333
417
  * Payload for filtering samples by comparing a quantitative attribute
334
418
  * against a numeric operand.
@@ -82,6 +82,9 @@ export interface AttributeInfo {
82
82
  /** More detailed name with optional formatting */
83
83
  title: string | import("lit").TemplateResult;
84
84
 
85
+ /** Plain short label for compact contexts and summaries. */
86
+ shortTitle?: string;
87
+
85
88
  /** Formatted attribute name for context menus (e.g., with selective emphasis). */
86
89
  emphasizedName: string | import("lit").TemplateResult;
87
90
 
@@ -32,6 +32,11 @@ export interface SampleSpec extends Omit<ViewSpecBase, "templates"> {
32
32
  */
33
33
  metadata?: MetadataDef;
34
34
 
35
+ /**
36
+ * Layout settings for sample rows and sample groups.
37
+ */
38
+ sampleLayout?: SampleLayoutDef;
39
+
35
40
  /**
36
41
  * An object defining the view background and outline. The background is
37
42
  * repeated for each group.
@@ -90,6 +95,16 @@ export interface SampleAttributeDef {
90
95
  */
91
96
  barScale?: Scale;
92
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
+
93
108
  /**
94
109
  * Width of the column in pixels.
95
110
  */
@@ -377,6 +392,16 @@ export interface MetadataDef {
377
392
  */
378
393
  attributeWidth?: number;
379
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
+
380
405
  /**
381
406
  * Spacing between metadata columns in pixels.
382
407
  *
@@ -485,3 +510,36 @@ export interface SampleDef {
485
510
  */
486
511
  labelAlign?: Align;
487
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
+ }