cytoscape / cyREST

Core App: REST API module for Cytoscape
https://github.com/cytoscape/cyREST/wiki
MIT License
30 stars 13 forks source link

Add support for loading lists of values to tables #98

Closed AlexanderPico closed 4 years ago

AlexanderPico commented 5 years ago

http://localhost:1234/v1/swaggerUI/swagger-ui/index.html?url=http://localhost:1234/v1/swagger.json#!/Tables/updateTable_1

Something like this should work:

{
  "key": "SUID",
  "dataKey": "id",
  "data": [
    {
    "id": 12345,
    "my_list": ["brca1","brca2"]
    }
  ]
}
dotasek commented 4 years ago

It looks like this feature already exists, BUT will not create a list column if one doesn't exist yet.

I'm going to see if it's possible to add the creation of a list column as well.

dotasek commented 4 years ago

I've added some code that does this. What do you think of this limitation:

In order to generate a column, we need to know the intended content. The following is impossible to infer a list type from:

myColumn: []

For this to work, the input needs to be non-empty:

myColumn: [0.0,1.0, 2.0]

I can try to do something clever later, but will the be sufficient for now?

AlexanderPico commented 4 years ago

Yes, this would be great. I can easily check (and reject) empty lists. Let me know when/how to test an R function against this.

AlexanderPico commented 4 years ago

Tested 3.9-SNAPSHOT via RCy3 and it works!