@vitessce/vit-s 4.0.8 → 4.0.10

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.
@@ -38,6 +38,40 @@ export function getParameterScope(parameter: string, coordinationScopes: any): s
38
38
  * @returns {string|undefined} The coordination scope that matches.
39
39
  */
40
40
  export function getParameterScopeBy(parameter: string, byType: any, typeScope: any, coordinationScopes: any, coordinationScopesBy: any): string | undefined;
41
+ /**
42
+ * Determine whether a view defines a value for a coordination type directly,
43
+ * in which case that value takes precedence over any coordination scope
44
+ * (from coordinationScopes or metaCoordinationScopes) for the same type.
45
+ * @param {object|undefined} coordinationValues The view.coordinationValues object, if any.
46
+ * @param {string} parameter A coordination type.
47
+ * @returns {boolean} True if there is a direct value for this coordination type.
48
+ */
49
+ export function hasCoordinationValue(coordinationValues: object | undefined, parameter: string): boolean;
50
+ /**
51
+ * Revive the `{ "$CL": ... }` sentinels within a JSON value
52
+ * into CoordinationLevel instances.
53
+ * @param {*} value The JSON value.
54
+ * @returns {*} The revived value.
55
+ */
56
+ export function reviveCoordinationLevels(value: any): any;
57
+ /**
58
+ * Merge the coordination values that an annotation frame defines for a view
59
+ * into the view config. The frame values take precedence over the current values.
60
+ * The frame itself is treated as read-only.
61
+ * - Single-level values are written wherever the view's setter would write them:
62
+ * in-place if the view defines the value directly (view.coordinationValues),
63
+ * otherwise into the coordination scope(s) that the view is mapped to
64
+ * (after accounting for meta-coordination), so that linked views follow along.
65
+ * - Multi-level values (`{ "$CL": [...] }`) are expanded into new coordination scopes,
66
+ * and the view's existing (meta-)coordination scope mapping for those coordination types
67
+ * is re-pointed to the new scopes (so that linked views follow along).
68
+ * @param {object} viewConfig The current view config.
69
+ * @param {string} viewUid The view of interest.
70
+ * @param {object} frameCoordinationValues The coordination values for the view in the frame.
71
+ * @param {string} scopePrefix Prefix for any newly-created coordination scope names.
72
+ * @returns {object} The new view config.
73
+ */
74
+ export function applyAnnotationFrameToViewConfig(viewConfig: object, viewUid: string, frameCoordinationValues: object, scopePrefix: string): object;
41
75
  /**
42
76
  * This hook uses the same logic as for the `values` part of
43
77
  * the useCoordination hook, with the difference that it
@@ -46,9 +80,11 @@ export function getParameterScopeBy(parameter: string, byType: any, typeScope: a
46
80
  * @param {string[]} parameters Array of coordination types.
47
81
  * @param {object} coordinationScopes Mapping of coordination types
48
82
  * to scope names.
83
+ * @param {object} coordinationValues Mapping of coordination types to
84
+ * values which the view defines directly. Optional.
49
85
  * @returns {object} Object containing all coordination values.
50
86
  */
51
- export function useInitialCoordination(parameters: string[], coordinationScopes: object): object;
87
+ export function useInitialCoordination(parameters: string[], coordinationScopes: object, coordinationValues: object): object;
52
88
  /**
53
89
  * The useCoordination hook returns both the
54
90
  * values and setter functions for the coordination objects
@@ -59,13 +95,17 @@ export function useInitialCoordination(parameters: string[], coordinationScopes:
59
95
  * @param {string[]} parameters Array of coordination types.
60
96
  * @param {object} coordinationScopes Mapping of coordination types
61
97
  * to scope names.
98
+ * @param {object} coordinationValues Mapping of coordination types to
99
+ * values which the view defines directly. Optional.
100
+ * @param {string} viewUid The view of interest. Optional, but required for
101
+ * setter functions to be able to write back to view-level coordinationValues.
62
102
  * @returns {array} Returns a tuple [values, setters]
63
103
  * where values is an object containing all coordination values,
64
104
  * and setters is an object containing all coordination setter
65
105
  * functions for the values in `values`, named with a "set"
66
106
  * prefix.
67
107
  */
68
- export function useCoordination(parameters: string[], coordinationScopes: object): array;
108
+ export function useCoordination(parameters: string[], coordinationScopes: object, coordinationValues: object, viewUid: string): array;
69
109
  export function useMultiCoordinationScopes(parameter: any, coordinationScopes: any): any;
70
110
  export function useMultiCoordinationScopesNonNull(parameter: any, coordinationScopes: any): any;
71
111
  export function useMultiCoordinationScopesSecondary(parameter: any, byType: any, coordinationScopes: any, coordinationScopesBy: any): any;
@@ -86,12 +126,16 @@ export function useDatasetUids(coordinationScopes: object): object;
86
126
  * mapping object for a view.
87
127
  * @param {string} byType The {coordinationType} to use for per-{coordinationType} coordination
