cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
LiPav
Level II

//GraphBuilderGroupBox << Get Window Title issue

Hi,

 

do you know how to get the GraphBuilderGroupBox "name" from the JSL scripting level? In attached picture it would be "Male" or "Female" (marked in red circles). My guess is to have a similar command to << xpath( "//GraphBuilderGroupBox" )) << Get Window Title. However it doesn't work.

 

Here is the code:

 

 

dt = Open( "$SAMPLE_DATA/Academic Achievement.jmp" );

win = dt << Graph Builder(
    Size( 570, 475 ),
    Variables( X( :Year4 ), Y( :Year2 ), Group X( :Female ) ),
    Elements( Points( X, Y, Legend( 8 ) ), Smoother( X, Y, Legend( 9 ) ) )
);

GroupBoxName = (win << xpath( "//GraphBuilderGroupBox" )) << Get Window Title; //<<Class Name

Show( GroupBoxName );

 

 

I need it in my extended code, where I paste FrameBoxes from different tables on one GB. Frameboxes keep "correct" location as long as I do not use Local Data Filter, otherwise plotted data is messed up. I use JMP 16.1.

 

Thanks for your advices!

 

Regards,

Li

 

InkedGroupBox.jpg

Li Pavlov
1 REPLY 1
jthi
Super User

Re: //GraphBuilderGroupBox << Get Window Title issue

No sure if you can access those "names" (groupings) from graph builder. You can check what you can access with Xpath by using << Get XML on win variable and based on that there is no mention of "Female" and "Male". Also checking from Show Tree Structure and Show Properties I cannot see them there either:

jthi_0-1633420318543.png

To get a reference to GraphBuilderGroupBox you can use:

gbgb = Report(win)[GraphBuilderGroupBox(1)];
//or
gbgb = (win << XPath("//GraphBuilderGroupBox"))[1]; //it is a list so use index

Accessing the Group X can be done with Variable, but I'm not sure if it will be helpful here:

Names Default To Here(1); 

dt = Open("$SAMPLE_DATA/Academic Achievement.jmp");

win = dt << Graph Builder(
	Size(570, 475),
	Variables(X(:Year4), Y(:Year2), Group X(:Female)),
	Elements(Points(X, Y, Legend(8)), Smoother(X, Y, Legend(9)))
);
//win << get xml
gbb = Report(win)[Graph Builder Box(1)];
wait(1);
gbb << Remove Variable(3);
gbb << Add Variable({:Female Binary, Role("Group X")});

Edit:

If you need just the values of Female column, you can get them directly from datatable. As these are value labels, you have to get value label property

(Column(dt, "Female") << Get Column Properties())["Value Labels"]

 

 

-Jarmo