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

Commit 60669a4

Browse files
authored
Merge pull request #3 from Autodesk-Forge/package-update
Package update-v0.2.3
2 parents 1d0b3ed + 27e3fa0 commit 60669a4

15 files changed

+116
-107
lines changed

client/app.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ ApplicationContext.setup(SiteConfig);
1212
/**
1313
* Import required libraries
1414
*/
15-
var React = require("react");
16-
var ReactDOM = require("react-dom");
17-
var AppPage = require("./pages/App.jsx");
18-
15+
import React from "react";
16+
import ReactDOM from "react-dom";
17+
import App from "./pages/App.jsx";
1918
import { BrowserRouter } from "react-router-dom";
2019

20+
2121
ReactDOM.render(
2222
<BrowserRouter>
23-
<AppPage {...{ appData: __app.dataContext, appContext: ApplicationContext }} />
23+
<App {...{ appData: __app.dataContext, appContext: ApplicationContext }} />
2424
</BrowserRouter>,
2525
document.getElementById("hyperion_container")
2626
);

client/pages/AnimatedSprites.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,4 +307,4 @@ function AnimatedSprites(props) {
307307
);
308308
}
309309

310-
module.exports = AnimatedSprites;
310+
export default AnimatedSprites;

client/pages/App.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,4 @@ function App(props) {
6666
);
6767
}
6868

69-
module.exports = App;
69+
export default App;

client/pages/CustomPage.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ function CustomPage() {
1111
);
1212
}
1313

14-
module.exports = CustomPage;
14+
export default CustomPage;

client/pages/Dot.jsx

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,6 @@
44

55
import React from "react";
66
import { Viewer } from "forge-dataviz-iot-react-components";
7-
import ApplicationContext from "../../shared/config/ApplicationContext.js";
8-
9-
/**
10-
* @type {SensorStyleDefinitions}
11-
*/
12-
const SensorStyleDefinitions = {
13-
co2: {
14-
url: `${ApplicationContext.assetUrlPrefix}/images/co2.svg`,
15-
color: 0xffffff,
16-
},
17-
temperature: {
18-
url: `${ApplicationContext.assetUrlPrefix}/images/thermometer.svg`,
19-
color: 0xffffff,
20-
},
21-
default: {
22-
url: `${ApplicationContext.assetUrlPrefix}/images/circle.svg`,
23-
color: 0xffffff,
24-
},
25-
};
267

