drawSidebar(graphNodes) {
    this.sidebar.innerHTML = "";
    // TODO(benwright) - Move these to use CSS margins.
    for (const graphNode of graphNodes) {
      const listNode = document.createElement("li");
      listNode.appendChild(document.createTextNode(graphNode["name"]));
      if (graphNode["routes"]["uses"].length) {
        listNode.appendChild(document.createElement("br"));
        listNode.appendChild(document.createElement("br"));
        listNode.appendChild(document.createTextNode("uses:"));
        for (const use of graphNode["routes"]["uses"]) {
          listNode.appendChild(document.createElement("br"));
          listNode.appendChild(document.createTextNode(use));
        }
      }
      if (graphNode["routes"]["offers"].length) {
        listNode.appendChild(document.createElement("br"));
        listNode.appendChild(document.createElement("br"));
        listNode.appendChild(document.createTextNode("offers:"));
        for (const offer of graphNode["routes"]["offers"]) {
          listNode.appendChild(document.createElement("br"));
          listNode.appendChild(document.createTextNode(offer));
        }
      }
      listNode.appendChild(document.createElement("br"));
      listNode.appendChild(document.createElement("br"));
      listNode.appendChild(document.createTextNode("verson: " + graphNode["version"]));
      if (graphNode["source"]) {
        listNode.appendChild(document.createElement("br"));
        listNode.appendChild(document.createElement("br"));
        listNode.appendChild(document.createTextNode("source: " + graphNode["source"]));
      }
      if (graphNode["type"]) {
        listNode.appendChild(document.createElement("br"));
        listNode.appendChild(document.createElement("br"));
        listNode.appendChild(document.createTextNode("type: " + graphNode["type"]));
      }
      if (graphNode["consumers"]) {
        listNode.appendChild(document.createElement("br"));
        listNode.appendChild(document.createElement("br"));
        listNode.appendChild(document.createTextNode("consumers: " + graphNode["consumers"]));
      }

      this.sidebar.appendChild(listNode);
    }
  }
/**
   * Draws the component sidebar with the listed items.
   */
Draws the component sidebar with the listed items.
Draws the component sidebar with the listed items .
drawSidebar(graphNodes) {
    this.sidebar.innerHTML = "";
    for (const graphNode of graphNodes) {
      const listNode = document.createElement("li");
      listNode.appendChild(document.createTextNode(graphNode["name"]));
      if (graphNode["routes"]["uses"].length) {
        listNode.appendChild(document.createElement("br"));
        listNode.appendChild(document.createElement("br"));
        listNode.appendChild(document.createTextNode("uses:"));
        for (const use of graphNode["routes"]["uses"]) {
          listNode.appendChild(document.createElement("br"));
          listNode.appendChild(document.createTextNode(use));
        }
      }
      if (graphNode["routes"]["offers"].length) {
        listNode.appendChild(document.createElement("br"));
        listNode.appendChild(document.createElement("br"));
        listNode.appendChild(document.createTextNode("offers:"));
        for (const offer of graphNode["routes"]["offers"]) {
          listNode.appendChild(document.createElement("br"));
          listNode.appendChild(document.createTextNode(offer));
        }
      }
      listNode.appendChild(document.createElement("br"));
      listNode.appendChild(document.createElement("br"));
      listNode.appendChild(document.createTextNode("verson: " + graphNode["version"]));
      if (graphNode["source"]) {
        listNode.appendChild(document.createElement("br"));
        listNode.appendChild(document.createElement("br"));
        listNode.appendChild(document.createTextNode("source: " + graphNode["source"]));
      }
      if (graphNode["type"]) {
        listNode.appendChild(document.createElement("br"));
        listNode.appendChild(document.createElement("br"));
        listNode.appendChild(document.createTextNode("type: " + graphNode["type"]));
      }
      if (graphNode["consumers"]) {
        listNode.appendChild(document.createElement("br"));
        listNode.appendChild(document.createElement("br"));
        listNode.appendChild(document.createTextNode("consumers: " + graphNode["consumers"]));
      }
      this.sidebar.appendChild(listNode);
    }
  }
drawSidebar ( graphNodes ) { this . sidebar . innerHTML = "" ; for ( const graphNode of graphNodes ) { const listNode = document . createElement ( "li" ) ; listNode . appendChild ( document . createTextNode ( graphNode [ "name" ] ) ) ; if ( graphNode [ "routes" ] [ "uses" ] . length ) { listNode . appendChild ( document . createElement ( "br" ) ) ; listNode . appendChild ( document . createElement ( "br" ) ) ; listNode . appendChild ( document . createTextNode ( "uses:" ) ) ; for ( const use of graphNode [ "routes" ] [ "uses" ] ) { listNode . appendChild ( document . createElement ( "br" ) ) ; listNode . appendChild ( document . createTextNode ( use ) ) ; } } if ( graphNode [ "routes" ] [ "offers" ] . length ) { listNode . appendChild ( document . createElement ( "br" ) ) ; listNode . appendChild ( document . createElement ( "br" ) ) ; listNode . appendChild ( document . createTextNode ( "offers:" ) ) ; for ( const offer of graphNode [ "routes" ] [ "offers" ] ) { listNode . appendChild ( document . createElement ( "br" ) ) ; listNode . appendChild ( document . createTextNode ( offer ) ) ; } } listNode . appendChild ( document . createElement ( "br" ) ) ; listNode . appendChild ( document . createElement ( "br" ) ) ; listNode . appendChild ( document . createTextNode ( "verson: " + graphNode [ "version" ] ) ) ; if ( graphNode [ "source" ] ) { listNode . appendChild ( document . createElement ( "br" ) ) ; listNode . appendChild ( document . createElement ( "br" ) ) ; listNode . appendChild ( document . createTextNode ( "source: " + graphNode [ "source" ] ) ) ; } if ( graphNode [ "type" ] ) { listNode . appendChild ( document . createElement ( "br" ) ) ; listNode . appendChild ( document . createElement ( "br" ) ) ; listNode . appendChild ( document . createTextNode ( "type: " + graphNode [ "type" ] ) ) ; } if ( graphNode [ "consumers" ] ) { listNode . appendChild ( document . createElement ( "br" ) ) ; listNode . appendChild ( document . createElement ( "br" ) ) ; listNode . appendChild ( document . createTextNode ( "consumers: " + graphNode [ "consumers" ] ) ) ; } this . sidebar . appendChild ( listNode ) ; } }
Draws the component sidebar with the listed items.
Draws the component sidebar with the listed items .
// TODO(benwright) - Move these to use CSS margins.