Way to fitView with default zoom? #922
-
| 
         Is there a way to fitView and set the desired zoom instead of having to show all nodes? At first load, I want to set the view centered around my base node with specific zoom level regardless of how many nodes exist.  | 
  
Beta Was this translation helpful? Give feedback.
      
      
          Answered by
          
            bcakmakoglu
          
      
      
        May 10, 2023 
      
    
    Replies: 1 comment
-
| 
         You can pass a number of options to the  export interface TransitionOptions {
  duration?: number
}
export type FitViewParams = {
  padding?: number
  includeHiddenNodes?: boolean
  minZoom?: number
  maxZoom?: number
  offset?: {
    x?: number
    y?: number
  }
  nodes?: string[]
} & TransitionOptions
  | 
  
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
      Answer selected by
        bcakmakoglu
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
You can pass a number of options to the
fitViewaction.minZoomandmaxZoomto the same value will force a specific zoom levelnodesoption will force fit view to only wrap around the specified node(s)