278
const devices = [
289
{
@@ -54,9 +35,30 @@ const devices = [
5435
* @param {Object} props.appData Data passed to the Dot Page.
5536
* @param {("AutodeskStaging"|"AutodeskProduction")} props.appData.env Forge API environment
5637
* @param {string} props.appData.docUrn Document URN of model
38+
* @param {Object} props.appContext Contains base urls used to query assets, LMV, data etc.
39+
* @param {string} [props.appContext.assetUrlPrefix] The url used to query assets
5740
*/
5841
function Dot(props) {
5942
const { env, docUrn } = props.appData;
43+
const ApplicationContext = props.appContext
44+
45+
/**
46+
* @type {SensorStyleDefinitions}
47+
*/
48+
const SensorStyleDefinitions = {
49+
co2: {
50+
url: `${ApplicationContext.assetUrlPrefix}/images/co2.svg`,
51+
color: 0xffffff,
52+
},
53+
temperature: {
54+
url: `${ApplicationContext.assetUrlPrefix}/images/thermometer.svg`,
55+
color: 0xffffff,
56+
},
57+
default: {
58+
url: `${ApplicationContext.assetUrlPrefix}/images/circle.svg`,
59+
color: 0xffffff,
60+
},
61+
};
6062

6163
/**
6264
* Handles `Autodesk.Viewing.GEOMETRY_LOADED_EVENT` event that is sent when a model has been completely loaded in the viewer.
@@ -123,4 +125,4 @@ function Dot(props) {
123125
);
124126
}
125127

126-
module.exports = Dot;
128+
export default Dot;

client/pages/EngineSimulation.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,4 +167,4 @@ function EngineSimulation(props) {
167167
);
168168
}
169169

170-
module.exports = EngineSimulation;
170+
export default EngineSimulation;

client/pages/Heatmap.jsx

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,6 @@
88

99
import React from "react";
1010
import { Viewer } from "forge-dataviz-iot-react-components";
11-
import ApplicationContext from "../../shared/config/ApplicationContext.js";
12-
13-
/**
14-
* @type {SensorStyleDefinitions}
15-
*/
16-
const SensorStyleDefinitions = {
17-
co2: {
18-
url: `${ApplicationContext.assetUrlPrefix}/images/co2.svg`,
19-
color: 0xffffff,
20-
},
21-
temperature: {
22-
url: `${ApplicationContext.assetUrlPrefix}/images/thermometer.svg`,
23-
color: 0xffffff,
24-
},
25-
default: {
26-
url: `${ApplicationContext.assetUrlPrefix}/images/circle.svg`,
27-
color: 0xffffff,
28-
},
29-
};
3011

3112
const devices = [
3213
{
@@ -59,11 +40,32 @@ const devices = [
5940
* @param {Object} props.appData Data passed to the application.
6041
* @param {("AutodeskStaging"|"AutodeskProduction")} props.appData.env Forge API environment
6142
* @param {string} props.appData.docUrn Document URN of model
43+
* @param {Object} props.appContext Contains base urls used to query assets, LMV, data etc.
44+
* @param {string} [props.appContext.assetUrlPrefix] The url used to query assets
6245
*
6346
* @memberof Autodesk.DataVisualization.Examples
6447
*/
6548
function Heatmap(props) {
6649
const { env, docUrn } = props.appData;
50+
const ApplicationContext = props.appContext
51+
52+
/**
53+
* @type {SensorStyleDefinitions}
54+
*/
55+
const SensorStyleDefinitions = {
56+
co2: {
57+
url: `${ApplicationContext.assetUrlPrefix}/images/co2.svg`,
58+
color: 0xffffff,
59+
},
60+
temperature: {
61+
url: `${ApplicationContext.assetUrlPrefix}/images/thermometer.svg`,
62+
color: 0xffffff,
63+
},
64+
default: {
65+
url: `${ApplicationContext.assetUrlPrefix}/images/circle.svg`,
66+
color: 0xffffff,
67+
},
68+
};
6769

6870
/**
6971
* Handles `Autodesk.Viewing.GEOMETRY_LOADED_EVENT` event that is sent when a model has been completely loaded in the viewer.
@@ -149,4 +151,4 @@ function Heatmap(props) {
149151
);
150152
}
151153

152-
module.exports = Heatmap;
154+
export default Heatmap;

client/pages/Navisworks.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,4 +126,4 @@ function Navisworks(props) {
126126
);
127127
}
128128

129-
module.exports = Navisworks;
129+
export default Navisworks;

client/pages/ReferenceApp.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ function ReferenceApp(props) {
7979
})
8080

8181
/**
82-
* Called when a user has selected a level in the {@link LevelsTree} or expanded/closed a
82+
* Called when a user has selected a grouping in the {@link HyperionToolContainer} or expanded/closed a
8383
* grouping in {@link DeviceTree}
8484
* @param {Event} event
8585
*/
@@ -108,10 +108,10 @@ function ReferenceApp(props) {
108108
}
109109
}
110110

111-
eventBusRef.current.addEventListener(EventTypes.LEVELS_TREE_MOUSE_CLICK, handleNodeChange);
111+
eventBusRef.current.addEventListener(EventTypes.GROUP_SELECTION_MOUSE_CLICK, handleNodeChange);
112112
eventBusRef.current.addEventListener(EventTypes.DEVICE_TREE_EXPAND_EVENT, handleNodeChange);
113113

114-
eventBusRef.current.addEventListener(EventTypes.LEVELS_TREE_MOUSE_OUT, (event) => {
114+
eventBusRef.current.addEventListener(EventTypes.GROUP_SELECTION_MOUSE_OUT, (event) => {
115115
let floorSelector = levelsExt.floorSelector;
116116

117117
if (floorSelector.floorData) {
@@ -123,7 +123,7 @@ function ReferenceApp(props) {
123123
}
124124
});
125125

126-
eventBusRef.current.addEventListener(EventTypes.LEVELS_TREE_MOUSE_OVER, (event) => {
126+
eventBusRef.current.addEventListener(EventTypes.GROUP_SELECTION_MOUSE_OVER, (event) => {
127127
let floorSelector = levelsExt.floorSelector;
128128
if (floorSelector.floorData) {
129129
let floor = floorSelector.floorData.find((item) => item.name == event.data.id);
@@ -165,4 +165,4 @@ function ReferenceApp(props) {
165165
);
166166
}
167167

168-
module.exports = ReferenceApp;
168+
export default ReferenceApp;

client/pages/StructureInfo.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function StructureInfo(props) {
6868
}
6969

7070
useEffect(() => {
71-
eventBusRef.current.addEventListener(EventTypes.LEVELS_TREE_MOUSE_CLICK, (event) => {
71+
eventBusRef.current.addEventListener(EventTypes.GROUP_SELECTION_MOUSE_CLICK, (event) => {
7272
if (appState.levelsExt) {
7373
let floorSelector = appState.levelsExt.floorSelector;
7474

@@ -108,4 +108,4 @@ function StructureInfo(props) {
108108
);
109109
}
110110

111-
module.exports = StructureInfo;
111+
export default StructureInfo;

0 commit comments

Comments
 (0)