forked from deephaven/web-client-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Grids.tsx
71 lines (65 loc) · 2.1 KB
/
Grids.tsx
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
import React, { PureComponent } from 'react';
import {
Grid,
MockGridModel,
MockTreeGridModel,
ThemeContext,
GridThemeType,
} from '@deephaven/grid';
import { IrisGrid } from '@deephaven/iris-grid';
import MockIrisGridTreeModel from './MockIrisGridTreeModel';
import StaticExample from './grid-examples/StaticExample';
import QuadrillionExample from './grid-examples/QuadrillionExample';
import TreeExample from './grid-examples/TreeExample';
import AsyncExample from './grid-examples/AsyncExample';
type GridsState = {
irisGridModel: MockIrisGridTreeModel;
model: MockGridModel;
theme: Partial<GridThemeType>;
contextTheme: Partial<GridThemeType>;
};
class Grids extends PureComponent<Record<string, never>, GridsState> {
constructor(props: Record<string, never>) {
super(props);
this.state = {
irisGridModel: new MockIrisGridTreeModel(new MockTreeGridModel()),
model: new MockGridModel(),
theme: { autoSelectRow: true },
contextTheme: { rowHeight: 40 },
};
}
render(): React.ReactElement {
const { contextTheme, irisGridModel, model, theme } = this.state;
return (
<div>
<ThemeContext.Provider value={contextTheme}>
<h2 className="ui-title">Grid</h2>
<div>
<Grid model={model} theme={theme} />
</div>
<h2 className="ui-title">Static Data</h2>
<div style={{ height: 200 }}>
<StaticExample />
</div>
</ThemeContext.Provider>
<h2 className="ui-title">Quadrillion rows and columns</h2>
<div style={{ height: 500, position: 'relative' }}>
<QuadrillionExample />
</div>
<h2 className="ui-title">Async example</h2>
<div style={{ height: 500, position: 'relative' }}>
<AsyncExample />
</div>
<h2 className="ui-title">Tree Grid</h2>
<div style={{ height: 500 }}>
<TreeExample />
</div>
<h2 className="ui-title">Iris Grid</h2>
<div style={{ height: 500 }}>
<IrisGrid model={irisGridModel} />
</div>
</div>
);
}
}
export default Grids;