cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
EstelleS
Level III

How to link graph selections with JSL?

Hi Everyone!

 

I am using Application Builder and I have several different plots I scripted using Graph Builder. Many of the graphs are using different data tables that have been operated on using Python and sent back into JMP. Because the data goes through significant processing in Python, these tables do not include any of the same variables. I am looking for a way to connect selections on these graphs (like if you select one of the legend labels and it grays out the non-selected items) using JSL.

 

For example, I am graphing my raw data and my "final product" data, which has greatly reduced dimensions and similar features are grouped together, so in Table1/Graph1 there may be 30 columns and in Table2/Graph2 there are only 3. If I have a list box with the Table2 variables and I select Variable1, I would like to be able to highlight Variable1 on Graph2, but also to highlight the relevant information in Graph1. I can determine the relevant columns/rows to highlight, but I haven't been able to find how to actually set those selections on the graph. It would also be great if I could select one of the legend labels on a graph (where it automatically grays out the non-selected items) and script something so that it selects the relevant info on the other graphs.

 

Is there a JSL line to highlight something on a graph like this?

12 REPLIES 12
jthi
Super User

Re: How to link graph selections with JSL?

Managed, at some point, to generate "helpful" message in Enhanced Log

jthi_0-1658341937464.png

 

-Jarmo
EstelleS
Level III

Re: How to link graph selections with JSL?

I see... Thanks for the info! Since I'm closing this chapter on row state handlers lol, I decided to try the "<< Add Graphics Script" idea provided above again, but with flags this time. When implemented without flags, it seems to exhibit the same (bad) behavior I was dealing with above, but with flags it seems to work! 

 

 

appNS:already_run=0;

Eval(EvalExpr(Report(gb1)[FrameBox(1)] << Add Graphics Script(
	If(appNS:already_run==1,
	appNS:already_run=0,
	f = dt1 << Get Selected Rows;
	group_selected = dt1[f, "index1"];
	appNS:already_run=1;
	expr(dt2) << Select Where(Contains(group_selected, :"index2"));	
))));

Eval(EvalExpr(Report(gb2)[FrameBox(1)] << Add Graphics Script(
	If(appNS:already_run==1,
	appNS:already_run=0,
	f = dt2 << Get Selected Rows;
	group_selected = dt2[f, "index2"];
	appNS:already_run=1;
	expr(dt1) << Select Where(Contains(group_selected, :"index1"));	
))));

Hopefully this will continue to work as I expand the graphics connections. Any idea why row state handlers will continuously grab the "selection" over and over (thus creating a loop between the graphs and freezing JMP) and why the same JSL in a graphics script doesn't?

 

I really appreciate the help @jthi & @txnelson !

 

jthi
Super User

Re: How to link graph selections with JSL?

Row State Handlers trigger on all row state changes. So when you choose 1 row, you trigger (at least) two events; one deselect and one select. Most likely this is causing some issues and could very easily cause loop. If you could only capture specific events (select, un-select, hide, exclude...) maybe it would work.

-Jarmo