try Variant=3; // 1-3 (no influence on timing)
try Command=1; // 1: Heatmap, 2: Points (~ factor 10 faster)
groups = 500;
variant = {"Continuous", "Ordinal","Nominal"}[tryVariant];
myCommand={Expr(Elements( Heatmap( X, Y, Legend( 17 ) ) )),Expr(Elements( Points( X, Y, Legend( 17 ) ) ))}[tryCommand];
dt = New Table( "dt" );
Eval( Eval Expr( New Column( "X", Numeric, Expr( variant ), Format( "Best", 12 ), Formula( Floor( Modulo( (Row() - 1), 10000 ) / 100 ) ) ) ) );
Eval( Eval Expr( New Column( "Y", Numeric, Expr( variant ), Format( "Best", 12 ), Formula( Modulo( (Row() - 1), 100 ) ) ) ) );
New Column( "group", Numeric, "Nominal", Format( "Best", 12 ), Formula( Floor( (Row() - 1) / 10000 ) ) );
New Column( "value",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula( Random Normal( 0, 0.001 ) + If( Random Integer( 10000 ) < 5, 1, 0 ) ),
);
dt << Add Rows( 10000 * groups, At End );
New Window( "wait ...", <<MODAL> all groups will be plotted
// surprising: the data filter inside the GraphBuilder doesn't show this effect ...
start1 = Today();
Eval(Eval Expr(New Window( "Data Filter Context Box",
Data Filter Context Box(
H List Box(
dt << Data Filter(
Local,
Add Filter( columns( :group ), Where( :group == As List( 0 :: 4 )[1] ), Display( :group, N Items( 4 ), Find( Set Text( "" ) ) ) )
),
dt << Graph Builder(
Size( 400, 400 ),
Show Control Panel( 0 ),
Graph Spacing( 5 ),
Variables( X( :X ), Y( :Y ), Wrap( :group ), Color( :value ) ),
Expr(myCommand),
SendToReport(
Dispatch( {}, "X", ScaleBox, {Min( 0 ), Max( 100 ), Inc( 10 ), Minor Ticks( 9 )} ),
Dispatch( {}, "Y", ScaleBox, {Min( 0 ), Max( 100 ), Inc( 10 ), Minor Ticks( 9 )} ),
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
17,
Properties(
0,
{gradient( {Color Theme( "Black Body" ), Scale Values( [0 1] ), Reverse Gradient( 1 )} )},
Item ID( "value", 1 )
)
)}
)
)
)
)
)
)));
stop1 = Today();
Print( "data filter context box: ", stop1 - start1 );
New Window( "wait ...", <<MODAL>calculated< time difference is much smaller, but it takes the same time for the graph to show up
Eval(EvalExpr(New Window( "Data Filter inside GraphBuilder",
dt << Graph Builder(
Size( 400, 400 ),
Show Control Panel( 0 ),
Graph Spacing( 5 ),
Variables( X( :X ), Y( :Y ), wrap( :group ), Color( :value ) ),
Expr(myCommand),
Local Data Filter(
Add Filter( columns( :group ), Where( :group == As List( 0 :: 4 )[1] ), Display( :group, N Items( 15 ), Find( Set Text( "" ) ) ) )
),
SendToReport(
Dispatch( {}, "X", ScaleBox, {Min( 0 ), Max( 100 ), Inc( 10 ), Minor Ticks( 9 )} ),
Dispatch( {}, "Y", ScaleBox, {Min( 0 ), Max( 100 ), Inc( 10 ), Minor Ticks( 9 )} ),
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
17,
Properties( 0, {gradient( {Color Theme( "Black Body" ), Scale Values( [0 1] ), Reverse Gradient( 1 )} )}, Item ID( "value", 1 ) )
)}
)
)
)
)));
stop2 = Today();
Print( "local data filter inside the Graphbuilder: ", stop2 - start2 );</MODAL></MODAL>