@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.
Files changed (71) hide show
  1. package/dist/AbortablePromiseCache-beUIcZcW.js +96 -0
  2. package/dist/agentApi-ClsLtELB.js +26994 -0
  3. package/dist/agentApi.es.js +11145 -0
  4. package/dist/agentShared.es.js +4742 -0
  5. package/dist/{blosc-oa0DlI6G.js → blosc-BX4BJ8sR.js} +1 -1
  6. package/dist/blosc-DL1kZHdE.js +692 -0
  7. package/dist/chunk-INHXZS53-Dx2aFznx.js +13 -0
  8. package/dist/componentStyles-CIXoKEp0.js +2182 -0
  9. package/dist/dialog.es.js +377 -0
  10. package/dist/esm-CHVYSGF2.js +1084 -0
  11. package/dist/esm-CZvS2Ldm.js +155 -0
  12. package/dist/esm-C_XrKaCY.js +137 -0
  13. package/dist/{esm-DCCYNvaz.js → esm-CqrZuhTF.js} +50 -50
  14. package/dist/{esm-D-WfYOx7.js → esm-Cz4iCfzF.js} +25 -25
  15. package/dist/esm-D-y0Ce1M.js +573 -0
  16. package/dist/esm-D2-C5ZzN.js +1084 -0
  17. package/dist/esm-DPS6pYKF.js +1248 -0
  18. package/dist/esm-Dfo2M18m.js +461 -0
  19. package/dist/esm-DjF6pKy5.js +369 -0
  20. package/dist/{esm-n0auOe11.js → esm-Q6nrd9vJ.js} +1 -1
  21. package/dist/esm-aOLxLL7A.js +121 -0
  22. package/dist/esm-id9DWBZW.js +137 -0
  23. package/dist/esm-kXhrPIYy.js +1426 -0
  24. package/dist/esm-s_SlArJ8.js +298 -0
  25. package/dist/index.es.js +15272 -37563
  26. package/dist/index.js +1202 -741
  27. package/dist/lit-ymUSmGBw.js +510 -0
  28. package/dist/{lz4-jZ0zyLBa.js → lz4-BSYl80V8.js} +1 -1
  29. package/dist/lz4-Csz5aoFA.js +626 -0
  30. package/dist/parquetRead-m8-8_SpH.js +1609 -0
  31. package/dist/schema.json +489 -85
  32. package/dist/style.css +1 -1
  33. package/dist/viewUtils-3_xHIxmy.js +14292 -0
  34. package/dist/{zstd-C6ksIG9r.js → zstd-BAfRM3IH.js} +1 -1
  35. package/dist/zstd-dJuUp1fl.js +583 -0
  36. package/package.json +30 -5
  37. package/src/agentApi/index.d.ts +147 -0
  38. package/src/agentShared/index.d.ts +97 -0
  39. package/src/agentShared/types.d.ts +8 -0
  40. package/src/appTypes.d.ts +75 -0
  41. package/src/bookmark/databaseSchema.d.ts +33 -0
  42. package/src/charts/boxplotTypes.d.ts +15 -0
  43. package/src/charts/sampleAttributePlotTypes.d.ts +149 -0
  44. package/src/coreSpecAugmentation.d.ts +29 -0
  45. package/src/dialog/index.d.ts +5 -0
  46. package/src/embedTypes.d.ts +9 -0
  47. package/src/index.d.ts +16 -0
  48. package/src/sampleView/sampleViewTypes.d.ts +176 -0
  49. package/src/sampleView/state/payloadTypes.d.ts +484 -0
  50. package/src/sampleView/state/sampleState.d.ts +76 -0
  51. package/src/sampleView/types.d.ts +128 -0
  52. package/src/spec/appSpec.d.ts +54 -0
  53. package/src/spec/sampleView.d.ts +545 -0
  54. package/src/spec/view.d.ts +124 -0
  55. package/src/state/paramProvenanceTypes.d.ts +215 -0
  56. package/src/state/selectionExpansionTypes.d.ts +77 -0
  57. package/src/state.d.ts +97 -0
  58. package/src/types/lz-string.d.ts +24 -0
  59. package/src/types/vega-loader.d.ts +1 -0
  60. package/src/utils/colorScaleSummary.d.ts +15 -0
  61. package/src/utils/statistics/fieldSummary.d.ts +49 -0
  62. package/src/vite-env.d.ts +6 -0
  63. package/dist/browser-Dvlo92rx.js +0 -126
  64. package/dist/esm-Cmo4qEPr.js +0 -1015
  65. /package/dist/{AbortablePromiseCache-3gHJdF3E.js → AbortablePromiseCache-BDH1cqFl.js} +0 -0
  66. /package/dist/{chunk-INHXZS53-fPMmEwMt.js → chunk-INHXZS53-DwEV9sMh.js} +0 -0
  67. /package/dist/{esm-BygJiwh0.js → esm-BL9SNSnj.js} +0 -0
  68. /package/dist/{esm-B8-vSu-c.js → esm-BwW--bVV.js} +0 -0
  69. /package/dist/{esm-CGX-qz1d.js → esm-Bz_92nH0.js} +0 -0
  70. /package/dist/{esm-CuMSzCHy.js → esm-D2_c7lXY.js} +0 -0
  71. /package/dist/{parquetRead-CJe1UPsz.js → parquetRead-C33mgLEo.js} +0 -0
