@okitan/grid-for-sheet
v2.5.2
Published
utilities for google spreadsheet griddata generation
Downloads
121
Readme
@okitan/grid-for-sheet
utilities for google spreadsheet griddata generation
Installation
$ npm install @okitan/grid-for-sheet
Usage
import { Grid } from "@okitan/grid-for-sheet";
const grid = new Grid({ data: [["strong", 0]] });
grid.toGridData();
/* returns
{
rowData: [
{ values: [
{
userEnteredValue: { stringValue: "strong" }
},
{
userEnteredValue: { numberValue: 0 }
}
]}
]
}
*/
More usage: tests/grid.test.ts
.
Terminology
A B C D
1 | | C1 | C2 | | ← columnHeader
2 | | SUM | SUM | SOS | ← columnTotalHeader
3 | R1 | | | SUM |
4 | R2 | | | SUM |
↑ rowHeader ↑ rowTotal
- columnHeader
- activated by
column.showHeader
- activated by
- columnTotalHeader
- activated by
sum.column
- activated by
- rowHeader
- activated by
row.showHeader
- activated by
- rowTotal
- activated by
sum.row
- activated by
Labels
On the upper table, these cells can be set by labels.
- gridLable(A1)
- set
label
, but only shown when rowHeader and columnHeader are present
- set
- rowTotalLabel(D1)
- set
sum.row.label
, but only shown when rowTotal and columnHeader are present
- set
- columnTotalHeaderLabel(A2)
- set
sum.column.label
, but only shown when rowHeader and columnTotalHeader are present
- set