@avs/go-react 0.12.71739 → 0.13.71745

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/demo/src/App.tsx CHANGED
@@ -1,38 +1,48 @@
1
- import './App.css'
2
- import { useRef } from 'react';
3
- import { AvsGoDataViz } from '@avs/go-react/src/AvsGoDataViz';
4
-
5
- const serverUrl = "http://localhost:8080/OpenVizAppServer/chart"
6
- //const serverUrl = "hydrogen.json";
1
+ import './App.css'
2
+ import { AvsGoDataViz } from '@avs/go-react/src/AvsGoDataViz';
3
+ import { useRef } from 'react';
7
4
 
8
- const myStyle = {
9
- '--avs-transform-animation': '[{"time":0,"rotation":[-75,0,0,"XYZ"],"position":[0,0,0],"scale":100},{"time":2000,"rotation":[-75,0,-90,"XYZ"],"position":[0,0,0],"scale":100},{"time":4000,"rotation":[-75,0,-90,"XYZ"],"position":[0,0,0],"scale":200},{"time":6000,"rotation":[0,0,-90,"XYZ"],"position":[0,0,0],"scale":200}]'
10
- };
5
+ const startupAnimation = null; // btoa('[{"time":0,"rotation":[-75,0,0,"XYZ"],"position":[0,0,0],"scale":100},{"time":2000,"rotation":[-75,0,-90,"XYZ"],"position":[0,0,0],"scale":100},{"time":4000,"rotation":[-75,0,-90,"XYZ"],"position":[0,0,0],"scale":200},{"time":6000,"rotation":[0,0,-90,"XYZ"],"position":[0,0,0],"scale":200}]');
6
+ const params = new URLSearchParams(window.location.search);
7
+ const param = params.get('animation');
11
8
 
12
- function App() {
9
+ function App() {
13
10
  const dataVizRef = useRef(null);
14
11
 
15
- function handleLoadComplete() {
12
+ function handleLoadComplete() {
16
13
  if (dataVizRef.current) {
17
14
  dataVizRef.current.runAnimation();
18
15
  }
19
- }
20
-
21
- return (
22
- <div style={{width: '100vw', height: '100vh'}}>
23
- <AvsGoDataViz
24
- ref={dataVizRef}
25
- url={serverUrl}
26
- xurlLoadJsonFile
27
- sceneName="contour3dConstraint"
28
- streamEnable
29
- style={myStyle}
30
- renderer='THREEJS'
31
- transformEnable
32
- onLoadComplete={handleLoadComplete}
33
- />
34
- </div>
35
- )
36
- }
37
-
38
- export default App
16
+ }
17
+
18
+ function handleTransformAnimationShare(animation: string) {
19
+ const url = window.location.origin + window.location.pathname + "?animation=" + animation;
20
+ navigator.clipboard.writeText(url);
21
+
22
+ const dialog = document.createElement("dialog");
23
+ document.body.appendChild(dialog);
24
+ dialog.innerText = "URL copied to clipboard";
25
+ dialog.show();
26
+ setTimeout(function () {
27
+ dialog.close();
28
+ }, 1000);
29
+ }
30
+
31
+ return (
32
+ <div style={{width: '100vw', height: '100vh', backgroundColor: 'white'}}>
33
+ <AvsGoDataViz
34
+ url='hydrogen.json'
35
+ ref={dataVizRef}
36
+ urlLoadJsonFile
37
+ renderer='THREEJS'
38
+ transformEnable
39
+ transformAnimation={param ?? startupAnimation}
40
+ animationControlsEnable
41
+ onLoadComplete={handleLoadComplete}
42
+ onTransformAnimationShare={handleTransformAnimationShare}
43
+ />
44
+ </div>
45
+ )
46
+ }
47
+
48
+ export default App
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@avs/go-react",
3
- "version": "0.12.71739",
3
+ "version": "0.13.71745",
4
4
  "description": "React wrapper for AVS/Go web components",
