Subscribe Bookmark RSS Feed

HTML-like references within a JSL scripted display window

mikedriscoll

Community Trekker

Joined:

Jun 23, 2011

Hi, I have a script that does an analysis on a given data set, and outputs summaries on the first few pages of a report (uses new window() command with various display objects), followed by N pages of scripted analysis for N chosen parameters. All of this is in the same report, and I make use of the page break feature to separate each parameter. N can be any number... just a few or a thousand or so parameters / pages.  Is it possible to have hyperlinks that can link from the summary on the first page or so and point to targets within this report? It could point to either a coded target, or a page number, which i could try to track.  Coded reference is preferred... with 1000 parameters the summary would wrap through several pages and I'm actually not sure I could keep track of page number.

I've seen links (e.g. help menu -> sample data -> all categories have them), but they would point to a file or I suppose some other protocol address would also work -- open() vs web() commands.  But is it possible to code it such that I can link and point to a place in the same report window?

Note that because I make extensive use of dynamically controlled / scaled axis boxes and on the fly calculations, it needs to be done in the native 'new window()' output, not an HTML5 export.

Thanks,
Mike

6 REPLIES
Wendy_Murphrey

Joined:

Jun 23, 2011

Hi, Mike.

Have you considered using TabBox()?  There is a tab style called "Combo" that produces a dropdown menu of each tab name so the user can select and be taken to that tab directly.  Here is a simple example:


/* Open sample data and obtain a list of column names */


dt = Open( "$SAMPLE_DATA\Fitness.jmp" );


colList = dt << Get Column Names( Continuous, String );





/* Store the number of desired tabs in a variable */


nTabs = N Items( colList );





/* Create a New Window containing an empty TabBox */


New Window( "Example", tb = Tab Box() );





/* Use a For loop to add the desired number of tabs to the TabBox */


For( i = 1, i <= nTabs, i++,


  tb << Add( colList || " Distribution",


      V List Box(


          Distribution( Continuous Distribution( Column( Column( colList ) ), Horizontal Layout( 1 ), Vertical( 0 ) ) )


      )


  )


);


tb << Set Selected( 1 );


tb << Set Style( "combo" );


Wendy
mikedriscoll

Community Trekker

Joined:

Jun 23, 2011

Hi Wendy,

I've been thinking along those lines as a workaround, but I like the idea of keeping the full set of parameters in 1 very long report for report archiving. I can print to pdf for someone (or very likely, no one) to view it later. Also, with 1000+ parameters, sometimes it is nice to be able to quickly page down and just visually scan for a distribution that looks off (skewed, bi modal, outliers). 

My idea was to create the same window i have now, but also open a separate window the first time a link (parameter name) in the summary was clicked. In this window would be a set of analyses and outputs that are essentially the same as i have in my main window, except that in the secondary window it would just be 1 parameter, while in the main window, it would be the full set of many parameters. Clicking on subsequent links from the main window would delete the previous parameter from the secondary window and create the new one.  There are several radio buttons and other controls and axis scaling that is done, so I'd have to take this information and relay it back to the main window's corresponding parameter, but it would probably work.  The only exception I think would be manually scaling the axis with the mouse.  I don't think there is an event function that is associated with this  (OnAxisChange() for example), but I suppose a 'done' button could be implemented to grab the new min / max and throw that back into the main window's parameter's axis.

Thanks,
Mike

Jeff_Perkinson

Community Manager

Joined:

Jun 23, 2011

I think I would use Column Switcher in a case like this.

It will allow your user to pick the analysis they want, no extra scripting on your part to update another window.

If you want the PDF option you can put a button on the window that will run all the parameters in a new, invisible window and save it as PDF.

-Jeff

-Jeff
mikedriscoll

Community Trekker

Joined:

Jun 23, 2011

Hi Jeff,

I spent some time checking the column switcher out. Someone at the Discovery Summit had mentioned it (shortly after your game show host stint ), but I didn't realize it can be added to any platform.   I really like the play / vary speed feature. However, my script has some other embedded features, one of which is allowing the user to scale window size on distributions using radio buttons (application is semiconductor electrical testing in production). I have a button to scale all parameters' axes to existing limits (and others window sizes like all data, low side fallout, high side fallout, median +/- N * IQR, etc). Keeping these min / max values as the user sets them is important; it looks like column switcher resets this.  Other features include ability to group-by using Anova and GR&R all at the same time.

But for this specific feature I use, I set all the min / max axes to the corresponding spec limits. This means the only part of the distribution shown is from the minimum limit to max limit (min / max spec in our testing); this is used as a starting point such that all parameters start with min / max of the window = min / max spec limit.  Each individual parameter has these axis scaling controls as well, or a user can use the mouse to scale the axis.  After the user goes in and scales the parameters of interest, there is a button at the bottom to generate a limit table. This grabs all of the min / max axis values and outputs to a table which can then be imported into the test program. It turns out to be an efficient way to adjust many limits (especially with a GUI option to plot only the top N yield offenders).  We have other scripts to set limits via desired cpk or whatever math, but sometimes there's just too many distributions that are not ideal and this works quite well.

Here's an example of the output, in this case only one parameter was plotted, and I didn't group it.  The radio buttons would scale the axis, and the button box at the bottom would retrieve all of the min / max values and generate the table.

Because this script is used for a few different things, I'm sort of reluctant to completely rewrite it.  But I will see if I can make use of that column switcher in some manner or other in the near future.

8797_pastedImage_1.png

Thanks,

Mike

Wendy_Murphrey

Joined:

Jun 23, 2011

Mike,

The earlier TabBox() example should save as you want in PDF, but that doesn't offer the long report you are looking for.  So here is another option for you.  See the embedded comments for details.

Wendy


dt = Open( "$SAMPLE_DATA\Fitness.jmp" );


colList = dt << Get Column Names( Continuous, String );



/* New Window with a Summary OutlineBox and a separate Analyses OutlineBox */


nw = New Window( "Example 2", ob = Outline Box( "Summary" ), Outline Box( "Analyses", vl = V List Box() ) );


/* Initialize a list for storing references to the Distributions */


dist = {};



/* Loop through each column


     - append each Distribution to the Analyses Outline Box


     - append a button link to expand the specified Distribution OutlineBox */


For( i = 1, i <= N Items( colList ), i++,


       vl << Append( dist = Distribution( Continuous Distribution( Column( Column( colList ) ), Horizontal Layout( 1 ), Vertical( 0 ) ) ) );


       var = colList || " Distribution";


       Report( dist )[Outline Box( 1 )] << Set Title( var );


       Eval(


              Eval Expr(


                     ob << Append(


                           bb = Button Box( var,


                                  Current Window()[Expr( var )] << Close All Like This;


                                  Current Window()[Expr( var )] << Set Open( 1 );


                           )


                     )


              )


       );


       bb << UnderlineStyle( 1 );


);



/* Add a button to open all the OutlineBoxes and save the output as PDF */


ob << Append(


       Button Box( "Save All to PDF",


              Current Window()["Analyses"] << Open All Below;


              Current Window() << Set Page Setup( Scale(.75));


              path = Pick File( "Select PDF File", "E:\Trash", {"PDF|pdf"}, 1, 1, "Example 2.pdf" );


              Current Window() << SavePDF( path );


              Open( path );


       )


);



Wendy
mikedriscoll

Community Trekker

Joined:

Jun 23, 2011

Thanks Wendy. I will review with some other users and see if this is ok. For a hundreds of parameters it will still be a bit of scrolling but shouldn't be too bad.

-Mike