vitessce-python icon indicating copy to clipboard operation
vitessce-python copied to clipboard

Adjust grid layout columns to prevent float values for x,y,w,h

Open keller-mark opened this issue 4 years ago • 1 comments

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?).

Originally posted by @sehilyi in https://github.com/vitessce/vitessce-python/issues/34#issuecomment-754834382

keller-mark avatar Jan 05 '21 19:01 keller-mark

We should either do this adjustment automatically on the JS side and allow floats in the view config, or do the adjustment on the Python side and add a field layoutCols which sets cols of react-grid-layout https://github.com/STRML/react-grid-layout#grid-layout-props to something other than 12

keller-mark avatar Jan 05 '21 19:01 keller-mark