@vitessce/vit-s 3.5.6 → 3.5.8

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 (53) hide show
  1. package/dist/index.js +768 -111
  2. package/dist-tsc/CallbackPublisher.js +2 -1
  3. package/dist-tsc/DebugWindow.d.ts +4 -0
  4. package/dist-tsc/DebugWindow.d.ts.map +1 -0
  5. package/dist-tsc/DebugWindow.js +9 -0
  6. package/dist-tsc/FallbackForView.d.ts +2 -0
  7. package/dist-tsc/FallbackForView.d.ts.map +1 -0
  8. package/dist-tsc/FallbackForView.js +13 -0
  9. package/dist-tsc/FallbackForVitS.d.ts +2 -0
  10. package/dist-tsc/FallbackForVitS.d.ts.map +1 -0
  11. package/dist-tsc/FallbackForVitS.js +12 -0
  12. package/dist-tsc/VitS.d.ts +4 -0
  13. package/dist-tsc/VitS.d.ts.map +1 -1
  14. package/dist-tsc/VitS.js +21 -2
  15. package/dist-tsc/VitSContainer.d.ts +9 -0
  16. package/dist-tsc/VitSContainer.d.ts.map +1 -0
  17. package/dist-tsc/VitSContainer.js +15 -0
  18. package/dist-tsc/Warning.d.ts.map +1 -1
  19. package/dist-tsc/Warning.js +1 -37
  20. package/dist-tsc/data-hook-utils.d.ts.map +1 -1
  21. package/dist-tsc/data-hook-utils.js +3 -2
  22. package/dist-tsc/data-hooks.d.ts +22 -0
  23. package/dist-tsc/data-hooks.d.ts.map +1 -1
  24. package/dist-tsc/data-hooks.js +90 -0
  25. package/dist-tsc/hooks.d.ts +9 -0
  26. package/dist-tsc/hooks.d.ts.map +1 -1
  27. package/dist-tsc/hooks.js +29 -1
  28. package/dist-tsc/index.d.ts +3 -2
  29. package/dist-tsc/index.js +3 -2
  30. package/dist-tsc/shared-warning-styles.d.ts +2 -0
  31. package/dist-tsc/shared-warning-styles.d.ts.map +1 -0
  32. package/dist-tsc/shared-warning-styles.js +37 -0
  33. package/dist-tsc/view-config-utils.d.ts.map +1 -1
  34. package/dist-tsc/view-config-utils.js +7 -4
  35. package/dist-tsc/vitessce-grid-layout/VitessceGridLayout.d.ts.map +1 -1
  36. package/dist-tsc/vitessce-grid-layout/VitessceGridLayout.js +8 -6
  37. package/dist-tsc/vitessce-grid-utils.js +2 -1
  38. package/package.json +11 -9
  39. package/src/CallbackPublisher.js +2 -2
  40. package/src/DebugWindow.js +35 -0
  41. package/src/FallbackForView.js +23 -0
  42. package/src/FallbackForVitS.js +21 -0
  43. package/src/VitS.js +31 -2
  44. package/src/VitSContainer.js +19 -0
  45. package/src/Warning.js +1 -38
  46. package/src/data-hook-utils.js +3 -2
  47. package/src/data-hooks.js +122 -0
  48. package/src/hooks.js +32 -1
  49. package/src/index.js +7 -0
  50. package/src/shared-warning-styles.js +38 -0
  51. package/src/view-config-utils.js +7 -4
  52. package/src/vitessce-grid-layout/VitessceGridLayout.js +32 -26
  53. package/src/vitessce-grid-utils.js +2 -2
@@ -1,8 +1,10 @@
1
1
  import React, { useState, useMemo, useCallback } from 'react';
2
2
  import { Responsive, WidthProvider } from 'react-grid-layout-with-lodash';
3
3
  import { isEqual } from 'lodash-es';
4
+ import { ErrorBoundary } from 'react-error-boundary';
4
5
  import { getMaxRows, resolveLayout } from './layout-utils.js';
5
6
  import { PageModeViewContext } from '../contexts.js';
7
+ import { FallbackForView } from '../FallbackForView.js';
6
8
 
7
9
  const ResponsiveGridLayout = WidthProvider(Responsive);
8
10
 
