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

Lack in documentation to visualize Regions in Area Map #851

Open
Lupanoide opened this issue Apr 9, 2024 · 5 comments
Open

Lack in documentation to visualize Regions in Area Map #851

Lupanoide opened this issue Apr 9, 2024 · 5 comments
Assignees
Labels

Comments

@Lupanoide
Copy link

Lupanoide commented Apr 9, 2024

Hi!
In the documentation page of Area Map visualization of Neodash it is written that:

the supported format for the region polygons is ISO 3166.

And there is an example of italian regions. So I am italian and I would like to reproduce that visualization. So I have downloaded italian regions ISO 3166 codes from wikipedia and I have added those properties to my Regions nodes:

MATCH (r:Regione) RETURN r.nomeRegione, r.regCode LIMIT 5

╒════════════════╤═════════╕
│r.nomeRegione   │r.regCode│
╞════════════════╪═════════╡
│"Abruzzo"       │"IT-65"  │
├────────────────┼─────────┤
│"Basilicata"    │"IT-77"  │
├────────────────┼─────────┤
│"Calabria"      │"IT-78"  │
├────────────────┼─────────┤
│"Campania"      │"IT-72"  │
├────────────────┼─────────┤
│"Emilia-Romagna"│"IT-45"  │
└────────────────┴─────────┘

Now I am trying to create an Area Map visualization trying to coping the documentation page, adding this cypher query into the Area Map settings :

MATCH (r:Regione)<-[:HA_REGIONE]-(p:Provincia)
RETURN r.regCode AS code, count(p) AS totalCount

But nothing happens. What I am doing wrong?
Is there a way toI visualize in addition to the regions also the provinces?

@alfredorubin96
Copy link
Collaborator

Hi, looks like it's mapped on another kind of format, for an example look here: https://raw.githubusercontent.com/neo4j-labs/neodash-static/main/world_polymap_level_1_entities.json. I will file a bug for it and add a selector to choose between the iso 3166 and the other

@alfredorubin96 alfredorubin96 self-assigned this Apr 9, 2024
@alfredorubin96 alfredorubin96 linked a pull request Apr 9, 2024 that will close this issue
@Lupanoide
Copy link
Author

Lupanoide commented Apr 9, 2024

Thank you, I have seen your pull request, but this don't seem to be the problem. I have seen that you are trying to change the ISTAT code of the regions to the ISO_3166 code, but this don't solve the problem.

I have already the ISTAT code of the Italian Regions as property of my nodes:

MATCH (r:Regione) RETURN "IT."+ apoc.text.lpad(toString(r.idRegione), 2, '0'), r.nomeRegione LIMIT 5

╒════════════════════════════════════════════════════╤════════════════╕
│"IT."+ apoc.text.lpad(toString(r.idRegione), 2, '0')│r.nomeRegione   │
╞════════════════════════════════════════════════════╪════════════════╡
│"IT.01"                                             │"Abruzzo"       │
├────────────────────────────────────────────────────┼────────────────┤
│"IT.02"                                             │"Basilicata"    │
├────────────────────────────────────────────────────┼────────────────┤
│"IT.03"                                             │"Calabria"      │
├────────────────────────────────────────────────────┼────────────────┤
│"IT.04"                                             │"Campania"      │
├────────────────────────────────────────────────────┼────────────────┤
│"IT.05"                                             │"Emilia-Romagna"│
└────────────────────────────────────────────────────┴────────────────┘

If I try to convert the query inside of the Area Map visualization settings, nothing happens:

MATCH (r:Regione)<-[:HA_REGIONE]-(p:Provincia)
RETURN "IT."+ apoc.text.lpad(toString(r.idRegione), 2, '0') AS code, count(p) AS value

Probably there is a setting that should be enabled and it is not documented or there is a bug. Could you please verify? Thank you

@alfredorubin96
Copy link
Collaborator

Did you enabled the drilldown options inside the card settings?

@Lupanoide
Copy link
Author

Lupanoide commented Apr 9, 2024

Yes, sure. But I haven't passed any country ISO3 format cause I would like to visualize statistics on Italian regions. Regions visualization works only as a drill down of the country?

@Lupanoide
Copy link
Author

Lupanoide commented Apr 9, 2024

Yes, It works only as a drilldown of the country!!

MATCH (c:Comune)-[:HA_PROVINCIA]->(p:Provincia)-[:HA_REGIONE]->(r:Regione)-[:IN_COUNTRY]->(n:Nazione)
WITH c, r AS region, n AS country
CALL {
    WITH c, country
    RETURN country.sigla_iso_3166_1_alpha_3_stato as code, count(c) as value
    UNION
    WITH c, region
    RETURN  "IT."+ apoc.text.lpad(toString(region.idRegione), 2, '0') as code, count(c) as value
}
WITH code, sum(value) AS value
RETURN code, value

Thank you for your time! Could you please add to the documentation that the regions visualization is possible only as a drilldown of the country?

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

Successfully merging a pull request may close this issue.

2 participants