@deephaven/js-plugin-ag-grid 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +68 -3
- package/dist/AgGridPlugin.js +3 -3
- package/dist/AgGridPlugin.js.map +1 -1
- package/dist/bundle/index.js +67476 -65226
- package/dist/components/AgGridView.d.ts +18 -0
- package/dist/components/AgGridView.d.ts.map +1 -0
- package/dist/{AgGridView.js → components/AgGridView.js} +3 -6
- package/dist/components/AgGridView.js.map +1 -0
- package/dist/{AgGridWidget.d.ts → components/AgGridWidget.d.ts} +0 -1
- package/dist/components/AgGridWidget.d.ts.map +1 -0
- package/dist/{AgGridWidget.js → components/AgGridWidget.js} +5 -6
- package/dist/components/AgGridWidget.js.map +1 -0
- package/dist/components/LoadingOverlay.d.ts +10 -0
- package/dist/components/LoadingOverlay.d.ts.map +1 -0
- package/dist/components/LoadingOverlay.js +12 -0
- package/dist/components/LoadingOverlay.js.map +1 -0
- package/dist/components/LoadingSpinner.d.ts +7 -0
- package/dist/components/LoadingSpinner.d.ts.map +1 -0
- package/dist/components/LoadingSpinner.js +14 -0
- package/dist/components/LoadingSpinner.js.map +1 -0
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +5 -0
- package/dist/components/index.js.map +1 -0
- package/dist/datasources/DeephavenViewportDatasource.d.ts +2 -2
- package/dist/datasources/DeephavenViewportDatasource.d.ts.map +1 -1
- package/dist/datasources/DeephavenViewportDatasource.js +1 -2
- package/dist/datasources/DeephavenViewportDatasource.js.map +1 -1
- package/dist/hooks/useWidgetFetch.d.ts +1 -1
- package/dist/hooks/useWidgetFetch.d.ts.map +1 -1
- package/dist/hooks/useWidgetFetch.js +18 -20
- package/dist/hooks/useWidgetFetch.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/renderers/TreeCellRenderer.d.ts +1 -2
- package/dist/renderers/TreeCellRenderer.d.ts.map +1 -1
- package/dist/renderers/TreeCellRenderer.js +3 -3
- package/dist/renderers/TreeCellRenderer.js.map +1 -1
- package/dist/types/AgGridTableType.d.ts.map +1 -0
- package/dist/types/AgGridTableType.js.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/AgGridAggUtils.d.ts +1 -1
- package/dist/utils/AgGridAggUtils.d.ts.map +1 -1
- package/dist/utils/AgGridAggUtils.js.map +1 -1
- package/dist/{AgGridDhTheme.d.ts → utils/AgGridDhTheme.d.ts} +3 -4
- package/dist/utils/AgGridDhTheme.d.ts.map +1 -0
- package/dist/{AgGridDhTheme.js → utils/AgGridDhTheme.js} +3 -2
- package/dist/utils/AgGridDhTheme.js.map +1 -0
- package/dist/utils/AgGridFilterUtils.d.ts +3 -3
- package/dist/utils/AgGridFilterUtils.d.ts.map +1 -1
- package/dist/utils/AgGridFilterUtils.js +2 -1
- package/dist/utils/AgGridFilterUtils.js.map +1 -1
- package/dist/utils/AgGridFormatter.d.ts +3 -2
- package/dist/utils/AgGridFormatter.d.ts.map +1 -1
- package/dist/utils/AgGridFormatter.js +2 -1
- package/dist/utils/AgGridFormatter.js.map +1 -1
- package/dist/utils/AgGridPivotUtils.d.ts +1 -1
- package/dist/utils/AgGridPivotUtils.d.ts.map +1 -1
- package/dist/utils/AgGridPivotUtils.js.map +1 -1
- package/dist/utils/AgGridRenderUtils.d.ts +1 -1
- package/dist/utils/AgGridRenderUtils.d.ts.map +1 -1
- package/dist/utils/AgGridSortUtils.d.ts +3 -2
- package/dist/utils/AgGridSortUtils.d.ts.map +1 -1
- package/dist/utils/AgGridSortUtils.js +2 -1
- package/dist/utils/AgGridSortUtils.js.map +1 -1
- package/dist/utils/AgGridTableUtils.d.ts +2 -2
- package/dist/utils/AgGridTableUtils.d.ts.map +1 -1
- package/dist/utils/AgGridTableUtils.js +2 -0
- package/dist/utils/AgGridTableUtils.js.map +1 -1
- package/dist/utils/AgGridUtils.d.ts +1 -1
- package/dist/utils/AgGridUtils.d.ts.map +1 -1
- package/dist/utils/AgGridUtils.js +6 -4
- package/dist/utils/AgGridUtils.js.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/package.json +6 -14
- package/dist/AgGridDhTheme.d.ts.map +0 -1
- package/dist/AgGridDhTheme.js.map +0 -1
- package/dist/AgGridTableType.d.ts.map +0 -1
- package/dist/AgGridTableType.js.map +0 -1
- package/dist/AgGridView.d.ts +0 -16
- package/dist/AgGridView.d.ts.map +0 -1
- package/dist/AgGridView.js.map +0 -1
- package/dist/AgGridWidget.d.ts.map +0 -1
- package/dist/AgGridWidget.js.map +0 -1
- /package/dist/{AgGridTableType.d.ts → types/AgGridTableType.d.ts} +0 -0
- /package/dist/{AgGridTableType.js → types/AgGridTableType.js} +0 -0
package/README.md
CHANGED
|
@@ -4,10 +4,73 @@ This package can be used to display Deephaven tables using [AG Grid](https://www
|
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The easiest way to use this plugin is to import and use the provided `AgGridView` component directly. You must wrap it with an `ApiContext.Provider` to provide the Deephaven API instance:
|
|
8
8
|
|
|
9
9
|
```tsx
|
|
10
|
-
import React
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import type { dh as DhType } from '@deephaven/jsapi-types';
|
|
12
|
+
// Only if using Core+ features
|
|
13
|
+
import type { dh as CorePlusDhType } from '@deephaven-enterprise/jsapi-coreplus-types';
|
|
14
|
+
import { AgGridView } from '@deephaven/js-plugin-ag-grid';
|
|
15
|
+
import { ApiContext } from '@deephaven/jsapi-bootstrap';
|
|
16
|
+
|
|
17
|
+
function DeephavenAgGridComponent({
|
|
18
|
+
api,
|
|
19
|
+
table,
|
|
20
|
+
}: {
|
|
21
|
+
api: typeof DhType;
|
|
22
|
+
table: DhType.Table | DhType.TreeTable | CorePlusDhType.PivotTable;
|
|
23
|
+
}) {
|
|
24
|
+
return (
|
|
25
|
+
<ApiContext.Provider value={api}>
|
|
26
|
+
<AgGridView table={table} />
|
|
27
|
+
</ApiContext.Provider>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Formatting
|
|
33
|
+
|
|
34
|
+
You can pass in custom `Settings` to the `AgGridView` component to configure the grid's formatting. For example, to apply the Singapore time zone, display time down to the nanosecond, and show decimals to 4 places by default:
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
import React, { useMemo } from 'react';
|
|
38
|
+
import type { dh as DhType } from '@deephaven/jsapi-types';
|
|
39
|
+
import { AgGridView } from '@deephaven/js-plugin-ag-grid';
|
|
40
|
+
import { ApiContext } from '@deephaven/jsapi-bootstrap';
|
|
41
|
+
|
|
42
|
+
function FormattedAgGridComponent({
|
|
43
|
+
api,
|
|
44
|
+
table,
|
|
45
|
+
}: {
|
|
46
|
+
api: typeof DhType;
|
|
47
|
+
table: DhType.Table | DhType.TreeTable;
|
|
48
|
+
}) {
|
|
49
|
+
const settings = useMemo(
|
|
50
|
+
() => ({
|
|
51
|
+
timeZone: 'Singapore',
|
|
52
|
+
defaultDateTimeFormat: 'yyyy-MM-dd HH:mm:ss.SSSSSSSSS',
|
|
53
|
+
defaultDecimalFormatOptions: {
|
|
54
|
+
defaultFormatString: '###,##0.0000',
|
|
55
|
+
},
|
|
56
|
+
}),
|
|
57
|
+
[]
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<ApiContext.Provider value={api}>
|
|
62
|
+
<AgGridView table={table} settings={settings} />
|
|
63
|
+
</ApiContext.Provider>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Advanced Usage
|
|
69
|
+
|
|
70
|
+
You can import the datasource directly if you want to manipulate the `AgGridReact` component directly. Import the DeephavenViewportDatasource and use it with your AG Grid view:
|
|
71
|
+
|
|
72
|
+
```tsx
|
|
73
|
+
import React, { useMemo } from 'react';
|
|
11
74
|
import { AgGridReact } from 'ag-grid-react';
|
|
12
75
|
import type { dh as DhType } from '@deephaven/jsapi-types';
|
|
13
76
|
import { DeephavenViewportDatasource } from '@deephaven/js-plugin-ag-grid';
|
|
@@ -31,7 +94,7 @@ function DeephavenAgGridComponent({
|
|
|
31
94
|
}}
|
|
32
95
|
rowModelType="viewport"
|
|
33
96
|
viewportDatasource={datasource}
|
|
34
|
-
// other AG Grid properties
|
|
97
|
+
// ...other AG Grid properties
|
|
35
98
|
/>
|
|
36
99
|
);
|
|
37
100
|
}
|
|
@@ -46,3 +109,5 @@ The [`DeephavenViewportDatasource` listens to the grid's events](./src/datasourc
|
|
|
46
109
|
- [AgGridFilterUtils](./src/utils/AgGridFilterUtils.ts): Utility functions for mapping AG Grid filter models to Deephaven table operations.
|
|
47
110
|
- [AgGridSortUtils](./src/utils/AgGridSortUtils.ts): Utility functions for mapping AG Grid sort models to Deephaven table operations.
|
|
48
111
|
- [AgGridAggUtils](./src/utils/AgGridAggUtils.ts): Utility functions for mapping AG Grid aggregation and grouping models to Deephaven table operations.
|
|
112
|
+
- [AgGridPivotUtils](./src/utils/AgGridPivotUtils.ts): Utility functions for handling pivot tables in AG Grid with Deephaven.
|
|
113
|
+
- [AgGridFormatter](./src/utils/AgGridFormatter.ts): AG Grid formatter that takes Deephaven workspace settings to format columns.
|
package/dist/AgGridPlugin.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var _a, _b;
|
|
2
2
|
import { PluginType } from '@deephaven/plugin';
|
|
3
3
|
import { vsTable } from '@deephaven/icons';
|
|
4
|
-
import { LicenseManager } from '
|
|
5
|
-
import { AgGridWidget } from './
|
|
4
|
+
import { LicenseManager } from 'ag-grid-enterprise';
|
|
5
|
+
import { AgGridWidget } from './components';
|
|
6
6
|
const key = (_b = (_a = import.meta.env) === null || _a === void 0 ? void 0 : _a.VITE_AG_GRID_LICENSE_KEY) !== null && _b !== void 0 ? _b : '';
|
|
7
7
|
if (key != null && key !== '') {
|
|
8
8
|
LicenseManager.setLicenseKey(key);
|
|
@@ -10,7 +10,7 @@ if (key != null && key !== '') {
|
|
|
10
10
|
export const AgGridPlugin = {
|
|
11
11
|
name: '@deephaven/js-plugin-ag-grid',
|
|
12
12
|
type: PluginType.WIDGET_PLUGIN,
|
|
13
|
-
supportedTypes: ['deephaven.ag_grid.AgGrid'
|
|
13
|
+
supportedTypes: ['deephaven.ag_grid.AgGrid'],
|
|
14
14
|
component: AgGridWidget,
|
|
15
15
|
icon: vsTable,
|
|
16
16
|
title: 'AG Grid',
|
package/dist/AgGridPlugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgGridPlugin.js","sourceRoot":"","sources":["../src/AgGridPlugin.ts"],"names":[],"mappings":";AAAA,OAAO,EAAqB,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"AgGridPlugin.js","sourceRoot":"","sources":["../src/AgGridPlugin.ts"],"names":[],"mappings":";AAAA,OAAO,EAAqB,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,GAAG,GAAG,MAAA,MAAA,MAAM,CAAC,IAAI,CAAC,GAAG,0CAAE,wBAAwB,mCAAI,EAAE,CAAC;AAC5D,IAAI,GAAG,IAAI,IAAI,IAAI,GAAG,KAAK,EAAE,EAAE,CAAC;IAC9B,cAAc,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,CAAC,MAAM,YAAY,GAA4B;IACnD,IAAI,EAAE,8BAA8B;IACpC,IAAI,EAAE,UAAU,CAAC,aAAa;IAC9B,cAAc,EAAE,CAAC,0BAA0B,CAAC;IAC5C,SAAS,EAAE,YAAY;IACvB,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,SAAS;CACjB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|