@@ -131,19 +133,21 @@ export function VitessceGridLayout(props) {
131
133
  const Component = getComponent(v.component);
132
134
  return [v.uid, () => (
133
135
  <div key={v.uid} style={{ display: 'flex', flexDirection: 'column', height: '100%' }}>
134
- <Component
135
- {... v.props}
136
- uuid={v.uid}
137
- coordinationScopes={v.coordinationScopes}
138
- coordinationScopesBy={v.coordinationScopesBy}
139
- theme={theme}
140
- removeGridComponent={null}
141
- // Props used by LinkControllerSubscriber:
142
- viewTypes={viewTypes}
143
- fileTypes={fileTypes}
144
- coordinationTypes={coordinationTypes}
145
- stores={stores}
146
- />
136
+ <ErrorBoundary FallbackComponent={FallbackForView}>
137
+ <Component
138
+ {... v.props}
139
+ uuid={v.uid}
140
+ coordinationScopes={v.coordinationScopes}
141
+ coordinationScopesBy={v.coordinationScopesBy}
142
+ theme={theme}
143
+ removeGridComponent={null}
144
+ // Props used by LinkControllerSubscriber:
145
+ viewTypes={viewTypes}
146
+ fileTypes={fileTypes}
147
+ coordinationTypes={coordinationTypes}
148
+ stores={stores}
149
+ />
150
+ </ErrorBoundary>
147
151
  </div>
148
152
  )];
149
153
  }));
@@ -157,19 +161,21 @@ export function VitessceGridLayout(props) {
157
161
  };
158
162
  return (
159
163
  <div key={v.uid}>
160
- <Component
161
- {...v.props}
162
- uuid={v.uid}
163
- coordinationScopes={v.coordinationScopes}
164
- coordinationScopesBy={v.coordinationScopesBy}
165
- theme={theme}
166
- removeGridComponent={removeGridComponent}
167
- // Props used by LinkControllerSubscriber:
168
- viewTypes={viewTypes}
169
- fileTypes={fileTypes}
170
- coordinationTypes={coordinationTypes}
171
- stores={stores}
172
- />
164
+ <ErrorBoundary FallbackComponent={FallbackForView}>
165
+ <Component
166
+ {...v.props}
167
+ uuid={v.uid}
168
+ coordinationScopes={v.coordinationScopes}
169
+ coordinationScopesBy={v.coordinationScopesBy}
170
+ theme={theme}
171
+ removeGridComponent={removeGridComponent}
172
+ // Props used by LinkControllerSubscriber:
173
+ viewTypes={viewTypes}
174
+ fileTypes={fileTypes}
175
+ coordinationTypes={coordinationTypes}
176
+ stores={stores}
177
+ />
178
+ </ErrorBoundary>
173
179
  </div>
174
180
  );
175
181
  }), contextValue];
@@ -5,7 +5,7 @@ import { InternMap } from 'internmap';
5
5
  import { isEqual, pick } from 'lodash-es';
6
6
  import { DATA_TYPE_COORDINATION_VALUE_USAGE } from '@vitessce/constants-internal';
7
7
  import { getSourceAndLoaderFromFileType, getDataTypeFromFileType } from '@vitessce/abstract';
8
-
8
+ import { log } from '@vitessce/globals';
9
9
  /**
10
10
  * Return the bottom coordinate of the layout.
11
11
  * https://github.com/STRML/react-grid-layout/blob/20dac73f91274526034c00968b5bedb9c2ed36b9/lib/utils.js#L82
@@ -107,7 +107,7 @@ function withDefaults(
107
107
  };
108
108
  if (!isEqual(coordinationValues, coordinationValuesWithDefaults)) {
109
109
  // eslint-disable-next-line max-len
110
- console.warn(`Using coordination value defaults for file type ${fileType} in dataset ${datasetUid}\nBefore: ${JSON.stringify(coordinationValues)}\nAfter: ${JSON.stringify(coordinationValuesWithDefaults)}`);
110
+ log.warn(`Using coordination value defaults for file type ${fileType} in dataset ${datasetUid}\nBefore: ${JSON.stringify(coordinationValues)}\nAfter: ${JSON.stringify(coordinationValuesWithDefaults)}`);
111
111
  }
112
112
  return coordinationValuesWithDefaults;
113
113
  }