diff --git a/public/config.json b/public/config.json index 3d0a81e..65d0c7c 100644 --- a/public/config.json +++ b/public/config.json @@ -19,6 +19,26 @@ "range": [0, 1000], "color": ["#FFFFE0", "#FFD700"], "unit": "ppm" + }, + "CH2O": { + "range": [0, 100], + "color": ["#90EE90", "#006400"], + "unit": "ppb" + }, + "PM1": { + "range": [0, 20], + "color": ["#E6E6FA", "#800080"], + "unit": "µg/m³" + }, + "PM2.5": { + "range": [0, 55], + "color": ["#FFB6C1", "#FF0000"], + "unit": "µg/m³" + }, + "PM10": { + "range": [0, 150], + "color": ["#FFDDC1", "#FF1493"], + "unit": "µg/m³" } } } diff --git a/src/hooks/forge/useForgeFloor.js b/src/hooks/forge/useForgeFloor.js index ea9fee4..60cf9f7 100644 --- a/src/hooks/forge/useForgeFloor.js +++ b/src/hooks/forge/useForgeFloor.js @@ -53,7 +53,7 @@ function useForgeFloor() { }); const hideDbIdFn = () => { - const tree = forgeViewer.value.model.getInstanceTree(); + const tree = forgeViewer.value?.model.getInstanceTree(); const allDbIdsStr = Object.keys(tree.nodeAccess.dbIdToIndex); for (var i = 0; i < allDbIdsStr.length; i++) { forgeViewer.value.hide(parseInt(allDbIdsStr[i])); @@ -69,26 +69,29 @@ function useForgeFloor() { }; const showLevels = () => { - const currentFloorName = selectedFloor.value.title.replaceAll(/U/gi, ""); + if (forgeViewer.value) { + const currentFloorName = + selectedFloor.value?.title?.replaceAll(/U/gi, "") || ""; - const level = levelList.value.find(({ name }) => - name.includes(currentFloorName) - ); - console.log(currentFloorName, level); + const level = levelList.value.find(({ name }) => + name.includes(currentFloorName) + ); + console.log(currentFloorName, level); - if (!level) { - forgeViewer.value.impl.toggleGhosting(true); - forgeViewer.value.fitToView([forgeViewer.value.model.getRootId()]); - showDbIdFn(); - } else { - hideDbIdFn(); - // forgeViewer.value.clearSelection(); - // forgeViewer.value.model.setAllVisibility(0); - forgeViewer.value.impl.toggleGhosting(false); - // forgeViewer.value.impl.toggleGroundShadow(false); - forgeViewer.value.show(level.dbId); - forgeViewer.value.impl.invalidate(true); - forgeViewer.value.fitToView([level.dbId]); + if (!level) { + forgeViewer.value?.impl.toggleGhosting(true); + forgeViewer.value?.fitToView([forgeViewer.value.model.getRootId()]); + showDbIdFn(); + } else { + hideDbIdFn(); + // forgeViewer.value.clearSelection(); + // forgeViewer.value.model.setAllVisibility(0); + forgeViewer.value.impl.toggleGhosting(false); + // forgeViewer.value.impl.toggleGroundShadow(false); + forgeViewer.value.show(level.dbId); + forgeViewer.value.impl.invalidate(true); + forgeViewer.value.fitToView([level.dbId]); + } } }; diff --git a/src/hooks/forge/useForgeHeatmap.js b/src/hooks/forge/useForgeHeatmap.js index 1abbfe5..3f9166a 100644 --- a/src/hooks/forge/useForgeHeatmap.js +++ b/src/hooks/forge/useForgeHeatmap.js @@ -131,7 +131,6 @@ export default function useForgeHeatmap() { watch( data, (newValue, oldValue) => { - debugger; dataVizExtn.value?.removeSurfaceShading(); createHeatMap(route.query.gas); },