-
-
Notifications
You must be signed in to change notification settings - Fork 0
fix: area stats query on number columns with empty strings #256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -33,6 +33,7 @@ function WrappedAreaPopup({ | |||
| }) { | ||||
| const { viewConfig } = useMapViews(); | ||||
| const choroplethDataSource = useChoroplethDataSource(); | ||||
| const [, setHoverArea] = useHoverArea(); | ||||
|
|
||||
| const areaStatsQuery = useAreaStats(); | ||||
| const areaStats = areaStatsQuery.data; | ||||
|
|
@@ -104,6 +105,7 @@ function WrappedAreaPopup({ | |||
| longitude={coordinates[0]} | ||||
| latitude={coordinates[1]} | ||||
| closeButton={false} | ||||
| onClose={() => setHoverArea(null)} | ||||
|
||||
| onClose={() => setHoverArea(null)} |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -331,6 +331,26 @@ export default function VisualisationPanel({ | |||||||||||||
| </Select> | ||||||||||||||
| </> | ||||||||||||||
| )} | ||||||||||||||
|
|
||||||||||||||
| {viewConfig.calculationType !== CalculationType.Count && | ||||||||||||||
| columnOneIsNumber && ( | ||||||||||||||
|
||||||||||||||
| columnOneIsNumber && ( | |
| columnOneIsNumber && | |
| dataRecordsWillAggregate( | |
| dataSource?.geocodingConfig, | |
| viewConfig.areaSetGroupCode, | |
| ) && ( |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import { MapType } from "@/server/models/MapView"; | ||
| import mapStyles, { hexMapStyle } from "../styles"; | ||
| import type { MapConfig } from "@/server/models/Map"; | ||
| import type { MapViewConfig } from "@/server/models/MapView"; | ||
|
|
||
| export const getDataSourceIds = (mapConfig: MapConfig) => { | ||
| return new Set( | ||
| [mapConfig.membersDataSourceId] | ||
| .concat(mapConfig.markerDataSourceIds) | ||
| .filter(Boolean), | ||
| ) | ||
| .values() | ||
| .toArray(); | ||
| }; | ||
|
|
||
| export const getMapStyle = (viewConfig: MapViewConfig) => { | ||
| if (viewConfig.mapType === MapType.Hex) { | ||
| return hexMapStyle; | ||
| } | ||
| return mapStyles[viewConfig.mapStyleName] || Object.values(mapStyles)[0]; | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change adds a
setHoverAreahandler that wasn't previously imported. While theonClosehandler at line 108 is a reasonable addition, this change appears unrelated to the PR's stated purpose of fixing area stats queries with empty strings. Consider moving this to a separate PR focused on popup behavior improvements.