I might misunderstand the desired outcome, but sounds like that you only need a data filter and a plot, not the drag-n-drop interactivity in Graph Builder (GB) and the complex graph layout within GB.
If so, I believe that you at least need following ingredients:
- JSL function "Make Filter Change Handler", so you can get subsets of data based on the state of the data filter. See example for "Make Filter Change Handler" in Scripting Index.
- JSL function "Python Get Graphics", so you can get plot back from python. See example for "Python Get Graphics" in Scripting Index.
- A "Data Filter Context Box" display box to hold both the filter and your plot, and possibly other analysis together.
Here is a small example which puts the elements together.
dt = Open( "$SAMPLE_DATA/Cities.jmp" );
New Window( "Shared Local Filter",
Data Filter Context Box(
H List Box(
filter = (dt << Data Filter( Local, Add Filter( columns( :Region ) ) )),
pb = Picture Box()
)
)
);
f = Function( {nrows},
rows = filter << get filtered rows;
xx = dt:X[rows];
yy = dt:Y[rows];
Python Init();
Python Send(xx);
Python Send(yy);
ml = Python Submit(
"\[
import matplotlib.pyplot as plt
plt.scatter(xx,yy)
plt.xlabel('X')
plt.ylabel('Y')
plt.show(block=False)
]\"
);
plot = Python Get Graphics( png );
pb << set image(plot);
Python Submit( "plt.close()" );
Python Term();
);
rs = filter << Make Filter Change Handler( f );
Pay attention to Python's indentation rule. E.g. all strings in Python Submit must stick they fronts at the beginning of the lines.
Here are a couple of screenshots of the product.