Line

You are reading the unreleased docs (next). See latest (v0.9)

ui/client/features/workflows/hooks/useFitOnResize

Cockpit client (features), next. Source: ui/client/features/workflows/hooks/useFitOnResize.tsx.

Functions#

useFitOnResize()#

useFitOnResize(padding): object

Defined in: ui/client/features/workflows/hooks/useFitOnResize.tsx:12

React Flow fits the diagram to its box once, when it first renders. Inside the shell the box changes afterwards (the Tools panel opens when a file loads, panes are dragged, the window resizes), so refit whenever the viewport element's size changes. padding matches the initial fit.

Parameters#

padding

number

Returns#

object

onInit

onInit: (instance) => void

Parameters
instance

Fitter

Returns

void

viewportRef

viewportRef: RefObject<HTMLDivElement | null>