From c2db235f12bcde97bbd7656f1cf8895f05a4e7a6 Mon Sep 17 00:00:00 2001 From: regeter <2320305+regeter@users.noreply.github.com> Date: Wed, 23 Jul 2025 18:11:07 -0700 Subject: [PATCH 1/2] fix: Remove excessive dataframe logging. --- src/Dataframe.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Dataframe.js b/src/Dataframe.js index ba13c217..710fad47 100644 --- a/src/Dataframe.js +++ b/src/Dataframe.js @@ -153,7 +153,6 @@ function Dataframe({ featuredObject, extraColumns, onColumnToggle, onToggleMarke }, []); const shouldCollapse = useCallback(({ indexOrName, depth }) => { - log(`shouldCollapse called for indexOrName: '${indexOrName}', depth: ${depth}`); if (depth === 1 && typeof indexOrName === "undefined") { return false; } From c9d92501e08c8b9f04103f192ff05b79f10c5192 Mon Sep 17 00:00:00 2001 From: regeter <2320305+regeter@users.noreply.github.com> Date: Wed, 23 Jul 2025 18:24:25 -0700 Subject: [PATCH 2/2] fix: Prevent expensive map effects from running on every render --- src/App.js | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/src/App.js b/src/App.js index 3bebbe79..748b2141 100644 --- a/src/App.js +++ b/src/App.js @@ -61,6 +61,7 @@ class App extends React.Component { selectedRowIndexPerDataset: [-1, -1, -1, -1, -1], currentLogData: this.props.logData, dynamicMarkerLocations: {}, + visibleToggles: getVisibleToggles(this.props.logData.solutionType), }; this.onSliderChangeDebounced = _.debounce((timeRange) => this.onSliderChange(timeRange), 25); this.setFeaturedObject = this.setFeaturedObject.bind(this); @@ -696,20 +697,21 @@ class App extends React.Component { const data = await getUploadedData(index); if (data && data.rawLogs && Array.isArray(data.rawLogs) && data.rawLogs.length > 0) { const tripLogs = new TripLogs(data.rawLogs, data.solutionType); + const newVisibleToggles = getVisibleToggles(data.solutionType); + this.setState( - (prevState) => { - return { - activeDatasetIndex: index, - timeRange: { minTime: tripLogs.minDate.getTime(), maxTime: tripLogs.maxDate.getTime() }, - initialMapBounds: data.bounds, - currentLogData: { - ...prevState.currentLogData, - tripLogs: tripLogs, - solutionType: data.solutionType, - }, - dynamicMarkerLocations: {}, // Clear markers when switching datasets - }; - }, + (prevState) => ({ + activeDatasetIndex: index, + timeRange: { minTime: tripLogs.minDate.getTime(), maxTime: tripLogs.maxDate.getTime() }, + initialMapBounds: data.bounds, + currentLogData: { + ...prevState.currentLogData, + tripLogs: tripLogs, + solutionType: data.solutionType, + }, + visibleToggles: newVisibleToggles, + dynamicMarkerLocations: {}, // Clear markers when switching datasets + }), () => { log(`Switched to dataset ${index}`); log(`New time range: ${tripLogs.minDate} - ${tripLogs.maxDate}`); @@ -768,10 +770,16 @@ class App extends React.Component { } render() { - const { featuredObject, timeRange, currentLogData, toggleOptions, extraColumns, dynamicMarkerLocations } = - this.state; + const { + featuredObject, + timeRange, + currentLogData, + toggleOptions, + extraColumns, + dynamicMarkerLocations, + visibleToggles, + } = this.state; const selectedEventTime = featuredObject?.timestamp ? new Date(featuredObject.timestamp).getTime() : null; - const visibleToggles = getVisibleToggles(currentLogData.solutionType); return (