Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <!DOCTYPE html>
<html>
<head>
  <title>05. Edges with arrows.</title>
</head>
<body onload='main()'>
  <div id="graph-container"></div>
</body>
</html>
              
            
!

CSS

              
                html, body { width: 100%; height: 100%;}

#graph-container {
  height: 100%;
  width: 100%;
  position: absolute;
  overflow: hidden;
  margin: 0px;
}
              
            
!

JS

              
                function main () {
      var graph = Viva.Graph.graph();
  
  graph.addNode("bc1qlctv5xhgw0yalp2vs47u342pegqm5r843c64dv");
  graph.addNode("33mMAc6nGyENdKMQTr5SrKoEkwNTeZQUx9");

   graph.addNode("a57c2a427dfa591b1243343c8413c249faac3e5df2fe4fa1fc93dca3d904f3c7");

  /*
    I have add the row to from a57c2a427dfa591b1243343c8413c249faac3e5df2fe4fa1fc93dca3d904f3c7 from 33mMAc6nGyENdKMQTr5SrKoEkwNTeZQUx9

    a57c2a427dfa591b1243343c8413c249faac3e5df2fe4fa1fc93dca3d904f3c7 -> 33mMAc6nGyENdKMQTr5SrKoEkwNTeZQUx9
    a57c2a427dfa591b1243343c8413c249faac3e5df2fe4fa1fc93dca3d904f3c7 -> bc1qlctv5xhgw0yalp2vs47u342pegqm5r843c64dv
  */
  
  graph.addLink("a57c2a427dfa591b1243343c8413c249faac3e5df2fe4fa1fc93dca3d904f3c7",
                    "bc1qlctv5xhgw0yalp2vs47u342pegqm5r843c64dv");

  graph.addLink("a57c2a427dfa591b1243343c8413c249faac3e5df2fe4fa1fc93dca3d904f3c7",
                    "33mMAc6nGyENdKMQTr5SrKoEkwNTeZQUx9");

  var layout = Viva.Graph.Layout.forceDirected(graph, {
    springLength : 30,
    springCoeff : 0.0008,
    dragCoeff : 0.01,
    gravity : -1.2,
    theta : 1
  });

  var graphics = Viva.Graph.View.webglGraphics();

  renderer = Viva.Graph.View.renderer(graph,
    {
      layout     : layout,
      graphics   : graphics,
      container  : document.getElementById('graph-container'),
      renderLinks : true
    });
  
      
  
      renderer.run();
}

        
              
            
!
999px

Console