lundi 30 décembre 2019

How to implement Google Spreadsheet like application in browser? [closed]

Could you help me answer a few questions that I have regarding "Design Spreadsheet like app in browser"?

This is mainly from "browsers" perspective.

  1. How would you structure your data?

    2D Matrix: [["XYZ"],[]]
    A Hashmap like:
    {
        rowNumber: {
            colNumber: {
                data: "XYZ" 
            }
        }
    }
    
    In my opinion, hashmap would be great because it provides an easy access of O(1) and will save a 
    lot memory.
    

    What are some other ways to structure it?

  2. How will you implement/calculate formulas? Is using "Reactive programming" a good approach, or do I need to represent my sheet as a graph where each cell will be a vertex and their relations with other cells will be an edge? Like:

    {
        A6: [C9, D1, D3],
        c2: [d3, D1, A6]
    }
    
    C9, D1, and D3 are dependent on A6. So whenever the value of A6 changes,
    we need to update their values as well.
    
    Any other approaches?
    

    Finally, how will you calculate a value using the given formula?

  3. Will you store the entire data of the sheet locally or only the visible section?

Any help would be highly appreciated. Thanks for your time.

Aucun commentaire:

Enregistrer un commentaire