Subscribe Bookmark RSS Feed

How can I make sure a window does not change names (when using a contingency graph together with a column switcher)?

gv

Community Trekker

Joined:

Jul 28, 2014

Combining a Contingency graph (Fit y-by-x) with two column switchers provides a nice little interface to explore data. However, when the column selection is changed by the column switchers the name of the window is automatically changed, the name of the contingency window is always: Contingency of ... by .... . Is there any way to prevent JMP from changing the name of the window? Changing the name of the window within the script works but does not 'lock' the title, so whenever the column switcher is used the name changes again.

This is a problem for me because I use the name of the window as a reference for an external program. I also have a variable number of windows so I can't use the number of the window as a reference.

Here is an example, just use the column switcher to select a different column and see the window change names:

Open("$SAMPLE_DATA/Auto Raw Data.jmp");

Y( :Name( "Claim(Y/N)" ) ),

X( :Name( "City(Y/N)" ) ),

Count( 1 ),

Total %( 1 ),

Col %( 1 ),

Row %( 1 ),

Expected( 0 ),

Deviation( 0 ),

Cell Chi Square( 0 ),

Col Cum( 0 ),

Col Cum %( 0 ),

Row Cum( 0 ),

Row Cum %( 0 )

),

Tests( 0 ),

Name( "Claim(Y/N)" ),

{Sample #, Premium USD, Name( "Claim(Y/N)" ), Claim USD, Age, AgeClass,

Gender, Car Power, Rating Class, Branch, Zone, Region}

),

Name( "City(Y/N)" ),

{Sample #, Premium USD, Claim USD, Age, AgeClass, Gender, Car Power,

Rating Class, Branch, Zone, Region, Name( "City(Y/N)" )}

);

Open("$SAMPLE_DATA/Auto Raw Data.jmp");

Y( :Name( "Claim(Y/N)" ) ),

X( :Name( "City(Y/N)" ) ),

Count( 1 ),

Total %( 1 ),

Col %( 1 ),

Row %( 1 ),

Expected( 0 ),

Deviation( 0 ),

Cell Chi Square( 0 ),

Col Cum( 0 ),

Col Cum %( 0 ),

Row Cum( 0 ),

Row Cum %( 0 )

),

Tests( 0 ),

Name( "Claim(Y/N)" ),

{Sample #, Premium USD, Name( "Claim(Y/N)" ), Claim USD, Age, AgeClass,

Gender, Car Power, Rating Class, Branch, Zone, Region}

),

Name( "City(Y/N)" ),

{Sample #, Premium USD, Claim USD, Age, AgeClass, Gender, Car Power,

Rating Class, Branch, Zone, Region, Name( "City(Y/N)" )}

);

3 REPLIES
ian_jmp

Staff

Joined:

Jun 23, 2011

I'm a little unclear on your use case, but a development of the code below may help:

NamesDefaultToHere(1);

title = "Fixed";

// Get a table

dt = Open("$SAMPLE_DATA/Auto Raw Data.jmp");

cols = dt << getColumnNames("String");

// Make a window

nw = NewWindow(title,

  c = dt << Contingency(Y( :Age ), X( :Car Power ), Contingency Table( 0 ), Tests( 0 ));

  cs = c << Column Switcher(:Age, cols);

);

// Use the column switcher via JSL

vars = cs << getList;

For(v=1, v<=NItems(vars), v++,

  Wait(1);

  cs << Next;

  nw << setWindowTitle(title); 

);


ms

Super User

Joined:

Jun 23, 2011

When manually playing around with the column switchers, this approach may work to reset the window title after each column selection.

Names Default To Here( 1 );

dt = Open( "$SAMPLE_DATA/Auto Raw Data.jmp" );

cols = dt << Get Column Names( "String" );

nw = New Window( "Fixed",

    dt << Contingency(

        Y( :Age ),

        X( :Car Power ),

        Column Switcher( :Age, cols ),

        Column Switcher( :Car Power, cols ),

        Contingency Table( 0 ),

        Tests( 0 )

    )

);

{nw[listboxbox( 1 )], nw[listboxbox( 2 )]} << set function( nw << set window title( "Fixed" ) );


gv

Community Trekker

Joined:

Jul 28, 2014

Thank you both for your reply Ian and MS. To clarify my use case a bit further: We use a VB GUI in which the user choses which JMP windows to show (actually which scripts to run). The resulting graphs (such as the contingency analysis) are displayed within the VB GUI. We use the JMP window title as a reference to a specific instance of a window.  

The solution proposed by MS seems to work in my case! Thank you! The window title is still momentarily changed though, I wonder if an even cleaner solution would be possible that truly freezes the window title.