Commit graph

46 commits

Author SHA1 Message Date
premek
bddc9d6c52 Spreadsheet: Fix maxIf and minIf name in documentation 2022-10-29 06:29:11 +03:30
Ali Mohammad Pur
135683795b Spreadsheet: Throw if lookup value doesn't exist and no default is given
And explicitly state which value wasn't found and where in the error.
2022-06-26 22:21:17 +01:00
Ali Mohammad Pur
746b8ec8de Spreadsheet: Make it possible to refer to ranges in other sheets
Now the range A0:C4 in a sheet named "foo" can be represented as:

    R`sheet("foo"):A0:C4`

This makes it possible to do cross-sheet lookups and more.
2022-06-26 22:21:17 +01:00
Eli Youngs
21671d9b91 Spreadsheet: Interpret numbers as floats, not integers 2022-05-08 16:45:21 +02:00
Eli Youngs
21c605bfda Spreadsheet: Update statistical functions to take variadic arguments 2022-05-08 16:45:21 +02:00
u9g
c8803afe3e Spreadsheet: Add CommonRange#unique() 2022-03-09 10:22:20 +03:30
u9g
b9d44eb022 Spreadsheet: Add SplitRange class and CommonRange#filter 2022-03-09 10:22:20 +03:30
u9g
4147b56e79 Spreadsheet: Allow integer() to throw in weird cases
Also makes numericResolve use parseInt to avoid using our own integer()
2022-03-05 05:46:35 +03:30
u9g
75a02300ba Spreadsheet: Add find, findIndex, indexOf, & has to CommonRange 2022-03-05 05:46:35 +03:30
u9g
87c818c571 Spreadsheet: Put common Range(s) functionality into CommonRange class 2022-03-05 05:46:35 +03:30
u9g
9fcd3f7920 Spreadsheet: Prevent infinite loop in Range ctor 2022-03-04 04:29:20 +03:30
u9g
12ef20b869 Spreadsheet: Improve R function to support all of the examples 2022-03-04 04:29:20 +03:30
u9g
93115ee044 Spreadsheet: Add Range(s).toArray() 2022-03-04 04:29:20 +03:30
u9g
4eb2c70a03 Spreadsheet: Make Range(s).forEach() return Position objects 2022-03-02 21:49:17 +03:30
u9g
d047f26a74 Spreadsheet: Add Range(s).at(ix) 2022-03-02 21:49:17 +03:30
u9g
d2adf54e73 Spreadsheet: Add sumProduct(If) functions 2022-02-27 02:48:32 +03:30
u9g
99425c5adc Spreadsheet: Add max(If)/min(If) function for ranges 2022-02-27 02:48:32 +03:30
u9g
6c35419236 Spreadsheet: Add Range(s).first() functions 2022-02-27 02:48:32 +03:30
Ali Mohammad Pur
6bb0c09bc1 Spreadsheet: Make Range.forEach() stop looping when it receives a Break
Not having this broke the mechanism behind lookup() and reflookup().
2022-02-23 03:17:12 +03:30
u9g
678d26dd19 Spreadsheet: Fix calling variable that wasn't defined 2022-02-22 07:53:02 +03:30
u9g
d00781de36 Spreadsheet: Replace range function with R function
As discussed on discord, the R function is much more user friendly
and shorter to write.
2022-02-21 16:02:04 +03:30
u9g
78804eda85 Spreadsheet: Make R function syntax more simple 2022-02-21 16:02:04 +03:30
u9g
b3591d28df Spreadsheet: Prevent infinite loop in Range ctor 2022-02-21 00:11:00 +03:30
u9g
1511e9a5a9 Spreadsheets: Add range functions to the Position class
Adds functions to get range of non-empty cells in a direction.
2022-02-18 23:26:45 +03:30
u9g
7590c0fff8 Spreadsheet: Make ranges vertically end-inclusive
With the spreadsheet:
```
A0:1
B0:2
A1:2
B1:3
```
Before: sum(range("A0","B1")) === 3
After: sum(range("A0","B1")) === 8
2022-02-15 03:03:21 +03:30
kleines Filmröllchen
c4013f72a3 Spreadsheet: Implement the mode function
My statistics course has gotten to me :^)
2022-01-15 21:55:24 +03:30
Ali Mohammad Pur
91444de2cf Spreadsheet: Reimplement ranges as lazy objects instead of arrays
Doing so makes it possible to talk about theoretically infinite ranges
like "all of column A".
2021-12-12 14:49:49 +03:30
Linus Groh
f538df7572 CI: Bump prettier to latest version (2.4.1)
We didn't initially upgrade because it started to (incorrectly) see
files as strict mode and chokes on things that then would be syntax
errors - but we're starting to fall behind a bit, so I'd rather put
these files on the ignore list instead.
2021-11-21 01:18:23 +00:00
Monroe Clinton
a59010bd97 Spreadsheet: Add missing examples 2021-09-24 04:53:57 +03:30
Linus Groh
21dafc11d5 Spreadsheet: Use strict mode for runtime.js 2021-08-28 13:33:04 +01:00
Linus Groh
527efc1d52 Spreadsheet: Replace loose with strict equality operators in runtime.js 2021-08-28 13:33:04 +01:00
Linus Groh
f70bed7339 Spreadsheet: Remove custom JS string split function implementation 2021-08-28 13:33:04 +01:00
Linus Groh
dc8e69eb44 Spreadsheed: Call native functions in runtime.js on thisSheet
I think this *should* be working as-is, but there's probably something
wrong with the this value of native functions. Either way, not relying
on the implicit this value will allow us to use strict mode here
eventually.

