spreadsheets + vi + json
Hi lobste.rs! I'd like to share a proof of concept for an idea I've thought about for a long time. Think of a new form of spreadsheets where the primary data structure is not a rigid grid but a free-form JSON-like structure (but with first class tables support of course). I'm linking here a demo which uses vi style hotkeys for interaction, although of course the idea is not limited to that mode of interaction.
The addresses end up being JSON paths. The layout is currently rigid because it's just a PoC but ideally you'd have much more control over it, kind of like a canvas.
Expressions can refer to other cells via their JSON based address, even relative to their current address. There is no expressions support in the PoC yet but a table in the example does show a dynamic column. Since you have arbitrarily nested arrays/hashes anyway, you can reserve tables to represent arrays of homogenous records, and some of the columns can be dynamically calculated (or have a default dynamic calculation) based on other columns. The expressions are just JavaScript functions, but they can be anything that works with JSON types.
This is very far from finished. I'm just been trying to share early these days and I think many of you'd find the idea itself interesting.
Why? I think spreadsheets are great but they are underutilized because of their rigidity. They are not suitable for version control, being authoritative data sources, powering APIs etc. I don't know if this is the right direction either. I'd be happy to hear your thoughts!
The code is 100% manually written by me (except for the CSS background which I copied from SO). If there is sufficient interest in collaboration, I'd be happy to put up the source on codeberg.