title: Visualize networkx using vis.js
body: <p>I am using the <code>Python</code> library <code>networkx</code> to create a directed graph with almost 2k nodes, and I want to visualize the graph using  <code>vis.js</code> library</p>
  
  <p>I know how to export it as Json, but I am not able to generate a compatible format to use it directly into vis.js</p>
  
  <p>I should have a json String output that looks like:</p>
  
  <p><strong>nodes:</strong></p>
  
  <pre><code>[
    {id: 1, label: 'a'},
    {id: 2, label: 'b'},
    {id: 3, label: 'c'}
  ]
  </code></pre>
  
  <p><strong>edges:</strong></p>
  
  <pre><code>[
      {from: 1, to: 2, label: 'label1'},
      {from: 1, to: 3, label: 'label2'},
      {from: 2, to: 4, label: 'label3'},
      {from: 2, to: 5, label: 'label3'}
  ]
  </code></pre>