88
128
  * scope mappings.
129
+ * @param {object} coordinationValues Mapping of coordination types to
130
+ * values which the view defines directly. Optional.
131
+ * @param {string} viewUid The view of interest. Optional, but required for
132
+ * setter functions to be able to write back to view-level coordinationValues.
89
133
  * @returns {array} [cValues, cSetters] where
90
134
  * cValues is a mapping from coordination scope name to { coordinationType: coordinationValue },
91
135
  * and cSetters is a mapping from coordination scope name to { setCoordinationType }
92
136
  * setter functions.
93
137
  */
94
- export function useComplexCoordination(parameters: string[], coordinationScopes: object, coordinationScopesBy: object, byType: string): array;
138
+ export function useComplexCoordination(parameters: string[], coordinationScopes: object, coordinationScopesBy: object, byType: string, coordinationValues: object, viewUid: string): array;
95
139
  /**
96
140
  * Get the "computed" (i.e., after accounting for meta-coordination)
97
141
  * value for coordinationScopes.
@@ -107,15 +151,35 @@ export function useCoordinationScopes(coordinationScopes: object): object;
107
151
  * @returns {object} The coordinationScopesBy after filling in with meta-coordinationScopesBy.
108
152
  */
109
153
  export function useCoordinationScopesBy(coordinationScopes: object, coordinationScopesBy: object): object;
154
+ /**
155
+ * Get the coordination information for a view, as defined directly on the
156
+ * corresponding layout entry (i.e., prior to accounting for meta-coordination).
157
+ * @param {string} viewUid The view of interest.
158
+ * @returns {[coordinationScopes, coordinationScopesBy, coordinationValues]}
159
+ */
160
+ export function useRawViewMapping(viewUid: string): [coordinationScopes, coordinationScopesBy, coordinationValues];
161
+ /**
162
+ * Get the coordination information for a view,
163
+ * after accounting for meta-coordination.
164
+ * Note that coordinationValues are defined by the view directly,
165
+ * so they are not affected by meta-coordination.
166
+ * @param {string} viewUid The view of interest.
167
+ * @returns {[coordinationScopes, coordinationScopesBy, coordinationValues]}
168
+ */
169
+ export function useViewMapping(viewUid: string): [object, object, coordinationValues];
110
170
  /**
111
171
  * Use a second level of complex coordination.
112
172
  * @param {string[]} parameters Array of coordination types.
113
173
  * @param {object} coordinationScopesBy The coordinationScopesBy object from the view definition.
114
174
  * @param {string} primaryType The first-level coordination type, such as spatialImageLayer.
115
175
  * @param {string} secondaryType The second-level coordination type, such as spatialImageChannel.
176
+ * @param {object} coordinationValues Mapping of coordination types to
177
+ * values which the view defines directly. Optional.
178
+ * @param {string} viewUid The view of interest. Optional, but required for
179
+ * setter functions to be able to write back to view-level coordinationValues.
116
180
  * @returns The results of useComplexCoordination.
117
181
  */
118
- export function useComplexCoordinationSecondary(parameters: string[], coordinationScopes: any, coordinationScopesBy: object, primaryType: string, secondaryType: string): any[];
182
+ export function useComplexCoordinationSecondary(parameters: string[], coordinationScopes: any, coordinationScopesBy: object, primaryType: string, secondaryType: string, coordinationValues: object, viewUid: string): any[];
119
183
  /**
120
184
  * Use coordination values and coordination setter functions corresponding to
121
185
  * dataset-specific coordination scopes for each coordination type.
@@ -230,6 +294,38 @@ export function useSetLoaders(): Function;
230
294
  * in the `useViewConfigStore` store.
231
295
  */
232
296
  export function useMergeCoordination(): Function;
297
+ /**
298
+ * Determine which coordination values to merge for a view
299
+ * when the story or the current annotation frame changes.
300
+ * - When a frame is active, the values that the frame defines for the view.
301
+ * If the frame does not define annotationShapes for the view, they are cleared,
302
+ * so that shapes from a previous frame do not persist.
303
+ * - When the frame index becomes null (after a frame was active),
304
+ * annotationShapes are cleared.
305
+ * Clearing annotationShapes is the only exception to leaving the
306
+ * state untouched for values that a frame does not define.
307
+ * @param {object|null} annotationStory The annotation story.
308
+ * @param {number|null|undefined} prevFrameIndex The previously-applied frame index.
309
+ * @param {number|null} annotationFrameIndex The current frame index.
310
+ * @param {string} viewUid The view of interest.
311
+ * @returns {object|null} The { frameCoordinationValues, scopePrefix } to apply, or null.
312
+ */
313
+ export function getAnnotationFrameUpdate(annotationStory: object | null, prevFrameIndex: number | null | undefined, annotationFrameIndex: number | null, viewUid: string): object | null;
314
+ /**
315
+ * When the current annotation frame changes, merge the coordination values
316
+ * that the frame defines for this view into the coordination space.
317
+ * The annotation story is treated as read-only: after the frame has been applied,
318
+ * the view reads (and its setters write) the coordination space as usual,
319
+ * so user interactions (e.g., panning) are not overridden by the frame.
320
+ * Values which the frame does not define keep their current values,
321
+ * except that annotationShapes are cleared when the frame does not define them
322
+ * or when the frame index becomes null.
323
+ * @param {string} viewUid The view of interest.
324
+ * @param {object} coordinationScopes The coordination scopes for the view,
325
+ * after accounting for meta-coordination.
326
+ * @param {object} coordinationValues Values which the view defines directly. Optional.
327
+ */
328
+ export function useAnnotationFrameCoordination(viewUid: string, coordinationScopes: object, coordinationValues: object): void;
233
329
  /**
234
330
  * Obtain the current view config object from
235
331
  * the global app state.
@@ -299,6 +395,7 @@ export function useGridResize(): number;
299
395
  * function.
300
396
  */
