Choose a sparse data structure for efficiency.
Sparse storage:
{
cells: {
'A1': { value: 'Hello', formula: null },
'B2': { value: 15, formula: '=A1+10' }
},
columns: { A: { width: 100 }, B: { width: 120 } },
rows: { 1: { height: 24 } }
}
Why sparse: A M cell grid stored densely uses massive memory. Sparse storage only stores non-empty cells.
Cell addressing: Use "A1" notation or row/column indices. Convert between them as needed.