@avs/go-react 0.13.71740 → 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.
@@ -1,6 +1,3 @@
1
- import {
2
- PolymerElement
3
- } from "./chunk-BSA4YZO6.js";
4
1
  import {
5
2
  Class,
6
3
  CustomStyleInterface,
@@ -19,6 +16,9 @@ import {
19
16
  updateNativeProperties
20
17
  } from "./chunk-BHAOVVTR.js";
21
18
  import "./chunk-QQPVW2K2.js";
19
+ import {
20
+ PolymerElement
21
+ } from "./chunk-BSA4YZO6.js";
22
22
  import {
23
23
  ElementMixin,
24
24
  PropertyEffects,
@@ -1,86 +1,86 @@
1
1
  {
2
- "hash": "9ee08c08",
2
+ "hash": "9655bdd0",
3
3
  "configHash": "f1217b0f",
4
- "lockfileHash": "417d4215",
5
- "browserHash": "3e4fb1de",
4
+ "lockfileHash": "2e777a7e",
5
+ "browserHash": "a93d0bfe",
6
6
  "optimized": {
7
7
  "react": {
8
8
  "src": "../../../../../../node_modules/react/index.js",
9
9
  "file": "react.js",
10
- "fileHash": "dd2cb163",
10
+ "fileHash": "cbda1220",
11
11
  "needsInterop": true
12
12
  },
13
13
  "react-dom": {
14
14
  "src": "../../../../../../node_modules/react-dom/index.js",
15
15
  "file": "react-dom.js",
16
- "fileHash": "edbd09e2",
16
+ "fileHash": "131e2108",
17
17
  "needsInterop": true
18
18
  },
19
19
  "react/jsx-dev-runtime": {
20
20
  "src": "../../../../../../node_modules/react/jsx-dev-runtime.js",
21
21
  "file": "react_jsx-dev-runtime.js",
22
- "fileHash": "b38c43bd",
22
+ "fileHash": "75d33b4c",
23
23
  "needsInterop": true
24
24
  },
25
25
  "react/jsx-runtime": {
26
26
  "src": "../../../../../../node_modules/react/jsx-runtime.js",
27
27
  "file": "react_jsx-runtime.js",
28
- "fileHash": "b5a42a9c",
28
+ "fileHash": "06888346",
29
29
  "needsInterop": true
30
30
  },
31
31
  "@polymer/iron-resizable-behavior/iron-resizable-behavior.js": {
32
32
  "src": "../../../../../../node_modules/@polymer/iron-resizable-behavior/iron-resizable-behavior.js",
33
33
  "file": "@polymer_iron-resizable-behavior_iron-resizable-behavior__js.js",
34
- "fileHash": "98f16794",
34
+ "fileHash": "7e01d931",
35
35
  "needsInterop": false
36
36
  },
37
37
  "@polymer/polymer/lib/legacy/class.js": {
38
38
  "src": "../../../../../../node_modules/@polymer/polymer/lib/legacy/class.js",
39
39
  "file": "@polymer_polymer_lib_legacy_class__js.js",
40
- "fileHash": "8f19d2c0",
40
+ "fileHash": "95a26f3a",
41
41
  "needsInterop": false
42
42
  },
43
43
  "@polymer/polymer/lib/utils/mixin.js": {
44
44
  "src": "../../../../../../node_modules/@polymer/polymer/lib/utils/mixin.js",
45
45
  "file": "@polymer_polymer_lib_utils_mixin__js.js",
46
- "fileHash": "a8767480",
46
+ "fileHash": "89943a4c",
47
47
  "needsInterop": false
48
48
  },
49
49
  "@polymer/polymer/lib/utils/render-status.js": {
50
50
  "src": "../../../../../../node_modules/@polymer/polymer/lib/utils/render-status.js",
51
51
  "file": "@polymer_polymer_lib_utils_render-status__js.js",
52
- "fileHash": "dea8912f",
52
+ "fileHash": "5d3b8dcd",
53
53
  "needsInterop": false
54
54
  },
55
55
  "@polymer/polymer/polymer-element.js": {
56
56
  "src": "../../../../../../node_modules/@polymer/polymer/polymer-element.js",
57
57
  "file": "@polymer_polymer_polymer-element__js.js",
58
- "fileHash": "db3c42ec",
58
+ "fileHash": "34ad9e7a",
59
59
  "needsInterop": false
60
60
  },
61
61
  "react-dom/client": {
62
62
  "src": "../../../../../../node_modules/react-dom/client.js",
63
63
  "file": "react-dom_client.js",
64
- "fileHash": "7a3f7fbd",
64
+ "fileHash": "77621582",
65
65
  "needsInterop": true
66
66
  },
67
67
  "three": {
68
68
  "src": "../../../../../../node_modules/three/build/three.module.js",
69
69
  "file": "three.js",
70
- "fileHash": "080ab43f",
70
+ "fileHash": "484cc2aa",
71
71
  "needsInterop": false
72
72
  }
73
73
  },
74
74
  "chunks": {
75
- "chunk-BSA4YZO6": {
76
- "file": "chunk-BSA4YZO6.js"
77
- },
78
75
  "chunk-BHAOVVTR": {
79
76
  "file": "chunk-BHAOVVTR.js"
80
77
  },
81
78
  "chunk-QQPVW2K2": {
82
79
  "file": "chunk-QQPVW2K2.js"
83
80
  },
81
+ "chunk-BSA4YZO6": {
82
+ "file": "chunk-BSA4YZO6.js"
83
+ },
84
84
  "chunk-PRUGAEYJ": {
85
85
  "file": "chunk-PRUGAEYJ.js"
86
86
  },
package/demo/src/App.tsx CHANGED
@@ -1,15 +1,46 @@
1
1
  import './App.css'
2
2
  import { AvsGoDataViz } from '@avs/go-react/src/AvsGoDataViz';
3
+ import { useRef } from 'react';
4
+
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');
3
8
 
4
9
  function App() {
10
+ const dataVizRef = useRef(null);
11
+
12
+ function handleLoadComplete() {
13
+ if (dataVizRef.current) {
14
+ dataVizRef.current.runAnimation();
15
+ }
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
+
5
31
  return (
6
- <div style={{width: '100vw', height: '100vh'}}>
7
- <AvsGoDataViz
8
- url='hydrogen.json'
9
- urlLoadJsonFile
10
- renderer='THREEJS'
11
- transformEnable
12
- />
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
+ />
13
44
  </div>
14
45
  )
15
46
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@avs/go-react",
3
- "version": "0.13.71740",
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.13.71740",
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
  );