Code snippet to add and remove a wrap variable. This came from the online discovery summit 2021 unsession JSL scripting.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
//make initial graph
gb = Graph Builder(
Variables( X( :height ), Y( :weight ) ),
Elements( Points( X, Y ), Smoother( X, Y ) )
);
//get a reference to the grab builder box
gbb = Report( gb )[Graph Builder Box( 1 )];
Wait( 1 );
//add a wrap variable to demonstrate adding
gbb << Add Variable( {:age, Role( "Wrap" )} );
Wait( 1 );
//remove wrap variable
gbb << Remove Variable( {:age, Role( "Wrap" )});
Wait( 1 );
//add graphics script
gbb[frame box( 1 )] << Add Graphics Script(
2,
Description( "" ),
If( Is Empty( g_x4 ),
g_x4 = [52.92, 68.48, 70.56];
g_y4 = [119.69, 139.30, 124.01];
);
Drag Line( g_x4, g_y4 );
);
//add wrap variable
gbb << Add Variable( {:age, Role( "Wrap" )} );
Script by @julian THX a lot.
"I thought about our dilemma, and I came up with a solution that I honestly think works out best for one of both of us"
- GLaDOS