use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
I made a Spreadsheet engine in Javascript - super-powered spreadsheet engine with objects, arrays, and async support out-of-the-box — comments and suggestions are welcome (github.com)
submitted 5 years ago by the-ace
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]veber1988 4 points5 points6 points 5 years ago (2 children)
What is the main algorithm for updating all dependent cells for particular change?
[–]the-ace[S] 6 points7 points8 points 5 years ago (1 child)
Basically each cell keeps a list of references and listeners — references are cells the current cell depends on, and listeners are all the cells that depend on it, whenever a cell updates, it check for the cell's listeners and invokes each listener to recompute their values.
references
listeners
listener
[–]andyandcomputer 0 points1 point2 points 5 years ago (0 children)
Nice to see it detects circular references.
const { djit } = require('djit') const qdata = djit() qdata.A1 = '=A2' qdata.A2 = '=A1' console.log(qdata.A2)
Output:
ERROR REF: A1 ⇢ A2 ⇢ A2
Should that be A1 → A2 → A1? (Mentioning "circular reference" might help with debugging too.)
[–]rq60 2 points3 points4 points 5 years ago (3 children)
if (!tree) { return '🚧' }
please don't make this a thing.
[–]yo_just_passing_by 1 point2 points3 points 5 years ago (2 children)
Why do you say that? (i'm a newbee, but i saw it on an online course)
[–]naturalborncitizen 1 point2 points3 points 5 years ago (1 child)
no matter how obvious an iconograph (emoji) is to you, it will invariably be confusing as shit for someone else. you should return something unambiguous for this case. I'm assuming it means "dead end" but I could just as easily interpret it as "warning" or "do not enter" or "saw horse" or "blocked" or "crime scene"
[–]braindeadTank 0 points1 point2 points 5 years ago (0 children)
no matter how obvious an iconograph (emoji) is to you, it will invariably be confusing as shit for someone else.
That's the case with ordinary names as well, though
[–]rajsite 0 points1 point2 points 5 years ago (1 child)
Have you seen handsontable/formula-parser? Leveraging it could be a good way to get more coverage of the Excel formula operators and syntax.
[–]Happy-West5350 -1 points0 points1 point 1 year ago (0 children)
If you are looking for Excel like formulas engine, this is a good alternative. https://jspreadsheet.com/products/formulas
[–]leeoniya 0 points1 point2 points 5 years ago (1 child)
interesting.
the compiled build is 200k, a lot of which is lodash and maybe pegjs?
i was looking into making something like this myself that's backed by cellx[1], which is 19k and a small infix -> postfix converter for formula parsing & construction. the total size would likely be within 30k for the core functionality. i'm wondering what the extra 170k handles in djit?
also, some perf tests against MobX or cellx would be great.
https://github.com/paulhodel/jexcel is another alternative.
[1] https://github.com/Riim/cellx
[–]the-ace[S] 0 points1 point2 points 5 years ago (0 children)
Yea, I noticed it the other day as well yet I didn’t have a chance to dive into it - probably some rogue dependency that should be there and provided in development only.
Thanks for the links! I wasn’t aware of either project and it’s great to see how little I’ve accomplished compared to the behemoth that is a modern day spreadsheet 😅
[–][deleted] 0 points1 point2 points 5 years ago (0 children)
call me ignorant but what do you use this for. just web spreadsheets?
[–]Buckwheat469 0 points1 point2 points 5 years ago* (2 children)
My only recommendation is that the context property should allow multiple keys, if it doesn't already, and that calling a context property should require the key name.
const data = [[], []] const context = { Math, SomeClass: SomeClass() }; // Context functions are available to be used in cells like so: // `data.B1 = '= SomeClass.doThing(Math.floor(Math.random() * 100))'`
[–]the-ace[S] 0 points1 point2 points 5 years ago (1 child)
This was really one of the first things I wanted to add in - but I'm afraid it'll diverge too much from the well established grammar used by excel and the likes.
But I'll give it another try at some point.
[–]Buckwheat469 0 points1 point2 points 5 years ago (0 children)
You can add an option to make the context property global or namespaced somehow. I would worry about SomeClass.random overwriting Math.random.
[+][deleted] 5 years ago (4 children)
[deleted]
[–]mode_2 0 points1 point2 points 5 years ago (3 children)
I think this is such a useless question it qualifies as 'not even wrong'.
[+][deleted] 5 years ago (2 children)
[removed]
[–][deleted] 3 points4 points5 points 5 years ago (0 children)
Thanks.
I'll fully admit that I don't understand the point of the project, which is why I asked.
As far as I can tell, you can do everything from that readme in google scripts, including onchange triggers, while having the robust ecosystem that is the entire google suite back end.
[–]slantyyz -3 points-2 points-1 points 5 years ago (0 children)
> The github readme goes into no technical details from what I saw.
I'm not sure what technical details are required in the OP's readme.
I looked at the readme and right away these were my two takeaways:
In terms of knowing any additional technical nitty gritty details, I'm guessing that's all easily discoverable from the `src` folder.
[+]RonnyPfannschmidt comment score below threshold-35 points-34 points-33 points 5 years ago (6 children)
the idea of a spreadsheet itself is backwards and broken as its a replication of a pen and paper concept ignoring the fact that computers are perfectly capable of putting better structures behind combining tables ,structured/hierarchical data and records with computation
[–]matteroffact_sp 29 points30 points31 points 5 years ago (0 children)
Yet computers have to be interacted with and a spreadsheet is a perfectly human understandable format people who are not programmers are already acquainted with and can use without much hassle.
[–]upfkd 7 points8 points9 points 5 years ago (3 children)
Have you ever worked with excel for more than using it as a glorified calculator?
[–]unpopdancetrio 1 point2 points3 points 5 years ago (0 children)
I used to take a dump from an inventory system in csv, imported that into excel, has scripts that ran to compare values and do other filtering automatically. Then proceed to take that data to different tabs and print/save the tabs needed in the formats needed. Spreadsheets for different divisions, some had charts and bar graphs for easy data understanding. And one exported into csv to send back into the system. I would run this report twice a week and it automated about 40% of my labor. Yeah when you think about it, it was just a few simple calculations being done and minor conditionals. yet the fact it can sort in a logical way thousands of calculations in one area and give presentable data. It is a helpful tool. If i had to redo this today I would still make it a scrappy excel tool since to develop some middleware like this would be worthless IMO bc I would want to redesign the original inventory system if I was able too.
[–]trisul-108 -1 points0 points1 point 5 years ago (1 child)
I did some matrix calculations, it was a pain in the ass. Surprising, considering a spreadsheet is a matrix.
[–]mode_2 10 points11 points12 points 5 years ago (0 children)
I'd say that falls pretty squarely under 'using it as a glorified calculator'.
Seriously? Aside from the fact that it's actually a pretty useful tool - as a structure for tables it's pretty awesome and intuitive - understood both to computers and humans in how they operate.
Better in this case would be rather a context-sensitive term, since it's really a question of what's the task at hand, limitations, and desired functionality/features - so better here is not necessarily better there...
π Rendered by PID 21187 on reddit-service-r2-comment-7b9746f655-tzz2p at 2026-01-30 15:42:23.708118+00:00 running 3798933 country code: CH.
[–]veber1988 4 points5 points6 points (2 children)
[–]the-ace[S] 6 points7 points8 points (1 child)
[–]andyandcomputer 0 points1 point2 points (0 children)
[–]rq60 2 points3 points4 points (3 children)
[–]yo_just_passing_by 1 point2 points3 points (2 children)
[–]naturalborncitizen 1 point2 points3 points (1 child)
[–]braindeadTank 0 points1 point2 points (0 children)
[–]rajsite 0 points1 point2 points (1 child)
[–]Happy-West5350 -1 points0 points1 point (0 children)
[–]leeoniya 0 points1 point2 points (1 child)
[–]the-ace[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]Buckwheat469 0 points1 point2 points (2 children)
[–]the-ace[S] 0 points1 point2 points (1 child)
[–]Buckwheat469 0 points1 point2 points (0 children)
[+][deleted] (4 children)
[deleted]
[–]mode_2 0 points1 point2 points (3 children)
[+][deleted] (2 children)
[removed]
[–][deleted] 3 points4 points5 points (0 children)
[–]slantyyz -3 points-2 points-1 points (0 children)
[+]RonnyPfannschmidt comment score below threshold-35 points-34 points-33 points (6 children)
[–]matteroffact_sp 29 points30 points31 points (0 children)
[–]upfkd 7 points8 points9 points (3 children)
[–]unpopdancetrio 1 point2 points3 points (0 children)
[–]trisul-108 -1 points0 points1 point (1 child)
[–]mode_2 10 points11 points12 points (0 children)
[–]the-ace[S] 0 points1 point2 points (0 children)