Possibility of adding additional data to hyperformula cells #739
Replies: 2 comments 2 replies
-
Thanks @MartinDawson for the idea. I'm marking it with Feature label, and maybe in the future we will reconsider. For now, we see HF as purely calculation engine, so storing additional data is out of scope for this project. Presentational attributes are more like another abstraction layer over the engine. A good practice says that View should be separate from Model. Keeping such data would have an unnecessary overhead. Engine is mostly build for tracking dependencies and resolving changes between them. Static data like this does not require this overhead and could quickly clog up the browser memory. So as long as they do not need dependency tracking they should be stored next to the calculation data. Otherwise we would have to create nodes for empty cells that have styling attributes. Taking the above under consideration, metadata like that should be stored next to the data graph to avoid overhead and synced anyway. So it's better to keep it outside of HF. |
Beta Was this translation helpful? Give feedback.
-
This is something I am also looking for, Is this feature available now? |
Beta Was this translation helpful? Give feedback.
-
I think this request would require a data structure change and it probably isn't trivial to do that because all the docs would need updating but I thought I'd raise it anyway to see what you guys thought.
So currently we are only able to use setCellContents with something like this:
hf.setSellContents(cellAddress, [['=A1*B1']])
What would be useful would be to allow storing of additional data alongside it, i.e like this:
hf.setSellContents(cellAddress, [ { height: 35, cells: [{ text: '=A1*B1', border: 'solid 1px blue', backgroundColor: 'red' }] } ])
So essentially making it an array of objects where the user can add anything inside it but the
cells
key is required and thetext
key is required.The reason I would like this is because each cell has the ability to be styled by the user. Currently I have to have this in a separate array of objects:
Why would I need this?
One example is if the user does a copy/paste into different cells (like in excel), hyperformula handles the formula and text moving but it doesn't handle any styles moving from cell to cell (i.e additional data). This means I have to keep a copy of the style data in the same format like above but also make sure the styles are copied to the same cells that hyperformula has done.
A single source of truth would be better so that my styles don't get out of sync with my formulas so if a copy/paste happens and I put my styles inside hyperformula it will automatically move them to the correct cell.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions