Saving layouts and substructure search

Hi Datagrok team,

I have questions related to saving layouts and doing subsctructure search.

  1. How to save the layout without some columns? Are there some tags telling that the system don’t have to save some particular columns? Eg, we added boolean or float columns, but don’t want them to be saved to the layout.

  2. How to create a boolean column from a bitset column that we have after substructure search?

Can you clarify what do you mean by saving in layout?
If you hide a column in grid – layout will save that, but the column itself is stored inside a data frame, and it doesn’t connected with layout.

Regarding second question – I guess, there is no such ability yet.

Hi Olesia, welcome! :slight_smile:

  1. Indeed, you typically should not worry about the layout containing columns, since at most it only contains names (or other ids) of the columns that are used for viewers in that layout. The columns you added might be persisted into grid settings though (and will be applied when loading only if columns with such names exist, is that what you referred to?
  2. There is no such functionality yet but it totally makes sense - this will be implemented soon.
  1. Yes, I think.
    For better clarification, I will give an example
    Let’s say we have a table that we added a column to. If we call the saveLayout method (which the TableView has), will the table be saved with these columns? And after reloading the page, will these columns show up in the table?

If so, is it possible to make sure that these columns are not saved and after reloading the page they are not displayed?

  1. Thank you!

It’s important to understand that the layout never contains any data. It might contain some metadata associated with the column (such as column width, color coding options, or number format), but it never contains any values. So in your example, the table never gets saved.

Further following your example, if you call saveLayout method, only the metadata about the columns gets saved. Later on, when you would apply that layout against another dataframe that does not contain columns in questions, this metadata will be simply ignored.

1 Like

Thank you! It was really helpful :slightly_smiling_face:

Hi Olesia!
About your second question: we have added Column.fromBitSet() constructor, so in the next build you will be able to use it like this:

let bitset = DG.BitSet.fromString('01001');
let column = DG.Column.fromBitSet('BitSet column', bitset);
grok.shell.addTableView(DG.DataFrame.fromColumns([column]));
2 Likes