@genome-spy/app 0.77.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.
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "contributors": [],
9
9
  "license": "MIT",
10
10
  "homepage": "https://genomespy.app/",
11
- "version": "0.77.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.77.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.77.0"
85
+ "@genome-spy/app-agent": "^0.78.0"
86
86
  },
87
- "gitHead": "2851e22e2069a70d7d02e3ab707b7556573aa17e"
87
+ "gitHead": "54041db3a590ae8df78fa43aa755b9e07fe3503c"
88
88
  }
@@ -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
+ };