UNPKG

markgojs

Version:

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

1,684 lines (622 loc) 69.5 kB
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>GoJS&reg; Geometry Class</title> <script src="../../assets/js/jquery.min.js"></script> <script src="../../assets/js/bootstrap.min.js"></script> <script src="../../assets/js/highlight.js"></script> <script src="../../assets/js/api.js"></script> <script src="../../assets/js/fuse.min.js"></script> <link href="../../assets/css/bootstrap.min.css" rel="stylesheet" > <!-- custom CSS after bootstrap --> <link href="../../assets/css/main.css" rel="stylesheet" type="text/css"/> <link href="../../assets/css/api.css" rel="stylesheet" type="text/css"/> <!--<link rel="stylesheet" href="../../assets/css/api.css" type="text/css" media="all" />--> <link rel="stylesheet" href="../../assets/css/highlight.css" type="text/css" media="all" /> </head> <body> <!-- non-fixed navbar --> <nav id="non-fixed-nav" class="navbar navbar-inverse navbar-top"> <div class="container-fluid"> <div class="navbar-header"> <div class="navheader-container"> <div class="navheader-collapse" data-toggle="collapse" data-target="#navbar"> <a id="toplogo" class="navbar-brand" href="../../index.html">GoJS</a> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> </div> </div> <div id="navbar" class="navbar-collapse collapse"> <ul class="nav navbar-nav navbar-right"> <li><a href="../../index.html">Home</a></li> <li><a href="../../learn/index.html">Learn</a></li> <li><a href="../../samples/index.html">Samples</a></li> <li><a href="../../intro/index.html">Intro</a></li> <li><a href="../../api/index.html">API</a></li> <li><a href="https://www.nwoods.com/components/evalform.htm">Register</a></li> <li><a href="../../download.html">Download</a></li> <li><a href="https://forum.nwoods.com/c/gojs">Forum</a></li> <li><a href="https://www.nwoods.com/contact.html" onclick="ga('send','event','Outbound Link','click','contact');">Contact</a></li> <li class="buy"><a href="https://www.nwoods.com/sales/index.html" onclick="ga('send','event','Outbound Link','click','buy');">Buy</a></li> <li class="activate"><a href="https://www.nwoods.com/app/activate.aspx?sku=gojs">Activate</a></li> </ul> </div><!--/.nav-collapse --> </div> </nav> <div class="container-fluid"> <!-- ============================== classes index ============================ --> <div id="navindex" class="col-md-2"> <!-- begin publish.classesIndex --> <!-- <div><a href="../index.html">GoJS Class Index</a></div> --> <div class="sidebar-nav"> <div class="navbar navbar-default" role="navigation"> <div class="navbar-header"> <div class="navheader-container"> <div class="navheader-collapse" data-toggle="collapse" data-target="#DiagramNavbar"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#DiagramNavbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <span class="navbar-brand">Diagram Classes</span> </div> </div> <div id="DiagramNavbar" class="navbar-collapse collapse sidebar-navbar-collapse"> <ul class="classList nav navbar-nav"> <li><a href="../symbols/Adornment.html" class="linkConstructor">Adornment</a></li> <li><a href="../symbols/AnimationManager.html" class="linkConstructor">AnimationManager</a></li> <li><a href="../symbols/CommandHandler.html" class="linkConstructor">CommandHandler</a></li> <li><a href="../symbols/Diagram.html" class="linkConstructor">Diagram</a></li> <li><a href="../symbols/DiagramEvent.html" class="linkConstructor">DiagramEvent</a></li> <li><a href="../symbols/GraphObject.html" class="linkConstructor">GraphObject</a></li> <li><a href="../symbols/Group.html" class="linkConstructor">Group</a></li> <li><a href="../symbols/InputEvent.html" class="linkConstructor">InputEvent</a></li> <li><a href="../symbols/Layer.html" class="linkConstructor">Layer</a></li> <li><a href="../symbols/Link.html" class="linkConstructor">Link</a></li> <li><a href="../symbols/Node.html" class="linkConstructor">Node</a></li> <li><a href="../symbols/Overview.html" class="linkConstructor">Overview</a></li> <li><a href="../symbols/Palette.html" class="linkConstructor">Palette</a></li> <li><a href="../symbols/Panel.html" class="linkConstructor">Panel</a></li> <li><a href="../symbols/Part.html" class="linkConstructor">Part</a></li> <li><a href="../symbols/Picture.html" class="linkConstructor">Picture</a></li> <li><a href="../symbols/Placeholder.html" class="linkConstructor">Placeholder</a></li> <li><a href="../symbols/RowColumnDefinition.html" class="linkConstructor">RowColumnDefinition</a></li> <li><a href="../symbols/Shape.html" class="linkConstructor">Shape</a></li> <li><a href="../symbols/TextBlock.html" class="linkConstructor">TextBlock</a></li> </ul> </div> </div> <div class="navbar navbar-default" role="navigation"> <div class="navbar-header"> <div class="navheader-container"> <div class="navheader-collapse" data-toggle="collapse" data-target="#GeometryNavbar"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#GeometryNavbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <span class="navbar-brand">Geometry Classes</span> </div> </div> <div id="GeometryNavbar" class="navbar-collapse collapse sidebar-navbar-collapse"> <ul class="classList nav navbar-nav"> <li><a href="../symbols/Brush.html" class="linkConstructor">Brush</a></li> <li><a href="../symbols/Geometry.html" class="linkConstructor">Geometry</a></li> <li><a href="../symbols/Margin.html" class="linkConstructor">Margin</a></li> <li><a href="../symbols/PathFigure.html" class="linkConstructor">PathFigure</a></li> <li><a href="../symbols/PathSegment.html" class="linkConstructor">PathSegment</a></li> <li><a href="../symbols/Point.html" class="linkConstructor">Point</a></li> <li><a href="../symbols/Rect.html" class="linkConstructor">Rect</a></li> <li><a href="../symbols/Size.html" class="linkConstructor">Size</a></li> <li><a href="../symbols/Spot.html" class="linkConstructor">Spot</a></li> </ul> </div> </div> <div class="navbar navbar-default" role="navigation"> <div class="navbar-header"> <div class="navheader-container"> <div class="navheader-collapse" data-toggle="collapse" data-target="#ModelNavbar"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#ModelNavbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <span class="navbar-brand">Model Classes</span> </div> </div> <div id="ModelNavbar" class="navbar-collapse collapse sidebar-navbar-collapse"> <ul class="classList nav navbar-nav"> <li><a href="../symbols/Binding.html" class="linkConstructor">Binding</a></li> <li><a href="../symbols/ChangedEvent.html" class="linkConstructor">ChangedEvent</a></li> <li><a href="../symbols/GraphLinksModel.html" class="linkConstructor">GraphLinksModel</a></li> <li><a href="../symbols/Model.html" class="linkConstructor">Model</a></li> <li><a href="../symbols/Transaction.html" class="linkConstructor">Transaction</a></li> <li><a href="../symbols/TreeModel.html" class="linkConstructor">TreeModel</a></li> <li><a href="../symbols/UndoManager.html" class="linkConstructor">UndoManager</a></li> </ul> </div> </div> <div class="navbar navbar-default" role="navigation"> <div class="navbar-header"> <div class="navheader-container"> <div class="navheader-collapse" data-toggle="collapse" data-target="#LayoutNavbar"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#LayoutNavbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <span class="navbar-brand">Layout Classes</span> </div> </div> <div id="LayoutNavbar" class="navbar-collapse collapse sidebar-navbar-collapse"> <ul class="classList nav navbar-nav"> <li><a href="../symbols/CircularLayout.html" class="linkConstructor">CircularLayout</a></li> <li><a href="../symbols/ForceDirectedLayout.html" class="linkConstructor">ForceDirectedLayout</a></li> <li><a href="../symbols/GridLayout.html" class="linkConstructor">GridLayout</a></li> <li><a href="../symbols/LayeredDigraphLayout.html" class="linkConstructor">LayeredDigraphLayout</a></li> <li><a href="../symbols/Layout.html" class="linkConstructor">Layout</a></li> <li><a href="../symbols/LayoutNetwork.html" class="linkConstructor">LayoutNetwork</a></li> <li><a href="../symbols/TreeLayout.html" class="linkConstructor">TreeLayout</a></li> </ul> </div> </div> <div class="navbar navbar-default" role="navigation"> <div class="navbar-header"> <div class="navheader-container"> <div class="navheader-collapse" data-toggle="collapse" data-target="#ToolNavbar"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#ToolNavbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <span class="navbar-brand">Tool Classes</span> </div> </div> <div id="ToolNavbar" class="navbar-collapse collapse sidebar-navbar-collapse"> <ul class="classList nav navbar-nav"> <li><a href="../symbols/ActionTool.html" class="linkConstructor">ActionTool</a></li> <li><a href="../symbols/ClickCreatingTool.html" class="linkConstructor">ClickCreatingTool</a></li> <li><a href="../symbols/ClickSelectingTool.html" class="linkConstructor">ClickSelectingTool</a></li> <li><a href="../symbols/ContextMenuTool.html" class="linkConstructor">ContextMenuTool</a></li> <li><a href="../symbols/DraggingTool.html" class="linkConstructor">DraggingTool</a></li> <li><a href="../symbols/DragSelectingTool.html" class="linkConstructor">DragSelectingTool</a></li> <li><a href="../symbols/HTMLInfo.html" class="linkConstructor">HTMLInfo</a></li> <li><a href="../symbols/LinkingBaseTool.html" class="linkConstructor">LinkingBaseTool</a></li> <li><a href="../symbols/LinkingTool.html" class="linkConstructor">LinkingTool</a></li> <li><a href="../symbols/LinkReshapingTool.html" class="linkConstructor">LinkReshapingTool</a></li> <li><a href="../symbols/PanningTool.html" class="linkConstructor">PanningTool</a></li> <li><a href="../symbols/RelinkingTool.html" class="linkConstructor">RelinkingTool</a></li> <li><a href="../symbols/ResizingTool.html" class="linkConstructor">ResizingTool</a></li> <li><a href="../symbols/RotatingTool.html" class="linkConstructor">RotatingTool</a></li> <li><a href="../symbols/TextEditingTool.html" class="linkConstructor">TextEditingTool</a></li> <li><a href="../symbols/Tool.html" class="linkConstructor">Tool</a></li> <li><a href="../symbols/ToolManager.html" class="linkConstructor">ToolManager</a></li> </ul> </div> </div> <div class="navbar navbar-default" role="navigation"> <div class="navbar-header"> <div class="navheader-container"> <div class="navheader-collapse" data-toggle="collapse" data-target="#CollectionNavbar"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#CollectionNavbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <span class="navbar-brand">Collection Classes</span> </div> </div> <div id="CollectionNavbar" class="navbar-collapse collapse sidebar-navbar-collapse"> <ul class="classList nav navbar-nav"> <li><a href="../symbols/Iterable.html" class="linkConstructor">Iterable</a></li> <li><a href="../symbols/Iterator.html" class="linkConstructor">Iterator</a></li> <li><a href="../symbols/List.html" class="linkConstructor">List</a></li> <li><a href="../symbols/Map.html" class="linkConstructor">Map</a></li> <li><a href="../symbols/Set.html" class="linkConstructor">Set</a></li> </ul> </div> </div> </div> <!-- /class="sidebar-nav --> <!-- end publish.classesIndex --> </div> <div id="contentBody" class="col-md-10"> <div class="searchsumm"> <div class="table-wrap"> <div class="table-cell" id="apisearch" data-base="../"> <div class="title">Search API</div> <div class="field"> <label for="search-field" class="search-icon"></label> <input id="search-field" type="text" /> </div> <ul class="results"> <li class="state loading">Preparing search index...</li> <li class="state failure">The search index is not available</li> </ul> </div> <div class="table-cell" id="apisumm"> <input type="checkbox" id="showsumms" /> <label class="apisumms" for="showsumms">Show Summaries</label> </div> </div> </div> <!-- ============================== header ================================= --> <div id="header" class="fineprint"> <b>GoJS</b>&reg; Diagramming Components<br/>version 1.8.36 for JavaScript/HTML<br/>by <a href="https://www.nwoods.com/">Northwoods Software&reg;</a> </div> <!-- ============================== class title ============================ --> <h2 class="classTitle"> Class Geometry </h2> <!-- ============================== class summary ========================== --> <p class="classsummary"> The Geometry class is used to define the "shape" of a <a href="../symbols/Shape.html" class="linkConstructor">Shape</a>. A Geometry can be simple straight lines, rectangles, or ellipses. A Geometry can also be an arbitrarily complex path, consisting of a list of <a href="../symbols/PathFigure.html" class="linkConstructor">PathFigure</a>s. <p> A Geometry must not be modified once it has been used by a <a href="../symbols/Shape.html" class="linkConstructor">Shape</a>. However, a Geometry may be shared by multiple Shapes. <p> It is commonplace to create Geometries using geometry path string syntax: <a href="../../intro/geometry.html">Geometry Path Strings</a>. However it is much more efficient to create Geometries programmatically. One way to do that is illustrated by several of the samples that evaluate JavaScript such as: <pre> new go.Geometry() .add(new go.PathFigure(p.x, p.y) .add(new go.PathSegment(go.PathSegment.Arc, -sweep/2, sweep, 0, 0, radius+layerThickness, radius+layerThickness)) .add(new go.PathSegment(go.PathSegment.Line, q.x, q.y)) .add(new go.PathSegment(go.PathSegment.Arc, sweep/2, -sweep, 0, 0, radius, radius).close())); </pre> See samples that make use of Geometries in the <a href="../../samples/index.html#geometries">samples index</a>. </p> <!-- ============================== constructor summary ==================== --> <h2 id="constructor" class="summaryCaption"> Constructor <span class="nodetails"> Summary</span><span class="details"> Details</span></h2> <div class="table-responsive"> <table class="summaryTable table table-bordered table-condensed" summary="A summary of the constructor documented in the class Geometry."> <thead> <tr> <th scope="col" class="name">Name</th> <th scope="col" class="description">Description</th> </tr> </thead> <tbody> <tr> <td class="name" > <div class="name"> Geometry(type) </div> </td> <td class="description"> <div class="description"> <!--newp--><p><p>Construct an empty Geometry.<span class="nodetails" id="xconGeometry"><a class="morelink" onclick="hst('conGeometry')">More...</a></span> <span class="details" id="conGeometry"> The geometry type must be one of the following values: <a href="../symbols/Geometry.html#Line" class="linkConstant">Geometry.Line</a>, <a href="../symbols/Geometry.html#Ellipse" class="linkConstant">Geometry.Ellipse</a>, <a href="../symbols/Geometry.html#Rectangle" class="linkConstant">Geometry.Rectangle</a>, <a href="../symbols/Geometry.html#Path" class="linkConstant">Geometry.Path</a>.</span> <dl class="detailList"> <dt class="heading">Parameters:</dt> <dt> <span class="light fixedFont">{EnumValue=}</span> <b>type</b> </dt> <dd>If not supplied, the default Geometry type is <a href="../symbols/Geometry.html#Path" class="linkConstant">Geometry.Path</a>.</dd> </dl> </div> </td> </tr> </tbody> </table> </div><!-- class="table-responsive">--> <!-- ============================== properties summary ===================== --> <h2 class="summaryCaption">Properties<span class="nodetails"> Summary</span><span class="details"> Details</span></h2> <div class="table-responsive"> <table class="summaryTable table table-bordered table-condensed" summary="A summary of the properties documented in the class Geometry."> <thead> <tr> <th scope="col" class="name">Name, Value Type</th> <th scope="col" class="description">Description</th> </tr> </thead> <tbody> <tr id="bounds" > <td class="name"> <div class="name"> bounds </div> <div class="attributes"> <span class="light">{<a href="../symbols/Rect.html" class="linkConstructor">Rect</a>}</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>This read-only property returns a rectangle that contains all points within the Geometry.<span class="nodetails" id="xpropbounds"><a class="morelink" onclick="hst('propbounds')">More...</a></span> <span class="details" id="propbounds"> The result will always contain the origin (0, 0).</span> </div> </td> </tr> <tr id="defaultStretch" > <td class="name"> <div class="name"> defaultStretch </div> <div class="attributes"> <span class="light">{EnumValue}</span> <span class="since" title="since">1.5</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>Gets or sets the <a href="../symbols/Shape.html#geometryStretch" class="linkProperty">Shape.geometryStretch</a> value the <a href="../symbols/Shape.html" class="linkConstructor">Shape</a> should use by default when the <a href="../symbols/Shape.html#geometryStretch" class="linkProperty">Shape.geometryStretch</a> value is <a href="../symbols/GraphObject.html#None" class="linkConstant">GraphObject.None</a>.<span class="nodetails" id="xpropdefaultStretch"><a class="morelink" onclick="hst('propdefaultStretch')">More...</a></span> <span class="details" id="propdefaultStretch"> The default value is <a href="../symbols/GraphObject.html#Fill" class="linkConstant">GraphObject.Fill</a>. Some figure generators return a Geometry with this property set to <a href="../symbols/GraphObject.html#Uniform" class="linkConstant">GraphObject.Uniform</a>, in order to preserve its aspect ratio when used by a Shape that may have different sizes.</span> </div> </td> </tr> <tr id="endX" > <td class="name"> <div class="name"> endX </div> <div class="attributes"> <span class="light">{number}</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>Gets or sets the ending X coordinate of the Geometry if it is of type <a href="../symbols/Geometry.html#Line" class="linkConstant">Line</a>, <a href="../symbols/Geometry.html#Rectangle" class="linkConstant">Rectangle</a>, or <a href="../symbols/Geometry.html#Ellipse" class="linkConstant">Ellipse</a>.<span class="nodetails" id="xpropendX"><a class="morelink" onclick="hst('propendX')">More...</a></span> <span class="details" id="propendX"> The initial value is zero.</span> </div> </td> </tr> <tr id="endY" > <td class="name"> <div class="name"> endY </div> <div class="attributes"> <span class="light">{number}</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>Gets or sets the ending Y coordinate of the Geometry if it is of type <a href="../symbols/Geometry.html#Line" class="linkConstant">Line</a>, <a href="../symbols/Geometry.html#Rectangle" class="linkConstant">Rectangle</a>, or <a href="../symbols/Geometry.html#Ellipse" class="linkConstant">Ellipse</a>.<span class="nodetails" id="xpropendY"><a class="morelink" onclick="hst('propendY')">More...</a></span> <span class="details" id="propendY"> The initial value is zero.</span> </div> </td> </tr> <tr id="figures" > <td class="name"> <div class="name"> figures </div> <div class="attributes"> <span class="light">{List.<PathFigure>}</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>Gets or sets the <a href="../symbols/List.html" class="linkConstructor">List</a> of <a href="../symbols/PathFigure.html" class="linkConstructor">PathFigure</a>s that describes the content of the path for Geometries of type <a href="../symbols/Geometry.html#Path" class="linkConstant">Path</a>. </div> </td> </tr> <tr id="spot1" > <td class="name"> <div class="name"> spot1 </div> <div class="attributes"> <span class="light">{<a href="../symbols/Spot.html" class="linkConstructor">Spot</a>}</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>Gets or sets the spot an "Auto" <a href="../symbols/Panel.html" class="linkConstructor">Panel</a> will use for the top-left corner of any panel content when the <a href="../symbols/Shape.html#spot1" class="linkProperty">Shape.spot1</a> value is <a href="../symbols/Spot.html#Default" class="linkConstant">Spot.Default</a>.<span class="nodetails" id="xpropspot1"><a class="morelink" onclick="hst('propspot1')">More...</a></span> <span class="details" id="propspot1"> The default value is <a href="../symbols/Spot.html#TopLeft" class="linkConstant">Spot.TopLeft</a>, at the top-left point of the bounds of the Shape.</span> </div> </td> </tr> <tr id="spot2" > <td class="name"> <div class="name"> spot2 </div> <div class="attributes"> <span class="light">{<a href="../symbols/Spot.html" class="linkConstructor">Spot</a>}</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>Gets or sets the spot an "Auto" <a href="../symbols/Panel.html" class="linkConstructor">Panel</a> will use for the bottom-right corner of any panel content when the <a href="../symbols/Shape.html#spot2" class="linkProperty">Shape.spot2</a> value is <a href="../symbols/Spot.html#Default" class="linkConstant">Spot.Default</a>.<span class="nodetails" id="xpropspot2"><a class="morelink" onclick="hst('propspot2')">More...</a></span> <span class="details" id="propspot2"> The default value is <a href="../symbols/Spot.html#BottomRight" class="linkConstant">Spot.BottomRight</a>, at the bottom-right point of the bounds of the Shape.</span> </div> </td> </tr> <tr id="startX" > <td class="name"> <div class="name"> startX </div> <div class="attributes"> <span class="light">{number}</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>Gets or sets the starting X coordinate of the Geometry if it is of type <a href="../symbols/Geometry.html#Line" class="linkConstant">Line</a>, <a href="../symbols/Geometry.html#Rectangle" class="linkConstant">Rectangle</a>, or <a href="../symbols/Geometry.html#Ellipse" class="linkConstant">Ellipse</a>.<span class="nodetails" id="xpropstartX"><a class="morelink" onclick="hst('propstartX')">More...</a></span> <span class="details" id="propstartX"> The initial value is zero.</span> </div> </td> </tr> <tr id="startY" > <td class="name"> <div class="name"> startY </div> <div class="attributes"> <span class="light">{number}</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>Gets or sets the starting Y coordinate of the Geometry if it is of type <a href="../symbols/Geometry.html#Line" class="linkConstant">Line</a>, <a href="../symbols/Geometry.html#Rectangle" class="linkConstant">Rectangle</a>, or <a href="../symbols/Geometry.html#Ellipse" class="linkConstant">Ellipse</a>.<span class="nodetails" id="xpropstartY"><a class="morelink" onclick="hst('propstartY')">More...</a></span> <span class="details" id="propstartY"> The initial value is zero.</span> </div> </td> </tr> <tr id="type" > <td class="name"> <div class="name"> type </div> <div class="attributes"> <span class="light">{EnumValue}</span> </div> </td> <td class="description"> <div class="description"> <!--newp <p> --> <p>Gets or sets the type of the Geometry.<span class="nodetails" id="xproptype"><a class="morelink" onclick="hst('proptype')">More...</a></span> <span class="details" id="proptype"> The default type is <a href="../symbols/Geometry.html#Path" class="linkConstant">Geometry.Path</a>. Other permissible values are <a href="../symbols/Geometry.html#Line" class="linkConstant">Geometry.Line</a>, <a href="../symbols/Geometry.html#Ellipse" class="linkConstant">Geometry.Ellipse</a>, or <a href="../symbols/Geometry.html#Rectangle" class="linkConstant">Geometry.Rectangle</a>.</span> </div> </td> </tr> </tbody> </table> </div><!-- class="table-responsive">--> <!-- ============================== methods summary ======================== --> <h2 class="summaryCaption">Method <span class="nodetails"> Summary</span><span class="details"> Details</span></h2> <div class="table-responsive"> <table class="summaryTable table table-bordered table-condensed" summary="A summary of the methods documented in the class Geometry."> <thead> <tr> <th scope="col" class="name">Name, Return Type</th> <th scope="col" class="description">Description</th> </tr> </thead> <tbody> <tr id="add"> <td class="name"> <div class="name"> add(figure) </div> <div class="attributes"> <span class="light">{<a href="../symbols/Geometry.html" class="linkConstructor">Geometry</a>}</span> <span class="since" title="since">1.5</span> </div> </td> <td class="description"> <div class="description"> <!--newp--><p><p>Add a <a href="../symbols/PathFigure.html" class="linkConstructor">PathFigure</a> to the <a href="../symbols/Geometry.html#figures" class="linkProperty">figures</a> list.<span class="nodetails" id="xmethadd"><a class="morelink" onclick="hst('methadd')">More...</a></span> <span class="details" id="methadd"></span> <dl class="detailList"> <dt class="heading">Parameters:</dt> <dt> <span class="light fixedFont">{<a href="../symbols/PathFigure.html" class="linkConstructor">PathFigure</a>}</span> <b>figure</b> </dt> <dd>a newly allocated unshared PathFigure that will become owned by this Geometry</dd> </dl> <dl class="detailList"> <dt class="heading">Returns:</dt> <dt><span class="light fixedFont">{<a href="../symbols/Geometry.html" class="linkConstructor">Geometry</a>}</span> this</dt> </dl> </div> </td> </tr> <tr id="computeBoundsWithoutOrigin"> <td class="name"> <div class="name"> computeBoundsWithoutOrigin() </div> <div class="attributes"> <span class="light">{<a href="../symbols/Rect.html" class="linkConstructor">Rect</a>}</span> <span class="since" title="since">1.1</span> </div> </td> <td class="description"> <div class="description"> <!--newp--><p><p>Computes the Geometry's bounds without adding an origin point, and returns those bounds as a rect.<span class="nodetails" id="xmethcomputeBoundsWithoutOrigin"><a class="morelink" onclick="hst('methcomputeBoundsWithoutOrigin')">More...</a></span> <span class="details" id="methcomputeBoundsWithoutOrigin"> This method does not modify the Geometry or its bounds.</span> <dl class="detailList"> <dt class="heading">Returns:</dt> <dt><span class="light fixedFont">{<a href="../symbols/Rect.html" class="linkConstructor">Rect</a>}</span> </dt> </dl> </div> </td> </tr> <tr id="copy"> <td class="name"> <div class="name"> copy() </div> <div class="attributes"> <span class="light">{<a href="../symbols/Geometry.html" class="linkConstructor">Geometry</a>}</span> </div> </td> <td class="description"> <div class="description"> <!--newp--><p><p>Create a copy of this Geometry, with the same values and figures. <dl class="detailList"> <dt class="heading">Returns:</dt> <dt><span class="light fixedFont">{<a href="../symbols/Geometry.html" class="linkConstructor">Geometry</a>}</span> </dt> </dl> </div> </td> </tr> <tr id=".fillPath"> <td class="name"> &lt;static&gt; <div class="name"> Geometry.fillPath(str) </div> <div class="attributes"> <span class="light">{string}</span> <span class="since" title="since">1.1</span> </div> </td> <td class="description"> <div class="description"> <!--newp--><p><p>Given a SVG or GoJS path string, returns a congruent path string with each pathfigure filled.<span class="nodetails" id="xmethfillPath"><a class="morelink" onclick="hst('methfillPath')">More...</a></span> <span class="details" id="methfillPath"> For instance, "M0 0 L22 22 L33 0" would become "F M0 0 L22 22 L33 0".</span> <dl class="detailList"> <dt class="heading">Parameters:</dt> <dt> <span class="light fixedFont">{string}</span> <b>str</b> </dt> <dd></dd> </dl> <dl class="detailList"> <dt class="heading">Returns:</dt> <dt><span class="light fixedFont">{string}</span> </dt> </dl> </div> </td> </tr> <tr id="normalize"> <td class="name"> <div class="name"> normalize() </div> <div class="attributes"> <span class="light">{<a href="../symbols/Point.html" class="linkConstructor">Point</a>}</span> <span class="since" title="since">1.1</span> </div> </td> <td class="description"> <div class="description"> <!--newp--><p><p>Normalizes the Geometry points in place by ensuring the top-left bounds of the geometry lines up with (0, 0), returning the <a href="../symbols/Point.html" class="linkConstructor">Point</a> (x, y) amount it was shifted.<span class="nodetails" id="xmethnormalize"><a class="morelink" onclick="hst('methnormalize')">More...</a></span> <span class="details" id="methnormalize"> After this method is called there will be no negative X or Y value for the Geometry's bounds, and no empty space at the top-left of the Geometry.</span> <dl class="detailList"> <dt class="heading">Returns:</dt> <dt><span class="light fixedFont">{<a href="../symbols/Point.html" class="linkConstructor">Point</a>}</span> </dt> </dl> </div> </td> </tr> <tr id="offset"> <td class="name"> <div class="name"> offset(x, y) </div> <div class="attributes"> <span class="light">{<a href="../symbols/Geometry.html" class="linkConstructor">Geometry</a>}</span> <span class="since" title="since">1.1</span> </div> </td> <td class="description"> <div class="description"> <!--newp--><p><p>Offsets the Geometry in place by a given (x, y) amount<span class="nodetails" id="xmethoffset"><a class="morelink" onclick="hst('methoffset')">More...</a></span> <span class="details" id="methoffset"></span> <dl class="detailList"> <dt class="heading">Parameters:</dt> <dt> <span class="light fixedFont">{number}</span> <b>x</b>