Skip to content

Commit

Permalink
Fix documentation for new table improvements [SCI-11270]
Browse files Browse the repository at this point in the history
  • Loading branch information
andrej-scinote committed Dec 5, 2024
1 parent 24e7ff1 commit 604e3ff
Show file tree
Hide file tree
Showing 2 changed files with 300 additions and 124 deletions.
224 changes: 153 additions & 71 deletions source/includes/_result_tables_v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,47 @@ curl "https://<server-name>/api/v2/teams/1/projects/1/experiments/1/tasks/1/resu
"id": "1",
"type": "tables",
"attributes": {
"name": "Table 1",
"position": 0,
"contents": "{\"data\":[[\"1\",\"2\",\"3\"],[\"4\",\"5\",\"6\"]]}",
"metadata": {
"cells": [{"col": 0, "row": 0, "className": "htCenter"},
{"col": 0, "row": 1, "className": "htRight"},
{"col": 1, "row": 0, "className": "htLeft"},
{"col": 1, "row": 1, "className": "htJustify"}
{"col": 2, "row": 0, "className": "htMiddle htRight"},
{"col": 2, "row": 1, "className": "htBottom"}],
"plateTemplate": true
"table_id": "1",
"table_contents": "{\"data\":[[\"1\",\"2\",\"3\"],[\"4\",\"5\",\"6\"]]}",
"table_metadata": {
"sheet_name": "sheet name",
"rows_size": [100, 100],
"columns_size": [100, 100, 100],
"cells": [{"col": 0, "row": 0},
{"col": 0, "row": 1},
{"col": 1, "row": 0},
{"col": 1, "row": 1}
{"col": 2, "row": 0},
{"col": 2, "row": 1}],
"plateTemplate": true,
"cells_merge": { "A1": [1, 2]},
"cells_style": { "A2": "font-size:120px" },
"cells_properties": [{ "x": 0, "y": 0, "properties": { "type": "text", "readOnly": true } } ],
"columns_properties": [{ "x": 1, "properties": { "type": "text", "readOnly": true, "title": "title" }}]
}
}
},
{
"id": "2",
"type": "tables",
"attributes": {
"name": "Table 2",
"position": 1,
"contents": "{\"data\":[[\"1\",\"2\",\"3\"],[\"4\",\"5\",\"6\"]]}",
"metadata": {
"cells": [{"col": 0, "row": 0, "className": "htCenter"},
{"col": 0, "row": 1, "className": "htRight"},
{"col": 1, "row": 0, "className": "htLeft"},
{"col": 1, "row": 1, "className": "htJustify"}
{"col": 2, "row": 0, "className": "htMiddle htRight"},
{"col": 2, "row": 1, "className": "htBottom"}]
"table_id": "1",
"table_contents": "{\"data\":[[\"1\",\"2\",\"3\"],[\"4\",\"5\",\"6\"]]}",
"table_metadata": {
"sheet_name": "sheet name",
"rows_size": [100, 100],
"columns_size": [100, 100, 100],
"cells": [{"col": 0, "row": 0},
{"col": 0, "row": 1},
{"col": 1, "row": 0},
{"col": 1, "row": 1}
{"col": 2, "row": 0},
{"col": 2, "row": 1}],
"plateTemplate": true,
"cells_merge": { "A1": [1, 2]},
"cells_style": { "A2": "font-size:120px" },
"cells_properties": [{ "x": 0, "y": 0, "properties": { "type": "text", "readOnly": true } } ],
"columns_properties": [{ "x": 1, "properties": { "type": "text", "readOnly": true, "title": "title" }}]
}
}
}
Expand Down Expand Up @@ -91,20 +104,26 @@ curl "https://<server-name>/api/v2/teams/1/projects/1/experiments/1/tasks/1/resu
"data": {
"id": "1",
"type": "tables",
"attributes": {
"name": "Table 1",
"position": 0,
"contents": "{\"data\":[[\"1\",\"2\",\"3\"],[\"4\",\"5\",\"6\"]]}",
"metadata": {
"cells": [{"col": 0, "row": 0, "className": "htCenter"},
{"col": 0, "row": 1, "className": "htRight"},
{"col": 1, "row": 0, "className": "htLeft"},
{"col": 1, "row": 1, "className": "htJustify"}
{"col": 2, "row": 0, "className": "htMiddle htRight"},
{"col": 2, "row": 1, "className": "htBottom"}],
"plateTemplate": true
"attributes": {
"table_id": "1",
"table_contents": "{\"data\":[[\"1\",\"2\",\"3\"],[\"4\",\"5\",\"6\"]]}",
"table_metadata": {
"sheet_name": "sheet name",
"rows_size": [100, 100],
"columns_size": [100, 100, 100],
"cells": [{"col": 0, "row": 0},
{"col": 0, "row": 1},
{"col": 1, "row": 0},
{"col": 1, "row": 1}
{"col": 2, "row": 0},
{"col": 2, "row": 1}],
"plateTemplate": true,
"cells_merge": { "A1": [1, 2]},
"cells_style": { "A2": "font-size:120px" },
"cells_properties": [{ "x": 0, "y": 0, "properties": { "type": "text", "readOnly": true } } ],
"columns_properties": [{ "x": 1, "properties": { "type": "text", "readOnly": true, "title": "title" }}]
}
}
}
}
}
```
Expand Down Expand Up @@ -140,13 +159,20 @@ curl -X POST \
"name": "New table",
"contents": "{\"data\":[[\"1\",\"2\",\"3\"],[\"4\",\"5\",\"6\"]]}",
"metadata": {
"sheet_name": "sheet name",
"cells": [{"col": 0, "row": 0, "className": ""},
{"col": 0, "row": 1, "className": "htRight"},
{"col": 1, "row": 0, "className": ""},
{"col": 1, "row": 1, "className": "htJustify"},
{"col": 2, "row": 0, "className": "htMiddle htRight"},
{"col": 2, "row": 1, "className": "htBottom"}],
"plateTemplate": true
"plateTemplate": true,
"rows_size": [100, 100],
"columns_size": [100, 100, 100],
"cells_merge": {"A1": [1, 2]},
"cells_style": {"A2": "font-size:120px"},
"cells_properties": [{"x": 0, "y": 0, "properties": { "readOnly": true, "type": "text" }}],
"columns_properties": [{"x": 1, "properties": { "readOnly": true, "type": "text", "title": "title" }}]
}
}
}
Expand All @@ -161,17 +187,23 @@ curl -X POST \
"id": "3",
"type": "tables",
"attributes": {
"name": "New table",
"position": 0,
"contents": "{\"data\":[[\"1\",\"2\",\"3\"],[\"4\",\"5\",\"6\"]]}",
"metadata": {
"cells": [{"col": 0, "row": 0, "className": ""},
{"col": 0, "row": 1, "className": "htRight"},
{"col": 1, "row": 0, "className": ""},
{"col": 1, "row": 1, "className": "htJustify"}
{"col": 2, "row": 0, "className": "htMiddle htRight"},
{"col": 2, "row": 1, "className": "htBottom"}],
"plateTemplate": true
"table_id": "3",
"table_contents": "{\"data\":[[\"1\",\"2\",\"3\"],[\"4\",\"5\",\"6\"]]}",
"table_metadata": {
"sheet_name": "sheet name",
"rows_size": [100, 100],
"columns_size": [100, 100, 100],
"cells": [{"col": 0, "row": 0},
{"col": 0, "row": 1},
{"col": 1, "row": 0},
{"col": 1, "row": 1}
{"col": 2, "row": 0},
{"col": 2, "row": 1}],
"plateTemplate": true,
"cells_merge": { "A1": [1, 2]},
"cells_style": { "A2": "font-size:120px" },
"cells_properties": [{ "x": 0, "y": 0, "properties": { "type": "text", "readOnly": true } } ],
"columns_properties": [{ "x": 1, "properties": { "type": "text", "readOnly": true, "title": "title" }}]
}
}
}
Expand Down Expand Up @@ -223,7 +255,22 @@ This endpoint creates new table in the result.
| --------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name | yes | Name of the table |
| contents | no | Serialized JSON representation of the table data |
| metadata | no | JSON representation of the table metadata. `cells` represent the alignment of the specific table cell. Available `className` are `htCenter`, `htRight`, `htLeft`, `htJustify` for horizontal alignment, and `htTop`, `htMiddle`, `htBottom` for vertical alignment. `plateTemplate` field mark if table is a plate template |
| metadata | no | JSON representation of the table metadata. |


### Metadata attributes

| Attribute | Description |
| --------- | --------- |
| sheet_name | The name of the table sheet. |
| cells | Applicable only for the open-source version. Represents the alignment of a specific table cell. Available `className` are `htCenter`, `htRight`, `htLeft`, `htJustify` (horizontal alignment) and `htTop`, `htMiddle`, `htBottom` (vertical alignment).|
| plateTemplate | Indicates if the table is a plate template. |
| rows_size | The height of each row in the table. |
| columns_size | The width of each column in the table. |
| cells_merge | Hash of values merge settings: each value is represented as `cell_coordinate` in the format [`number_of_columns`, `number_of_rows`].|
| cells_style | A string representing the CSS style properties that define the appearance of a cell. |
| cells_properties | Defines properties for each specific cell (`x` and `y`). Available properties are: `readOnly` (if `true`, the cell is locked) and `type` (available values: `text` and `sa`). |
| columns_properties | Defines properties for each column (`x`). Available properties are: `readOnly` (if `true`, the column is locked), `type` (available values: `text` and `sa`), and `title` (the name of the column). |

## Update Result Table

Expand All @@ -240,13 +287,20 @@ curl -X PATCH \
"name": "Table 2",
"contents": "{\"data\":[[\"6\",\"5\",\"4\"],[\"3\",\"2\",\"1\"]]}",
"metadata": {
"sheet_name": "sheet name",
"cells": [{"col": 0, "row": 0, "className": ""},
{"col": 0, "row": 1, "className": "htRight"},
{"col": 1, "row": 0, "className": ""},
{"col": 1, "row": 1, "className": "htJustify"}
{"col": 1, "row": 1, "className": "htJustify"},
{"col": 2, "row": 0, "className": "htMiddle htRight"},
{"col": 2, "row": 1, "className": "htBottom"}],
"plateTemplate": true
"plateTemplate": true,
"rows_size": [100, 100],
"columns_size": [100, 100, 100],
"cells_merge": {"A1": [1, 2]},
"cells_style": {"A2": "font-size:120px"},
"cells_properties": [{"x": 0, "y": 0, "properties": { "readOnly": true, "type": "text" }}],
"columns_properties": [{"x": 1, "properties": { "readOnly": true, "type": "text", "title": "title" }}]
}
}
}
Expand All @@ -261,17 +315,23 @@ curl -X PATCH \
"id": "1",
"type": "tables",
"attributes": {
"name": "Table 2",
"position": 0,
"contents": "{\"data\":[[\"6\",\"5\",\"4\"],[\"3\",\"2\",\"1\"]]}",
"metadata": {
"cells": [{"col": 0, "row": 0, "className": ""},
{"col": 0, "row": 1, "className": "htRight"},
{"col": 1, "row": 0, "className": ""},
{"col": 1, "row": 1, "className": "htJustify"}
{"col": 2, "row": 0, "className": "htMiddle htRight"},
{"col": 2, "row": 1, "className": "htBottom"}],
"plateTemplate": true
"table_id": "1",
"table_contents": "{\"data\":[[\"1\",\"2\",\"3\"],[\"4\",\"5\",\"6\"]]}",
"table_metadata": {
"sheet_name": "sheet name",
"rows_size": [100, 100],
"columns_size": [100, 100, 100],
"cells": [{"col": 0, "row": 0},
{"col": 0, "row": 1},
{"col": 1, "row": 0},
{"col": 1, "row": 1}
{"col": 2, "row": 0},
{"col": 2, "row": 1}],
"plateTemplate": true,
"cells_merge": { "A1": [1, 2]},
"cells_style": { "A2": "font-size:120px" },
"cells_properties": [{ "x": 0, "y": 0, "properties": { "type": "text", "readOnly": true } } ],
"columns_properties": [{ "x": 1, "properties": { "type": "text", "readOnly": true, "title": "title" }}]
}
}
}
Expand Down Expand Up @@ -303,16 +363,23 @@ If submitted attributes are the same and no changes are made for the table, serv
"id": "1",
"type": "tables",
"attributes": {
"name": "Table 2",
"contents": "{\"data\":[[\"6\",\"5\",\"4\"],[\"3\",\"2\",\"1\"]]}",
"metadata": {
"cells": [{"col": 0, "row": 0, "className": ""},
{"col": 0, "row": 1, "className": "htRight"},
{"col": 1, "row": 0, "className": ""},
{"col": 1, "row": 1, "className": "htJustify"}
{"col": 2, "row": 0, "className": "htMiddle htRight"},
{"col": 2, "row": 1, "className": "htBottom"}],
"plateTemplate": true
"table_id": "1",
"table_contents": "{\"data\":[[\"1\",\"2\",\"3\"],[\"4\",\"5\",\"6\"]]}",
"table_metadata": {
"sheet_name": "sheet name",
"rows_size": [100, 100],
"columns_size": [100, 100, 100],
"cells": [{"col": 0, "row": 0},
{"col": 0, "row": 1},
{"col": 1, "row": 0},
{"col": 1, "row": 1}
{"col": 2, "row": 0},
{"col": 2, "row": 1}],
"plateTemplate": true,
"cells_merge": { "A1": [1, 2]},
"cells_style": { "A2": "font-size:120px" },
"cells_properties": [{ "x": 0, "y": 0, "properties": { "type": "text", "readOnly": true } } ],
"columns_properties": [{ "x": 1, "properties": { "type": "text", "readOnly": true, "title": "title" }}]
}
}
}
Expand All @@ -325,7 +392,22 @@ If submitted attributes are the same and no changes are made for the table, serv
| --------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name | no | Name of the table |
| contents | no | Serialized JSON representation of the table data |
| metadata | no | JSON representation of the table metadata. `cells` represent the alignment of the specific table cell. Available `className` are `htCenter`, `htRight`, `htLeft`, `htJustify` for horizontal alignment, and `htTop`, `htMiddle`, `htBottom` for vertical alignment. `plateTemplate` field mark if table is a plate template |
| metadata | no | JSON representation of the table metadata. |


### Metadata attributes

| Attribute | Description |
| --------- | --------- |
| sheet_name | The name of the table sheet. |
| cells | Applicable only for the open-source version. Represents the alignment of a specific table cell. Available `className` are `htCenter`, `htRight`, `htLeft`, `htJustify` (horizontal alignment) and `htTop`, `htMiddle`, `htBottom` (vertical alignment).|
| plateTemplate | Indicates if the table is a plate template. |
| rows_size | The height of each row in the table. |
| columns_size | The width of each column in the table. |
| cells_merge | Hash of values merge settings: each value is represented as `cell_coordinate` in the format [`number_of_columns`, `number_of_rows`].|
| cells_style | A string representing the CSS style properties that define the appearance of a cell. |
| cells_properties | Defines properties for each specific cell (`x` and `y`). Available properties are: `readOnly` (if `true`, the cell is locked) and `type` (available values: `text` and `sa`). |
| columns_properties | Defines properties for each column (`x`). Available properties are: `readOnly` (if `true`, the column is locked), `type` (available values: `text` and `sa`), and `title` (the name of the column). |

## Delete Result Table

Expand Down
Loading

0 comments on commit 604e3ff

Please sign in to comment.