cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
BHarris
Level VI

Connect Local Data Filters between Graph Builder Windows from different data tables

Suppose I have two Graph Builder windows from different data tables, each with a Local Data Filter filtering on "run number" and "time".

 

Is it possible to connect the two Local Data Filters so they stay in sync?

 

Or perhaps with JSL to pull the current settings from Local Data Filter #1 and apply them to Local Data Filter #2?

 

(I guess step 1 is getting a reference to the Local Data Filters, I haven't even figured out how to do that yet -- here's what I have so far:

 

// get the last Graph Builder
win = Get Window List();
graphs = Filter Each({w}, win,
	If(Length(w << XPath("//OutlineBox[@helpKey='Graph Builder']")) > 0, 1, 0)
);
last_gb = graphs[N Items(graphs)][OutlineBox("Graph Builder")] << Get Scriptable Object;
localDataFilter = last_gb << XPath("//OutlineBox[text()='Local Data Filter']");

)

11 REPLIES 11
BHarris
Level VI

Re: Connect Local Data Filters between Graph Builder Windows from different data tables

Wow, it works!  I wish I understood what that code was doing...

 

Last question -- assuming I already have a Graph Builder window open with a Local Data Filter, I know how I can get the gb .jsl object variable:

 

win = Get Window List();
graphs = Filter Each({w}, win,	If(Length(w << XPath("//OutlineBox[@helpKey='Graph Builder']")) > 0, 1, 0) );
gb = graphs[N Items(graphs)][OutlineBox("Graph Builder")] << Get Scriptable Object;

... but how can I get the df1 object variable from the gb object variable?  (It feels like I've tried 100 different things...)

 

jthi
Super User

Re: Connect Local Data Filters between Graph Builder Windows from different data tables

One option is to use similar idea as you use for graph builder

df = (gb << top parent)[Outline Box("Local Data Filter")] << Get Scriptable Object;

local data filter isn't inside the graph builder, so you have to first travel to higher level (in this case I use << top parent). Using XPath with attribute helpKey and value Data Filter might be a bit more robust solution and it would be something like this

(gb << top parent) << XPath("//OutlineBox[@helpKey='Data Filter']")

 

Edit: If you have possibility of multiple data filters in the same window, you might have to make the definition of the starting point a bit more specific than just using << top parent.

-Jarmo