Author’s note: Today’s example applies to a map created in Graph Builder, but you can use this approach in the majority of platforms in JMP.
In part one of this two-part series, I showed an example of the support for images in data tables in JMP 12. Today, I’ll show you how this capability allows you to create multilayered reports and graphs in Graph Builder, with just a bit of scripting.

In the map above, each state is colored by its average temperature — blue is cooler, red is warmer. Hovering over any state reveals a graph of the state’s temperature trends over time. Here, we have the best of both worlds: an easily digestible overview of the data, with additional details hidden but immediately available.
Graph Builder in JMP allows us to save images of the graphs it creates to data tables, but the trend graph above was not created in Graph Builder — it was created using Overlay Plot. What happens when we want to save images we created outside of Graph Builder?
Fortunately, a bit of JSL is all we need. In today’s example, we will walk through the code needed to create a map like the one above.
First, let’s look at the raw data: average annual temperatures for each of the 50 states in the US. This is our source table, and will be used to create the trend plots.

The map itself relies on the table below. To create it, we will:

Step by step, here is what it looks like in JSL.

After running the code above, the report looks like this. (If your report differs, it could be due to differences in our preference settings.)

The next four lines of JSL create the summary table and prepare it for use with the images.

All that remains is to loop through the report, saving the pictures to the summary table.

The summary table should now look like this:

To create the map, invoke Graph Builder and drag the State and Temperature columns to the Shape and Color zones, respectively. That’s all there is to it!

I hope you have enjoyed today’s post; I am excited to see and hear about the interesting applications you will come up with!
P.S. I’ve placed the source table and script file in the JMP User Community’s File Exchange. (A free SAS profile is needed to access the files.)