@@ -0,0 +1,76 @@
1
+ import { scalar } from "@genome-spy/core/utils/domainArray.js";
2
+ import { SampleAttributeDef } from "@genome-spy/app/spec/sampleView.js";
3
+ import { AttributeIdentifier } from "../types.js";
4
+ import { PayloadAction } from "@reduxjs/toolkit";
5
+
6
+ export type SampleId = string;
7
+
8
+ /**
9
+ * Sample metadata
10
+ */
11
+ export interface Sample {
12
+ id: SampleId;
13
+
14
+ displayName: string;
15
+
16
+ /** For internal use. Identifies the sample facet efficiently. */
17
+ indexNumber: number;
18
+ }
19
+
20
+ export type Metadatum = Record<string, scalar>;
21
+ export type Metadata = Record<SampleId, Metadatum>;
22
+
23
+ export interface BaseGroup {
24
+ /** e.g., an attribute value that forms a group. Used as a key when identifying subgroups. */
25
+ name: string;
26
+
27
+ /** A descriptive title for the group. May contain quantile intervals, etc. */
28
+ title: string;
29
+
30
+ /** Original generated title for derived groups, such as threshold intervals. */
31
+ generatedTitle?: string;
32
+ }
33
+
34
+ export interface SampleGroup extends BaseGroup {
35
+ samples: SampleId[];
36
+ }
37
+
38
+ export interface GroupGroup extends BaseGroup {
39
+ groups: Group[];
40
+ }
41
+
42
+ export type Group = SampleGroup | GroupGroup;
43
+
44
+ export interface GroupMetadata {
45
+ /** e.g., an attribute that is used for partitioning */
46
+ attribute: AttributeIdentifier;
47
+ }
48
+
49
+ export interface SampleMetadata {
50
+ /** SampleIds as keys, attributes as values */
51
+ entities: Metadata;
52
+ /** Names of all available metadata attributes */
53
+ attributeNames: string[];
54
+ /** A definition for each attribute or attribute group */
55
+ attributeDefs?: Record<string, SampleAttributeDef>;
56
+ }
57
+
58
+ export interface SampleHierarchy {
59
+ /** All known samples that are available for use */
60
+ sampleData: {
61
+ ids: SampleId[];
62
+ entities: Record<SampleId, Sample>;
63
+ };
64
+
65
+ /** Metadata for samples. It's ok to have some samples missing. */
66
+ sampleMetadata: SampleMetadata;
67
+
68
+ /** Metadata for each hierarchy level. Does not include the root. */
69
+ groupMetadata: GroupMetadata[];
70
+
71
+ /** The root of the hierarchy */
72
+ rootGroup: Group;
73
+
74
+ // TODO: Extract this into a separate interface
75
+ lastAction?: PayloadAction;
76
+ }
@@ -0,0 +1,128 @@
1
+ import { ViewAttributeSpecifier } from "./sampleViewTypes.js";
2
+ import { SampleHierarchy } from "./state/sampleState.js";
3
+ import { ChromosomalLocus } from "@genome-spy/core/spec/genome.js";
4
+ import { Scale } from "@genome-spy/core/spec/scale.js";
5
+
6
+ /**
7
+ * Stable identifier for an abstract attribute used by actions and agent
8
+ * context.
9
+ *
10
+ * `type` identifies the attribute source kind, and `specifier` contains the
11
+ * concrete lookup information for that source.
12
+ *
13
+ * Examples:
14
+ * - `{ type: "SAMPLE_ATTRIBUTE", specifier: "age" }`
15
+ */
16
+ export type AttributeIdentifierType =
17
+ | "SAMPLE_ATTRIBUTE"
18
+ | "VALUE_AT_LOCUS"
19
+ | "SAMPLE_NAME"
20
+ | "VIEW_ATTRIBUTE";
21
+
22
+ export interface AttributeIdentifier {
23
+ type: AttributeIdentifierType;
24
+ specifier?: string | ViewAttributeSpecifier;
25
+ }
26
+
27
+ /**
28
+ * One endpoint of an interval.
29
+ */
30
+ export type IntervalPoint = number | ChromosomalLocus;
31
+
32
+ /**
33
+ * Interval expressed as two scalar or locus points.
34
+ */
35
+ export type Interval = [IntervalPoint, IntervalPoint];
36
+
37
+ /**
38
+ * Aggregation operators supported by interval-based attribute access.
39
+ */
40
+ export type AggregationOp =
41
+ | "itemCount"
42
+ | "min"
43
+ | "max"
44
+ | "weightedMean"
45
+ | "variance"
46
+ | "count";
47
+
48
+ /**
49
+ * Aggregation configuration for interval-derived attribute access.
50
+ */
51
+ export interface AggregationSpec {
52
+ op: AggregationOp;
53
+ }
54
+
55
+ /**
56
+ * Arguments passed to attribute value providers, including the current
57
+ * selection of sample ids and optional interval/aggregation context.
58
+ */
59
+ export interface AttributeValuesScope {
60
+ sampleIds: string[];
61
+ sampleHierarchy: SampleHierarchy;
62
+ interval?: Interval;
63
+ aggregation?: AggregationSpec;
64
+ }
65
+
66
+ /**
67
+ * Context passed to attribute availability hooks.
68
+ */
69
+ export interface AttributeEnsureContext {
70
+ signal?: AbortSignal;
71
+ }
72
+
73
+ export interface AttributeInfo {
74
+ /**
75
+ * A concise name of the attribute: TODO: Used for what?
76
+ * @deprecated Use attribute instead
77
+ */
78
+ name: string;
79
+
80
+ attribute: AttributeIdentifier;
81
+
82
+ /** More detailed name with optional formatting */
83
+ title: string | import("lit").TemplateResult;
84
+
85
+ /** Plain short label for compact contexts and summaries. */
86
+ shortTitle?: string;
87
+
88
+ /** Formatted attribute name for context menus (e.g., with selective emphasis). */
89
+ emphasizedName: string | import("lit").TemplateResult;
90
+
91
+ /**
92
+ * Optional description of the attribute. Can be used in UI and agent
93
+ * context to explain the meaning of the attribute.
94
+ */
95
+ description?: string;
96
+
97
+ /** Function that maps a sampleId to an attribute value */
98
+ accessor: (sampleId: string, sampleHierarchy: SampleHierarchy) => any;
99
+
100
+ /**
101
+ * Provides values for dialogs (e.g., histograms) with optional interval aggregation.
102
+ * Use `extractAttributeValues` for the default fallback implementation.
103
+ */
104
+ valuesProvider: (scope: AttributeValuesScope) => any[];
105
+
106
+ /** e.g., "quantitative" */
107
+ type: string;
108
+
109
+ /**
110
+ * Optional hook for ensuring attribute availability before access.
111
+ * Used by async intent processing to resolve lazy data dependencies.
112
+ */
113
+ ensureAvailability?: (context: AttributeEnsureContext) => Promise<void>;
114
+
115
+ /**
116
+ * Optional hook for awaiting post-dispatch readiness.
117
+ * Used by async intent processing to guarantee that state and data are ready.
118
+ */
119
+ awaitProcessed?: (context: AttributeEnsureContext) => Promise<void>;
120
+
121
+ scale?: any;
122
+
123
+ /**
124
+ * Authored scale definition for the source encoding, when available.
125
+ * Unlike `scale`, this does not include runtime-inferred defaults.
126
+ */
127
+ scaleSpec?: Scale;
128
+ }
@@ -0,0 +1,54 @@
1
+ import { RootConfig } from "@genome-spy/core/spec/root.js";
2
+ import { AppViewSpec } from "./view.js";
3
+
4
+ export interface RemoteBookmarkConfig {
5
+ /**
6
+ * URL to the remote bookmark file.
7
+ */
8
+ url: string;
9
+
10
+ /**
11
+ * Should the user be shown a tour of the remote bookmarks when the visualization
12
+ * is launched? If the `initialBookmark` property is not defined, the tour starts
13
+ * from the first bookmark.
14
+ *
15
+ * __Default value:__ `false`
16
+ */
17
+ tour?: boolean;
18
+
19
+ /**
20
+ * Name of the bookmark that should be loaded as the initial state. The bookmark
21
+ * description dialog is shown only if the `tour` property is set to `true`.
22
+ */
23
+ initialBookmark?: string;
24
+
25
+ /**
26
+ * Name of the bookmark that should be loaded when the user ends the tour.
27
+ * If `null`, the dialog will be closed and the current state is retained.
28
+ * If undefined, the default state without any performed actions will be loaded.
29
+ */
30
+ afterTourBookmark?: string;
31
+ }
32
+
33
+ export interface BookmarkConfig {
34
+ /**
35
+ * Configuration for loading bookmarks from a remote JSON file.
36
+ */
37
+ remote?: RemoteBookmarkConfig;
38
+ }
39
+
40
+ interface AppRootConfig {
41
+ /**
42
+ * A unique identifier that is used in storing state bookmarks to browser's
43
+ * IndexedDB. This is needed to make distinction between visualizations that
44
+ * are served from the same origin, i.e., the same host and port.
45
+ */
46
+ specId?: string;
47
+
48
+ /**
49
+ * Bookmark configuration.
50
+ */
51
+ bookmarks?: BookmarkConfig;
52
+ }
53
+
54
+ export type AppRootSpec = AppViewSpec & RootConfig & AppRootConfig;