LazStats: fine-tuning and chm help file update of BoxPlotUnit and BubblePlotUnit

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8025 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2021-05-11 13:55:25 +00:00
parent 9a4ebebaa1
commit 81963e634c
8 changed files with 52 additions and 63 deletions

Binary file not shown.

View File

@ -241,7 +241,7 @@
<Unit16>
<Filename Value="forms\analysis\descriptive\boxplotunit.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="BoxPlotFrm"/>
<ComponentName Value="BoxPlotForm"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="BoxPlotUnit"/>

View File

@ -1,10 +1,10 @@
inherited BoxPlotFrm: TBoxPlotFrm
inherited BoxPlotForm: TBoxPlotForm
Left = 449
Height = 500
Top = 211
Width = 1000
HelpType = htKeyword
HelpKeyword = 'html/BoxPlots.htm'
HelpKeyword = 'html/BoxPlot.htm'
Caption = 'Box Plot'
ClientHeight = 500
ClientWidth = 1000
@ -31,6 +31,8 @@ inherited BoxPlotFrm: TBoxPlotFrm
inherited HelpBtn: TButton
Left = 73
Top = 459
HelpType = htKeyword
HelpKeyword = 'html/BoxPlot.htm'
TabOrder = 7
end
inherited ButtonBevel: TBevel

View File

