Tutorial | No-code maps#

Dataiku has a drag and drop interface for creating a wide range of data visualizations — including maps. Let’s walk through how to create these maps without any code.

Get started#

Objectives#

In this tutorial, you will:

  • Create a variety of maps from geographic data.

Prerequisites#

Create the project#

Let’s get started!

  1. From the Dataiku Design homepage, click + New Project > DSS tutorials > Core Designer > No-code Maps.

  2. From the project homepage, click Go to Flow (or g + f).

Note

You can also download the starter project from this website and import it as a zip file.

You’ll next want to build the Flow.

  1. Click Flow Actions at the bottom right of the Flow.

  2. Click Build all.

  3. Keep the default settings and click Build.

Use case summary#

The project has three data sources:

tx

Each row is a unique credit card transaction that has been either been authorized (a score of 1 in the authorized_flag column) or flagged for potential fraud (a score of 0).

cardholders

Each row is the latitude and longitude coordinates of a unique credit card holder.

merchants

Each row is the latitude and longitude coordinates of a unique merchant, all of which are gas stations.

The Flow joins a small random sample of these three datasets together so that every record in tx_joined is a unique transaction, enriched with data about the location of credit card holders and merchants for that transaction.

Geographic data types#

The tx_prepared dataset contains four columns of geographic data. Although all columns are stored as strings in this case, Dataiku has auto-detected the meanings to be either geopoint or geometry. This designation enables us to use the map chart types in the Charts tab.

  1. Open the tx_prepared dataset, and observe the meanings detected for the geographic data columns: merchant_geopoint, merchant_bubble, cardholder_geopoint, and cardholder_county_geom.

Dataiku screenshot of the geographic columns in a dataset.

Tip

If interested in how to create these kinds of geographic columns, see Tutorial | Geographic processors.

Scatter map#

The scatter map is one of the best options to get started visualizing geographic data because it is a straightforward way to plot points on a map.

Let’s try to visualize the locations of our credit card holders, and whether or not their transactions have been authorized.

  1. Navigate to the Charts tab of the tx_prepared dataset.

  2. Open the chart picker on the left, and select the Scatter map.

  3. Drag cardholder_geopoint from the left to the Geo field.

  4. Drag authorized_flag to the color droplet field. Open the authorized_flag dropdown, and check the box Treat as alphanum.

  5. Click the color droplet, and change the palette to Set 2.

  6. Drag purchase_amount to the radius field to the right of the color field in order to scale the size of the bubbles. Click the radius setting at the left of the field, and reduce the base to 2.

  7. Rename the chart Transactions by authorization.

Dataiku screenshot of a scatter map.

Tip

This is a very small dataset. To visualize patterns among a larger number of points, you may want to try a density map.

Geometry map#

In order to simultaneously visualize multiple sets of geographic columns, we can use a geometry map.

This time, let’s try to visualize not just the cardholders, but also the merchants (and the buffer area drawn around them).

  1. Click + Chart at the bottom.

  2. From the chart picker, select Geometry map.

  3. As above, drag cardholder_geopoint to the Geo field.

  4. Drag merchant_geopoint to the second Geo field. Open its corresponding color droplet, and change the merchant points to orange.

  5. Drag merchant_bubble to the third Geo field. Change its color to yellow.

  6. Rename the chart Cardholders and merchant zones.

  7. Zoom in to explore which customers lie within a 10 kilometer radius of a merchant.

Dataiku screenshot of a geometry map.

Administrative maps#

Although this dataset has a column of county geometries, we do not actually need it for the purpose of mapping. We can use administrative maps to visualize data within administrative boundaries — also known as a choropleth.

Filled administrative maps#

Let’s visualize the counts of transactions at the state level, assuming the merchant location as the place of the transaction.

  1. Click + Chart at the bottom.

  2. From the chart picker, select Administrative map (filled).

  3. Drag merchant_geopoint to the Geo field. Open the field dropdown, and set the admin level to Region/State.

  4. Drag Count of records to the Details field.

  5. Open the color droplet, and change the palette to Viridis.

  6. Rename the chart Transaction counts by state.

Dataiku screenshot of a filled admin map.

Tip

Instead of official administrative boundaries, you could also use a grid map to define an arbitrarily-sized area and visualize counts within those boxes.

Bubble administrative maps#

By their nature, administrative boundaries can be squiggly and vary widely in area. In some cases, we may want to aggregate by administrative boundaries, but visualize results in a more uniform way.

Let’s again visualize the counts of transactions in each state, but also plot the average distance between card holders and merchants for transactions within an administrative boundary.

  1. At the bottom, click the three dots to open the options menu for the filled admin chart. Select Duplicate.

  2. Change the chart picker to Administrative map (bubbles).

  3. Shift Count of records over to the radius setting.

  4. Drag cardholder_merchant_distance_km to the color droplet field.

  5. Rename the chart Transactions by avg cardholder distance.

Dataiku screenshot of a bubble admin map.

What’s next?#

Congratulations! You’ve built a range of maps for quick insights into a range of geographic data questions. We encourage you to polish these existing maps using filters, tooltips, and many other options. You can also try the density and grid maps not demonstrated here.

Note

For more information on maps, see the reference documentation. For more resources on other types of charts, see the Knowledge Base.

Once you have prepared and visualized geographic data structures, you can move on to more advanced geographic operations. Try that next in Tutorial | Geo join recipe!

Tip

You can find this content (and more) by registering for the Dataiku Academy course, Geospatial Analytics. When ready, challenge yourself to earn a certification!