server/graph/nested/shallow-topology.js
/**
   * Convert to nested graph data.
   * @returns {NestedTopologyData} Graph data of shallow graph.
   * @public
   */
Convert to nested graph data.
@returns {NestedTopologyData} Graph data of shallow graph.
@public
Convert to nested graph data . @returns { NestedTopologyData } Graph data of shallow graph . @public
toData() {
    const operativeNodes = this._operativeNodes()
    const supportTpLinks = this._makeSupportTpLinks(operativeNodes)
    const ascendingLayerOrder = (a, b) => {
      return a.layerOrder > b.layerOrder ? 1 : -1
    }
    return {
      nodes: operativeNodes.sort(ascendingLayerOrder),
      inoperativeNodes: this._inoperativeNodes(),
      links: this._operativeLinksIn(operativeNodes).concat(supportTpLinks),
      grid: this.grid.toData()
    }
  }
toData ( ) { const operativeNodes = this . _operativeNodes ( ) const supportTpLinks = this . _makeSupportTpLinks ( operativeNodes ) const ascendingLayerOrder = ( a , b ) => { return a . layerOrder > b . layerOrder ? 1 : - 1 } return { nodes : operativeNodes . sort ( ascendingLayerOrder ) , inoperativeNodes : this . _inoperativeNodes ( ) , links : this . _operativeLinksIn ( operativeNodes ) . concat ( supportTpLinks ) , grid : this . grid . toData ( ) } }
Convert to nested graph data.
Convert to nested graph data .
/**
     * @typedef {Object} NestedTopologyData
     * @prop {Array<NestedNodeData>} nodes - Nodes. (operative)
     * @prop {Array<NestedNodeData>} inoperativeNodes - Nodes. (inoperative)
     * @prop {Array<NestedLinkData>} links - Links. (connecting between operative nodes)
     * @prop {GridPositions} grid - Grid positions.
     */ // inoperative nodes are used to find parents // when hosts must be highlight by alert are not found in operative nodes.