@ -16,9 +16,9 @@ uses
type
{ TBoxPlotFrm }
{ TBoxPlotForm }
TBoxPlotFrm = class(TBasicStatsReportAndChartForm)
TBoxPlotForm = class(TBasicStatsReportAndChartForm)
MeasEdit: TEdit;
GroupEdit: TEdit;
Label1: TLabel;
@ -52,7 +52,7 @@ type
end;
var
BoxPlotFrm: TBoxPlotFrm;
BoxPlotForm: TBoxPlotForm;
implementation
@ -66,9 +66,9 @@ const
BOX_COLORS: Array[0..3] of TColor = (clBlue, clGreen, clFuchsia, clLime);
{ TBoxPlotFrm }
{ TBoxPlotForm }
constructor TBoxPlotFrm.Create(AOwner: TComponent);
constructor TBoxPlotForm.Create(AOwner: TComponent);
begin
inherited;
@ -78,7 +78,7 @@ begin
end;
procedure TBoxPlotFrm.BoxPlot(const LowQrtl, HiQrtl, TenPcnt, NinetyPcnt, Medians: DblDyneVec);
procedure TBoxPlotForm.BoxPlot(const LowQrtl, HiQrtl, TenPcnt, NinetyPcnt, Medians: DblDyneVec);
var
i: Integer;
ser: TBoxAndWhiskerSeries;
@ -115,7 +115,7 @@ begin
end;
procedure TBoxPlotFrm.Compute;
procedure TBoxPlotForm.Compute;
var
lReport: TStrings;
i, j, k, GrpVar, MeasVar, mingrp, maxgrp, G, NoGrps, cnt: integer;
@ -137,30 +137,24 @@ var
Median: DblDyneVec = nil;
ColNoSelected: IntDyneVec = nil;
begin
GrpVar := GetVariableIndex(OS3MainFrm.DataGrid, GroupEdit.Text);
MeasVar := GetVariableIndex(OS3MainFrm.DataGrid, MeasEdit.Text);
if GrpVar = -1 then
begin
ErrorMsg('Group variable not selected.');
exit;
end;
if MeasVar = -1 then
begin
ErrorMsg('Measurement variable not selected.');
exit;
end;
lReport := TStringList.Create;
try
lReport.Add('BOX PLOTS OF GROUPS');
lReport.Add('');
GrpVar := 0;
MeasVar := 0;
for i := 1 to NoVariables do
begin
cellstring := OS3MainFrm.DataGrid.Cells[i,0];
if cellstring = GroupEdit.Text then GrpVar := i;
if cellstring = MeasEdit.Text then MeasVar := i;
end;
if GrpVar = 0 then
begin
ErrorMsg('Group variable not selected.');
exit;
end;
if MeasVar = 0 then
begin
ErrorMsg('Measurement variable not selected.');
exit;
end;
SetLength(ColNoSelected, 2);
ColNoSelected[0] := GrpVar;
ColNoSelected[1] := MeasVar;
@ -330,7 +324,7 @@ begin
end;
procedure TBoxPlotFrm.AdjustConstraints;
procedure TBoxPlotForm.AdjustConstraints;
begin
inherited;
@ -343,7 +337,7 @@ begin
end;
procedure TBoxPlotFrm.GrpInBtnClick(Sender: TObject);
procedure TBoxPlotForm.GrpInBtnClick(Sender: TObject);
var
index: integer;
begin
@ -357,7 +351,7 @@ begin
end;
procedure TBoxPlotFrm.GrpOutBtnClick(Sender: TObject);
procedure TBoxPlotForm.GrpOutBtnClick(Sender: TObject);
begin
if GroupEdit.Text <> '' then
begin
@ -368,7 +362,7 @@ begin
end;
procedure TBoxPlotFrm.MeasInBtnClick(Sender: TObject);
procedure TBoxPlotForm.MeasInBtnClick(Sender: TObject);
var
index: integer;
begin
@ -382,7 +376,7 @@ begin
end;
procedure TBoxPlotFrm.MeasOutBtnClick(Sender: TObject);
procedure TBoxPlotForm.MeasOutBtnClick(Sender: TObject);
begin
if MeasEdit.Text <> '' then
begin
@ -392,7 +386,7 @@ begin
end;
end;
function TBoxPlotFrm.Percentile(nScoreGrps: integer;
function TBoxPlotForm.Percentile(nScoreGrps: integer;
APercentile: double; const Freq, CumFreq, Scores: DblDyneVec): double;
var
i, interval: integer;
@ -429,7 +423,7 @@ begin
end;
procedure TBoxPlotFrm.Reset;
procedure TBoxPlotForm.Reset;
begin
inherited;
@ -441,7 +435,7 @@ begin
end;
procedure TBoxPlotFrm.UpdateBtnStates;
procedure TBoxPlotForm.UpdateBtnStates;
begin
inherited;
@ -453,7 +447,7 @@ begin
end;
procedure TBoxPlotFrm.VarListDblClick(Sender: TObject);
procedure TBoxPlotForm.VarListDblClick(Sender: TObject);
var
index: integer;
begin
@ -470,7 +464,7 @@ begin
end;
procedure TBoxPlotFrm.VarListSelectionChange(Sender: TObject; User: boolean);
procedure TBoxPlotForm.VarListSelectionChange(Sender: TObject; User: boolean);
begin
UpdateBtnStates;
end;

View File

@ -31,6 +31,8 @@ inherited BubbleForm: TBubbleForm
inherited HelpBtn: TButton
Left = 116
Top = 424
HelpType = htKeyword
HelpKeyword = 'html/RepeatedMeasuresBubblePlot.htm'
TabOrder = 5
end
inherited ButtonBevel: TBevel

View File

@ -77,7 +77,8 @@ implementation
{$R *.lfm}
uses
TAChartUtils, TALegend, TAMultiSeries;
TAChartUtils, TALegend, TAMultiSeries,
Utils, GridProcs;
{ TBubbleForm }
@ -96,15 +97,14 @@ begin
inherited;
Panel1.Constraints.MinHeight := SizeOutBtn.Top + SizeOutBtn.Height;
ParamsPanel.Constraints.MinHeight := Panel1.Height + Panel1.BorderSpacing.Bottom +
3*TitleEdit.Height + 2*XLabelEdit.BorderSpacing.Top +
TransformChk.BorderSpacing.Top + TransformChk.Height + TransformChk.BorderSpacing.Bottom +
ButtonBevel.Height +
CloseBtn.Height + CloseBtn.BorderSpacing.Top;
ParamsPanel.Constraints.MinWidth := Max(TransformChk.Width, 4*CloseBtn.Width + 3*HelpBtn.BorderSpacing.Right);
Constraints.MinWidth := ParamsPanel.Constraints.MinWidth + 200;
Constraints.MinHeight := ParamsPanel.Constraints.MinHeight + 2*ParamsPanel.BorderSpacing.Top;
ParamsPanel.Constraints.MinWidth := Max(TransformChk.Width, 4*CloseBtn.Width + 3*HelpBtn.BorderSpacing.Right);
end;
@ -113,7 +113,6 @@ var
i, j, cell: integer;
Xmin, Xmax, intcell, noreplications, minrep, maxrep: integer;
nobubbles: integer;
varname: string;
Ymin, Ymax, xvalue, yvalue, sizeValue, cellValue: double;
BubMin, BubMax: double;
ncases, ncols, BubbleID, newcol: integer;
@ -129,21 +128,13 @@ var
begin
inherited;
BubbleCol := 0;
XCol := 0;
YCol := 0;
SizeCol := 0;
for i := 1 to NoVariables do
BubbleCol := GetVariableIndex(OS3MainFrm.DataGrid, BubbleEdit.Text);
XCol := GetVariableIndex(OS3MainFrm.DataGrid, XEdit.Text);
YCol := GetVariableIndex(OS3MainFrm.DataGrid, YEdit.Text);
SizeCol := GetVariableIndex(OS3MainFrm.DataGrid, SizeEdit.Text);
if ((BubbleCol = -1) or (XCol = -1) or (YCol = -1) or (SizeCol = -1)) then
begin
varname := OS3MainFrm.DataGrid.Cells[i,0];
if (varname = BubbleEdit.Text) then BubbleCol := i;
if (varname = XEdit.Text) then XCol := i;
if (varname = YEdit.Text) then YCol := i;
if (varname = SizeEdit.Text) then SizeCol := i;
end;
if ((BubbleCol = 0) or (XCol = 0) or (YCol = 0) or (SizeCol = 0)) then
begin
MessageDlg('One or more variables not found.', mtError, [mbOK], 0);
ErrorMsg('One or more variables not found.');
ModalResult := mrNone;
Exit;
end;

View File

@ -1896,12 +1896,12 @@ end;
// Menu "Analysis" > "Descriptive" > "Box Plot"
procedure TOS3MainFrm.mnuAnalysisDescr_BoxPlotClick(Sender: TObject);
begin
if BoxPlotFrm = nil then
Application.CreateForm(TBoxPlotFrm, BoxPlotFrm);
BoxPlotFrm.Show;
if BoxPlotForm = nil then
Application.CreateForm(TBoxPlotForm, BoxPlotForm);
BoxPlotForm.Show;
end;
// Menu "Analysis" > "Descriptive" > "mnuAnalysisDescr_Breakdown"
// Menu "Analysis" > "Descriptive" > "reakdown"
procedure TOS3MainFrm.mnuAnalysisDescr_BreakdownClick(Sender: TObject);
begin
if BreakDownFrm = nil then
@ -1917,7 +1917,7 @@ begin
BubbleForm.Show;
end;
// Menu "Analysis" > "Descriptive" > "Compare mnuAnalysisDescr_DistribStats"
// Menu "Analysis" > "Descriptive" > "Compare Distributions"
procedure TOS3MainFrm.mnuAnalysisDescr_CompareDistsClick(Sender: TObject);
begin
if CompareDistFrm = nil then