1.
Select Help > Sample Data Library and open Big Class.jmp.
2.
Run the Distribution table script to generate the report.
3.
Select File > New > Application (or File > New > New Application on Macintosh).
New Application with Distribution Report Displayed in the Sources Pane
The Distribution report appears in a new window (Example of an Instant Application). Note that the histograms are interactive and still associated with the data table. When the data changes, you run the application again, and the Distribution report is updated.
Example of an Instant Application
An application consists of modules. A module contains the objects and scripts that are compiled into an application. When you run an application, JMP can show a separate window for each module. For example, one window might show a Create Graphs button. After the user clicks the button, the graphs appear in a new window.
Application Builder Terms describes the terms that you should become familiar with before using Application Builder. Knowing these terms helps you understand how a module works, even if you need to minimally edit an automatically generated script.
An object is a dynamic entity in JMP, such as a data table, a data column, a platform results window, a graph, and so on. Most objects can receive messages that instruct the object to perform some action on itself.
A message is a JSL statement that is directed to an object. That object knows how to evaluate the message.
JMP creates the Application namespace and the ModuleInstance namespace automatically. Symbols in the Application namespace are visible only to scripts in the application; the namespace is not available to scripts not created in the application. For more information about namespaces, see Advanced Scoping and Namespaces in Programming Methods.
A unique name to which you assign a value. JMP creates the thisApplication and thisModuleInstance variables automatically.
The thisApplication variable (used in the Application namespace) contains module names, which are available in any script in the application.
The thisModuleInstance variable (used in the ModuleInstance namespace) contains box and script names, which are valid only in their own modules.
The Application Builder Window shows an application under development in Application Builder.
The Application Builder Window
Tip: To hide the grid and turn off snap-to-grid for all applications that you create, select File > Preferences > Platforms > JMP App and deselect these options. You can also deselect these features in the Application Builder red triangle menu.
Opens a sample application from the JMP Samples/Apps folder. These samples show you how to set up common applications, and you can modify them as you wish. Sample Applications Installed with JMP describes the samples.
A modified version of Instant App.jmpappsource. Options for selecting the principal components report, changing the marker size, and showing means are included.
1.
Select File > New > Application (or File > New > New Application on Macintosh).
2.
Select File > Save and save the file as a JMP Source File. The extension is .jmpappsource.
On Macintosh, select Window > Combine Windows, select the open data table or report window, and then click OK.
2.
Drag the object onto the Module1 tab (or double-click the object).
6.
From the Application Builder red triangle menu, select Run Application to test your application.
1.
Select Format > Add Module.
Change the Variable Name in the module’s object properties.
Select Format > Delete Module.
ret = Module1 << Create Instance() will not return until the dialog is complete. By this time, the dialog has been destroyed. Therefore, the return value will not be a handle to the Module Instance. Like New Window(), the return will instead be of the form {Button(1 | -1), User Data}. (1 | -1) indicates whether the OK (1) or Cancel (-1) button was pressed.
User Data() is a new property on the Module Instance. During execution of the dialog, the Module script can set the user data:
Like New Window(), if there is no OK or Cancel button included, an OK button will be added.
There is an optional Validate script property on the Module Instance. This script is only used for Modal dialogs and behaves like On Validate() in New Window(). It is called when the OK button is pressed, and returns 1 to accept the input or 0 to disallow the close.
Tip: If you use the Validate property, you can call thisModuleInstance << Set User Data().
Unlike other module types, a Modal Dialog will not show until the module script has completed. For other module types, the window is created during the call to thisModuleInstance << Create Objects. JMP cannot display a Modal Dialog here because control would stop and there would be no way to initialize the contents of the boxes in the display. Since the window is not created yet, you will not be able to do actions like set the window title or set an on-close script.
The top and left edges of an object align (or snap) to the nearest dotted grid lines as you drag them on the workspace. For a more precise placement, deselect Snap to Grid in the Application Builder red triangle menu. You can also turn off Snap to Grid for all applications in the JMP Preferences. (Select File > Preferences > Platforms > JMP App to change the option.)
Examples of Dragging Objects into a Container shows the various methods for dragging objects inside a container.
Examples of Dragging Objects into a Container
To position a container object precisely, select the object and then change the X Position and Y Position properties. After you enter a new X position, press the TAB key to see the object move to the new position and then enter the new Y position.
To place an object in the upper left corner, right-click the object and select Move to Corner. This is a shortcut to setting the X and Y positions to 0. On Macintosh, hold down CTRL and COMMAND and then select Move to Corner.
The Align Boxes options are unavailable when you select a container rather than the internal objects.
Change a Panel to an Outline
Container Toolbar
On Windows, select Edit > Clear to delete all objects in a module.
To create the radio box list items in Radio Box Object Properties, double-click the placeholder items “Item1” and “Item2” and enter the new list item.
Radio Box Object Properties
For more information about an object, right-click the object and select Scripting Help. The JMP Scripting Index appears, and the object that you selected is highlighted. The Scripting Index often includes a script that you can run to see an example of the object.
Prevents users from editing the application in a text editor. Only applications that the user runs are encrypted (the .jmpapp file and the application in a JMP add-in). Scripts that you save to a data table, journal, and add-in are encrypted. For more information about encryption, see Encrypt and Decrypt Scripts in Programming Methods.
Label in Data Table Prompt Window
To see the scripts in these namespaces, click the Scripts tab and then select the namespace in the Namespace list (or in the Objects pane). See Application and Module Namespaces.
Application and Module Namespaces
There are two types of scripts: named scripts and anonymous scripts.
A named script is a function that several controls can use. The this argument tells which control is calling the function. In the following example, Get Button Name is sent to the this argument to print the button name to the log when the button is clicked:
On another button, use Button1Press script to produce the same results.
1.
Right-click the object, select Scripts, and then select the script that you want to add. In this example of creating a button, select the Press script. (On Macintosh, press OPTION, and then select Scripts > Press.)
The object’s placeholder script appears on the Scripts tab (New Script and Script Properties). The name of the named script, Button1Press, shows up in both the script and the object properties.
New Script and Script Properties
The Title property was changed to Submit, the text that appears on the button.
The Close Window function was added to the object. When the user clicks the Submit button, the window closes.
Tip: After you add a script to an object and then delete the object, delete the object’s script from the Scripts tab if you no longer need the script. This feature prevents scripts that you might want in the future from being deleted.
If you rename the script in the object properties, rename it on the Scripts tab also. And if the script is used in another part of the application, rename it there as well.
An anonymous script is available only to the object that defines it. For example, you might want a simple Print statement for one button that is not used elsewhere. By writing an anonymous script, you reduce the number of names to manage in the script. Anonymous scripts also reduce clutter among more important named scripts in the Scripts tab, because you add them to the object properties.
Objects such as check boxes might provide additional arguments after this that are not otherwise available. One example is an argument that tells which check box in a column of check boxes just changed.
When an object has multiple scripts, right-click the object, select Scripts, and then select the script name. You can also select the Scripts tab, select the module name from the Namespace list and then select the script name from the Method list. Likewise, to see the application scripts, select Application from the Namespace list.
In each case, the Scripts tab appears with the cursor in the first line of the object’s script.
To open an application for editing, select File > Open, select the .jmpappsource file, and then select Open.
To run an open application, select Run Application from the Application Builder red triangle menu.
To run a closed application, select File > Open, select the .jmpapp file, and then select Open.
Right-click either the .jmpappsource or the .jmpapp file and select either Edit Application or Run Application.
JMP provides several options for saving application files. When you select File > Save As (or File > Export on Macintosh), you can choose to save as an application source file (.jmpappsource), an application (.jmpapp), or a script (.jsl).
The .jmpappsource file allows an application developer to save the application as is, in order to continue editing the application later. When reopened, the App Builder interface remains in same state as when it was saved. The data tables used to create the application must still be available.
The .jmpapp file is used to distribute applications for others to use. The application runs immediately after opening the file. The application resolves the data tables using the current data tables, files on disk, or by prompting the user, depending on the application settings.
The Script red triangle menu provides additional options for saving scripts. When an encrypted script is saved, JMP encloses the script in the JSL Encrypted() function to preserve white space and comments.
Embeds the application script in an open or new journal. Click the link to run the application.
Tip: This can also be accomplished by saving as a .jmpapp file and using Open() to run the application. However, saving the script can reduce the number of files.
1.
Select Help > Sample Data Library and open Quality Control/Steam Turbine Historical.jmp.
3.
Select File > New > Application.
6.
Select both reports and then select Format > Align Boxes > Align Top.
7.
Select each report and type yvar next to Y Variable in the Objects pane.
9.
Select the Fuel, Steam Flow, Steam Temp, and MW variables and then click the Y button.
10.
Multivariate Application
Tip: The absolute path to the data table is inserted automatically in the application’s Table property. You can use the $SAMPLE_DATA path variable instead or enter another absolute or relative path. Remember that the user must have access to this path.
On Macintosh, select Window > Combine Windows, select the open data table or report window, and then click OK.
2.
In the new window, select Edit Application from the red triangle menu.
4.
Select Run Application from the Application Builder red triangle menu.
Example of Filtered Content
3.
Select Date from the list and then select m/d/y.
6.
Select Run Application from the Application Builder red triangle menu.
Example of a Date Selector