Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Create UI to Display Partitioned Tables #1663

Merged
merged 40 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
9c94210
Create IrisGridPartitionedTableModel
georgecwan Oct 23, 2023
00c96df
Merge branch 'main' of https://github.com/deephaven/web-client-ui int…
georgecwan Nov 2, 2023
12b638c
Handle partitions and partitionColumns with model
georgecwan Nov 6, 2023
dffd2bb
Update IrisGridPartitionSelector for PartitionedTable
georgecwan Nov 16, 2023
7ead3b5
Fix partially selected partitions
georgecwan Nov 16, 2023
ac52c3f
Merge branch 'main' of github.com:GcWan/web-client-ui into 1143-parti…
georgecwan Nov 16, 2023
35120eb
Fix minor bugs and button formatting
georgecwan Nov 22, 2023
64cfaf4
Add new partition selector dropdowns
georgecwan Nov 29, 2023
563a6c5
Merge branch 'main' of https://github.com/deephaven/web-client-ui int…
georgecwan Nov 29, 2023
a2cdec0
Fix bug when no partition is selected
georgecwan Nov 29, 2023
6bcb03a
Fix error with char and long types
georgecwan Nov 29, 2023
0b578b1
Fix unit tests
georgecwan Nov 30, 2023
5f69436
Rename PartitionedTable model file
georgecwan Nov 30, 2023
3a5c1fb
Update key tables to match jsapi
georgecwan Dec 1, 2023
208dd61
Remove partitionColumns setter
georgecwan Dec 7, 2023
3131270
Check partition in IrisGridTableModel constructor
georgecwan Dec 7, 2023
93ab3bc
Merge branch 'main' of https://github.com/deephaven/web-client-ui int…
georgecwan Dec 7, 2023
105dc3a
Fix styling
georgecwan Dec 11, 2023
57d787e
Remove recursion in partition selector
georgecwan Dec 12, 2023
a139bf2
Remove log statements
georgecwan Dec 12, 2023
9eea801
Add PartitionedGridModel
georgecwan Dec 15, 2023
98f9ba3
Add PartitionedGridModel
georgecwan Dec 18, 2023
e01581a
Merge branch 'main' of https://github.com/deephaven/web-client-ui int…
georgecwan Dec 18, 2023
e86692c
Update unit tests
georgecwan Dec 18, 2023
820eb2e
Use model in partition selector
georgecwan Dec 22, 2023
5e82a31
Fix initial key selection
georgecwan Dec 22, 2023
394932d
Fix unit tests
georgecwan Dec 22, 2023
1899334
WIP cleaning up George's partitioned table selector
mofojed Jan 4, 2024
c0bf727
Cleaning up some more
mofojed Jan 5, 2024
6726531
Don't throw for getting properties
mofojed Jan 5, 2024
4e0ae6c
Some more cleanup
mofojed Jan 5, 2024
19a1b35
Fix bad import
mofojed Jan 5, 2024
a9e834b
Fix failing test
mofojed Jan 5, 2024
dd761a1
Fix rehydration and char partitions
mofojed Jan 5, 2024
cbd28aa
Merge remote-tracking branch 'origin/main' into 1143-partitioned-tabl…
mofojed Jan 5, 2024
f4cba3a
Fix review comments
mofojed Jan 8, 2024
02542dd
Fix the columns used in the partition selector
mofojed Jan 16, 2024
5ce6ff9
Fix issues found in review with ticking partition tables
mofojed Jan 18, 2024
b81cd58
Merge remote-tracking branch 'origin/main' into pr/georgecwan/1663
dsmmcken Jan 18, 2024
681bc24
adjust color variables
dsmmcken Jan 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions packages/code-studio/src/styleguide/MockIrisGridTreeModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,22 @@ class MockIrisGridTreeModel
// Ignore for mock
}

get partition(): never[] {
return [];
}

set partition(partition: never[]) {
// Ignore for mock
}

get partitionColumns(): never[] {
return [];
}

set partitionColumns(partitionColumns: never[]) {
// Ignore for mock
}

georgecwan marked this conversation as resolved.
Show resolved Hide resolved
set formatter(formatter: Formatter) {
// Ignore for mock
}
Expand Down
20 changes: 5 additions & 15 deletions packages/components/src/Option.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
import React from 'react';
import React, { OptionHTMLAttributes } from 'react';

export type OptionProps = {
export type OptionProps = OptionHTMLAttributes<HTMLOptionElement> & {
children: React.ReactNode;
disabled?: boolean;
value: string;
'data-testid'?: string;
};

function Option({
children,
disabled,
value,
'data-testid': dataTestId,
}: OptionProps): JSX.Element {
return (
<option value={value} disabled={disabled} data-testid={dataTestId}>
{children}
</option>
);
function Option({ children, ...props }: OptionProps): JSX.Element {
// eslint-disable-next-line react/jsx-props-no-spreading
return <option {...props}>{children}</option>;
}

export default Option;
3 changes: 2 additions & 1 deletion packages/console/src/common/ConsoleUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ class ConsoleUtils {
return (
type === dh.VariableType.TABLE ||
type === dh.VariableType.TREETABLE ||
type === dh.VariableType.HIERARCHICALTABLE
type === dh.VariableType.HIERARCHICALTABLE ||
type === dh.VariableType.PARTITIONEDTABLE
);
}

Expand Down
1 change: 1 addition & 0 deletions packages/console/src/common/ObjectIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ function ObjectIcon({ type }: ObjectIconProps): JSX.Element {
case dh.VariableType.TABLEMAP:
case dh.VariableType.TREETABLE:
case dh.VariableType.HIERARCHICALTABLE:
case dh.VariableType.PARTITIONEDTABLE:
return <FontAwesomeIcon icon={dhTable} />;
case dh.VariableType.FIGURE:
return <FontAwesomeIcon icon={vsGraph} />;
Expand Down
7 changes: 6 additions & 1 deletion packages/dashboard-core-plugins/src/GridPluginConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ const GridPluginConfig: WidgetPlugin = {
type: PluginType.WIDGET_PLUGIN,
component: GridWidgetPlugin,
panelComponent: GridPanelPlugin,
supportedTypes: ['Table', 'TreeTable', 'HierarchicalTable'],
supportedTypes: [
'Table',
'TreeTable',
'HierarchicalTable',
'PartitionedTable',
],
icon: dhTable,
};

Expand Down
33 changes: 14 additions & 19 deletions packages/dashboard-core-plugins/src/panels/IrisGridPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import {
ColumnHeaderGroup,
IrisGridContextMenuData,
IrisGridTableModel,
PartitionConfig,
} from '@deephaven/iris-grid';
import {
AdvancedFilterOptions,
Expand Down Expand Up @@ -126,9 +127,7 @@ export interface PanelState {
type LoadedPanelState = PanelState & {
irisGridPanelState: PanelState['irisGridPanelState'] & {
partitions?: (string | null)[];
partitionColumns?: ColumnName[];
partition?: string | null;
partitionColumn?: ColumnName | null;
};
};

Expand Down Expand Up @@ -190,7 +189,7 @@ interface IrisGridPanelState {
movedRows: readonly MoveOperation[];
isSelectingPartition: boolean;
partitions: (string | null)[];
partitionColumns: Column[];
partitionConfig?: PartitionConfig;
rollupConfig?: UIRollupConfig;
showSearchBar: boolean;
searchValue: string;
Expand Down Expand Up @@ -296,7 +295,6 @@ export class IrisGridPanel extends PureComponent<
movedRows: [],
isSelectingPartition: false,
partitions: [],
partitionColumns: [],
rollupConfig: undefined,
showSearchBar: false,
searchValue: '',
Expand Down Expand Up @@ -466,13 +464,11 @@ export class IrisGridPanel extends PureComponent<
model: IrisGridModel,
isSelectingPartition: boolean,
partitions: (string | null)[],
partitionColumns: Column[],
advancedSettings: Map<AdvancedSettingsType, boolean>
) =>
IrisGridUtils.dehydrateIrisGridPanelState(model, {
isSelectingPartition,
partitions,
partitionColumns,
advancedSettings,
})
);
Expand All @@ -499,7 +495,8 @@ export class IrisGridPanel extends PureComponent<
pendingDataMap: PendingDataMap<UIRow>,
frozenColumns: readonly ColumnName[],
conditionalFormats: readonly SidebarFormattingRule[],
columnHeaderGroups: readonly ColumnHeaderGroup[]
columnHeaderGroups: readonly ColumnHeaderGroup[],
partitionConfig: PartitionConfig | undefined
) => {
assertNotNull(this.irisGridUtils);
return this.irisGridUtils.dehydrateIrisGridState(model, {
Expand All @@ -525,6 +522,7 @@ export class IrisGridPanel extends PureComponent<
frozenColumns,
conditionalFormats,
columnHeaderGroups,
partitionConfig,
});
}
);
Expand Down Expand Up @@ -1035,12 +1033,8 @@ export class IrisGridPanel extends PureComponent<
}[]
);
}
const {
isSelectingPartition,
partitions,
partitionColumns,
advancedSettings,
} = IrisGridUtils.hydrateIrisGridPanelState(model, irisGridPanelState);
const { isSelectingPartition, partitions, advancedSettings } =
IrisGridUtils.hydrateIrisGridPanelState(model, irisGridPanelState);
assertNotNull(this.irisGridUtils);
const {
advancedFilters,
Expand All @@ -1063,6 +1057,7 @@ export class IrisGridPanel extends PureComponent<
frozenColumns,
conditionalFormats,
columnHeaderGroups,
partitionConfig,
} = this.irisGridUtils.hydrateIrisGridState(model, {
...irisGridState,
...irisGridStateOverrides,
Expand All @@ -1084,7 +1079,6 @@ export class IrisGridPanel extends PureComponent<
movedColumns,
movedRows,
partitions,
partitionColumns,
quickFilters,
reverseType,
rollupConfig,
Expand All @@ -1102,6 +1096,7 @@ export class IrisGridPanel extends PureComponent<
isStuckToBottom,
isStuckToRight,
columnHeaderGroups,
partitionConfig,
});
} catch (error) {
log.error('loadPanelState failed to load panelState', panelState, error);
Expand All @@ -1117,7 +1112,6 @@ export class IrisGridPanel extends PureComponent<
panelState: oldPanelState,
isSelectingPartition,
partitions,
partitionColumns,
advancedSettings,
} = this.state;
const {
Expand All @@ -1140,6 +1134,7 @@ export class IrisGridPanel extends PureComponent<
frozenColumns,
conditionalFormats,
columnHeaderGroups,
partitionConfig,
} = irisGridState;
assertNotNull(model);
assertNotNull(metrics);
Expand All @@ -1153,7 +1148,6 @@ export class IrisGridPanel extends PureComponent<
model,
isSelectingPartition,
partitions,
partitionColumns,
advancedSettings
),
this.getDehydratedIrisGridState(
Expand All @@ -1177,7 +1171,8 @@ export class IrisGridPanel extends PureComponent<
pendingDataMap,
frozenColumns,
conditionalFormats,
columnHeaderGroups
columnHeaderGroups,
partitionConfig
),
this.getDehydratedGridState(
model,
Expand Down Expand Up @@ -1241,7 +1236,7 @@ export class IrisGridPanel extends PureComponent<
movedColumns,
movedRows,
partitions,
partitionColumns,
partitionConfig,
quickFilters,
reverseType,
rollupConfig,
Expand Down Expand Up @@ -1323,7 +1318,7 @@ export class IrisGridPanel extends PureComponent<
movedColumns={movedColumns}
movedRows={movedRows}
partitions={partitions}
partitionColumns={partitionColumns}
partitionConfig={partitionConfig}
quickFilters={quickFilters}
reverseType={reverseType}
rollupConfig={rollupConfig}
Expand Down
1 change: 1 addition & 0 deletions packages/embed-grid/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const SUPPORTED_TYPES: string[] = [
dh.VariableType.TREETABLE,
dh.VariableType.HIERARCHICALTABLE,
dh.VariableType.PANDAS,
dh.VariableType.PARTITIONEDTABLE,
];

export type Command = 'filter' | 'sort';
Expand Down
3 changes: 1 addition & 2 deletions packages/grid/src/DataBarGridModel.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { GridThemeType } from '.';
import { ModelIndex } from './GridMetrics';
import GridModel from './GridModel';
import { GridColor } from './GridTheme';
import { GridColor, type GridTheme as GridThemeType } from './GridTheme';

export type Marker = { value: number; color: string };
export type AxisOption = 'proportional' | 'middle' | 'directional';
Expand Down
1 change: 1 addition & 0 deletions packages/iris-grid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"@deephaven/filters": "file:../filters",
"@deephaven/grid": "file:../grid",
"@deephaven/icons": "file:../icons",
"@deephaven/jsapi-components": "file:../jsapi-components",
"@deephaven/jsapi-types": "file:../jsapi-types",
"@deephaven/jsapi-utils": "file:../jsapi-utils",
"@deephaven/log": "file:../log",
Expand Down
Loading
Loading