Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions schema/library.raml
Original file line number Diff line number Diff line change
Expand Up @@ -1956,6 +1956,9 @@ types:
required: false
format: int64
correlationMethod: ScatterCorrelationMethod
returnPointIds:
type: boolean
required: false
Scatterplot:
type: object
additionalProperties: false
Expand Down Expand Up @@ -2236,6 +2239,9 @@ types:
r2:
type: number
required: false
pointIds:
type: string[]
required: false
DensityplotData:
type: object
additionalProperties: false
Expand Down
3 changes: 3 additions & 0 deletions schema/url/data/pass/plugin-scatterplot.raml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ types:
required: false
correlationMethod:
type: ScatterCorrelationMethod
returnPointIds:
type: boolean
required: false

Scatterplot:
additionalProperties: false
Expand Down
3 changes: 3 additions & 0 deletions schema/url/data/plots.raml
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,9 @@ types:
r2:
type: number
required: false
pointIds:
type: string[]
required: false

DensityplotData:
additionalProperties: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ protected void writeResults(OutputStream out, Map<String, InputStream> dataStrea
String deprecatedShowMissingness = showMissingness.equals("FALSE") ? "noVariables" : showMissingness.equals("TRUE") ? "strataVariables" : showMissingness;
String yVarType = util.getVariableType(spec.getYAxisVariable());
String correlationMethod = spec.getCorrelationMethod() != null ? spec.getCorrelationMethod().getValue() : "none";
String recordIdColumnName = util.toColNameOrEmpty(util.getEntityIdVarSpec(spec.getOutputEntityId()));
String returnPointIds = spec.getReturnPointIds() != null ? String.valueOf(spec.getReturnPointIds()).toUpperCase() : "FALSE";

if (yVarType.equals("DATE") && !valueSpec.equals("raw")) {
LOG.error("Cannot calculate trend lines for y-axis date variables. The `valueSpec` property must be set to `raw`.");
Expand All @@ -139,6 +141,7 @@ protected void writeResults(OutputStream out, Map<String, InputStream> dataStrea
nonStrataVarColNames,
(name, conn) ->
conn.voidEval(util.getVoidEvalFreadCommand(name,
util.getEntityIdVarSpec(spec.getOutputEntityId()),
spec.getXAxisVariable(),
spec.getYAxisVariable(),
spec.getOverlayVariable(),
Expand All @@ -149,9 +152,17 @@ protected void writeResults(OutputStream out, Map<String, InputStream> dataStrea
useRConnectionWithProcessedRemoteFiles(Resources.RSERVE_URL, filesProcessor, connection -> {
connection.voidEval(getVoidEvalVariableMetadataList(varMap));
String cmd =
"plot.data::scattergl(" + DEFAULT_SINGLE_STREAM_NAME + ", variables, '" +
valueSpec + "', NULL, correlationMethod = '" + correlationMethod + "', TRUE, TRUE, '" +
deprecatedShowMissingness + "')";
"plot.data::scattergl(" +
DEFAULT_SINGLE_STREAM_NAME +
", variables" +
", value= '" + valueSpec +
"', overlayValues = NULL" +
", correlationMethod = '" + correlationMethod +
"', sampleSizes=TRUE, completeCases=TRUE" +
", evilMode='" + deprecatedShowMissingness +
"', idColumn = '" + recordIdColumnName +
"', returnPointIds = " + returnPointIds + ")";

streamResult(connection, cmd, out);
});
}
Expand Down