Initializing help system before first use

Loading the API

Every HTML view starts with a definition in the companion file that points to the associated HTML file.
For example:
<html-view title="Input View" path="input.html"/>

The path is relative to the client_resources folder within your app bundle/ZIP file.

You should take the Quick Start app as a starting point and use one of the HTML files within there as a template. For Example, if you take the input.html file from this app it already has the latest JavaScript API loaded in with the following lines:
<link type="text/css" 
         rel="stylesheet" 
         href="$distrib/insight-4.7.css"/>
<script src="$distrib/insight-4.7.js"></script>

The JavaScript API is bundled into a single JavaScript file, $distrib/insight-4.7.js, and a single CSS file, $distrib/insight-4.7.css.

Once the JavaScript API is loaded into you view you need to wait until the API is ready before you can start using it. The reason for this is that some information about the current app, the view selection and model schema have to be loaded in before data can be accessed. Your custom code needs to be wrapped in a callback function that will be invoked when the API is ready. This is done as follows:
insight.ready(function() {
  // Your code here
});

The JavaScript API exposes a global variable called insight. This is the starting point for all API calls. There are also a few third-party libraries that are loaded in along with the JavaScript API and these are exposed as global variables too. See Appendix B for more details on what is exposed.