diff --git a/.gitignore b/.gitignore index 9c53e9a..7aef359 100644 --- a/.gitignore +++ b/.gitignore @@ -35,4 +35,7 @@ yarn-error.log* *.tsbuildinfo next-env.d.ts .env -/proposal \ No newline at end of file +/proposal + +# git worktrees +.worktrees/ \ No newline at end of file diff --git a/app/components/widgets/MapStory.tsx b/app/components/widgets/MapStory.tsx index f2de6c9..1a8d729 100644 --- a/app/components/widgets/MapStory.tsx +++ b/app/components/widgets/MapStory.tsx @@ -564,19 +564,6 @@ export default function MapStory() { setViewState(newViewState); }; - /** - * Applies constraints to the view state, preventing panning outside defined bounds - * and zooming out too much. - */ - const applyViewStateConstraints = useCallback((viewState: ViewState): ViewState => { - return { - ...viewState, - longitude: Math.min(MAP_BOUNDS[1][0], Math.max(MAP_BOUNDS[0][0], viewState.longitude)), - latitude: Math.min(MAP_BOUNDS[1][1], Math.max(MAP_BOUNDS[0][1], viewState.latitude)), - zoom: Math.max(MIN_ZOOM, viewState.zoom), - }; - }, []); // No dependencies as MAP_BOUNDS and MIN_ZOOM are constant - // Determine the available metrics based on the currently selected data source. const availableMetrics = DataSourceMetrics[selectedDataSource] || []; diff --git a/app/components/workers/dataProcessor.worker.ts b/app/components/workers/dataProcessor.worker.ts index d4db806..0fef2c3 100644 --- a/app/components/workers/dataProcessor.worker.ts +++ b/app/components/workers/dataProcessor.worker.ts @@ -192,7 +192,7 @@ self.onmessage = (event: MessageEvent) => { console.log('[Worker] Message received from main thread:', event.data); // Optional logging const { geojsonFeatures, filteredData, selectedMetric, dataSource, isPerCapita, populationData } = event.data; - if (!geojsonFeatures || !filteredData || !selectedMetric || !dataSource === undefined) { // Check dataSource presence + if (!geojsonFeatures || !filteredData || !selectedMetric || dataSource === undefined) { // Check dataSource presence console.error('[Worker] Invalid data received.'); self.postMessage({ error: 'Invalid data received by worker' }); // Send error back return; diff --git a/lib/features/filters/filterSlice.ts b/lib/features/filters/filterSlice.ts index ccc3159..6b8f9d3 100644 --- a/lib/features/filters/filterSlice.ts +++ b/lib/features/filters/filterSlice.ts @@ -57,7 +57,6 @@ export interface FilterState { yearRange: [number, number]; selectedMetric: string; // Use string for flexibility rankedCounties: { name: string; value: number; rank: number }[]; - selectedCounty: string; selectedDataSource: DataSourceType; // Add selected data source isPerCapita: boolean; // Add per capita toggle state selectedCounties: string[]; // Add selected counties for filtering @@ -126,7 +125,6 @@ const initialState: FilterState = { yearRange: [2017, 2023], // Default range, will be updated selectedMetric: DataSourceMetrics['arrest'][0], // Default metric for 'arrest' source rankedCounties: [], - selectedCounty: '', selectedDataSource: 'arrest', // Default to the arrest source isPerCapita: true, // Default to true selectedCounties: [], // Initialize selected counties as empty array @@ -394,9 +392,6 @@ export const filterSlice = createSlice({ setRankedCounties: (state, action: PayloadAction<{ name: string; value: number; rank: number }[]>) => { state.rankedCounties = action.payload; }, - setSelectedCounty: (state, action: PayloadAction) => { - state.selectedCounty = action.payload; - }, setCsvData: (state, action: PayloadAction) => { // Store data in the current selected source slot state.csvDataSources[state.selectedDataSource] = action.payload; @@ -498,7 +493,6 @@ export const filterSlice = createSlice({ // Reset UI state for new source state.rankedCounties = []; - state.selectedCounty = ''; // Update year range if we have data for this source if (newSourceData.length > 0) { @@ -586,7 +580,6 @@ export const filterSlice = createSlice({ export const { setRankedCounties, - setSelectedCounty, setCsvData, toggleFilter, setYear,