Skip to content

Commit

Permalink
nih
Browse files Browse the repository at this point in the history
  • Loading branch information
trevlenb2 committed Oct 5, 2023
1 parent f1a92d7 commit 237e131
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
34 changes: 17 additions & 17 deletions src/features/planSimulation/components/Simulation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ const Simulation = () => {
useState<string[]>();
const levelsLoaded = useRef<string[]>([]);
const [showUploadModal, setShowUploadModal] = useState(false);
const [statsMetadata, setStatsMetadata] = useState<Stats>({});
// const [statsMetadata, setStatsMetadata] = useState<Stats>({});

const [statsLayerMetadata, setStatsLayerMetadata] = useState<StatsLayer>({});

Expand Down Expand Up @@ -302,7 +302,7 @@ const Simulation = () => {
setResetMap(true);
setParentMapData(undefined);
setShowResult(false);
setStatsMetadata({});
// setStatsMetadata({});

setMarkedLocations([]);
setMarkedParents(new Set<string>());
Expand Down Expand Up @@ -459,21 +459,21 @@ const Simulation = () => {
setMapDataLoad(mapDataSave);
};

const statsHandler = (message: MessageEvent) => {
const statsIncoming = JSON.parse(message.data);
setStatsMetadata(statsMetadata => {
let newStats: Stats = {};
Object.keys(statsMetadata).forEach(key => {
newStats[key] = statsMetadata[key];
});
Object.keys(statsIncoming).forEach(key => {
if (!newStats[key]) {
newStats[key] = statsIncoming[key];
}
});
return newStats;
});
};
// const statsHandler = (message: MessageEvent) => {
// const statsIncoming = JSON.parse(message.data);
// setStatsMetadata(statsMetadata => {
// let newStats: Stats = {};
// Object.keys(statsMetadata).forEach(key => {
// newStats[key] = statsMetadata[key];
// });
// Object.keys(statsIncoming).forEach(key => {
// if (!newStats[key]) {
// newStats[key] = statsIncoming[key];
// }
// });
// return newStats;
// });
// };

const statsHandlerAfterAnalysis = (message: MessageEvent, analysisLayer: AnalysisLayer) => {
// const statsIncoming = JSON.parse(message.data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
import { ColorPicker, Color, useColor } from 'react-color-palette';
import 'react-color-palette/lib/css/styles.css';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { Children, Stats, StatsLayer } from '../Simulation';
import { Children, StatsLayer } from '../Simulation';
import ActionDialog from '../../../../components/Dialogs/ActionDialog';
import MapboxDraw from '@mapbox/mapbox-gl-draw';
import { AnalysisLayer } from '../Simulation';
Expand Down

0 comments on commit 237e131

Please sign in to comment.