Fixes #9240.
2021-08-28 13:33:04 +01:00
AnotherTest
f17874ecd2 Spreadsheet: Add a 'contents' getter/setter to Position
This makes it possible to change the cells' contents programmatically!
2020-12-29 00:58:43 +01:00
AnotherTest
474453244b Spreadsheet: Implement infinit-scroll for columns
This naturally also implements multi-char columns, and also integrates
it into the js runtime (such columns can be named in ranges too).
2020-11-30 12:07:45 +01:00
AnotherTest
1bd3a2d09f Spreadsheet: Add support for example views and hyperlinks in the docs
Now the functions can actually be demonstrated by small examples,
embedded right inside the documentation via:
spreadsheet://example/<page>#<example_name>

Also allows pages to link to each other via the same scheme:
spreadsheet://doc/<page>
2020-10-31 15:40:13 +01:00
Linus Groh
bcfc6f0c57 Everywhere: Fix more typos 2020-10-03 12:36:49 +02:00
AnotherTest
cfa5e6efe9 Spreadsheet: Add the 'lookup' and 'reflookup' functions 2020-09-28 17:41:48 +02:00
AnotherTest
9c1143fe13 Spreadsheet: Add a 'choose' function 2020-09-28 17:41:48 +02:00
AnotherTest
f159d161fa Spreadsheet: Let the cells know their own position in the sheet 2020-09-28 17:41:48 +02:00
AnotherTest
383ee279ee Spreadsheet: Add a whole bunch of basic statistical functions 2020-08-28 20:30:31 +02:00
AnotherTest
facd7fe05b Spreadsheet: Document the behaviour of the 'R' function/tag 2020-08-28 20:30:31 +02:00
AnotherTest
cb7fe4fe7c Spreadsheet: Add support for multiple sheets
This also refactors the js integration stuff to allow sheets to
reference each other safely.
2020-08-27 10:27:20 +02:00
AnotherTest
d0c96ba2d8 Spreadsheet: Reformat the runtime file to comply with js standards 2020-08-24 18:21:33 +02:00
AnotherTest
3a07f6e345 Spreadsheet: Document runtime functions and add a help window
...that can automatically generate documentation pages from the objects.
2020-08-24 18:21:33 +02:00
AnotherTest
a6ebd29aa5 Spreadsheet: Start making a spreadsheet application 2020-08-24 18:21:33 +02:00