diff --git a/hub/graphql/types/model_types.py b/hub/graphql/types/model_types.py index d4aca6a3f..49b610fb6 100644 --- a/hub/graphql/types/model_types.py +++ b/hub/graphql/types/model_types.py @@ -259,13 +259,13 @@ def webhook_healthcheck(self: models.ExternalDataSource, info) -> bool: return self.webhook_healthcheck() @strawberry_django.field - def geojson_point_features( + def imported_data_geojson_points( self: models.ExternalDataSource, info: Info ) -> List[PointFeature]: data = self.get_import_data() return [ PointFeature.from_geodjango( - point=generic_datum, + point=generic_datum.point, id=generic_datum.data, properties=generic_datum.json, ) diff --git a/hub/management/commands/import_regions.py b/hub/management/commands/import_regions.py index a50556980..6fe00c1b9 100644 --- a/hub/management/commands/import_regions.py +++ b/hub/management/commands/import_regions.py @@ -9,7 +9,6 @@ from utils import mapit import requests - class Command(BaseCommand): help = "Import historical European regions for high-level aggregation" @@ -46,6 +45,7 @@ def handle(self, quiet: bool = False, *args, **options): geom = GEOSGeometry(json.dumps(area['geometry'])) if isinstance(geom, Polygon): geom = MultiPolygon([geom]) + geom.srid = 27700 a.geometry = geom_str a.polygon = geom a.point = a.polygon.centroid diff --git a/hub/management/commands/import_wards.py b/hub/management/commands/import_wards.py index c4881cc34..af0be1c69 100644 --- a/hub/management/commands/import_wards.py +++ b/hub/management/commands/import_wards.py @@ -46,6 +46,7 @@ def handle(self, quiet: bool = False, *args, **options): geom = GEOSGeometry(json.dumps(area['geometry'])) if isinstance(geom, Polygon): geom = MultiPolygon([geom]) + geom.srid = 27700 a.geometry = geom_str a.polygon = geom a.point = a.polygon.centroid diff --git a/hub/models.py b/hub/models.py index cc1132d6f..836343ff1 100644 --- a/hub/models.py +++ b/hub/models.py @@ -658,8 +658,8 @@ class Meta: class GenericData(CommonData): - point = PointField(blank=True, null=True) - polygon = MultiPolygonField(blank=True, null=True) + point = PointField(srid=4326, blank=True, null=True) + polygon = MultiPolygonField(srid=4326, blank=True, null=True) postcode_data = JSONField(blank=True, null=True) def get_postcode_data(self) -> Optional[PostcodesIOResult]: @@ -675,8 +675,8 @@ class Area(models.Model): name = models.CharField(max_length=200) area_type = models.ForeignKey(AreaType, on_delete=models.CASCADE) geometry = models.TextField(blank=True, null=True) - polygon = MultiPolygonField(blank=True, null=True) - point = PointField(blank=True, null=True) + polygon = MultiPolygonField(srid=4326, blank=True, null=True) + point = PointField(srid=4326, blank=True, null=True) overlaps = models.ManyToManyField("self", through="AreaOverlap") def __str__(self): diff --git a/nextjs/package-lock.json b/nextjs/package-lock.json index c30134c5b..9ced3c25f 100644 --- a/nextjs/package-lock.json +++ b/nextjs/package-lock.json @@ -39,6 +39,7 @@ "date-fns": "^3.5.0", "graphiql": "^3.1.1", "graphql": "^16.8.1", + "jotai": "^2.7.1", "lucide-react": "^0.344.0", "mapbox-gl": "^3.2.0", "next": "14.1.0", @@ -10299,6 +10300,26 @@ "url": "https://github.com/sponsors/panva" } }, + "node_modules/jotai": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/jotai/-/jotai-2.7.1.tgz", + "integrity": "sha512-bsaTPn02nFgWNP6cBtg/htZhCu4s0wxqoklRHePp6l/vlsypR9eLn7diRliwXYWMXDpPvW/LLA2afI8vwgFFaw==", + "engines": { + "node": ">=12.20.0" + }, + "peerDependencies": { + "@types/react": ">=17.0.0", + "react": ">=17.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "react": { + "optional": true + } + } + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", diff --git a/nextjs/package.json b/nextjs/package.json index 781f17138..1db80d118 100644 --- a/nextjs/package.json +++ b/nextjs/package.json @@ -43,6 +43,7 @@ "date-fns": "^3.5.0", "graphiql": "^3.1.1", "graphql": "^16.8.1", + "jotai": "^2.7.1", "lucide-react": "^0.344.0", "mapbox-gl": "^3.2.0", "next": "14.1.0", diff --git a/nextjs/public/markers/default.png b/nextjs/public/markers/default.png new file mode 100644 index 000000000..aab73ef72 Binary files /dev/null and b/nextjs/public/markers/default.png differ diff --git a/nextjs/public/markers/default.svg b/nextjs/public/markers/default.svg new file mode 100644 index 000000000..1fd56709e --- /dev/null +++ b/nextjs/public/markers/default.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/nextjs/public/markers/selected.png b/nextjs/public/markers/selected.png new file mode 100644 index 000000000..e52e76f31 Binary files /dev/null and b/nextjs/public/markers/selected.png differ diff --git a/nextjs/public/markers/selected.svg b/nextjs/public/markers/selected.svg new file mode 100644 index 000000000..98636c4bc --- /dev/null +++ b/nextjs/public/markers/selected.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/nextjs/src/__generated__/gql.ts b/nextjs/src/__generated__/gql.ts index 54095185a..fb1d977fa 100644 --- a/nextjs/src/__generated__/gql.ts +++ b/nextjs/src/__generated__/gql.ts @@ -43,9 +43,9 @@ const documents = { "\n fragment ExternalDataSourceCardFields on ExternalDataSource {\n id\n name\n connectionDetails {\n crmType: __typename\n }\n }\n": types.ExternalDataSourceCardFieldsFragmentDoc, "\n query ExternalDataSourceCard($ID: ID!) {\n externalDataSource(pk: $ID) {\n ...ExternalDataSourceCardFields\n }\n }\n \n": types.ExternalDataSourceCardDocument, "\n query EnrichmentLayers {\n externalDataSources {\n id\n name\n geographyColumn\n geographyColumnType\n dataType\n connectionDetails {\n __typename\n }\n fieldDefinitions {\n label\n value\n description\n }\n }\n }\n": types.EnrichmentLayersDocument, - "\n fragment MapReportLayersSummary on MapReport {\n importedDataCountByRegion {\n label\n areaId\n count\n }\n importedDataCountByConstituency {\n label\n areaId\n count\n }\n importedDataCountByWard {\n label\n areaId\n count\n }\n layers {\n name\n source {\n id\n name\n isImporting\n importedDataCount\n importedDataCountByRegion {\n label\n areaId\n count\n }\n importedDataCountByConstituency {\n label\n areaId\n count\n }\n importedDataCountByWard {\n label\n areaId\n count\n }\n }\n }\n }\n": types.MapReportLayersSummaryFragmentDoc, + "\n fragment MapReportLayersSummary on MapReport {\n importedDataCountByRegion {\n label\n areaId\n count\n gssArea {\n point {\n id\n type\n geometry {\n type\n coordinates\n }\n }\n }\n }\n importedDataCountByConstituency {\n label\n areaId\n count\n gssArea {\n point {\n id\n type\n geometry {\n type\n coordinates\n }\n }\n }\n }\n importedDataCountByWard {\n label\n areaId\n count\n gssArea {\n point {\n id\n type\n geometry {\n type\n coordinates\n }\n }\n }\n }\n layers {\n name\n source {\n id\n name\n isImporting\n importedDataCount\n importedDataCountByRegion {\n label\n areaId\n count\n }\n importedDataCountByConstituency {\n label\n areaId\n count\n }\n importedDataCountByWard {\n label\n areaId\n count\n }\n }\n }\n }\n": types.MapReportLayersSummaryFragmentDoc, "\n query GetMemberList {\n externalDataSources(filters: { dataType: MEMBER }) {\n id\n name\n importedDataCount\n }\n }\n": types.GetMemberListDocument, - "\n query GetSourceGeoJSON($externalDataSourceId: ID!) {\n externalDataSource(pk: $externalDataSourceId) {\n geojsonPointFeatures {\n id\n type\n geometry {\n type\n coordinates\n }\n }\n }\n }\n": types.GetSourceGeoJsonDocument, + "\n query GetSourceGeoJSON($externalDataSourceId: ID!) {\n externalDataSource(pk: $externalDataSourceId) {\n importedDataGeojsonPoints {\n id\n type\n geometry {\n type\n coordinates\n }\n }\n }\n }\n": types.GetSourceGeoJsonDocument, "\n mutation UpdateExternalDataSource($input: ExternalDataSourceInput!) {\n updateExternalDataSource(data: $input) {\n id\n name\n geographyColumn\n geographyColumnType\n autoUpdateEnabled\n updateMapping {\n source\n sourcePath\n destinationColumn\n }\n }\n }\n": types.UpdateExternalDataSourceDocument, "\n query PublicUser {\n publicUser {\n id\n username\n email\n }\n }\n": types.PublicUserDocument, }; @@ -187,7 +187,7 @@ export function gql(source: "\n query EnrichmentLayers {\n externalDataSourc /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function gql(source: "\n fragment MapReportLayersSummary on MapReport {\n importedDataCountByRegion {\n label\n areaId\n count\n }\n importedDataCountByConstituency {\n label\n areaId\n count\n }\n importedDataCountByWard {\n label\n areaId\n count\n }\n layers {\n name\n source {\n id\n name\n isImporting\n importedDataCount\n importedDataCountByRegion {\n label\n areaId\n count\n }\n importedDataCountByConstituency {\n label\n areaId\n count\n }\n importedDataCountByWard {\n label\n areaId\n count\n }\n }\n }\n }\n"): (typeof documents)["\n fragment MapReportLayersSummary on MapReport {\n importedDataCountByRegion {\n label\n areaId\n count\n }\n importedDataCountByConstituency {\n label\n areaId\n count\n }\n importedDataCountByWard {\n label\n areaId\n count\n }\n layers {\n name\n source {\n id\n name\n isImporting\n importedDataCount\n importedDataCountByRegion {\n label\n areaId\n count\n }\n importedDataCountByConstituency {\n label\n areaId\n count\n }\n importedDataCountByWard {\n label\n areaId\n count\n }\n }\n }\n }\n"]; +export function gql(source: "\n fragment MapReportLayersSummary on MapReport {\n importedDataCountByRegion {\n label\n areaId\n count\n gssArea {\n point {\n id\n type\n geometry {\n type\n coordinates\n }\n }\n }\n }\n importedDataCountByConstituency {\n label\n areaId\n count\n gssArea {\n point {\n id\n type\n geometry {\n type\n coordinates\n }\n }\n }\n }\n importedDataCountByWard {\n label\n areaId\n count\n gssArea {\n point {\n id\n type\n geometry {\n type\n coordinates\n }\n }\n }\n }\n layers {\n name\n source {\n id\n name\n isImporting\n importedDataCount\n importedDataCountByRegion {\n label\n areaId\n count\n }\n importedDataCountByConstituency {\n label\n areaId\n count\n }\n importedDataCountByWard {\n label\n areaId\n count\n }\n }\n }\n }\n"): (typeof documents)["\n fragment MapReportLayersSummary on MapReport {\n importedDataCountByRegion {\n label\n areaId\n count\n gssArea {\n point {\n id\n type\n geometry {\n type\n coordinates\n }\n }\n }\n }\n importedDataCountByConstituency {\n label\n areaId\n count\n gssArea {\n point {\n id\n type\n geometry {\n type\n coordinates\n }\n }\n }\n }\n importedDataCountByWard {\n label\n areaId\n count\n gssArea {\n point {\n id\n type\n geometry {\n type\n coordinates\n }\n }\n }\n }\n layers {\n name\n source {\n id\n name\n isImporting\n importedDataCount\n importedDataCountByRegion {\n label\n areaId\n count\n }\n importedDataCountByConstituency {\n label\n areaId\n count\n }\n importedDataCountByWard {\n label\n areaId\n count\n }\n }\n }\n }\n"]; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ @@ -195,7 +195,7 @@ export function gql(source: "\n query GetMemberList {\n externalDataSources( /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function gql(source: "\n query GetSourceGeoJSON($externalDataSourceId: ID!) {\n externalDataSource(pk: $externalDataSourceId) {\n geojsonPointFeatures {\n id\n type\n geometry {\n type\n coordinates\n }\n }\n }\n }\n"): (typeof documents)["\n query GetSourceGeoJSON($externalDataSourceId: ID!) {\n externalDataSource(pk: $externalDataSourceId) {\n geojsonPointFeatures {\n id\n type\n geometry {\n type\n coordinates\n }\n }\n }\n }\n"]; +export function gql(source: "\n query GetSourceGeoJSON($externalDataSourceId: ID!) {\n externalDataSource(pk: $externalDataSourceId) {\n importedDataGeojsonPoints {\n id\n type\n geometry {\n type\n coordinates\n }\n }\n }\n }\n"): (typeof documents)["\n query GetSourceGeoJSON($externalDataSourceId: ID!) {\n externalDataSource(pk: $externalDataSourceId) {\n importedDataGeojsonPoints {\n id\n type\n geometry {\n type\n coordinates\n }\n }\n }\n }\n"]; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ diff --git a/nextjs/src/__generated__/graphql.ts b/nextjs/src/__generated__/graphql.ts index a81e46de0..427da5f5a 100644 --- a/nextjs/src/__generated__/graphql.ts +++ b/nextjs/src/__generated__/graphql.ts @@ -65,7 +65,6 @@ export type AirtableSource = { fieldDefinitions?: Maybe>; geographyColumn?: Maybe; geographyColumnType: PostcodesIoGeographyTypes; - geojsonPointFeatures: Array; healthcheck: Scalars['Boolean']['output']; id: Scalars['UUID']['output']; importedDataCount: Scalars['Int']['output']; @@ -74,6 +73,7 @@ export type AirtableSource = { importedDataCountByCouncil: Array; importedDataCountByRegion: Array; importedDataCountByWard: Array; + importedDataGeojsonPoints: Array; isImporting: Scalars['Boolean']['output']; jobs: Array; lastUpdate: Scalars['DateTime']['output']; @@ -104,6 +104,31 @@ export type AirtableSourceInput = { updateMapping?: InputMaybe>; }; +/** Area(id, mapit_id, gss, name, area_type, geometry, polygon, point) */ +export type Area = { + __typename?: 'Area'; + areaType: DjangoModelType; + geometry?: Maybe; + gss: Scalars['String']['output']; + mapitId: Scalars['String']['output']; + name: Scalars['String']['output']; + overlaps: Array; + point?: Maybe; + polygon?: Maybe; +}; + + +/** Area(id, mapit_id, gss, name, area_type, geometry, polygon, point) */ +export type AreaPointArgs = { + withParentData?: Scalars['Boolean']['input']; +}; + + +/** Area(id, mapit_id, gss, name, area_type, geometry, polygon, point) */ +export type AreaPolygonArgs = { + withParentData?: Scalars['Boolean']['input']; +}; + export type AutoUpdateConfig = { __typename?: 'AutoUpdateConfig'; destinationColumn: Scalars['String']['output']; @@ -167,7 +192,6 @@ export type ExternalDataSource = { fieldDefinitions?: Maybe>; geographyColumn?: Maybe; geographyColumnType: PostcodesIoGeographyTypes; - geojsonPointFeatures: Array; healthcheck: Scalars['Boolean']['output']; id: Scalars['UUID']['output']; importedDataCount: Scalars['Int']['output']; @@ -176,6 +200,7 @@ export type ExternalDataSource = { importedDataCountByCouncil: Array; importedDataCountByRegion: Array; importedDataCountByWard: Array; + importedDataGeojsonPoints: Array; isImporting: Scalars['Boolean']['output']; jobs: Array; lastUpdate: Scalars['DateTime']['output']; @@ -219,9 +244,8 @@ export type ExternalDataSourceInput = { }; export type Feature = { - geometry: PointGeometryPolygonGeometryMultiPolygonGeometry; id?: Maybe; - properties: Scalars['JSON']['output']; + properties?: Maybe; type: GeoJsonTypes; }; @@ -240,14 +264,11 @@ export enum GeoJsonTypes { Polygon = 'Polygon' } -export type Geometry = { - type: GeoJsonTypes; -}; - export type GroupedDataCount = { __typename?: 'GroupedDataCount'; areaId?: Maybe; count: Scalars['Int']['output']; + gssArea?: Maybe; label?: Maybe; }; @@ -348,7 +369,15 @@ export type Membership = { user: User; }; -export type MultiPolygonGeometry = Geometry & { +export type MultiPolygonFeature = Feature & { + __typename?: 'MultiPolygonFeature'; + geometry: MultiPolygonGeometry; + id?: Maybe; + properties?: Maybe; + type: GeoJsonTypes; +}; + +export type MultiPolygonGeometry = { __typename?: 'MultiPolygonGeometry'; coordinates: Array>>>; type: GeoJsonTypes; @@ -613,24 +642,16 @@ export type PointFeature = Feature & { __typename?: 'PointFeature'; geometry: PointGeometry; id?: Maybe; - properties: Scalars['JSON']['output']; + properties?: Maybe; type: GeoJsonTypes; }; -export type PointGeometry = Geometry & { +export type PointGeometry = { __typename?: 'PointGeometry'; coordinates: Array; type: GeoJsonTypes; }; -export type PointGeometryPolygonGeometryMultiPolygonGeometry = MultiPolygonGeometry | PointGeometry | PolygonGeometry; - -export type PolygonGeometry = Geometry & { - __typename?: 'PolygonGeometry'; - coordinates: Array>>; - type: GeoJsonTypes; -}; - export enum PostcodesIoGeographyTypes { Constituency = 'CONSTITUENCY', Constituency_2025 = 'CONSTITUENCY_2025', @@ -1080,7 +1101,7 @@ export type EnrichmentLayersQueryVariables = Exact<{ [key: string]: never; }>; export type EnrichmentLayersQuery = { __typename?: 'Query', externalDataSources: Array<{ __typename?: 'ExternalDataSource', id: any, name: string, geographyColumn?: string | null, geographyColumnType: PostcodesIoGeographyTypes, dataType: DataSourceType, connectionDetails: { __typename: 'AirtableSource' }, fieldDefinitions?: Array<{ __typename?: 'FieldDefinition', label?: string | null, value: string, description?: string | null }> | null }> }; -export type MapReportLayersSummaryFragment = { __typename?: 'MapReport', importedDataCountByRegion: Array<{ __typename?: 'GroupedDataCount', label?: string | null, areaId?: string | null, count: number }>, importedDataCountByConstituency: Array<{ __typename?: 'GroupedDataCount', label?: string | null, areaId?: string | null, count: number }>, importedDataCountByWard: Array<{ __typename?: 'GroupedDataCount', label?: string | null, areaId?: string | null, count: number }>, layers?: Array<{ __typename?: 'MapLayer', name: string, source: { __typename?: 'ExternalDataSource', id: any, name: string, isImporting: boolean, importedDataCount: number, importedDataCountByRegion: Array<{ __typename?: 'GroupedDataCount', label?: string | null, areaId?: string | null, count: number }>, importedDataCountByConstituency: Array<{ __typename?: 'GroupedDataCount', label?: string | null, areaId?: string | null, count: number }>, importedDataCountByWard: Array<{ __typename?: 'GroupedDataCount', label?: string | null, areaId?: string | null, count: number }> } }> | null } & { ' $fragmentName'?: 'MapReportLayersSummaryFragment' }; +export type MapReportLayersSummaryFragment = { __typename?: 'MapReport', importedDataCountByRegion: Array<{ __typename?: 'GroupedDataCount', label?: string | null, areaId?: string | null, count: number, gssArea?: { __typename?: 'Area', point?: { __typename?: 'PointFeature', id?: string | null, type: GeoJsonTypes, geometry: { __typename?: 'PointGeometry', type: GeoJsonTypes, coordinates: Array } } | null } | null }>, importedDataCountByConstituency: Array<{ __typename?: 'GroupedDataCount', label?: string | null, areaId?: string | null, count: number, gssArea?: { __typename?: 'Area', point?: { __typename?: 'PointFeature', id?: string | null, type: GeoJsonTypes, geometry: { __typename?: 'PointGeometry', type: GeoJsonTypes, coordinates: Array } } | null } | null }>, importedDataCountByWard: Array<{ __typename?: 'GroupedDataCount', label?: string | null, areaId?: string | null, count: number, gssArea?: { __typename?: 'Area', point?: { __typename?: 'PointFeature', id?: string | null, type: GeoJsonTypes, geometry: { __typename?: 'PointGeometry', type: GeoJsonTypes, coordinates: Array } } | null } | null }>, layers?: Array<{ __typename?: 'MapLayer', name: string, source: { __typename?: 'ExternalDataSource', id: any, name: string, isImporting: boolean, importedDataCount: number, importedDataCountByRegion: Array<{ __typename?: 'GroupedDataCount', label?: string | null, areaId?: string | null, count: number }>, importedDataCountByConstituency: Array<{ __typename?: 'GroupedDataCount', label?: string | null, areaId?: string | null, count: number }>, importedDataCountByWard: Array<{ __typename?: 'GroupedDataCount', label?: string | null, areaId?: string | null, count: number }> } }> | null } & { ' $fragmentName'?: 'MapReportLayersSummaryFragment' }; export type GetMemberListQueryVariables = Exact<{ [key: string]: never; }>; @@ -1092,7 +1113,7 @@ export type GetSourceGeoJsonQueryVariables = Exact<{ }>; -export type GetSourceGeoJsonQuery = { __typename?: 'Query', externalDataSource: { __typename?: 'ExternalDataSource', geojsonPointFeatures: Array<{ __typename?: 'PointFeature', id?: string | null, type: GeoJsonTypes, geometry: { __typename?: 'PointGeometry', type: GeoJsonTypes, coordinates: Array } }> } }; +export type GetSourceGeoJsonQuery = { __typename?: 'Query', externalDataSource: { __typename?: 'ExternalDataSource', importedDataGeojsonPoints: Array<{ __typename?: 'PointFeature', id?: string | null, type: GeoJsonTypes, geometry: { __typename?: 'PointGeometry', type: GeoJsonTypes, coordinates: Array } }> } }; export type UpdateExternalDataSourceMutationVariables = Exact<{ input: ExternalDataSourceInput; @@ -1106,8 +1127,8 @@ export type PublicUserQueryVariables = Exact<{ [key: string]: never; }>; export type PublicUserQuery = { __typename?: 'Query', publicUser?: { __typename?: 'UserType', id: string, username: string, email: string } | null }; -export const MapReportLayersSummaryFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"MapReportLayersSummary"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MapReport"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByRegion"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}}]}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByConstituency"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}}]}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByWard"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}}]}},{"kind":"Field","name":{"kind":"Name","value":"layers"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"source"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"isImporting"}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCount"}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByRegion"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}}]}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByConstituency"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}}]}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByWard"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}}]}}]}}]}}]}}]} as unknown as DocumentNode; -export const MapReportPageFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"MapReportPage"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MapReport"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"MapReportLayersSummary"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"MapReportLayersSummary"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MapReport"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByRegion"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}}]}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByConstituency"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}}]}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByWard"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}}]}},{"kind":"Field","name":{"kind":"Name","value":"layers"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"source"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"isImporting"}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCount"}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByRegion"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}}]}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByConstituency"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}}]}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByWard"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}}]}}]}}]}}]}}]} as unknown as DocumentNode; +export const MapReportLayersSummaryFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"MapReportLayersSummary"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MapReport"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByRegion"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}},{"kind":"Field","name":{"kind":"Name","value":"gssArea"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"point"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"geometry"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"coordinates"}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByConstituency"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}},{"kind":"Field","name":{"kind":"Name","value":"gssArea"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"point"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"geometry"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"coordinates"}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByWard"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}},{"kind":"Field","name":{"kind":"Name","value":"gssArea"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"point"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"geometry"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"coordinates"}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"layers"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"source"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"isImporting"}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCount"}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByRegion"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}}]}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByConstituency"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}}]}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByWard"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}}]}}]}}]}}]}}]} as unknown as DocumentNode; +export const MapReportPageFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"MapReportPage"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MapReport"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"MapReportLayersSummary"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"MapReportLayersSummary"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MapReport"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByRegion"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}},{"kind":"Field","name":{"kind":"Name","value":"gssArea"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"point"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"geometry"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"coordinates"}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByConstituency"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}},{"kind":"Field","name":{"kind":"Name","value":"gssArea"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"point"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"geometry"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"coordinates"}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByWard"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}},{"kind":"Field","name":{"kind":"Name","value":"gssArea"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"point"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"geometry"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"coordinates"}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"layers"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"source"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"isImporting"}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCount"}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByRegion"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}}]}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByConstituency"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}}]}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByWard"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}}]}}]}}]}}]}}]} as unknown as DocumentNode; export const DataSourceCardFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"DataSourceCard"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ExternalDataSource"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"}},{"kind":"Field","name":{"kind":"Name","value":"connectionDetails"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"crmType"},"name":{"kind":"Name","value":"__typename"}}]}},{"kind":"Field","name":{"kind":"Name","value":"autoUpdateEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"updateMapping"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"source"}},{"kind":"Field","name":{"kind":"Name","value":"sourcePath"}},{"kind":"Field","name":{"kind":"Name","value":"destinationColumn"}}]}},{"kind":"Field","name":{"kind":"Name","value":"jobs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"lastEventAt"}},{"kind":"Field","name":{"kind":"Name","value":"status"}}]}}]}}]} as unknown as DocumentNode; export const ExternalDataSourceCardFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ExternalDataSourceCardFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ExternalDataSource"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"connectionDetails"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"crmType"},"name":{"kind":"Name","value":"__typename"}}]}}]}}]} as unknown as DocumentNode; export const ListExternalDataSourcesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ListExternalDataSources"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"externalDataSources"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"}},{"kind":"Field","name":{"kind":"Name","value":"connectionDetails"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"crmType"},"name":{"kind":"Name","value":"__typename"}}]}},{"kind":"Field","name":{"kind":"Name","value":"autoUpdateEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"jobs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"lastEventAt"}},{"kind":"Field","name":{"kind":"Name","value":"status"}}]}},{"kind":"Field","name":{"kind":"Name","value":"updateMapping"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"source"}},{"kind":"Field","name":{"kind":"Name","value":"sourcePath"}},{"kind":"Field","name":{"kind":"Name","value":"destinationColumn"}}]}}]}}]}}]} as unknown as DocumentNode; @@ -1127,8 +1148,8 @@ export const ExampleDocument = {"kind":"Document","definitions":[{"kind":"Operat export const LoginDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"Login"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"username"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"password"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"tokenAuth"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"username"},"value":{"kind":"Variable","name":{"kind":"Name","value":"username"}}},{"kind":"Argument","name":{"kind":"Name","value":"password"},"value":{"kind":"Variable","name":{"kind":"Name","value":"password"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"errors"}},{"kind":"Field","name":{"kind":"Name","value":"success"}},{"kind":"Field","name":{"kind":"Name","value":"token"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"token"}},{"kind":"Field","name":{"kind":"Name","value":"payload"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"exp"}}]}}]}}]}}]}}]} as unknown as DocumentNode; export const RegisterDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"Register"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"email"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"password1"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"password2"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"username"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"register"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"email"},"value":{"kind":"Variable","name":{"kind":"Name","value":"email"}}},{"kind":"Argument","name":{"kind":"Name","value":"password1"},"value":{"kind":"Variable","name":{"kind":"Name","value":"password1"}}},{"kind":"Argument","name":{"kind":"Name","value":"password2"},"value":{"kind":"Variable","name":{"kind":"Name","value":"password2"}}},{"kind":"Argument","name":{"kind":"Name","value":"username"},"value":{"kind":"Variable","name":{"kind":"Name","value":"username"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"errors"}},{"kind":"Field","name":{"kind":"Name","value":"success"}}]}}]}}]} as unknown as DocumentNode; export const GetMapReportNameDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetMapReportName"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"mapReport"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"pk"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]} as unknown as DocumentNode; -export const GetMapReportDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetMapReport"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"mapReport"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"pk"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"MapReportPage"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"MapReportLayersSummary"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MapReport"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByRegion"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}}]}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByConstituency"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}}]}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByWard"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}}]}},{"kind":"Field","name":{"kind":"Name","value":"layers"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"source"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"isImporting"}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCount"}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByRegion"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}}]}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByConstituency"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}}]}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByWard"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"MapReportPage"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MapReport"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"MapReportLayersSummary"}}]}}]} as unknown as DocumentNode; -export const UpdateMapReportDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateMapReport"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"MapReportInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateMapReport"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"data"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MapReportPage"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"MapReportLayersSummary"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MapReport"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByRegion"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}}]}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByConstituency"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}}]}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByWard"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}}]}},{"kind":"Field","name":{"kind":"Name","value":"layers"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"source"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"isImporting"}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCount"}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByRegion"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}}]}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByConstituency"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}}]}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByWard"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"MapReportPage"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MapReport"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"MapReportLayersSummary"}}]}}]} as unknown as DocumentNode; +export const GetMapReportDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetMapReport"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"mapReport"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"pk"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"MapReportPage"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"MapReportLayersSummary"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MapReport"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByRegion"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}},{"kind":"Field","name":{"kind":"Name","value":"gssArea"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"point"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"geometry"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"coordinates"}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByConstituency"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}},{"kind":"Field","name":{"kind":"Name","value":"gssArea"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"point"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"geometry"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"coordinates"}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByWard"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}},{"kind":"Field","name":{"kind":"Name","value":"gssArea"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"point"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"geometry"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"coordinates"}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"layers"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"source"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"isImporting"}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCount"}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByRegion"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}}]}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByConstituency"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}}]}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByWard"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"MapReportPage"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MapReport"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"MapReportLayersSummary"}}]}}]} as unknown as DocumentNode; +export const UpdateMapReportDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateMapReport"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"MapReportInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateMapReport"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"data"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MapReportPage"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"MapReportLayersSummary"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MapReport"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByRegion"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}},{"kind":"Field","name":{"kind":"Name","value":"gssArea"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"point"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"geometry"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"coordinates"}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByConstituency"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}},{"kind":"Field","name":{"kind":"Name","value":"gssArea"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"point"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"geometry"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"coordinates"}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByWard"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}},{"kind":"Field","name":{"kind":"Name","value":"gssArea"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"point"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"geometry"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"coordinates"}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"layers"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"source"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"isImporting"}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCount"}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByRegion"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}}]}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByConstituency"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}}]}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCountByWard"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"areaId"}},{"kind":"Field","name":{"kind":"Name","value":"count"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"MapReportPage"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MapReport"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"MapReportLayersSummary"}}]}}]} as unknown as DocumentNode; export const DeleteMapReportDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteMapReport"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"IDObject"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deleteMapReport"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"data"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]} as unknown as DocumentNode; export const AutoUpdateWebhookRefreshDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"AutoUpdateWebhookRefresh"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"ID"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"refreshWebhooks"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"externalDataSourceId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"ID"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"webhookHealthcheck"}}]}}]}}]} as unknown as DocumentNode; export const ExternalDataSourceAutoUpdateCardDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ExternalDataSourceAutoUpdateCard"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"ID"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"externalDataSource"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"pk"},"value":{"kind":"Variable","name":{"kind":"Name","value":"ID"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"DataSourceCard"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"DataSourceCard"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ExternalDataSource"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"}},{"kind":"Field","name":{"kind":"Name","value":"connectionDetails"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"crmType"},"name":{"kind":"Name","value":"__typename"}}]}},{"kind":"Field","name":{"kind":"Name","value":"autoUpdateEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"updateMapping"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"source"}},{"kind":"Field","name":{"kind":"Name","value":"sourcePath"}},{"kind":"Field","name":{"kind":"Name","value":"destinationColumn"}}]}},{"kind":"Field","name":{"kind":"Name","value":"jobs"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"lastEventAt"}},{"kind":"Field","name":{"kind":"Name","value":"status"}}]}}]}}]} as unknown as DocumentNode; @@ -1138,7 +1159,7 @@ export const TriggerFullUpdateDocument = {"kind":"Document","definitions":[{"kin export const ExternalDataSourceCardDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ExternalDataSourceCard"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"ID"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"externalDataSource"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"pk"},"value":{"kind":"Variable","name":{"kind":"Name","value":"ID"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ExternalDataSourceCardFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ExternalDataSourceCardFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ExternalDataSource"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"connectionDetails"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"crmType"},"name":{"kind":"Name","value":"__typename"}}]}}]}}]} as unknown as DocumentNode; export const EnrichmentLayersDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"EnrichmentLayers"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"externalDataSources"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"geographyColumn"}},{"kind":"Field","name":{"kind":"Name","value":"geographyColumnType"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"}},{"kind":"Field","name":{"kind":"Name","value":"connectionDetails"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}}]}},{"kind":"Field","name":{"kind":"Name","value":"fieldDefinitions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"value"}},{"kind":"Field","name":{"kind":"Name","value":"description"}}]}}]}}]}}]} as unknown as DocumentNode; export const GetMemberListDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetMemberList"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"externalDataSources"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"dataType"},"value":{"kind":"EnumValue","value":"MEMBER"}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"importedDataCount"}}]}}]}}]} as unknown as DocumentNode; -export const GetSourceGeoJsonDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSourceGeoJSON"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"externalDataSourceId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"externalDataSource"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"pk"},"value":{"kind":"Variable","name":{"kind":"Name","value":"externalDataSourceId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"geojsonPointFeatures"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"geometry"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"coordinates"}}]}}]}}]}}]}}]} as unknown as DocumentNode; +export const GetSourceGeoJsonDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSourceGeoJSON"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"externalDataSourceId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"externalDataSource"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"pk"},"value":{"kind":"Variable","name":{"kind":"Name","value":"externalDataSourceId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"importedDataGeojsonPoints"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"geometry"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"coordinates"}}]}}]}}]}}]}}]} as unknown as DocumentNode; export const UpdateExternalDataSourceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateExternalDataSource"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ExternalDataSourceInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateExternalDataSource"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"data"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"geographyColumn"}},{"kind":"Field","name":{"kind":"Name","value":"geographyColumnType"}},{"kind":"Field","name":{"kind":"Name","value":"autoUpdateEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"updateMapping"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"source"}},{"kind":"Field","name":{"kind":"Name","value":"sourcePath"}},{"kind":"Field","name":{"kind":"Name","value":"destinationColumn"}}]}}]}}]}}]} as unknown as DocumentNode; export const PublicUserDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"PublicUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"publicUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"username"}},{"kind":"Field","name":{"kind":"Name","value":"email"}}]}}]}}]} as unknown as DocumentNode; @@ -1154,20 +1175,11 @@ export const PublicUserDocument = {"kind":"Document","definitions":[{"kind":"Ope "OperationInfo" ], "Feature": [ + "MultiPolygonFeature", "PointFeature" ], - "Geometry": [ - "MultiPolygonGeometry", - "PointGeometry", - "PolygonGeometry" - ], "OutputInterface": [ "ObtainJSONWebTokenType" - ], - "PointGeometryPolygonGeometryMultiPolygonGeometry": [ - "MultiPolygonGeometry", - "PointGeometry", - "PolygonGeometry" ] } }; diff --git a/nextjs/src/app/graphiql/layout.tsx b/nextjs/src/app/graphiql/layout.tsx index 48b625c23..812dd3720 100644 --- a/nextjs/src/app/graphiql/layout.tsx +++ b/nextjs/src/app/graphiql/layout.tsx @@ -1,6 +1,8 @@ +import { useRequireAuth } from "@/hooks/auth"; import { Metadata } from "next"; export default function GraphiQL ({ children }: { children: React.ReactNode }) { + useRequireAuth() return
{children}
} diff --git a/nextjs/src/components/dataConfig.tsx b/nextjs/src/components/dataConfig.tsx index 00abb6754..9b35b6e7f 100644 --- a/nextjs/src/components/dataConfig.tsx +++ b/nextjs/src/components/dataConfig.tsx @@ -205,16 +205,46 @@ export const MAP_REPORT_LAYERS_SUMMARY = gql` label areaId count + gssArea { + point { + id + type + geometry { + type + coordinates + } + } + } } importedDataCountByConstituency { label areaId count + gssArea { + point { + id + type + geometry { + type + coordinates + } + } + } } importedDataCountByWard { label areaId count + gssArea { + point { + id + type + geometry { + type + coordinates + } + } + } } layers { name diff --git a/nextjs/src/components/report/ReportMap.tsx b/nextjs/src/components/report/ReportMap.tsx index a0610a970..d50d5b009 100644 --- a/nextjs/src/components/report/ReportMap.tsx +++ b/nextjs/src/components/report/ReportMap.tsx @@ -1,17 +1,21 @@ "use client" import { GetSourceGeoJsonQuery, GetSourceGeoJsonQueryVariables, GroupedDataCount, MapReportLayersSummaryFragment } from "@/__generated__/graphql"; -import { useContext, useEffect, useId, useRef } from "react"; -import Map, { Layer, MapRef, Marker, Popup, Source, LayerProps, VectorSourceRaw } from "react-map-gl"; +import { Fragment, useContext, useEffect, useRef, useState } from "react"; +import Map, { Layer, MapRef, Source, LayerProps } from "react-map-gl"; import { MAP_REPORT_LAYERS_SUMMARY } from "../dataConfig"; import { gql, useFragment, useQuery } from "@apollo/client"; import { ReportContext } from "@/app/reports/[id]/context"; import { Expression } from "mapbox-gl"; -import { scaleSequential } from 'd3-scale' -import { interpolatePlasma } from 'd3-scale-chromatic' +import { scaleLinear, scaleSequential } from 'd3-scale' +import { interpolateInferno } from 'd3-scale-chromatic' + +const MAX_REGION_ZOOM = 8 +const MAX_CONSTITUENCY_ZOOM = 11.5 +const MIN_MEMBERS_ZOOM = MAX_CONSTITUENCY_ZOOM export function ReportMap () { - const { id, update } = useContext(ReportContext) + const { id } = useContext(ReportContext) const layers = useFragment({ fragment: MAP_REPORT_LAYERS_SUMMARY, fragmentName: "MapReportLayersSummary", @@ -30,7 +34,7 @@ export function ReportMap () { sourceLayerId?: string, promoteId: string, labelId: string, - mapboxSourceProps: Omit, + mapboxSourceProps?: { maxzoom?: number }, mapboxLayerProps?: Omit, data: Array, downloadUrl?: string @@ -46,10 +50,10 @@ export function ReportMap () { // @ts-ignore data: layers.data.importedDataCountByRegion || [], mapboxSourceProps: { - maxzoom: 9.5 + maxzoom: MAX_REGION_ZOOM }, mapboxLayerProps: { - maxzoom: 9.5 + maxzoom: MAX_REGION_ZOOM } }, constituencies: { @@ -62,14 +66,27 @@ export function ReportMap () { // @ts-ignore data: layers.data.importedDataCountByConstituency || [], mapboxSourceProps: { - minzoom: 9.5, - maxzoom: 13, + maxzoom: MAX_CONSTITUENCY_ZOOM, }, mapboxLayerProps: { - minzoom: 9.5, - maxzoom: 13, + minzoom: MAX_REGION_ZOOM, + maxzoom: MAX_CONSTITUENCY_ZOOM, } }, + wards: { + name: "wards", + singular: "ward", + sourceId: "commonknowledge.0rzbo365", + sourceLayerId: "Wards_Dec_2023_UK_Boundaries_-7wzb6g", + promoteId: "WD23CD", + labelId: "WD23NM", + // @ts-ignore + data: layers.data.importedDataCountByWard || [], + mapboxSourceProps: {}, + mapboxLayerProps: { + minzoom: MAX_CONSTITUENCY_ZOOM, + } + } // constituencies2024: { // name: "GE2024 constituencies", // singular: "constituency", @@ -84,59 +101,67 @@ export function ReportMap () { // promoteId: "ctyua_code", // labelId: "ctyua_name", // }, - wards: { - name: "wards", - singular: "ward", - sourceId: "commonknowledge.0rzbo365", - promoteId: "WD23CD", - labelId: "WD23NM", - // @ts-ignore - data: layers.data.importedDataCountByWard || [], - mapboxSourceProps: { - minzoom: 13, - maxzoom: 18, - }, - mapboxLayerProps: { - minzoom: 13, - maxzoom: 18, - } - } } useEffect(function setFeatureState() { - layers.data.importedDataCountByRegion?.forEach((region) => { - if (region?.areaId && region?.count) { - mapboxRef.current?.setFeatureState({ - source: TILESETS.EERs.sourceId, - sourceLayer: TILESETS.EERs.sourceLayerId, - id: region.areaId, - }, { - count: region.count, - // ...layers.data.layers?.map((layer) => { - // return { - // [layer?.source!.id]: layer?.source?.importedDataCountByRegion?.find(r => r?.areaId === region.areaId)?.count - // } - // }) - }) - console.log("setFeatureState", region.areaId, region.count) - } + if (!mapboxRef.current) return + if (!layers.data) return + Object.values(TILESETS)?.forEach((tileset) => { + tileset.data?.forEach((area) => { + if (area?.areaId && area?.count) { + mapboxRef.current?.setFeatureState({ + source: tileset.sourceId, + sourceLayer: tileset.sourceLayerId, + id: area.areaId, + }, { + count: area.count, + // Per-layer data for choloropleths also + // ...layers.data.layers?.map((layer) => { + // return { + // [layer?.source!.id]: layer?.source?.importedDataCountByRegion?.find(r => r?.areaId === area.areaId)?.count + // } + // }) + }) + } + }) + }) + }, [layers, TILESETS, mapboxRef]) + + const requiredImages = [ + { + url: () => new URL('/markers/default.png', window.location.href).toString(), + name: 'meep-marker' + }, + { + url: () => new URL('/markers/selected.png', window.location.href).toString(), + name: 'meep-marker-selected' + } + ] + + const [loadedImages, setLoadedImages] = useState([]) + + useEffect(function loadIcons() { + if (!mapboxRef.current) return + requiredImages.forEach((requiredImage) => { + console.log("Loading", requiredImage.url()) + // Load an image from an external URL. + mapboxRef.current!.loadImage( + requiredImage.url(), + (error, image) => { + console.log("Loaded image", requiredImage.name, image, error) + try { + if (error) throw error; + if (!image) throw new Error('Marker icon did not load') + mapboxRef.current!.addImage(requiredImage.name, image); + setLoadedImages(loadedImages => [...loadedImages, requiredImage.name]) + console.log("Loaded image", requiredImage.name, image) + } catch (e) { + console.error("Failed to load image", e) + } + } + ) }) - // layers.data.layers?.forEach((layer) => { - // if (layer?.source) { - // layer.source.importedDataCountByRegion?.forEach((region) => { - // if (region?.areaId && region?.count) { - // mapboxRef.current?.setFeatureState({ - // source: TILESETS.EERs.sourceId, - // id: region.areaId, - // }, { - // totalCount: - // [layer.source!.id]: region.count, - // }) - // } - // }) - // } - // }) - }, [layers, mapboxRef]) + }, [mapboxRef.current, setLoadedImages]) return ( - {Object.entries(TILESETS).map(([key, tileset]) => { + {!layers.data && null} + {!!layers.data && Object.entries(TILESETS).map(([key, tileset]) => { const min = tileset.data.reduce( (min, p) => p?.count! < min ? p?.count! : min, tileset.data?.[0]?.count! @@ -158,106 +184,167 @@ export function ReportMap () { (max, p) => p?.count! > max ? p?.count! : max, tileset.data?.[0]?.count! ) || 1 - const scale = scaleSequential() + + // Uses 0-1 for easy interpolation + // go from 0-100% and return real numbers + const legendScale = scaleLinear() + .domain([0, 1]) + .range([min, max]) + + // Map real numbers to colours + const colourScale = scaleSequential() + .domain([min, max]) + .interpolator(interpolateInferno) + + // Text scale + const textScale = scaleLinear() .domain([min, max]) - .interpolator(interpolatePlasma) - console.log(scale) + .range([1, 1.5]) + + const inDataFilter = [ + "in", + ["get", tileset.promoteId], + ["literal", tileset.data.map(d => d.areaId)], + ] + + const steps = Math.min(max, 30) + const colourStops = (new Array(steps)).fill(0).map((_, i) => i / steps).map( + (n) => [ + Math.floor(legendScale(n)), + colourScale(legendScale(n)) + ] + ).flat() return ( - - {/* Shade area by count */} - - {/* Border of the boundary */} - - {/* Display count as a number in the centre of the area by a symbol layer */} - d.count?.toString() || "", - "?" - ), - "text-size": 25, - "symbol-placement": "point", - "text-offset": [0, -0.5], - "text-allow-overlap": true, - // "text-variable-anchor": ["center"], - // "text-ignore-placement": true, + + + {/* Shade area by count */} + + {/* Border of the boundary */} + + + { + return { + type: "Feature", + geometry: d.gssArea?.point?.geometry, + properties: { + count: d.count, + label: d.label, + } + } + }) }} - paint={{ - "text-color": "white", - }} - {...tileset.mapboxLayerProps || {}} - /> - d.label || "", - "?" - ), - "text-size": 13, - "symbol-placement": "point", - "text-offset": [0, 0.6], - "text-allow-overlap": true, - // "text-variable-anchor": ["center"], - // "text-ignore-placement": true, - }} - paint={{ - "text-color": "white", - "text-opacity": 0.7 - }} - {...tileset.mapboxLayerProps || {}} - /> - + {...tileset.mapboxSourceProps || {}} + > + + + + ) })} + {/* Wait for all icons to load */} {layers.data.layers?.map((layer, index) => { return ( >(data: Array, mapboxIdField: string, dataIdField: string, value: (d: T) => string, defaultValue: any): Expression { - // For each fromId value, find the corresponding toId value and return the valueId - const expression: Expression = [ - "match", - ["get", mapboxIdField], - ...data.map((d) => { - return [ - // If - d[dataIdField], - // Then - value(d), - ] - }).filter((d) => !!d[0]).flat(), - defaultValue - ] - return expression -} - function MapboxGLClusteredPointsLayer ({ externalDataSourceId }: { externalDataSourceId: string }) { const { data, error } = useQuery(GET_SOURCE_DATA, { variables: { @@ -295,7 +364,7 @@ function MapboxGLClusteredPointsLayer ({ externalDataSourceId }: { externalDataS }, }); - const id = useId() + const id = externalDataSourceId return ( <> @@ -305,18 +374,19 @@ function MapboxGLClusteredPointsLayer ({ externalDataSourceId }: { externalDataS data={{ type: "FeatureCollection", // @ts-ignore TODO: Fix types - features: data?.externalDataSource?.geojsonPointFeatures || [] + features: data?.externalDataSource?.importedDataGeojsonPoints || [] }} > @@ -326,7 +396,7 @@ function MapboxGLClusteredPointsLayer ({ externalDataSourceId }: { externalDataS const GET_SOURCE_DATA = gql` query GetSourceGeoJSON($externalDataSourceId: ID!) { externalDataSource(pk: $externalDataSourceId) { - geojsonPointFeatures { + importedDataGeojsonPoints { id type geometry {