Skip to content

Commit

Permalink
Merge pull request #2832 from the-deep/fix/analysis-schema
Browse files Browse the repository at this point in the history
Fix analysis geo schema
  • Loading branch information
AdityaKhatri authored Mar 15, 2024
2 parents 1e8a6be + e7ebda3 commit f34b790
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,25 @@ import HeatMap from '#components/HeatMap';
import styles from './styles.css';

const NLP_MAP = gql`
query NlpMap($projectId: ID!, $nlpMapId: ID!) {
project(id: $projectId) {
id
analysisGeoTask(id: $nlpMapId) {
query NlpMap($projectId: ID!, $nlpMapId: ID!) {
project(id: $projectId) {
id
status
entryGeo {
data {
geoids {
countrycode
featurecode
geonameid
latitude
longitude
match
analysisGeoTask(id: $nlpMapId) {
id
status
entryGeo {
data {
meta {
latitude
longitude
offsetEnd
offsetStart
}
}
}
}
}
}
}
`;

interface Props {
Expand Down Expand Up @@ -91,7 +89,7 @@ function NlpMap(props: Props) {
const points = useMemo(() => {
const latLongs = data?.project?.analysisGeoTask?.entryGeo
?.flatMap((geoData) => geoData?.data)
.flatMap((mapData) => mapData?.geoids)
.flatMap((mapData) => mapData?.meta)
.filter(isDefined)
.map((latLong) => ((latLong.latitude && latLong.longitude) ? {
count: 1,
Expand Down
8 changes: 3 additions & 5 deletions app/views/PillarAnalysis/AnalyticalStatementInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,11 @@ const AUTOMATIC_STORY_ANALYSIS = gql`
status
entryGeo {
data {
geoids {
countrycode
featurecode
geonameid
meta {
latitude
longitude
match
offsetEnd
offsetStart
}
}
}
Expand Down

0 comments on commit f34b790

Please sign in to comment.