vitessce-python
vitessce-python copied to clipboard
Uneven size of views when using h_concat
In the following examples, I expected that views A-D have same width, but the views on the right-most column have larger width than other views.
vc.layout((A | B | (C / D)) / E);
# or
vc.layout((A | (B / C) | D) / E);
(I was following this docs: https://vitessce.github.io/vitessce-python/notebooks/widget_pbmc.html)

In addition, the following code returns an error message.
vc.layout((umap | pca | cell_sets | genes) / heatmap);
Config validation failed
[
{
"keyword": "type",
"dataPath": ".layout[0].w",
"schemaPath": "#/definitions/components/items/properties/w/type",
"params": {
"type": "integer"
},
"message": "should be integer"
}
]
I guess this is because the w value in react-grid-layout is accepting only integer values by a JSON schema, and adding many columns results the width less than 1.0. (1) I think the error message can be more understandable to users, or (2) allow double values (Although only the integer values are said to be officially allowed by react-grid-layout, I think double values work fine as well?).
I think the first issue may be inherent to the magic syntax. Based on the way that operators are evaluated in python, I think (a | b | c) will always be evaluated as hconcat(hconcat(a, b), c) just like (1 + 2 + 3) would be ((1+2) + 3) as an abstract syntax tree.
But it is a good idea for us to write this in the documentation.
If you dont mind I am going to split the grid issue into a separate issue
Did not thought about the internal implementation of the magic syntax, but now it makes sense. It would be helpful if it is explained in the docs.