-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In order to preserve the nodes visible when opening the configuration panel, this commit schedules a `panIntoView` command to the selected node, preserving the zoom level while aiming for the less movement possible to make the node visible. relates: https://issues.redhat.com/browse/KTO-461
- Loading branch information
Showing
4 changed files
with
111 additions
and
79 deletions.
There are no files selected for viewing
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
21 changes: 21 additions & 0 deletions
21
packages/ui/src/components/Visualization/Canvas/CanvasController.tsx
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,21 @@ | ||
import { VisualizationProvider } from '@patternfly/react-topology'; | ||
import { FunctionComponent, PropsWithChildren, ReactNode, useMemo } from 'react'; | ||
import { BaseVisualCamelEntity } from '../../../models/visualization/base-visual-entity'; | ||
import { Canvas } from './Canvas'; | ||
import './Canvas.scss'; | ||
import { ControllerService } from './controller.service'; | ||
|
||
interface CanvasProps { | ||
contextToolbar?: ReactNode; | ||
entities: BaseVisualCamelEntity[]; | ||
} | ||
|
||
export const CanvasController: FunctionComponent<PropsWithChildren<CanvasProps>> = ({ entities }) => { | ||
const controller = useMemo(() => ControllerService.createController(), []); | ||
|
||
return ( | ||
<VisualizationProvider controller={controller}> | ||
<Canvas entities={entities} /> | ||
</VisualizationProvider> | ||
); | ||
}; |
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