getEdgeId #58
-
| 🙏  Can you please make   | 
Beta Was this translation helpful? Give feedback.
      
      
          Answered by
          
            bcakmakoglu
          
      
      
        Mar 31, 2022 
      
    
    Replies: 1 comment 6 replies
-
| You can add edge properties to the params: onConnect((params) => {
  addEdges([
    {
      ...params,
      style: { stroke: 'blue' },
      animated: true,
      label: `${params.source} - connected to - ${params.target}`,
      labelBgStyle: { fill: 'orange' },
    },
  ])
})Here the TypeScript interface as a reference /** base element props */
export interface Element {
  id: string
  label?:
    | string
    | {
        props?: any
        component: any
      }
  type?: string
  data?: Data
  class?: string
  style?: CSSProperties
  hidden?: boolean
}
export interface Edge extends Element {
  /** Source node id */
  source: string
  /** Target node id */
  target: string
  /** Source handle id */
  sourceHandle?: string | null
  /** Target handle id */
  targetHandle?: string | null
  /** Source position */
  sourcePosition?: Position
  /** Target position */
  targetPosition?: Position
  /** Label styles (CSSProperties) */
  labelStyle?: CSSProperties
  /** Show label bg */
  labelShowBg?: boolean
  /** Label Bg styles (CSSProperties) */
  labelBgStyle?: CSSProperties
  /** Label Bg padding */
  labelBgPadding?: [number, number]
  /** Label Bg border radius */
  labelBgBorderRadius?: number
  /** Animated edge */
  animated?: boolean
  /** EdgeMarker */
  markerStart?: EdgeMarkerType
  /** EdgeMarker */
  markerEnd?: EdgeMarkerType
  /** Disable/enable updating edge */
  updatable?: boolean
  /** Disable/enable selecting edge */
  selectable?: boolean
} | 
Beta Was this translation helpful? Give feedback.
                  
                    6 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 add edge properties to the params:
Here the TypeScript interface as a reference