Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R Syntax: split analysis and analysisForm #5764

Merged
merged 5 commits into from
Dec 20, 2024

Conversation

boutinb
Copy link
Contributor

@boutinb boutinb commented Dec 18, 2024

As described in the JASP Architecture for R Syntax document, we need to split the analysis and analysisForm objects. For this the AnalysisFormBase is added (AnalysisBase existed already), the Base objects contain all calls from Analysis to AnalysisForm and vice-versa.

The initColumnWithString is function is moved to the DataSet object so that the RDataFrame importer can use it.

The parseOptions function in the AnalysisForm is already added.

@boutinb boutinb requested a review from JorisGoosen December 18, 2024 16:33
return false;
jsonResult["options"] = jsonOptions;
jsonResult["error"] = fq(getError());
return tq(jsonResult.toStyledString());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not return the Json value then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the jaspQMLR example, the QML form is just a QuickItem object, so I call the parseOptions with the QMetaObject::invokeMethod method:
https://github.com/jasp-stats/jaspQmlR/blob/a7a93a2f6fa103d47560c1ed541e9c252eed3671/src/qmlR.cpp#L208
In this way I don't need to load the AnalysisFormBase header in the jaspQMLR package.
I don't think I can pass a Json::Value argument in the InvokeMethod, so I thought just send the string, and reset it as Json object afterwards.

Move the initColumnWithStrings from DataSetPackage to DataSet.
Add parseOptions in AnalysisForm
Update generateWrapper so that it can be called from the
Json::Value jsonOptions;
Json::Value jsonResult(Json::objectValue);

QJsonDocument doc = QJsonDocument::fromJson(options.toUtf8());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this step here?
It seems that the whole QJsonDocument

@JorisGoosen JorisGoosen merged commit ac3d399 into jasp-stats:development Dec 20, 2024
1 check failed
JorisGoosen pushed a commit that referenced this pull request Jan 7, 2025
* Prepare R Syntac

Move the initColumnWithStrings from DataSetPackage to DataSet.
Add parseOptions in AnalysisForm
Update generateWrapper so that it can be called from the
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants