I would use graph builder in combination with slider to change the appearance of the plot. In the example below I create a window with a map and a slider box to change interactively the scale of the colors. I would use the script to create different windows (of course, even with different variables, but in the example this stuff is not needed). It works just for the last created window, despite I try to assign the variables using namespaces. I tried different way but all unsuccessfully. Can anyone help?
Names Default To Here(1);
dtable= Open("$SAMPLE_DATA/SAT.jmp");
name="Map";
For(k=1, k<=10, k++,
If(Namespace Exists(Eval("ns" || name || Char(k))),
//If(k = 10,
// hanlde the max number of allowed namespaces
//);
,
name= name || char(k);
nsRef = New Namespace(Eval("ns" || name ));
Break();
)
);
nsRef << Insert("column", "% Taking (2004)");
nsRef << Insert("min", col min(column(dtable, "% Taking (2004)")));
nsRef << Insert("max", col max(column(dtable, "% Taking (2004)")));
nsRef << Insert("slmin", col min(column(dtable, "% Taking (2004)")));
nsRef << Insert("slmax", col max(column(dtable, "% Taking (2004)")));
datacolumn=column(dtable, nsRef:column );
nsRef << Insert("slider1",
slider box(nsRef:min,nsRef:max,nsRef:slmax,
title= Current Window() << Get Window Title;
ns = NameSpace(Eval("ns" || title));
slmin=ns:slmin;
slmax=ns:slmax;
scale=Matrix( {slmin,slmax} );
scale=scale`;
ns:gb <<SendToReport(
Dispatch({},"400",
ScaleBox,
{Legend Model( 3,
Properties(0,{gradient( {Scale Values( scale ), Width( 12 )} )})
)}
)
);
);
);
new window(name,
nsRef << Insert("gb",
Graph Builder(
Show Control Panel( 0 ),
Variables( Color( datacolumn ), Shape( :State ) ),
Elements(
Map Shapes(
Legend( 2 ),
Summary Statistic( "Mean" ),
Show Missing Shapes( 0 )
)
),
SendToReport(
Dispatch({},"",
ScaleBox,
{Scale( "Geodesic" ), Min( -137.654643872302 ), Max( -63.2427990180921 ),
Inc( 10 ), Minor Ticks( 0 )}
),
Dispatch({},"",
ScaleBox( 2 ),
{Scale( "Geodesic" ), Min( 16.7170042692343 ), Max( 80.0833409028976 ),
Inc( 10 ), Minor Ticks( 0 )}
)
)
),
),
H List Box(
Text Box("scale: max"),
nsRef:slider1,
),
);