Modular D3 visualization
In this section, we will convert our previously used D3 box plot graph (we added this in Chapter 5, The Splunk Web Framework) into extended SimpleSplunkView. The benefits here are substantial. Primarily, you gain the ability to quickly reuse the view in other dashboards. Simply assign the SearchManager to the view and off you go. Retrieving the events from the SearchManager is also easier, as it is handled natively within the extension. Another great benefit is that when the view is loading, the default loading screens are used, so it's not just a blank panel until it is loaded; it is actually a first-class-citizen view. The first thing to have when creating an extended SimpleSplunkView is the base template.
Let's take a look at the basic structure and then fill in the pieces we are missing:
define(function(require, exports, module) { var _ = require("underscore"); var mvc = require("splunkjs/mvc"); var SimpleSplunkView ...