Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

              
                <p>Knowledge Graph Example</p>

<div id="mynetwork"></div>

              
            
!

CSS

              
                #mynetwork {
  width: 1000px;
  height: 1000px;
  border: 1px;
}

              
            
!

JS

              
                function draw() {
  // create some nodes
  var nodes = [
    { id: 0, label: "Project", font: "36px verdana black",face: "sans serief",strokeWidth: 3,strokeColor:"#ffffff",group: 1},
    { id: 1, label: "Library", font: "36px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",group: 1 },
    { id: 2, label: "Variants",font: "36px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff", group: 1 },
    { id: 3, label: "Hypothesis",font: "36px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff", group: 1 },
    { id: 4, label: "Computational Data",font: "36px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff", group: 1 },
    { id: 5, label: "Runs",font: "36px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff", group: 1 },
    { id: 6, label: "Protocols",font: "36px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff", group: 1 },
    { id: 7, label: "Experiments",font: "36px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff", group: 1 },
    { id: 8, label: "Templates",font: "36px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff", group: 1 },
    { id: 9, label: "Plate Data",font: "36px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff", group: 1 },
    { id: 10, label: "ID",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",background: "grey", group: 2 },
    { id: 11, label: "Source",font: "24px verdana solid light grey",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 2 },
    { id: 12, label: "Alternative Names",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 2 },
    { id: 13, label: "Tissues of origin",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 2 },
    { id: 14, label: "Disease",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 2 },
    { id: 15, label: "Supplier",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 2 },
    { id: 16, label: "Supplier ID",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 2 },
    { id: 17, label: "Batch",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 2 },
    { id: 18, label: "Received Date",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 2 },
    { id: 19, label: "Media",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 2 },
    { id: 20, label: "Quantity",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 2 },
    { id: 21, label: "Vial",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 2 },
    { id: 22, label: "Working Cell Lines ID",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 3 },
    { id: 23, label: "Parent Cell Line",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 3 },
    { id: 24, label: "Passage Date",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 3 },
    { id: 25, label: "Passage Number",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 3 },
    { id: 27, label: "Working Compound",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 4 },
    { id: 28, label: "Working Cell Line",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 4 },
    { id: 29, label: "Pert Dose",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 4 },
    { id: 30, label: "Pert Time",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 4 },
    { id: 31, label: "Pert Protocol",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 4 },
    { id: 32, label: "Tissue ID",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 4 },
    { id: 33, label: "Tissue Passage",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 4 },
    { id: 34, label: "Type",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 4 },
    { id: 35, label: "Location",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 4 },
    { id: 36, label: "Storage Form",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 4 },
    { id: 37, label: "Storage Amount",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 4 },
    { id: 39, label: "Quantity of cells",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 4 },
    { id: 40, label: "Protein ID",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 5 },
    { id: 41, label: "Sample ID",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 5 },
    { id: 42, label: "Protocol ID",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 5 },
    { id: 43, label: "Extraction Date",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 5 },
    { id: 44, label: "Extraction Scientist",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 5 },
    { id: 45, label: "Extraction Fraction",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 5 },
    { id: 47, label: "Protein Concentration",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 5 },
    { id: 48, label: "BCA Results",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 5 },
    { id: 49, label: "Location",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 5 },
    { id: 50, label: "Storage Form",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 5 },
    { id: 51, label: "Storage Amount",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 5 },
    { id: 54, label: "Protein ID",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 6 },
    { id: 56, label: "Protocol ID",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 6 },
    { id: 57, label: "Digestion Scientist",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 6 },
    { id: 58, label: "Digestion Input",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 6 },
    { id: 60, label: "Reduction Chemical",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 6 },
    { id: 61, label: "Reduction Dose",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 6 },
    { id: 62, label: "Alkylation Chemical",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 6 },
    { id: 63, label: "Alkylation Dose",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 6 },
    { id: 64, label: "Protease Chemical",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 6 },
    { id: 65, label: "Quench Chemical",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 6 },
    { id: 66, label: "Quench Dose",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 6 },
    { id: 68, label: "Storage Form",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 6 },
    { id: 69, label: "Storage Concentration",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 6 },
    { id: 71, label: "Run ID",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 7 },
    { id: 72, label: "Digestion ID",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 7 },
    { id: 73, label: "Acquisition ID",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 7 },
    { id: 74, label: "Pass",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 7 },
    { id: 75, label: "Method",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 7 },
    { id: 76, label: "Injection",font: "24px verdana black",face: "courier",strokeWidth: 3,strokeColor:"#ffffff",  group: 7 },
  ];

  // create some edges
  var edges = [
    { from: 0, to: 1 },
    { from: 1, to: 2 },
    { from: 2, to: 3 },
    { from: 3, to: 4 },
    { from: 4, to: 5 },
    { from: 5, to: 6 },
    { from: 7, to: 6 },
    { from: 7, to: 8 },
    { from: 8, to: 7 },
    { from: 9, to: 7 },
    { from: 9, to: 8 },
    { from: 9, to: 7 },
    { from: 0, to: 10 },
    { from: 0, to: 11 },
    { from: 0, to: 12 },
    { from: 0, to: 13 },
    { from: 0, to: 14 },
    { from: 0, to: 15 },
    { from: 0, to: 16 },
    { from: 0, to: 17 },
    { from: 0, to: 18 },
    { from: 0, to: 19 },
    { from: 0, to: 20 },
    { from: 0, to: 21 },
    { from: 1, to: 22 },
    { from: 1, to: 23 },
    { from: 1, to: 24 },
    { from: 1, to: 25 },
    { from: 23, to: 10 },
    { from: 2, to: 27 },
    { from: 2, to: 28 },
    { from: 2, to: 29 },
    { from: 2, to: 30 },
    { from: 2, to: 31 },
    { from: 2, to: 32 },
    { from: 2, to: 33 },
    { from: 2, to: 34 },
    { from: 2, to: 35 },
    { from: 2, to: 36 },
    { from: 2, to: 37 },
    { from: 2, to: 39 },
    { from: 28, to: 1 },
    { from: 3, to: 40 },
    { from: 3, to: 41 },
    { from: 3, to: 42 },
    { from: 3, to: 43 },
    { from: 3, to: 44 },
    { from: 3, to: 45 },
    { from: 3, to: 47 },
    { from: 3, to: 48 },
    { from: 3, to: 49 },
    { from: 3, to: 50 },
    { from: 3, to: 51 },
    { from: 41, to: 2 },
    { from: 4, to: 54 },
    { from: 4, to: 56 },
    { from: 4, to: 57 },
    { from: 4, to: 58 },
    { from: 4, to: 60 },
    { from: 4, to: 61 },
    { from: 4, to: 62 },
    { from: 4, to: 63 },
    { from: 4, to: 64 },
    { from: 4, to: 65 },
    { from: 4, to: 66 },
    { from: 4, to: 68 },
    { from: 4, to: 69 },
    { from: 54, to: 3 },
    { from: 5, to: 71 },
    { from: 5, to: 72 },
    { from: 5, to: 73 },
    { from: 5, to: 74 },
    { from: 5, to: 75 },
    { from: 5, to: 76 },
    { from: 72, to: 5 },
    { from: 6, to: 31 },
    { from: 56, to: 31 },
 
  ];

  // create a network
  var container = document.getElementById("mynetwork");
  var data = {
    nodes: nodes,
    edges: edges,
  };
  var options = {
    nodes: {
      shape: "dot",
      size: 12,
    },
    
    physics: {
      forceAtlas2Based: {
        gravitationalConstant: -26,
        centralGravity: 0.0025,
        springLength: 400,
        springConstant: 0.18,
      },
      maxVelocity: 146,
      solver: "forceAtlas2Based",
      timestep: 0.35,
      stabilization: { iterations: 150 },
    },
  };
  var network = new vis.Network(container, data, options);
}

window.addEventListener("load", () => {
  draw();
});



              
            
!
999px

Console