-
-
Notifications
You must be signed in to change notification settings - Fork 212
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
Conversation
return false; | ||
jsonResult["options"] = jsonOptions; | ||
jsonResult["error"] = fq(getError()); | ||
return tq(jsonResult.toStyledString()); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
cea99e9
to
6083ea2
Compare
QMLComponents/analysisform.cpp
Outdated
Json::Value jsonOptions; | ||
Json::Value jsonResult(Json::objectValue); | ||
|
||
QJsonDocument doc = QJsonDocument::fromJson(options.toUtf8()); |
There was a problem hiding this comment.
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
* Prepare R Syntac Move the initColumnWithStrings from DataSetPackage to DataSet. Add parseOptions in AnalysisForm Update generateWrapper so that it can be called from the
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.