Putting It All Together


Spotfire is a very robust platform, which enables you to build interactive and visual analytic applications. One of the nice things about the Spotfire platform is there are many different features and components which you can leverage as you are building your application.  In an effort to start showing off all these features to the Community, we just launched a new section on the Community called Spotfire Live, where we will add live dashboards showing off many of these features, and how they work together to build a complete application.

In our first featured example, we allow users to enter a zip code and Spotfire retrieves the latest 7 day weather forecast for that location.

 

 

Data Access
To access the weather data, we are using our Application Data Services component to load data from the freely available CDYNE Weather Web Service. (http://wiki.cdyne.com/wiki/index.php?title=CDYNE_Weather)

We are using a Property Control to allow the user to enter a zip code. This zip code will be passed into the web service as a parameter which will load the weather data on demand. After the initial loading, the user can change the zip code and the query will be re-executed and only the weather information for the latest zip code will be displayed. 

We will discuss details of the web service data access component in a future tip.

Visualize the Data
Once the data is loaded, we are showing a table visualization which includes the date, the description, the high temperature, the low temperature, and an image displaying the weather (rain, sunny, cloudy, etc…).

We are using an extension to the platform which allows us to display these images directly into the table. 
 

Conditionally Coloring the temperatures
We have used the conditional coloring features (available from Spotfire 3.1 and above) to color the high and low temperatures in the table visualization. As the temperature gets hotter the color turns red, and as it gets colder, the color turns blue.



Adding Other Visualizations
In this example we just display the current weather, but we could very easily link to historical weather data to do analytic comparisons, or we could bring in two zip codes and compare the two.  One adaptation is shown below where we also show a Line Chart which plots the daily highs and lows.


 

Deploying the Application
We want to deploy the application so that it is highly visible to all users.  Rather than having them access the file directly from the Spotfire Library, we decided to integrate the file into an existing web site.  By using the Web Player APIs, we were able to embed parts of the analysis file into the site. 



Since the weather forecast probably does not change that often throughout the day, we really do not need to refresh the page. However, if this was something that changed often, it would make sense to have it update. We will discuss this in a future tip.

Want to see it in action? Check out the new ‘Spotfire Live’ section on the main page of the User Community.