-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathreadme.html
25 lines (23 loc) · 933 Bytes
/
readme.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<!DOCTYPE html>
<grid-chen></grid-chen>
<script type="module">
import "https://decatur.github.io/gridchen/gridchen/webcomponent.js"
import {createView} from "https://decatur.github.io/gridchen/gridchen/matrixview.js"
import {createTransactionManager} from "https://decatur.github.io/gridchen/gridchen/utils.js";
// The JSON schema defines the data structure of the matrix.
const schema = {
title: 'Array of Row Arrays',
type: 'array',
items: {
type: 'array',
items: [
{title: 'SomeDate', type: 'string', format:'full-date'},
{title: 'SomeNumber', type: 'number'}
]
}
};
const rows = [['2019-01-01', 1], ['2020-01-01', 2], ['2021-01-01', 3]];
const view = createView(schema, rows);
const tm = createTransactionManager();
document.querySelector('grid-chen').resetFromView(view, tm);
</script>