ipysheet icon indicating copy to clipboard operation
ipysheet copied to clipboard

Questions about code design

Open martinRenou opened this issue 6 years ago • 3 comments

I might be wrong, but I have the feeling that the code could be a lot faster than it is today. Whenever one cell attribute changes, we recompute the whole sheet. More than that, we make a deep copy of the data. I also feel like adding the entire logic inside of the SheetModel and the SheetView could be wrong.

So, my questions are:

  • Is it possible to make the changes of the sheet more specific to the event that happened? I mean, if I only change the value of one cell, is it possible to only change the sheet data for this cell specifically?
  • Can we add cell logic (like events) inside of the CellModel, and would it make sense to have a CellView ?

martinRenou avatar Feb 14 '19 15:02 martinRenou

Concerning my first question, there is a setDataAtCell method which makes it possible to specifically change the value of one cell. It also provides a way to update multiple cells at the same time, which could help when trying to update an entire cell range.

I guess this could be used from within a CellView class?

martinRenou avatar Feb 15 '19 15:02 martinRenou

I think handsontable always rerenders the whole table, so no way around it right?

maartenbreddels avatar Mar 06 '19 15:03 maartenbreddels

I hope not. I don't see why it would need to rerender the whole table just for changing one cell value?

martinRenou avatar Mar 19 '19 14:03 martinRenou