Skip to content

Way to fitView with default zoom? #922

Answered by bcakmakoglu
prksean asked this question in Q&A
Discussion options

You must be logged in to vote

You can pass a number of options to the fitView action.

export interface TransitionOptions {
  duration?: number
}

export type FitViewParams = {
  padding?: number
  includeHiddenNodes?: boolean
  minZoom?: number
  maxZoom?: number
  offset?: {
    x?: number
    y?: number
  }
  nodes?: string[]
} & TransitionOptions
  1. setting minZoom and maxZoom to the same value will force a specific zoom level
  2. setting id(s) to the nodes option will force fit view to only wrap around the specified node(s)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by bcakmakoglu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants