Hi All,
I am trying to write some JSL code that takes data from a data table and graphically displays it for the user to choose from for further analysis. What I'd like to get is something like a mix between the Eigenvalue report from the PCA platform and the Effect Summary report from the Fit Model Platform. I'd like the visual to look like the PCA report, but the functionality (i.e. being able to select a row) of the Effect Summary report.
PCA Eigenvalue report (how I want it to look):
Fit Model Effect Summary report (the functionality I'd like). In this platform one can select a row in the List Box() and choose to "remove" or "add". I don't want to remove or add, but I do want the user to be able to select the row (from the above output):
I've attached the data table I'm working with, this is the "Current Data Table()" in the JSL code below. The JSL code below can get me part of the way, but not exactly what I want.
Names Default To Here( 1 );
PC_dt = Current Data Table();
PC_n = {};
PC_eigv = {};
PC_per = {};
PC_cump = {};
For( i = 1, i <= N Rows( PC_dt ), i++,
Insert Into( PC_n, PC_dt:"Number"n[i] );
Insert Into( PC_eigv, Round( PC_dt:"Eigenvalue"n[i], 5 ) );
Insert Into( PC_per, Round( PC_dt:"Percent"n[i], 5 ) );
Insert Into( PC_cump, Round( PC_dt:"cumulative Percent"n[i], 5 ) );
);
PC_Rpt_win = New Window( "PC Results",
Outline Box( "Eigenvalues & cumulative Percent",
//List Box(
//List Box(
Table Box(
Number Col Box( "Number", Eval List( PC_n ) ),
Number Col Box( "Eigenvalue", Eval List( PC_eigv ), <<Set Format("Fixed Dec", 6,6) ),
Number Col Box( "Percent", Eval List( PC_per ), <<Set Format("Fixed Dec", 6,6) ),
Plot Col Box( "", Eval List( PC_per ), <<Set Scale(0,100, "Percent") ),
Number Col Box( "cumulative Percent", Eval List( PC_cump ), <<Set Format("Fixed Dec", 6,6) )
)
//)
//)
)
);
With the commented out sections I get the following output from the code (no row is selectable, though):
I really don't know if I need the whole pre-Outline box portion of the code where I generate lists for the PCs and eigenvalues, etc. But, it seemed like the logical way to do it since I'm dealing with columns in a data table and the functions require lists. It works, even if not necessary.
If I include either or both of the commented-out List Box() calls around the Table Box(), I get the following. Rows are selectable, but nothing shows up:
I'm not sure what I'm doing wrong, and the Scripting Index has limited examples of how to correctly use the List Box() call with a Table Box(). I tried following the tree structure from the Fit Model platform report window, but it's not working.
In summary, I'd like to correct the following in my script:
- Correct the Plot Col Box so that it has the cumulative percent curve like the PC report shows (first image above). This is not as critical as item 2.
- Correct the List Box() call around the Table Box() so that the user can select a row in the List Box that will then get sent on to another function for further analysis.
Thanks for any suggestions and help!,
DS