Skip to content
This repository was archived by the owner on Apr 11, 2024. It is now read-only.

Commit 2bc06f8

Browse files
committed
Adding Playground page for adding sensor positions, formatting, dependency updates
1 parent 7dfb9e5 commit 2bc06f8

28 files changed

+670
-318
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,4 @@ dist/
1212
node_modules/
1313
.DS_Store
1414
.env
15-
package-lock.json
16-
.vscode/*
15+
package-lock.json

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
![Application](docs/dataviz-intro.jpg)
44

5-
This sample application demonstrates the functionality of the Forge Data Visualization extension. To learn more about the extension and the features it offers, see the [Data Visualization Extension Developer's Guide](https://forge.autodesk.com/en/docs/dataviz/v1/developers_guide/introduction/overview/).
5+
This sample application demonstrates the functionality of the Forge Data Visualization extension. To learn more about the extension and the features it offers, see the [Data Visualization Extension Developer's Guide](https://forge.autodesk.com/en/docs/dataviz/v1/developers_guide/introduction/overview/).
66

77
## Directory Structure
88

client/app.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-disable no-undef */
2+
13
/**
24
* Initialize the configurations
35
*
@@ -17,7 +19,6 @@ import ReactDOM from "react-dom";
1719
import App from "./pages/App.jsx";
1820
import { BrowserRouter } from "react-router-dom";
1921

20-
2122
ReactDOM.render(
2223
<BrowserRouter>
2324
<App {...{ appData: __app.dataContext, appContext: ApplicationContext }} />

client/pages/AnimatedSprites.jsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,13 @@ const sensorPositions = {
107107

108108
/**
109109
* An example illustrating how to animate sprite viewables. Can be viewed at: https://hyperion.autodesk.io/animation
110-
*
110+
*
111111
* @component
112112
* @param {Object} props
113113
* @param {Object} props.appData Data passed to the AnimatedSprites.
114114
* @param {("AutodeskStaging"|"AutodeskProduction")} props.appData.env Forge API environment
115115
* @param {string} props.appData.docUrn Document URN of model
116-
*
116+
*
117117
* @memberof Autodesk.DataVisualization.Examples
118118
* @alias Autodesk.DataVisualization.Examples.AnimatedSprites
119119
*/
@@ -155,15 +155,14 @@ function AnimatedSprites(props) {
155155
async function generateViewableData(dataItems) {
156156
// Create a visual style shared by all the thermometers since they're the same type.
157157
const styleColor = 0xffffff;
158-
const dataVizExtn = Autodesk.DataVisualization.Core
158+
const dataVizExtn = Autodesk.DataVisualization.Core;
159159

160160
const ductFanStyle = new dataVizExtn.ViewableStyle(
161161
dataVizExtn.ViewableType.SPRITE,
162162
new THREE.Color(styleColor),
163163
fan00
164164
);
165165

166-
167166
fans.forEach((fan) => ductFanStyle.preloadSprite(fan));
168167

169168
const motionStyle = new dataVizExtn.ViewableStyle(
@@ -211,7 +210,7 @@ function AnimatedSprites(props) {
211210

212211
/**
213212
* Determines a random set of viewable ids that will be animated.
214-
*
213+
*
215214
* @param {SpriteViewable[]} viewables Array of {@link SpriteViewable} in scene.
216215
* @returns {number[]} Subset of viewable ids to animate.
217216
*/
@@ -239,7 +238,7 @@ function AnimatedSprites(props) {
239238
});
240239
}
241240

242-
const dataVizExtension = viewer.getExtension("Autodesk.DataVisualization")
241+
const dataVizExtension = viewer.getExtension("Autodesk.DataVisualization");
243242

244243
if (levelsExtension) {
245244
levelsExtension.floorSelector.selectFloor(0, true);

client/pages/App.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ import AnimatedSprites from "./AnimatedSprites.jsx";
1212
import StructureInfo from "./StructureInfo.jsx";
1313
import Navisworks from "./Navisworks.jsx";
1414
import CustomPage from "./CustomPage.jsx";
15+
import Playground from "./Playground.jsx";
1516

1617
/**
17-
*
18-
* @param {Object} props
18+
*
19+
* @param {Object} props
1920
* @param {Object} props.appData Data passed to the application.
2021
* @param {("AutodeskStaging"|"AutodeskProduction")} props.appData.env Forge API environment
2122
* @param {string} props.appData.docUrn Document URN of model
@@ -58,6 +59,9 @@ function App(props) {
5859
<Route path="/app">
5960
<CustomPage {...props} />
6061
</Route>
62+
<Route path="/playground">
63+
<Playground {...props} />
64+
</Route>
6165
<Route path="/">
6266
<ReferenceApp {...props} />
6367
</Route>

client/pages/CustomPage.jsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@ import React from "react";
44
* An interface file to allow customers to have their custom built application page.
55
*/
66
function CustomPage() {
7-
8-
return (
9-
<div id='customPage'>
10-
</div>
11-
);
7+
return <div id="customPage"></div>;
128
}
139

1410
export default CustomPage;

0 commit comments

Comments
 (0)