I make a facsimile of the Variability Plot Interface and Annotate from there. Will probably need refinement but seems to work.
Names Default To Here( 1 );
dt = Current Data Table();
If( !Namespace Exists( "Custom Dialog" ),
dialogRecallNS = New Namespace(
"Custom Dialog",
{
ycolRecall =
{
}
,
standRecall =
{
}
,
xcolRecall =
{
}
,
freqRecall =
{
}
,
partRecall =
{
}
,
byRecall =
{
}
}
)
,
dialogRecallNS = Namespace( "Custom Dialog" )
);
nc = N Col( dt );
lbWidth = 130;
pgm = Expr(
nw = New Window( "Annotated Multiple Plots",
For( i = 1, i <= N Items( exy ), i++,
Notes = Try( Column( dt, exy[i] ) << Get Property( "Notes" ) );
Try(
Variability Chart(
Y( exy[i] ),
X( Eval( exx ) ),
Standard( Eval( Standy ) ),
Freq( Eval( Freqy ) ),
By( Eval( Byy ) ),
SendToReport(
Dispatch(
{},
"",
AxisBox( 2 ),
Add Text Annotation(
Text( "Category: " || Notes ),
Fixed Size( 0 ),
Text Box( {0, -255, 0, 0} ),
Filled( 0 )
)
)
)
)
);
)
)
);
clearRoles = Expr(
colListY << RemoveAll;
colListX << RemoveAll;
Stand << RemoveAll;
Freq << RemoveAll;
Part << RemoveAll;
By << RemoveAll;
);
recallRoles = Expr(
dialogRecallNS:ycolRecall = colListY << GetItems;
dialogRecallNS:xcolRecall = colListX << GetItems;
dialogRecallNS:standRecall = Stand << GetItems;
dialogRecallNS:freqRecall = Freq << GetItems;
dialogRecallNS:partRecall = Part << GetItems;
dialogRecallNS:byRecall = By << GetItems;
);
customDlg = New Window( "Example of a Custom Dialog",
Border Box( Left( 3 ), top( 2 ),
V List Box(
H List Box(
V List Box(
Panel Box( "Select Columns",
colListData =
Filter Col Selector(
All,
width( lbWidth ),
nLines( Min( nc, 10 ) )
)
)
),
Panel Box( "Cast Selected Columns into Roles",
Lineup Box( N Col( 2 ), Spacing( 3 ),
Button Box( "Y, Response",
colListY << Append( colListData << GetSelected )
),
colListY = Col List Box( width( lbWidth ), nLines( 5 ) ),
Button Box( "Standard",
Stand << Append( colListData << GetSelected )
),
Stand = Col List Box( width( lbWidth ), nLines( 1 ) ),
Button Box( "X, Grouping",
colListX << Append( colListData << GetSelected )
),
colListX = Col List Box( width( lbWidth ), nLines( 2 ) ),
Button Box( "Freq",
Freq << Append( colListData << GetSelected )
),
Freq = Col List Box( width( lbWidth ), nLines( 1 ) ),
Button Box( "Part, Sample ID",
Part << Append( colListData << GetSelected )
),
Part = Col List Box( width( lbWidth ), nLines( 1 ) ),
Button Box( "By",
By << Append( colListData << GetSelected )
),
By = Col List Box( width( lbWidth ), nLines( 2 ) )
),
Text Box(
"Operator, Instrument are examples of possible Grouping Columns"
)
),
Panel Box( "Action",
Lineup Box( N Col( 1 ),
Button Box( "OK",
recallRoles;
exy = colListY << get items;
exx = colListX << get items;
Standy = Stand << Get Items;
Freqy = Freq << Get Items;
Party = Stand << Get Items;
Byy = By << Get Items;
pgm;
customDlg << CloseWindow;
),
Button Box( "Cancel", customDlg << CloseWindow ),
Button Box( "Reset", clearRoles ),
Text Box( " " ),
Button Box( "Remove",
colListY << RemoveSelected;
colListX << RemoveSelected;
Stand << RemoveSelected;
Freq << RemoveSelected;
Part << RemoveSelected;
By << RemoveSelected;
),
Button Box( "Recall",
clearRoles;
Try(
colListY << Append( dialogRecallNS:ycolRecall );
colListX << Append( dialogRecallNS:xcolRecall );
Stand << Append( dialogRecallNS:standRecall );
Freq << Append( dialogRecallNS:freqRecall );
Part << Append( dialogRecallNS:partRecall );
By << Append( dialogRecallNS:byRecall );
);
)
)
)
)
)
)
);
colListx << set min items( 1 );
colListy << set min items( 1 );
Slán
SpannerHead