Skip to content
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

Electoral data vis upgrades #206

Merged
merged 36 commits into from
Feb 3, 2025
Merged

Electoral data vis upgrades #206

merged 36 commits into from
Feb 3, 2025

Conversation

janbaykara
Copy link
Member

No description provided.


// Get min and max counts
let minCount = min(dataByBoundary.map((d) => d.count || 0)) || 0
let minCount = 0 // min(dataByBoundary.map((d) => d.count || 0)) || 0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: is this right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think so. We could make it an option to 'go from 0 or go from min' but I think in general, data we're loading is things like population, votes, £, etc — all continuous data which benefits from starting at 0. Otherwise the choropleth becomes hypersensitive to small differences between 95 and 98 or something.

The toggle is probably the most versatile approach.

@@ -203,12 +235,12 @@ const PoliticalChoropleths: React.FC<PoliticalChoroplethsProps> = ({
maxzoom={tileset.maxZoom}
/>

<Layer
{/* <Layer

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: should this be uncommented?

nextjs/src/lib/map/useExplorer.ts Show resolved Hide resolved
// (boundary) => boundary.boundaryType === boundaryType
// )?.tilesets

// const activeTileset = useActiveTileset(boundaryType)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: remove this if not required

@@ -906,7 +1230,7 @@ function BigRecord({
}

const { primary, secondary } = getListValuesBasedOnDataType(item, dataType)
const isActive = explorer.isValidEntity(explorer.state)
// const isActive = explorer.isValidEntity(explorer.state)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: remove this if not required

@@ -699,65 +868,140 @@ function RelatedDataCarousel({ data }: { data: AreaLayerDataQuery['data'] }) {
)
}

// const ELECTION_RESULTS = gql`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: remove this if not required

), # Back to start to close polygon
)
bbox = Polygon(bbox_coords, srid=4326)
# areas = models.Area.objects.filter(**area_type_filter.query_filter).filter(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: should the filter by combined area be removed?

It was there because when "rolling up" data to larger areas, not all of the relevant points are in the map_bounds box.

E.G. If have data at the output_area level, and I'm browsing at the LSOA level, not all the output_areas for the LSOA I'm looking at will be in the bounding box.

@commonknowledge-bot commonknowledge-bot temporarily deployed to electoral-displays - meep-intelligence-hub-frontend PR #206 February 3, 2025 17:09 — with Render Destroyed
@commonknowledge-bot commonknowledge-bot temporarily deployed to electoral-displays - meep-intelligence-hub-backend PR #206 February 3, 2025 17:09 — with Render Destroyed
@commonknowledge-bot commonknowledge-bot temporarily deployed to electoral-displays - meep-intelligence-hub-worker PR #206 February 3, 2025 17:09 — with Render Destroyed
@joaquimds joaquimds merged commit c96f167 into main Feb 3, 2025
4 checks passed
@joaquimds joaquimds deleted the electoral-displays branch February 3, 2025 17:09
Copy link

sentry-io bot commented Feb 3, 2025

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ GraphQLError: "['category'] not in index" /graphql View Issue
  • ‼️ GraphQLError: "Column(s) ['gss'] do not exist" /graphql View Issue
  • ‼️ GraphQLError: kth(=-1) out of bounds (1) /graphql View Issue
  • ‼️ GraphQLError: could not convert string to float: '33.21%' /graphql View Issue
  • ‼️ GraphQLError: could not convert string to float: '33.21%' /graphql View Issue

Did you find this useful? React with a 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants