That area is available as the Diagram.viewportBounds. The viewport is the area of the document that is visible in the canvas. Yet the Part.location does not change value as the user scrolls or zooms the diagram. When the user scrolls the diagram the part will need to be drawn elsewhere on the canvas.Īnd if the user zooms in to make the parts appear larger, the parts will be drawn at different points in the canvas. The HTML Div element that the user sees in the page. Or more likely they may cover both negative and positive values.īut a Part with a Part.location of (0, 0) in document coordinates is not always drawn at the top-left corner of The range of the document bounds might be entirely positive x and y values, or that might be entirely negative, This Rect has values that are in document coordinates.ĭepending on where the Nodes and Links are, the document bounds may cover a very large area. The union of all of the Nodes and Links in a Diagram form the Diagram.documentBounds. Thus the Point that may be saved for a Node's location in the model's node data object are normally in document coordinates: The Part.location and GraphObject.actualBounds and GraphObject.position of Parts are in document coordinates. A Diagram uses two major coordinate systems when drawing Parts: document coordinates and view coordinates.įurthermore each Panel within a Part has its own coordinate system that its elements use.Īll coordinate systems in GoJS have Points with increasing values of X going rightwards and
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |