-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
876a6ac
commit 94cc82c
Showing
33 changed files
with
953 additions
and
114 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,6 +79,8 @@ interface ConsoleProps { | |
* (file:File) => Promise<File[]> | ||
*/ | ||
unzip: (file: File) => Promise<JSZipObject[]>; | ||
supportsType(type: string): boolean; | ||
iconForType(type: string): ReactElement; | ||
} | ||
|
||
interface ConsoleState { | ||
|
@@ -105,6 +107,16 @@ interface ConsoleState { | |
isPrintStdOutEnabled: boolean; | ||
isClosePanelsOnDisconnectEnabled: boolean; | ||
} | ||
|
||
function defaultSupportsType(): boolean { | ||
return true; | ||
} | ||
|
||
function defaultIconForType(type: string): ReactElement { | ||
// eslint-disable-next-line react/jsx-no-useless-fragment | ||
return <></>; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
mattrunyon
Author
Collaborator
|
||
} | ||
|
||
export class Console extends PureComponent<ConsoleProps, ConsoleState> { | ||
static defaultProps = { | ||
statusBarChildren: null, | ||
|
@@ -117,6 +129,8 @@ export class Console extends PureComponent<ConsoleProps, ConsoleState> { | |
objectMap: new Map(), | ||
disabled: false, | ||
unzip: null, | ||
supportsType: defaultSupportsType, | ||
iconForType: defaultIconForType, | ||
}; | ||
|
||
static LOG_THROTTLE = 500; | ||
|
@@ -951,6 +965,8 @@ export class Console extends PureComponent<ConsoleProps, ConsoleState> { | |
timeZone, | ||
disabled, | ||
unzip, | ||
supportsType, | ||
iconForType, | ||
} = this.props; | ||
const { | ||
consoleHeight, | ||
|
@@ -1013,6 +1029,8 @@ export class Console extends PureComponent<ConsoleProps, ConsoleState> { | |
openObject={openObject} | ||
language={language} | ||
disabled={disabled} | ||
supportsType={supportsType} | ||
iconForType={iconForType} | ||
/> | ||
{historyChildren} | ||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,23 @@ | ||
import { | ||
assertIsDashboardPluginProps, | ||
DashboardPluginComponentProps, | ||
useDashboardPanel, | ||
} from '@deephaven/dashboard'; | ||
import { useApi } from '@deephaven/jsapi-bootstrap'; | ||
import { DashboardPanelProps } from '@deephaven/dashboard'; | ||
import { WidgetComponentProps } from '@deephaven/plugin'; | ||
import { forwardRef, useMemo } from 'react'; | ||
import { PandasPanel } from './panels'; | ||
import useHydrateGrid from './useHydrateGrid'; | ||
|
||
export function PandasPlugin( | ||
props: DashboardPluginComponentProps | ||
): JSX.Element | null { | ||
assertIsDashboardPluginProps(props); | ||
const dh = useApi(); | ||
const hydrate = useHydrateGrid(); | ||
export const PandasPlugin = forwardRef( | ||
(props: WidgetComponentProps, ref: React.Ref<PandasPanel>) => { | ||
const hydrate = useHydrateGrid<DashboardPanelProps>(); | ||
const { localDashboardId } = props; | ||
const hydratedProps = useMemo( | ||
() => hydrate(props, localDashboardId), | ||
[hydrate, props, localDashboardId] | ||
); | ||
|
||
useDashboardPanel({ | ||
dashboardProps: props, | ||
componentName: PandasPanel.COMPONENT, | ||
component: PandasPanel, | ||
supportedTypes: dh.VariableType.PANDAS, | ||
hydrate, | ||
}); | ||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
return <PandasPanel ref={ref} {...hydratedProps} />; | ||
} | ||
); | ||
|
||
return null; | ||
} | ||
PandasPlugin.displayName = 'PandasPlugin'; | ||
|
||
export default PandasPlugin; |
Oops, something went wrong.
@mattrunyon Any reason not to return
<ObjectIcon type={type} />
here?