UNPKG

gojs

Version:

Interactive diagrams, charts, and graphs, such as trees, flowcharts, orgcharts, UML, BPMN, or business diagrams

32 lines (31 loc) 1.26 kB
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Serpentine Layout</title> <meta name="description" content="TypeScript: Arrange a chain of nodes in rows, alternating directions, back and forth." /> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- Copyright 1998-2020 by Northwoods Software Corporation. --> <script src="../samples/assets/require.js"></script> <script src="../assets/js/goSamples.js"></script> <!-- this is only for the GoJS Samples framework --> <script id="code"> function init() { require(["SerpentineScript"], function(app) { app.init(); }); } </script> </head> <body onload="init()"> <div id="sample"> <div id="myDiagramDiv" style="border: solid 1px black; width:100%; height:500px; min-width: 200px"></div> <p> This sample demonstrates a custom Layout, SerpentineLayout, which assumes the graph consists of a chain of nodes. The layout is defined in its own file, as <a href="SerpentineLayout.ts">SerpentineLayout.ts</a>. </p> <p> It also has <a>Layout.isViewportSized</a> set to true, so that resizing the Diagram DIV will automatically re-layout. </p> </div> </body> </html>