@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/node_modules/.vite/deps/@polymer_iron-resizable-behavior_iron-resizable-behavior__js.js +4 -4
- package/demo/node_modules/.vite/deps/@polymer_polymer_lib_legacy_class__js.js +1 -1
- package/demo/node_modules/.vite/deps/_metadata.json +26 -26
- package/demo/public/hydrogen.json +1 -1
- package/demo/src/App.tsx +41 -31
- package/package.json +2 -2
- package/src/AvsGoDataViz.jsx +70 -57
package/demo/src/App.tsx
CHANGED
|
@@ -1,38 +1,48 @@
|
|
|
1
|
-
import './App.css'
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
|
|
9
|
-
|
|
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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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.
|
|
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.
|
|
14
|
+
"@avs/go": "0.13.71745",
|
|
15
15
|
"react": "^19.2.0",
|
|
16
16
|
"react-dom": "^19.2.0"
|
|
17
17
|
},
|
package/src/AvsGoDataViz.jsx
CHANGED
|
@@ -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
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
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
|
);
|