-
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.
- Each dashboard provides the `LayoutManagerContext`
- Loading branch information
Showing
12 changed files
with
71 additions
and
42 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from 'react'; | ||
import GoldenLayout from '@deephaven/golden-layout'; | ||
|
||
export const LayoutManagerContext: React.Context<GoldenLayout | undefined> = | ||
React.createContext<GoldenLayout | undefined>(undefined); | ||
|
||
export default LayoutManagerContext; |
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,5 +1,7 @@ | ||
export { default as LayoutManagerContext } from './LayoutManagerContext'; | ||
export { default as LayoutUtils } from './LayoutUtils'; | ||
export { default as GLPropTypes } from './GLPropTypes'; | ||
export { default as useDashboardPanel } from './useDashboardPanel'; | ||
export { default as useLayoutManager } from './useLayoutManager'; | ||
export { default as useListener } from './useListener'; | ||
export { default as usePanelRegistration } from './usePanelRegistration'; |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { useContext } from 'react'; | ||
import LayoutManager from '@deephaven/golden-layout'; | ||
import LayoutManagerContext from './LayoutManagerContext'; | ||
|
||
/** | ||
* Retrieve the current LayoutManager from the context | ||
*/ | ||
function useLayoutManager(): LayoutManager { | ||
const layoutManager = useContext(LayoutManagerContext); | ||
if (layoutManager == null) { | ||
throw new Error( | ||
'LayoutManager not available, did you add a LayoutManagerContext.Provider to the tree?' | ||
); | ||
} | ||
return layoutManager; | ||
} | ||
|
||
export default useLayoutManager; |
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 seems to be a breaking change for DHE