5
5
  "keywords": [
6
6
  "visualization",
@@ -11,7 +11,7 @@
11
11
  "author": "Advanced Visual Systems Inc.",
12
12
  "license": "Apache-2.0",
13
13
  "dependencies": {
14
- "@avs/go": "0.12.71739",
14
+ "@avs/go": "0.13.71745",
15
15
  "react": "^19.2.0",
16
16
  "react-dom": "^19.2.0"
17
17
  },
@@ -73,6 +73,7 @@ export const AvsGoDataViz = forwardRef(({
73
73
  transformTwistAngle,
74
74
  transformTiltAngle,
75
75
  transformScale,
76
+ transformAnimation,
76
77
  zoomRectangleEnable,
77
78
  panEnable,
78
79
  panZoomEnable,
@@ -81,9 +82,11 @@ export const AvsGoDataViz = forwardRef(({
81
82
  panMaximumZoomLevel,
82
83
  animatedGlyphsVisible,
83
84
  animatedGlyphsEnable,
85
+ animationControlsEnable,
84
86
  onSceneInfo,
85
87
  onLoadComplete,
86
88
  onPanInfo,
89
+ onTransformAnimationShare,
87
90
  onError
88
91
  }, ref) => {
89
92
 
@@ -130,6 +133,12 @@ export const AvsGoDataViz = forwardRef(({
130
133
  }
131
134
  }
132
135
 
136
+ function handleTransformAnimationShare(e) {
137
+ if (onTransformAnimationShare) {
138
+ onTransformAnimationShare(e.detail);
139
+ }
140
+ }
141
+
133
142
  function handleError(e) {
134
143
  if (onError) {
135
144
  onError(e.detail);
@@ -142,6 +151,7 @@ export const AvsGoDataViz = forwardRef(({
142
151
  dataVizRef.current.addEventListener('avs-scene-info', handleSceneInfo);
143
152
  dataVizRef.current.addEventListener('avs-load-complete', handleLoadComplete);
144
153
  dataVizRef.current.addEventListener('avs-pan-info', handlePanInfo);
154
+ dataVizRef.current.addEventListener('avs-transform-animation-share', handleTransformAnimationShare);
145
155
  dataVizRef.current.addEventListener('avs-error', handleError);
146
156
 
147
157
  return () => {
@@ -152,6 +162,7 @@ export const AvsGoDataViz = forwardRef(({
152
162
  dataVizRef.current.removeEventListener('avs-scene-info', handleSceneInfo);
153
163
  dataVizRef.current.removeEventListener('avs-load-complete', handleLoadComplete);
154
164
  dataVizRef.current.removeEventListener('avs-pan-info', handlePanInfo);
165
+ dataVizRef.current.removeEventListener('avs-transform-animation-share', handleTransformAnimationShare);
155
166
  dataVizRef.current.removeEventListener('avs-error', handleError);
156
167
  }
157
168
  }
@@ -197,63 +208,65 @@ export const AvsGoDataViz = forwardRef(({
197
208
 
198
209
  return (
199
210
  <avs-go-dataviz
200
- style={style}
201
- ref={dataVizRef}
202
- manual-update={manualUpdate}
203
- display-canvas={displayCanvas}
204
- url={url}
205
- url-load-json-file={urlLoadJsonFile}
206
- scene-name={sceneName}
207
- scene-user-properties={sceneUserProperties}
208
- data-source-name={dataSourceName}
209
- data-source-user-properties={dataSourceUserProperties}
210
- renderer-name={rendererName}
211
- renderer-user-properties={rendererUserProperties}
212
- renderer={renderer}
213
- stream-enable={streamEnable}
214
- stream-chunk-size-first={streamChunkSizeFirst}
215
- stream-chunk-size={streamChunkSize}
216
- theme-name={themeName}
217
- hidden={hidden}
218
- resize-threshold={resizeThreshold}
219
- aspect-ratio={aspectRatio}
220
- pointer-timeout={pointerTimeout}
221
- tap-enable={tapEnable}
222
- tap-level={tapLevel}
223
- tap-depth={tapDepth}
224
- tap-highlight-enable={tapHighlightEnable}
225
- tap-highlight-color={tapHighlightColor}
226
- tap-highlight-layer-enable={tapHighlightLayerEnable}
227
- tap-process-event-on-client={tapProcessEventOnClient}
228
- track-enable={trackEnable}
229
- track-level={trackLevel}
230
- track-depth={trackDepth}
231
- track-highlight-enable={trackHighlightEnable}
232
- track-highlight-color={trackHighlightColor}
233
- track-highlight-layer-enable={trackHighlightLayerEnable}
234
- track-process-event-on-client={trackProcessEventOnClient}
235
- hover-enable={hoverEnable}
236
- hover-level={hoverLevel}
237
- horer-depth={hoverDepth}
238
- hover-highlight-enable={hoverHighlightEnable}
239
- hover-highlight-color={hoverHighlightColor}
240
- hover-highlight-layer-enable={hoverHighlightLayerEnable}
241
- transform-enable={transformEnable}
242
- transform-client-only={transformClientOnly}
243
- transform-rotate-disable={transformRotateDisable}
244
- transform-zoom-disable={transformZoomDisable}
245
- transform-pan-disable={transformPanDisable}
246
- transform-twist-angle={transformTwistAngle}
247
- transform-tilt-angle={transformTiltAngle}
248
- transform-scale={transformScale}
249
- zoom-reactangle-enable={zoomRectangleEnable}
250
- pan-enable={panEnable}
251
- pan-zoom-enable={panZoomEnable}
252
- pan-width-zoom-level={panWidthZoomLevel}
253
- pan-height-zoom-level={panHeightZoomLevel}
254
- pan-maximum-zoom-level={panMaximumZoomLevel}
255
- animated-glyphs-visible={animatedGlyphsVisible}
256
- animated-glyphs-enable={animatedGlyphsEnable}
211
+ style={style}
212
+ ref={dataVizRef}
213
+ manual-update={manualUpdate}
214
+ display-canvas={displayCanvas}
215
+ url={url}
216
+ url-load-json-file={urlLoadJsonFile}
217
+ scene-name={sceneName}
218
+ scene-user-properties={sceneUserProperties}
219
+ data-source-name={dataSourceName}
220
+ data-source-user-properties={dataSourceUserProperties}
221
+ renderer-name={rendererName}
222
+ renderer-user-properties={rendererUserProperties}
223
+ renderer={renderer}
224
+ stream-enable={streamEnable}
225
+ stream-chunk-size-first={streamChunkSizeFirst}
226
+ stream-chunk-size={streamChunkSize}
227
+ theme-name={themeName}
228
+ hidden={hidden}
229
+ resize-threshold={resizeThreshold}
230
+ aspect-ratio={aspectRatio}
231
+ pointer-timeout={pointerTimeout}
232
+ tap-enable={tapEnable}
233
+ tap-level={tapLevel}
234
+ tap-depth={tapDepth}
235
+ tap-highlight-enable={tapHighlightEnable}
236
+ tap-highlight-color={tapHighlightColor}
237
+ tap-highlight-layer-enable={tapHighlightLayerEnable}
238
+ tap-process-event-on-client={tapProcessEventOnClient}
239
+ track-enable={trackEnable}
240
+ track-level={trackLevel}
241
+ track-depth={trackDepth}
242
+ track-highlight-enable={trackHighlightEnable}
243
+ track-highlight-color={trackHighlightColor}
244
+ track-highlight-layer-enable={trackHighlightLayerEnable}
245
+ track-process-event-on-client={trackProcessEventOnClient}
246
+ hover-enable={hoverEnable}
247
+ hover-level={hoverLevel}
248
+ horer-depth={hoverDepth}
249
+ hover-highlight-enable={hoverHighlightEnable}
250
+ hover-highlight-color={hoverHighlightColor}
251
+ hover-highlight-layer-enable={hoverHighlightLayerEnable}
252
+ transform-enable={transformEnable}
253
+ transform-client-only={transformClientOnly}
254
+ transform-rotate-disable={transformRotateDisable}
255
+ transform-zoom-disable={transformZoomDisable}
256
+ transform-pan-disable={transformPanDisable}
257
+ transform-twist-angle={transformTwistAngle}
258
+ transform-tilt-angle={transformTiltAngle}
259
+ transform-scale={transformScale}
260
+ transformAnimation={transformAnimation}
261
+ zoom-reactangle-enable={zoomRectangleEnable}
262
+ pan-enable={panEnable}
263
+ pan-zoom-enable={panZoomEnable}
264
+ pan-width-zoom-level={panWidthZoomLevel}
265
+ pan-height-zoom-level={panHeightZoomLevel}
266
+ pan-maximum-zoom-level={panMaximumZoomLevel}
267
+ animated-glyphs-visible={animatedGlyphsVisible}
268
+ animated-glyphs-enable={animatedGlyphsEnable}
269
+ animation-controls-enable={animationControlsEnable}
257
270
  >
258
271
  </avs-go-dataviz>
259
272
  );