![]() If you do supply a particular layout as the layout, you can control which Parts it operates This default layout will allow you to programmatically position nodes (including by loadingįrom a database) and will also allow the user to manually position nodes using the DraggingTool. Only positions Nodes that do not have a location. The default layout is an instance of the Layout base class that ignores links and Layout to an instance of the Layout subclass of your choice. You can have the diagram perform automatic layouts of its nodes and links by setting But you may find it easier to call methods to get the desired effect.įor example, if you want to make a particular Node be centered in the viewport,Ĭall either centerRect or scrollToRect with the Node's GraphObject.actualBounds,ĭepending on whether or not you want the view to be scrolled if the node is already in view. That control the initial size and position of the diagram contents.Īt any later time you can also explicitly set the position and/or scale to There are several properties that you can set, such as initialContentAlignment, The document bounds determines the area that the diagram can be scrolled to. The union of all of the parts' bounds constitutes the documentBounds. Read about models on the Using Models page in the introduction.Ī diagram is responsible for scrolling ( position) and zooming ( scale) all of the parts that it shows.Įach Part occupies some area given by its GraphObject.actualBounds. The above code is used to make the Minimal sample, a simple example ofĬreating a Diagram and setting its model. Diagram ( "myDiagramDiv", // create a Diagram for the DIV HTML element ]) Minimal Diagram construction looks like this.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |