All,
I can't wrap my head around this problem:
I need to put handles on my GB plots. I have multiple GB plots in one window. The variables in the handles script cross-talk. I need to either use new variables in each script, or create a new namespace for each graphics script (seems the way to go for me). But then again - as soon as I create a namespace, I address it through a reference variable - which gets overwritten each time I create a new namespace.
In the example below I just use different variable names, but it needs to be created dynamically and addressed properly.
I remember there was some trick using something like:
ns = Namespace( Expr( ns << Get Name ) )
but I'm not sure if it is applicable in this case and to be frankly I'm not sure I understand how and why it's working where I'm currently using it.
Here's an example script:
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
lub = Lineup Box( N Col( 2 ) );
ns1 = New Namespace(
"height"
);
ns1:_x_location_ = 2;
ns1:_y_location_ = 50;
lub << Append(Graph Builder(
Size( 528, 450 ),
Show Control Panel( 0 ),
Variables( X( :age ), Y( :height ), Overlay( :sex ) ),
Elements( Points( X, Y, Legend( 6 ) ) ),
SendToReport(
Dispatch(
{},
"Graph Builder",
FrameBox,
{Add Graphics Script(
2,
Description( "" ),
Handle(
ns1:_x_location_,
ns1:_y_location_,
ns1:_x_location_ = x;
ns1:_y_location_ = y;
)
)}
)
)
);
);
ns2 = New Namespace(
"weight"
);
ns2:_x_location_ = 2;
ns2:_y_location_ = 50;
lub << Append(Graph Builder(
Size( 528, 450 ),
Show Control Panel( 0 ),
Variables( X( :age ), Y( :weight ), Overlay( :sex ) ),
Elements( Points( X, Y, Legend( 6 ) ) ),
SendToReport(
Dispatch(
{},
"Graph Builder",
FrameBox,
{Add Graphics Script(
2,
Description( "" ),
Handle(
ns2:_x_location_,
ns2:_y_location_,
ns2:_x_location_ = x;
ns2:_y_location_ = y;
)
)}
)
)
);
);
win = New Window( "Independent Handles Example",lub);