Introducing Neomap, a Neo4j Desktop application for spatial data

Estelle Scifo
Neo4j Developer Blog
4 min readNov 16, 2019

Neo4j is one of the, if not THE, most famous graph database. It comes with Neo4j Browser that includes a powerful graph visualization tool. However, this tool is not well suited for nodes with geographical attributes that we prefer visualizing on a map. Neomap was born to address this issue.

neomap 0.3.1 opening

Installation

If you haven’t already, you will have to install Neo4j Desktop. It’s an awesome application from which you can manage your local and remote graphs, installed plugins and, most important for us today, applications. Installation instructions for Neo4j desktop depending on your OS can be found on the Neo4j website.

install.graphapp.io

Once Neo4j Desktop is installed and running, we can move on to the neomap installation.

You can now also find neomap on the Neo4j Graph App Gallery install.graphapp.io

1. First step is to visit https://github.com/stellasia/neomap/releases and download the last release’ .tgz: neomap-<version>.tgz (neomap-0.3.1.tgz at the time of writing)

2. In Neo4j Desktop and go to “Graph Applications” view:

3. Drag and drop the tarball you downloaded earlier below “Install Graph Application

If you have an older version you might want to remove that one.

After having agreed to trust this new application, it will be installed in Neo4j Desktop and available to be added in any of your projects.

4. In a given project, click to “Add Application” (it should be next to “Neo4j Browser” which is installed by default)

Add a new application

5. In the popup window, select “neomap”.

+Add neomap

We’re done! Neomap is now available for all the graphs in that project. Let’s discover how to use it.

Usage

Let’s learn about the functionalities by going through the interface. All configurations are done in the left panel, where you can create the layers that will be displayed on the right side map.

Two main options are to be considered:

Layer type

The simple mode

In the simple mode, you choose the node labels that will be shown on the map together with the properties to be used as latitude/longitude and the tooltip.You can also configure the LIMIT of rows to be fetched.

NOTE: If you display too many markers, the rendering performance will slow down.

If you need more configuration, like including WHERE clause, you will have to use the advanced mode.

The advanced mode

There, you can write the cypher query you need.
The only constraint is that it must RETURN at least the following columns (all the other will be ignored):
- latitude
- longitude
- tooltip (optional): the data to display on marker hover in case of marker rendering (see below).

Layer type choice

Note: Currently the Neo4j spatial Point type is not yet supported. If you want to use it you can use a Cypher query like this in an Advanced Layer.

MATCH (n:Location) 
RETURN n.location.latitude as latitude, n.location.latitude as latitude, n.name as tooltip

Map rendering

Markers

Each node will be shown as a pin marker. Some options are specific to marker layers:
- Color: marker color
- Tooltip (in simple layer mode): the property to use in popups.

Heatmap

A heatmap will be created based on the nodes distribution at the location.
Options specific to heatmap layers are:
- Radius: radius for heatmap points (default: 30) (source)

Map rendering choice

You can add as many layers as you want, mixing the layer type and the rendering at your convenience.

Example rendering with two layers: one heatmap layer and one marker layer.

On the map top right corner, you can list all layers and hide/show them if you need to. If a layer is not needed anymore, you can delete it permanently by clicking the red “Delete” button in the layer list from the left side bar.

Check out the video on YouTube for a live demo:

Live Demo Video for neomap

More information and documentation about future versions will be made available on the project wiki: https://github.com/stellasia/neomap/wiki

Next steps

neomap was started during Global Graph Hack 2019 (a one month hackathon) but it is still an evolving project. For instance, I plan to implement support for Neo4j’s spatial types in the very near future.

If you like the project and would like to contribute, I welcome all kind of contributions, for instance:

- Help with fixing the open issues in GitHub (including both bugs and planned features implementation)
- Report bugs
- Suggest new features that would be helpful to you

And in any case, don’t hesitate to star the project on GitHub if you think it’s a useful tool!

https://github.com/stellasia/neomap/

Thanks for reading and enjoy mapping your graph data!

--

--

Estelle Scifo
Neo4j Developer Blog

PhD, Data Scientist, Python developer — author @PacktPub — now ML engineer Graphs + GenAI https://www.linkedin.com/in/estellescifo/