lightsheet-team / lightsheet

GNU Lesser General Public License v3.0
1 stars 1 forks source link

Define API import/export data structure #37

Open Fluglow opened 8 months ago

Fluglow commented 8 months ago

It should be possible to pass a data structure containing cell data and formatting to the API. The same data structure can be used for exporting sheet data. The data structure should account for cell formulas, cell styling (data in CellStyle) and possibly resolved values. Discuss if sheet options should be included in the data structure as well.

Note: This issue is not save/open operation because this export/import doesn't preserve keys

Fluglow commented 8 months ago

Example structure in json:


{
    "options": {},
    "cellRows": {  
        "1": {
            "1": {
                "formula": "A1",
                "value": "A1",
                "style": {
                    "fillColor": "0x0000ff"
                }
            },
            "4": {
                "formula": "D1"
            }
        },
        "4": {
            "1": {
                "formula": "D1",
                "style": {
                    "border": "0b0001"
                }
            },
            "2": {
                "formula": "D2",
                "style": {
                    "textColor": "0x00ffff",
                    "bold": 1,
                    "underline": 1
                }
            }
        }
    }
}