I need help understanding how to reference framebox's axis from within graphics script.
Here's what I have now:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
ob_group = Outline Box( "Testing Handles: " || (dt << Get Name) );
nw = New Window( (dt << get name), ob_group );
GB_wHandle = Function( {dt, X_parameter, Y_Parameter, groupByColumnString},
groupByColumn = Column( dt, groupByColumnString );
cb = Context Box(
box:exx = 60;
box:exy = 60;
box:gb = Graph Builder(
Size( 450, 350 ),
Ignore Platform Preferences( 1 ),
Show Control Panel( 0 ),
Variables( X( Column( X_Parameter ) ), Y( Column( Y_Parameter ) ), Overlay( groupByColumn ) ),
Elements( Points( X, Y ), Smoother( X, Y ) )
);
box:rgb = box:gb << Report;
box:framebox = box:rgb << XPATH( "//FrameBox" );
box:axis = box:rgb << XPATH( "//AxisBox" );
box:axisMax = box:axis << Get Max;
box:axisMin = box:axis << Get Min;
{box:exx, box:exy} = box:axisMin + 10;
box:framebox << Add Graphics Script(
"Front",
Description( "Handle" ),
//Script start
{Handle(
box:exx,
box:exy,
box:exx = x;
box:exy = y;
) ;
box:axisMax = box:axis << Get Max;
box:axisMin = box:axis << Get Min;
Pen Color( "Red" ) ; Line( box:axisMin, {box:exx, box:exy} ) ; }
);
);
Return( cb );
);
ob_group << Append( GB_wHandle( dt, "height", "weight", "sex" ) );
I need context box because I have multiple GBs in the same window with independent handles.
Everything works until I select a point on the plot or a row in the table and exclude it.
Then my graphics disappear and I get "Graphic script reported errors in log" and "Send Expects Scriptable Object in access or evaluation of 'List' , {/*###*/DisplayBox[], DisplayBox[]}" in the log.
The error happens because of the lines:
box:axisMax = box:axis << Get Max;
box:axisMin = box:axis << Get Min;
If I comment them out, no errors - but then I don't get updated axis min/max in case user changes axis scale.
How can I fix it?