For example, I made a graph of the script below.
dt = Open( "$SAMPLE_DATA/Students2.JMP" );
dt << Sort( By( 1 ), Order( Ascending ), replacetable( 1 ) );
New Column( "A" );
Column( "A" ) << Formula( If( Row() == 1 | name != Lag( name, 1 ), 1, If( Lag( A, 1 ) < 6, Lag( A, 1 ) + 1 ) ) );
dt << run formulas;
Column( "A" ) << deleteFormula;
dt << Sort( By( "A" ), Order( DEscending ), replacetable( 1 ) );
dt << delete rows( N Rows( Loc( dt[0, "A"] > 0 ) ) + 1 :: N Row( dt ) );
dt << Sort( By( 1, "A" ), Order( Ascending, Ascending ), replacetable( 1 ) );
p1 = Graph Builder(
Size( 528, 454 ),
Show Control Panel( 0 ),
Variables( X( :A ), Y( :height ), Overlay( :name ) ),
Elements( Points( X, Y, Legend( 8 ) ), Smoother( X, Y, Legend( 9 ) ) )
);
Click any conditional curve in the graph, and automatically run the specified "D
A.jsl"

Thanks!