Subscribe Bookmark RSS Feed

Re: Interfacing sample application "Launcher with Report" to a graph from graphbuilder.

dfshort

Community Trekker

Joined:

Apr 23, 2014

I'm new to JSL and I suspect I'm going about this in the wrong way. Pointers and ideas would be welcome.

I have a data table that contains several versions of Z scores from slightly different models.

                    Z score from Model A     Z Score from Model B....Z Score from model X

Subject 1

Subect 2

...

Subject N

I'm trying to build a data visualization application where the client would pick a pair of these z values and a critical value.

The resultant interactive graph would then be an XY chart of the Z values and a horizontal line and a vertical line, both at the chosen critical value.

Hopefully the client can then mouse around the chart and locate individuals with dramatically different Z values.

I constructed a graph in graph builder that does what I want for a pair of variables.

I've modified the sample application Launcher with Report to return an X Value, a Y Value and a Critical number and have managed to pass these values into the code from graph builder.

OnModuleLoad({items},

    yval = items[1];

    xval = items[2];

    critical = items[3];

);

By changing x variable to xval (and the same thing for the y axis) I can make the sample application change axis. There is sample code at the end of the post.

I'm running into two problems.

#1. I can't seem to suppress the column dialog that autostarts when I use xval/yval. (If I could get the column dialog to pass a critical value....I suppose I could work with that.)

#2 I can't seem to locate a suitable way to modify the dispatch lines so the vertical and horizontal lines appear when I change the X, Y values from what they where when I created the graph in graph builder.

Am I just way up the wrong tree here?

Thanks in advance for any replies.

Report1 = Platform(
DataTable1,
Graph Builder(
Show Control Panel( 0 ),
Variables( X( Eval( xval ) ), Y( Eval( yval ) ) ),
Elements( Points( X, Y, Legend( 1 ), Jitter( 1 ) ) ),
SendToReport(
Dispatch(
{},
"Z Value From A",
ScaleBox,
{Add Ref Line(
Eval( critical ),
Solid,
"Red",
"",
2
)}
),
Dispatch(
{},
"Z Value from D",
ScaleBox,
{Add Ref Line(
Eval( critical ),
Solid,
"Red",
"",
2
)}
)
)
)
)
),

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Solution

I see - it's definitely an issue when the Dispatch() commands refer to one of the values that has been parameterized.  This may be a case where scripting the Ref Lines is easier than trying to use the Dispatch.  After the objects have been created (after thisModuleInstance << Create Objects in the script for Module1), you would include something like:

Report1[AxisBox(1)] << Add Ref Line( critical, "Solid", "Black", "", 2 );

The default behavior of App Builder is to use the Current Data Table for any boxes or reports that require a table.  To change this, select the Data Table in the Object Tree, and change the "Location" property.  A value of "Prompt" will always prompt you to select (or open) the table.  Note that the Location property only applies at run-time.  You still need to have a path to a data table so that App Builder can open the table at edit time.

There are on-line classes available for help in learning JSL.  Next month there is a Live Web Introduction to JSL that may be helpful.  There are other classes as well, including one for Application development using Application Builder, but that is not available again until September.  You can also just purchase the course notes by themselves.  Two books of interest are Jump into JMP Scripting and JSL Companion: Applications of the JMP Scripting Language.

Hope that helps!

-Dan

7 REPLIES
dfshort

Community Trekker

Joined:

Apr 23, 2014

checked assumed answered by mistake and cannot determine how to uncheck that.

Not a good day.

Jeff_Perkinson

Community Manager

Joined:

Jun 23, 2011

I fixed it by marking your reply as a correct answer and then undoing that.

-Jeff

-Jeff
danschikore

Staff

Joined:

Sep 21, 2012

#1: Select "Application" in the Object tree.  The property "Auto Launch" is selected by default.  If you uncheck this, then the Columns dialog should not be shown when the application runs.  When this option is disabled, it is assumed that the developer will write appropriate JSL to initialize the parameter variables, which you have already done.

#2: Application Builder currently only supports the parameterization of platform roles directly.  From your example script, it looks like you may have edited the saved file to use "Eval( critical )" for the lines?  I tested this with a simple Graph Builder example, and it seemed to work for me.  Where you might run into problems is if App Builder needs to re-save the JSL for the platform to capture changes - this is generally only done when you send an <<Edit message to a running Application.  This is possible through the red-triangle menus in an Instant Application (Combine Windows).  When this is re-saved the Eval(critical) would change back to a constant.

Another issue to point out when editing the JSL behind a JMP Application is the edit-time behavior.  When you open an App in the editor, scripts / launch dialogs are not run, so App Builder knows to create the xval, xval parameters so that the platform will launch correctly.  The same will not happen for changes that were made to the JSL through the editor.  If your variables are defined globally, the platform may still launch as expected, but it's possible that your customizations will be lost in this way as well.

If you want to send me a test App I'll be happy to look at it..

-Dan

dfshort

Community Trekker

Joined:

Apr 23, 2014

Dan,

Thank you #1 is exactly what I needed. I didn't think about the auto launch w/respect to the entire application, but that makes sense.

As to #2....The eval(critical) section works for what I need. In wanting the power of data selection in the graph builder there is potential for a user to go places I had not anticipated. Thanks for the warning.

What I was really after was a way to substitute some form of eval(xval) for "Z Value from A" in the dispatch statement.  I'm able to mimic the behavior that I want by inserting a dispatch statement for every possible variable that could be used, but I'm confident that is not the best practice.

Dispatch(
{},
"Z Value From A",
ScaleBox,
{Add Ref Line(
Eval( critical ),
Solid,
"Red",
"",
2
)}
),

Is there a way to create a dialog to allow the user to point to a data table at the start of the application?

I'm neither new to coding or JMP, but I'm looking under the hood of JPL for the first time and found the going much slower than I had thought. Any advice on resources or texts to turn the learning cliff into a learning curve?

pmroz

Super User

Joined:

Jun 23, 2011

Take a look at the attached presentation.  It shows how to develop a very basic program using Application Builder.  The program brings up a dialog box where you have to select a table to use for creating some graphs.

Highlighted
Solution

I see - it's definitely an issue when the Dispatch() commands refer to one of the values that has been parameterized.  This may be a case where scripting the Ref Lines is easier than trying to use the Dispatch.  After the objects have been created (after thisModuleInstance << Create Objects in the script for Module1), you would include something like:

Report1[AxisBox(1)] << Add Ref Line( critical, "Solid", "Black", "", 2 );

The default behavior of App Builder is to use the Current Data Table for any boxes or reports that require a table.  To change this, select the Data Table in the Object Tree, and change the "Location" property.  A value of "Prompt" will always prompt you to select (or open) the table.  Note that the Location property only applies at run-time.  You still need to have a path to a data table so that App Builder can open the table at edit time.

There are on-line classes available for help in learning JSL.  Next month there is a Live Web Introduction to JSL that may be helpful.  There are other classes as well, including one for Application development using Application Builder, but that is not available again until September.  You can also just purchase the course notes by themselves.  Two books of interest are Jump into JMP Scripting and JSL Companion: Applications of the JMP Scripting Language.

Hope that helps!

-Dan

dfshort

Community Trekker

Joined:

Apr 23, 2014

Thank you so much to all that replied.

Starting is always the tough part.