NDEx JavaScript Client API Reference - v0.6.0-alpha.5
    Preparing search index...

    Class CX2Network

    CX2Network - Modern representation of CX2 format networks Provides utilities for creating, manipulating, and validating CX2 networks

    Implements

    • CX2Network
    Index

    Constructors

    Properties

    CXVersion: string = '2.0'
    hasFragments: boolean = false
    metaData: CX2MetaData[] = []
    attributeDeclarations?: CX2AttributeDeclarations
    networkAttributes?: CX2NetworkAttribute[]
    nodes?: CX2Node[]
    edges?: CX2Edge[]
    nodeBypass?: CX2NodeBypass[]
    edgeBypass?: CX2EdgeBypass[]
    visualProperties?: CX2VisualProperty
    status?: any[]

    Methods

    • Add a node to the network

      Parameters

      • id: number
      • Optionalattributes: Record<string, any>

      Returns CX2Node

    • Add an edge to the network

      Parameters

      • id: number
      • sourceId: number
      • targetId: number
      • Optionalattributes: Record<string, any>

      Returns CX2Edge

    • Add an individual node attribute

      Parameters

      • nodeId: number
      • attributeName: string
      • value: any

      Returns void

    • Add edge attributes (bulk)

      Parameters

      • edgeId: number
      • attributeName: string
      • value: any

      Returns void

    • Set node coordinates

      Parameters

      • nodeId: number
      • x: number
      • y: number
      • Optionalz: number

      Returns void

    • Get network name from attributes

      Returns undefined | string

    • Set network name

      Parameters

      • name: string

      Returns void

    • Get network attribute by key

      Parameters

      • key: string

      Returns any

    • Set network attribute

      Parameters

      • key: string
      • value: any

      Returns void

    • Validate the CX2 network structure

      Returns { isValid: boolean; errors: string[] }

    • Get basic statistics about the network

      Returns {
          nodeCount: number;
          edgeCount: number;
          hasCoordinates: boolean;
          hasVisualProperties: boolean;
      }