Skip to main content
RSS feed Subscribe to feed

 

Creating a Visualization

A visualization is a visual displaying data in Spotfire. A custom visualization defines a unique visualization, implementing model, view, and possibly using additional components.

Overview

The set of Spotfire visualizations can be extended. Shortcut visualizations define data dependent properties, thereby configuring the appearance of an existing visualization. Custom visualizations are built using Spotfire APIs, and are added to the set of Spotfire visualizations.

Custom visualizations that have been deployed in the Spotfire environment appear in the same places and behave in the same way as Spotfire visualizations: They are accessible from the Insert > New visualization menu, from the plot context menus and from the toolbar, and they can share data sets, marking and filtering with other plots.

Model-View Architecture

One model for the views of two clients

Custom visualizations are built on the Spotfire model-view architecture. There is a model implementation using document nodes, and separate views for TIBCO Spotfire Professional and TIBCO Spotfire Web Player.

The model is responsible for managing the state of the visualization. It typically has properties for the data table to use and so forth. The model is also expected to be capable of drawing itself, a model characteristic used by the framework to implement printing and export functionality. It also enables the framework to supply default views for a properly created model.

The views handle user input and are responsible for drawing the visualization in the user interface. They usually delegate much of this to the model, as it is expected to be able to handle drawing. It is also a way to share implementation between the views.

The model and views typically reside in different assemblies. This is for deployment reasons. When developing a view for TIBCO Spotfire Professional classes not available when running in the Web Player may be used, and vice versa. If you are just targeting the Client, you may choose to package everything in one assembly. If only Spotfire Professional is targeted, both model and view may be packaged in a single assembly.

The Custom Visuals SDK Example

The custom visuals example is made up of the following projects:

  • Spotfire SDK\Examples\Extensions\SpotfireDeveloper.CustomVisualsExample - contains the models for the visualizations.
  • Spotfire SDK\Examples\Extensions\SpotfireDeveloper.CustomVisualsExampleForms – contains views and user interface classes for TIBCO Spotfire Client.
  • Spotfire SDK\Examples\Extensions\SpotfireDeveloper.CustomVisualsExampleWeb – contains view for the Web Player (currently only one).

In addition to these projects, that all need to be built to assemblies to use the full extent of the custom visuals example, the Normal Plot visualization also has a dependency on the Spotfire SDK\Examples\Extensions\SpotfireDeveloper.CalculationMethodExample as it relies on a method implemented there.

Visualizations

The Histogram example demonstrates how to implement a simple shortcut visualization. It configures a bar chart to behave like a histogram.

The Normal Plot is also a shortcut visualization. It configures a scatter plot to behave like a normal plot. It illustrates how to add custom nodes, that can react to changes, to a visualization. In this case it is used to change the expression on the X axis whenever the expression on the Y axis changes.

The Web Details shows how to create a visualization that fetches details for marked records from the internet.

The Traffic Light Chart is a simple visualization which demonstrates how to create and maintain an aggregated data view for the visualization, and how to react to filtering.

The Custom Scatter Plot is the most advanced example. It demonstrates the following features:

  • How to create a visualization derived from the CustomVisualization class, that tells the framework what data table and marking it is using.
  • How to react to filtering.
  • How to perform and react to marking and highlighting operations.
  • How to use components to build a view for TIBCO Spotfire Professional. The view:
    • integrates with the visualization title bar
    • supports drag and drop operations
    • displays a context menu with command implemented by the framework
    • implements rendering on a background thread
    • uses the busy indicator component to indicate the view is busy
    • implements custom help
    • supports custom tools
    • has a modeless property dialog
  • How to implement a visualization view for TIBCO Spotfire Web Player.

Tutorials

  • How to Create a Shortcut Visualization
    Shortcut visualizations, or configured visualizations, are base visualizations where the data dependent properties have been configured.
  • How to Create a Visualization Model
    A visualization model manages the state of a visualization. It is also expected to be capable of drawing itself.
  • How to Create a Visualization View
    A visualization view handles user input and is responsible for drawing the visualization in the user interface.
  • How to Create a Visualization Web View
    To display a custom Spotfire visualization in the Web Player, implement a custom web control. It must be integrated with the model object of the visualization to communicate state change and receive updates.
  • Spotfire 3.0-3.3
    This tutorial explains how to set up and test the custom web visualization SDK example for Spotfire 3.0-3.3.