Hi All,
I have been working on this idea for the past week or so and @gzmorgan0 helped me with this post
say for example, I loop through 5 continuous columns and 2 nominal columns, I plot one way analysis of 10 columns(say nw2). I get the p-value and other parameters in a table. I want the table sorted in an ascending order of p-value. Can I have my table in a new window(nw1) and each of the row(as the row has both the appropriate X and Y axis relating to the graph) in the table should reference to the appropriate graph in the nw2? Is Table Box (Data table col box) the right strategy or there is some other function I should be looking into?
I appreciate any input/comments/suggestions.
Names Default To Here( 1 );
dt = Open( "$Sample_Data/Big Class.jmp" );
ynames = {"weight", "height"};
xnames = {"sex", "age"};
pnames = {};
nw2 = New Window( "Custom Display", vl = V List Box() );
nw2 << Size Window( 724, 395 );
For( i = 1, i <= N Items( ynames ), i++,
For( j = 1, j <= N Items( xnames ), j++,
Insert Into( pnames, ynames[i] || " by " || xnames[j] );
vl << Append(
Oneway(
Y( Column( dt, ynames[i] ) ),
X( Column( dt, xnames[j] ) ),
Box Plots( 1 ),
Comparison Circles( 0 ),
X Axis Proportional( 0 ),
Means Diamonds( 1 ),
Points Jittered( 1 ),
SendToReport(
Dispatch(
{},
"Oneway",
OutlineBox,
{Set Title( Eval Insert( "^ynames[i]^ ^xnames[j]^ Comparison Report" ) )}
)
)
)
);
); //end for j
); //end for i
plb = List Box( pnames, width( 100 ), maxSelected( 1 ) );
nw1 = New Window( "Filter", plb );
_xx = (nw2 << Child) << xpath( "//OutlineBox[@helpKey='Oneway Report']" );
plb << Set Function(
Function( {this},
k = (this << get Selected Indices)[1];
nw2 << Scroll Window( _xx[k] );
)
);
nw1 << Bring Window to Front;
nw2 << Bring Window to Front;
nw1 << Move Window( 10, 10 );
nw2 << move Window( 180, 10 );
//Add a try in case the window is already closed
nw2 << On close( Try( nw1 << Close Window() ) );
I'm not really understanding your question, your code appears to do what you are asking. However, I wouldn't ever have one window affect the results of a second window. I would suggest you put both your filter and oneway plots in the same window, and you can split them with a scroll box.
This took a little more than what I documented. A sample script is attached.
gzmorgan appears to have answered your question, but you private messaged me, so I thought to elaborate on the scroll box. Attached is an editing of gzmorgan's implementation to use one window versus two.
The downside of the scroll box is that it doesn't support the << Scroll Window() command for whatever reason.
Yes, I thought a single window viewer would be best and had the same problem that scroll window would not work for a nested scroll box. I reported it to JMP so the developers are aware of the issue. JMP Support provided the attached script that demonstrates using << Get Offset to find the position more reliably.