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

Commit

Permalink
Adding Playground page for adding sensor positions, formatting, depen…
Browse files Browse the repository at this point in the history
…dency updates
  • Loading branch information
harshita-adsk committed Jul 9, 2021
1 parent 7dfb9e5 commit 2bc06f8
Show file tree
Hide file tree
Showing 28 changed files with 670 additions and 318 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ dist/
node_modules/
.DS_Store
.env
package-lock.json
.vscode/*
package-lock.json
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

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/).
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/).

## Directory Structure

Expand Down
3 changes: 2 additions & 1 deletion client/app.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable no-undef */

/**
* Initialize the configurations
*
Expand All @@ -17,7 +19,6 @@ import ReactDOM from "react-dom";
import App from "./pages/App.jsx";
import { BrowserRouter } from "react-router-dom";


ReactDOM.render(
<BrowserRouter>
<App {...{ appData: __app.dataContext, appContext: ApplicationContext }} />
Expand Down
11 changes: 5 additions & 6 deletions client/pages/AnimatedSprites.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ const sensorPositions = {

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

const ductFanStyle = new dataVizExtn.ViewableStyle(
dataVizExtn.ViewableType.SPRITE,
new THREE.Color(styleColor),
fan00
);


fans.forEach((fan) => ductFanStyle.preloadSprite(fan));

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

/**
* Determines a random set of viewable ids that will be animated.
*
*
* @param {SpriteViewable[]} viewables Array of {@link SpriteViewable} in scene.
* @returns {number[]} Subset of viewable ids to animate.
*/
Expand Down Expand Up @@ -239,7 +238,7 @@ function AnimatedSprites(props) {
});
}

const dataVizExtension = viewer.getExtension("Autodesk.DataVisualization")
const dataVizExtension = viewer.getExtension("Autodesk.DataVisualization");

if (levelsExtension) {
levelsExtension.floorSelector.selectFloor(0, true);
Expand Down
8 changes: 6 additions & 2 deletions client/pages/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ import AnimatedSprites from "./AnimatedSprites.jsx";
import StructureInfo from "./StructureInfo.jsx";
import Navisworks from "./Navisworks.jsx";
import CustomPage from "./CustomPage.jsx";
import Playground from "./Playground.jsx";

/**
*
* @param {Object} props
*
* @param {Object} props
* @param {Object} props.appData Data passed to the application.
* @param {("AutodeskStaging"|"AutodeskProduction")} props.appData.env Forge API environment
* @param {string} props.appData.docUrn Document URN of model
Expand Down Expand Up @@ -58,6 +59,9 @@ function App(props) {
<Route path="/app">
<CustomPage {...props} />
</Route>
<Route path="/playground">
<Playground {...props} />
</Route>
<Route path="/">
<ReferenceApp {...props} />
</Route>
Expand Down
6 changes: 1 addition & 5 deletions client/pages/CustomPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ import React from "react";
* An interface file to allow customers to have their custom built application page.
*/
function CustomPage() {

return (
<div id='customPage'>
</div>
);
return <div id="customPage"></div>;
}

export default CustomPage;
Loading

0 comments on commit 2bc06f8

Please sign in to comment.