Commit 38664e95 authored by Daria Zenkova's avatar Daria Zenkova

pcaplot works better, synchronous request need to be fixed, but i still don't know why it's there

parent e599771c
This diff is collapsed.
......@@ -169,8 +169,7 @@ morpheus.Dataset.prototype = {
else {
var protoMessage = morpheus.DatasetUtil.toProtoMessage(this);
var blob = new Blob(new Uint8Array(protoMessage), {type: "application/octet-stream"});
saveAs(blob, "test.bin");
var req = ocpu.call("createES", protoMessage, function (session) {
console.log(session);
_this.esSession = session;
......
......@@ -822,37 +822,36 @@ morpheus.DatasetUtil.getMetadataArray = function (dataset) {
var participantID = [];
var labelDescription = [];
var columnMeta = dataset.getColumnMetadata();
var n = columnMeta.getMetadataCount();
var m = dataset.columns;
for (var i = 0; i < n; i++) {
var vecI = columnMeta.get(i);
if (vecI.getName() == "participant_id") {
for (var j = 0; j < m; j++) {
participantID.push({
strval : vecI.getValue(j),
isNA : false
});
}
}
else {
for (j = 0; j < m; j++) {
pDataArray.push({
strval : vecI.getValue(j).toString(),
isNA : false
});
}
labelDescription.push({
strval : vecI.getName(),
var features = columnMeta.getMetadataCount();
var participants = dataset.getColumnCount();
var vecPartID = columnMeta.getByName("participant_id");
for (var i = 0; i < participants; i++) {
participantID.push({
strval : vecPartID.getValue(i),
isNA : false
});
}
for (var j = 0; j < features; j++) {
var vecJ = columnMeta.get(j);
if (vecJ.getName() == "participant_id") {
continue;
}
for (var l = 0; l < participants; l++) {
pDataArray.push({
strval : vecJ.getValue(l).toString(),
isNA : false
});
}
labelDescription.push({
strval : vecJ.getName(),
isNA : false
});
}
var rowMeta = dataset.getRowMetadata();
var rowNames = [];
var rowNamesVec = rowMeta.getByName("id");
for (j = 0; j < dataset.rows; j++) {
for (j = 0; j < dataset.getRowCount(); j++) {
rowNames.push({
strval : rowNamesVec.getValue(j),
isNA : false
......@@ -863,6 +862,7 @@ morpheus.DatasetUtil.getMetadataArray = function (dataset) {
morpheus.DatasetUtil.toProtoMessage = function (dataset) {
var array = morpheus.DatasetUtil.getContentArray(dataset);
var meta = morpheus.DatasetUtil.getMetadataArray(dataset);
console.log(meta);
var messageJSON = {
rclass : "LIST",
rexpValue : [{
......@@ -879,7 +879,7 @@ morpheus.DatasetUtil.toProtoMessage = function (dataset) {
attrName : "dim",
attrValue : {
rclass : "INTEGER",
intValue : [dataset.getColumnMetadata().getMetadataCount() - 1, dataset.columns]
intValue : [dataset.getColumnCount(), dataset.getColumnMetadata().getMetadataCount() - 1]
}
}, {
rclass : "STRING",
......@@ -918,5 +918,6 @@ morpheus.DatasetUtil.toProtoMessage = function (dataset) {
rexp = builder.build("rexp"),
REXP = rexp.REXP;
return new REXP(messageJSON);
var proto = new REXP(messageJSON);
return proto;
};
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment