@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
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.