301
397
  export function useEmitGridResize(): Function;
398
+ export const COORDINATION_LEVEL_SENTINEL: "$CL";
302
399
  export function createViewConfigStore(initialLoaders: any, initialConfig: any): Function;
303
400
  export function useComponentLayout(component: any, scopes: any, coordinationScopes: any): Object;
304
401
  export function createAuxiliaryStore(): Function;
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/state/hooks.js"],"names":[],"mappings":"AA8BA,oDAiBC;AAED,6CAMC;AACD,uDAOC;AAED,8DAEC;AAGD,mDAiBC;AAED,4CAMC;AACD,sDAOC;AAED,6DAEC;AAID;;;;;;GAMG;AACH,8CAJW,GAAC,mBAEC,MAAM,GAAC,SAAS,CA4B5B;AAED;;;;;;;GAOG;AACH,gDALW,GAAC,wBACD,GAAC,qBAEC,MAAM,GAAC,SAAS,CA0C5B;AAED;;;;;GAKG;AACH,6CAJW,MAAM,sBACN,GAAC,GACC,MAAM,GAAC,SAAS,CAI5B;AAED;;;;;;GAMG;AACH,+CALW,MAAM,mDACN,GAAC,wBACD,GAAC,GACC,MAAM,GAAC,SAAS,CAc5B;AAySD;;;;;;;;;GASG;AACH,mDALW,MAAM,EAAE,sBACR,MAAM,GAEJ,MAAM,CAclB;AAED;;;;;;;;;;;;;;;GAeG;AACH,4CATW,MAAM,EAAE,sBACR,MAAM,GAEJ,KAAK,CAmCjB;AAED,yFAKC;AAED,gG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H,iDAHa,MAAM,CAKlB;AAED;;;;;GAKG;AACH,6DAOC;AAED;;;;GAIG;AACH,iCAFa,MAAM,CAIlB;AAED;;;;;GAKG;AACH,8CAEC;AA5hCM,yFA4LH;AAOG,0FAFM,MAAM,CAOlB;AAcM,iDAUJ"}
1
+ {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/state/hooks.js"],"names":[],"mappings":"AA+BA,oDAiBC;AAED,6CAMC;AACD,uDAOC;AAED,8DAEC;AAGD,mDAiBC;AAED,4CAMC;AACD,sDAOC;AAED,6DAEC;AAID;;;;;;GAMG;AACH,8CAJW,GAAC,mBAEC,MAAM,GAAC,SAAS,CA4B5B;AAED;;;;;;;GAOG;AACH,gDALW,GAAC,wBACD,GAAC,qBAEC,MAAM,GAAC,SAAS,CA0C5B;AAED;;;;;GAKG;AACH,6CAJW,MAAM,sBACN,GAAC,GACC,MAAM,GAAC,SAAS,CAI5B;AAED;;;;;;GAMG;AACH,+CALW,MAAM,mDACN,GAAC,wBACD,GAAC,GACC,MAAM,GAAC,SAAS,CAc5B;AAED;;;;;;;GAOG;AACH,yDAJW,MAAM,GAAC,SAAS,aAChB,MAAM,GACJ,OAAO,CAKnB;AAoBD;;;;;GAKG;AACH,gDAHW,GAAC,GACC,GAAC,CAeb;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,6DANW,MAAM,WACN,MAAM,2BACN,MAAM,eACN,MAAM,GACJ,MAAM,CA2GlB;AA8UD;;;;;;;;;;;GAWG;AACH,mDAPW,MAAM,EAAE,sBACR,MAAM,sBAEN,MAAM,GAEJ,MAAM,CAkBlB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4CAbW,MAAM,EAAE,sBACR,MAAM,sBAEN,MAAM,WAEN,MAAM,GAEJ,KAAK,CAwCjB;AAED,yFAKC;AAED,gGAqBC;AAED,0IA4BC;AAED,iJAkEC;AAED,yFAmBC;AAED;;;;GAIG;AACH,mDAHW,MAAM,GACJ,MAAM,CAIlB;AAED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