spreadsheet
typeScript/javascript spreadsheet parser, with formulas.
git clone https://git.vogt.world/spreadsheet.git
Log | Files | README.md
← Commit log
commit
message
[TODO.md] seperating TODOs from README.md
author
Ben Vogt <[email protected]>
date
2017-05-19 02:26:49
stats
2 file(s) changed, 64 insertions(+), 15 deletions(-)
files
README.md
TODO.md
  1diff --git a/README.md b/README.md
  2index 87508ab..10022a8 100644
  3--- a/README.md
  4+++ b/README.md
  5@@ -1,36 +1,52 @@
  6 # Spreadsheet
  7-TypeScript/javascript implementation of a spreadsheet.
  8+TypeScript/javascript spreadsheet.
  9 
 10-## TODO
 11-Things I should do.
 12+## Usage
 13 
 14+### Example
 15 
 16-### SUM and SUMA should be different.
 17+```javascript
 18+var sheet = new Sheet();
 19+sheet.setCell("A1", "10");
 20+sheet.setCell("A2", "14");
 21+sheet.setCell("A4", "10e2");
 22+sheet.setCell("A5", "99.1");
 23+sheet.setCell("B1", "=SUM(A1:A5)");
 24+console.log(sheet.getCell("B1").getValue()); // output: 1124
 25+```
 26 
 27+### Ranges
 28 
 29-### MAX and MAXA should be different.
 30+In MS Excel, and Google Spreadsheets, literal ranges are denoted with opening and closing curly-brackets. E.g. "{1, 2, 3}". In this implementation however, literal ranges are denoted with opening and closing brackets. E.g. "[1, 2, 3]".
 31 
 32 
 33-### COUNT and COUNTA should be different.
 34+## Docs
 35+[Docs here](DOCUMENTATION.md)
 36 
 37 
 38-### Cells should have `formatAs` fields.
 39-Instead of having non-primitives, (i.e. Date, DateTime, Time, Dollar), cells should have formats based on the
 40-highest-order type that was used during the compilation and execution of a cell's dependency. For example, `DATE` might
 41-return a number, but the cell that called `DATE` would be aware of it calling a formula that returns an non-primitive
 42-type, and would display the returned number as a Date. If you're using `DATE` in conjunction with `DOLLAR` it would
 43-still display the returned value as a Date. The heirarhchy would look like: [Date, DateTime, Time, Dollar, number,
 44-boolean, string]. Advantages to this would include not having to cast down when using primitive operators,
 45-and flexibility in display. It would also simplify the types themselves, by having types be constants and just having
 46-helpers to convert, display, and do normal operations with them.
 47+## Contributing
 48+When adding a formula, or fixing a bug please follow the commit message format:
 49+```
 50+[BUG_FEATURE_FILE_OR_COMPONENT] short description here of issue and fix
 51+```
 52+If you're adding a new formula, before you submit a pull request or push ensure that:
 53+1) The formula is tested inside the proper category file in `tests/Formulas`.
 54+2) The formula tests for reference errors, N/A errors, value errors for each input.
 55+3) That the formula is tested for parsing inside `SheetFormulaTest.ts`.
 56 
 57 
 58-### Implement TO_DATE, TO_NUMBER, TO_DOLLARS, TO_TEXT
 59-Contingent upon cells having formats or types for primitives.
 60+### Why?
 61+Near the end of 2016 I began to ask myself why I didn't know more about MS Excel and Google Spreadsheets. Why didn't I know more about the most popular programing language in the world? I began to reverse engineer Google Spreadsheets in particular, gaining a better understanding along the way.
 62 
 63+I chose TypeScript because, coming from Java, it is really nice to be able to see type errors, and catch them. I also just enjoy getting specific with my return types, even if the specifications for a spreadsheet treat type flexibly.
 64 
 65-### Scrape jsdocs for functions, put in simple index.html, doc.md files to serve up simple documentation
 66+For the formula documentation, I tried to be at least -- if not more -- thorough as Google Spreadsheets.
 67 
 68 
 69-### CONVERT could offer more accurate conversions for units in the same system
 70-For example 64 tbs to a qt.
 71+### License
 72+
 73+For this repository's code license, and related licenses, see LICENSES directory.
 74+
 75+
 76+### Acknowledgements
 77+This is largely a re-write of [Handsontable](https://github.com/handsontable)'s [https://github.com/handsontable/ruleJS](https://github.com/handsontable/ruleJS), and [https://github.com/sutoiku/formula.js/](https://github.com/sutoiku/formula.js/). The parser was derived from Handsontable's, and many of the formulas were created with FormulaJS's formulas as a reference point.
 78\ No newline at end of file
 79diff --git a/TODO.md b/TODO.md
 80new file mode 100644
 81index 0000000..c3cbd28
 82--- /dev/null
 83+++ b/TODO.md
 84@@ -0,0 +1,26 @@
 85+# TODO
 86+Things I should do.
 87+
 88+
 89+### SUM and SUMA should be different.
 90+
 91+
 92+### MAX and MAXA should be different.
 93+
 94+
 95+### COUNT and COUNTA should be different.
 96+
 97+
 98+### Cells should have `formatAs` fields.
 99+Instead of having non-primitives, (i.e. Date, DateTime, Time, Dollar), cells should have formats based on the highest-order type that was used during the compilation and execution of a cell's dependency. For example, `DATE` might return a number, but the cell that called `DATE` would be aware of it calling a formula that returns an non-primitive type, and would display the returned number as a Date. If you're using `DATE` in conjunction with `DOLLAR` it would still display the returned value as a Date. The heirarhchy would look like: [Date, DateTime, Time, Dollar, number, boolean, string]. Advantages to this would include not having to cast down when using primitive operators, and flexibility in display. It would also simplify the types themselves, by having types be constants and just having helpers to convert, display, and do normal operations with them.
100+
101+
102+### Implement TO_DATE, TO_NUMBER, TO_DOLLARS, TO_TEXT
103+Contingent upon cells having formats or types for primitives.
104+
105+
106+### Scrape jsdocs for functions, put in simple index.html, doc.md files to serve up simple documentation
107+
108+
109+### CONVERT could offer more accurate conversions for units in the same system
110+For example 64 tbs to a qt.