cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
Martin
Level V

Data Filter Source Box / Selection Filter Output Selection

Is there a way to "read" or output what has been selected in a Data Filter Source Box graph?  I want to use the information to change a Data Table Data Filter.

1 ACCEPTED SOLUTION

Accepted Solutions
gzmorgan0
Super User (Alumni)

Re: Data Filter Source Box / Selection Filter Output Selection

@Martin,

Selections via a graph UI that has, select and lasso, etc tools, there might be no logic just user selected points.  So the Context filter only returns the row states. The script below is a modification of one written for JSL Companion, 2nd Ed. It does not use a transformed variable (to make it more intuitive) and it add a row state handler, to capture the results of any change.

 

The handler function merely prints to the log the rows states and the rows that are excluded.  It uses a simple loc() function looking for 6 the excluded state.  This will need a bit more work if colors and other states are changed.  This was a simple case. If your use is different you will have to provide details  

image.png

This screenshot shows the filter. The left set of XY graphs are included in the context box, the right set titled unfiltered are the same XY graphs but not included in the context box. The portion of code that gets the filtered(excluded) rows is shown below.

 

After you make selections, if you run the last commented line below you will see the points in the unfiltered side highlighted (selected);

 

 

 

//dfsb is the  object ref to the data filter source box

excl = []; f = function({a}, {sm}, sm = dfsb << get row states; excl = loc(sm==6); print(sm,excl); ); rs = dfsb << Make Row State Handler( f ); //fit_dt << select rows(excl)<<invert row selection;

Where this needs more work is the loc() function.  See the Help > JSL Scripting Index > Display Box > Data Filter Source Box for an example of Set Row States

 

Comment I like to use a Local Data Filter that has more options.  

View solution in original post

2 REPLIES 2
gzmorgan0
Super User (Alumni)

Re: Data Filter Source Box / Selection Filter Output Selection

@Martin,

Selections via a graph UI that has, select and lasso, etc tools, there might be no logic just user selected points.  So the Context filter only returns the row states. The script below is a modification of one written for JSL Companion, 2nd Ed. It does not use a transformed variable (to make it more intuitive) and it add a row state handler, to capture the results of any change.

 

The handler function merely prints to the log the rows states and the rows that are excluded.  It uses a simple loc() function looking for 6 the excluded state.  This will need a bit more work if colors and other states are changed.  This was a simple case. If your use is different you will have to provide details  

image.png

This screenshot shows the filter. The left set of XY graphs are included in the context box, the right set titled unfiltered are the same XY graphs but not included in the context box. The portion of code that gets the filtered(excluded) rows is shown below.

 

After you make selections, if you run the last commented line below you will see the points in the unfiltered side highlighted (selected);

 

 

 

//dfsb is the  object ref to the data filter source box

excl = []; f = function({a}, {sm}, sm = dfsb << get row states; excl = loc(sm==6); print(sm,excl); ); rs = dfsb << Make Row State Handler( f ); //fit_dt << select rows(excl)<<invert row selection;

Where this needs more work is the loc() function.  See the Help > JSL Scripting Index > Display Box > Data Filter Source Box for an example of Set Row States

 

Comment I like to use a Local Data Filter that has more options.  

Martin
Level V

Re: Data Filter Source Box / Selection Filter Output Selection

This is a unique solution and I like it. I think a Row State of 6 is both hidden and excluded, though.

Thank you @gzmorgan0