-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
75 lines (65 loc) · 2.29 KB
/
index.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<html>
<head>
<title>Goodcore Test Page</title>
</head>
<body>
<script src="./node_modules/goodcore/goodcore.bundle.js"></script>
<script src="./node_modules/rxjs/bundles/Rx.min.js"></script>
<script src="./dist/lib/goodstore.bundle.js"></script>
<script>
goodcore.integrate();
mocDataResult1 = [
{
totalPx: { x: 200, y: 400 },
pxScope: { start: { x: 0, y: 0 }, stop: { x: 39, y: 19 } },
totalCells: { x: 4, y: 6 },
dataPort: { pos: { x: 0, y: 0 }, size: { x: 4, y: 2 } },
r: [
{
i: 0, h: 10, d: "rowData", c: [
{ i: { x: 0, y: 0 }, w: 10, d: 1 },
{ i: { x: 1, y: 0 }, w: 10, d: 2 },
{ i: { x: 2, y: 0 }, w: 10, d: 3 },
{ i: { x: 3, y: 0 }, w: 10, d: 4 }
],
},
{
i: 1, h: 10, d: "rowData", c: [
{ i: { x: 0, y: 1 }, w: 10, d: 5 },
{ i: { x: 1, y: 1 }, w: 10, d: 6 },
{ i: { x: 2, y: 1 }, w: 10, d: 7 },
{ i: { x: 3, y: 1 }, w: 10, d: 8 }
],
}
],
cellsPerPage: { x: 2, y: 2 }
}];
let mocDataResult = Arr.shallowCopy(mocDataResult1);
let dsc = {
pageSize: new Vec2(2, 2),
retainSize: 4,
endPointFn: (payload) => {
let result = new Rx.Observable((observable) => {
observable.next(mocDataResult.shift());
});
return result;
}
};
let ds = new goodstore.DataStore(dsc);
let handle = ds.register(new goodstore.RequestConfig());
let req = 0;
handle.stream.subscribe({
next: (v) => {
if (req === 1) {
console.log(v);
}
req++;
}
});
//Test
let viewPort = new Range2(0, 0, 4, 2);
handle.load({ viewPort });
</script>
<H1>GoodCore library is loaded</H1>
</body>
</html>