Here is an example of saving and then using a row state column to reset the data table back to the state it was when the original graph was run.
names default to here(1);
// Open a sample data table
dt = open("$SAMPLE_DATA/big class.jmp" );
// Set some exclusions and row coloring
dt << select where(:age == 12 & :sex == "F" );
dt << hide and exclude;
dt << color by column(:age);
// Run the graph to get the results desired
Graph Builder(
Size( 522, 486 ),
Show Control Panel( 0 ),
Variables( X( :age ), Group X( :sex ), Overlay( :age ) ),
Elements( Bar( X, Legend( 8 ) ) ),
SendToReport( Dispatch( {}, "400", LegendBox, {Set Title( "" )} ) )
);
// To save the data table status at the time of the graph, simply
// create a new row state column, and copy the row states to it
dt << new column("My Row States", rowstate);
dt:My Row States << copy from row states;
// To illustrate what would needed to be added to the Graph Script
// to recreate the environment it was originally run in, I will first
// clear all of the row states to bring the table back to the
// default blank row states
dt << clear row states;
// Now all that has to be done, is to copy the rowstates from the row state
// column back to the data table row states, and then rerun the graph
dt:My Row States << copy to row states;
Graph Builder(
Size( 522, 486 ),
Show Control Panel( 0 ),
Variables( X( :age ), Group X( :sex ), Overlay( :age ) ),
Elements( Bar( X, Legend( 8 ) ) ),
SendToReport( Dispatch( {}, "400", LegendBox, {Set Title( "" )} ) )
);
I don't think this is a complete answer to your response, but I was not real sure on what else you were asking for. Could you restate what you are asking and provide more specifics?
Jim