Skip to content

Commit

Permalink
Introduce plain text cells.
Browse files Browse the repository at this point in the history
  • Loading branch information
r3c committed Apr 12, 2021
1 parent 6723adf commit d042d92
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -321,12 +321,13 @@
// Initialize pivot table and attach event listeners
let cellDefinitions = [
() => ({ constructor: createPlainValue, value: Math.floor(Math.random() * 100) }),
() => ({ constructor: createPlainValue, value: Math.floor(Math.random() * 100) }),
() => ({ constructor: createDimensionValue, value: cellLabels[Math.floor(Math.random() * cellLabels.length)] }),
() => ({ constructor: createPlainValue, value: cellTexts[Math.floor(Math.random() * cellTexts.length)] }),
() => ({ constructor: createDimensionValue, value: cellModalities[Math.floor(Math.random() * cellModalities.length)] }),
() => ({ constructor: createBooleanValue, value: Math.random() < 0.5 })
];

let cellLabels = ['Apple', 'Banana', 'Cherry', 'Durian', 'Elderberry', 'Fig', 'Grape', 'Honeyberry', 'Jujube', 'Kumquat'];
let cellModalities = ['Apple', 'Banana', 'Cherry', 'Durian', 'Elderberry', 'Fig', 'Grape', 'Honeyberry', 'Jujube', 'Kumquat'];
let cellTexts = ['Alice', 'Bob', 'Charlie', 'Dan', 'Eve', 'Frank', 'Grace', 'Heidi', 'Ivan', 'Judy', 'Ken'];

function createArray(length, generator) {
return new Array(length).fill(undefined).map((_, index) => generator(index));
Expand Down

0 comments on commit d042d92

Please sign in to comment.