gojs
Version:
Interactive diagrams, charts, and graphs, such as trees, flowcharts, orgcharts, UML, BPMN, or business diagrams
794 lines (790 loc) • 66 kB
HTML
<!doctype html>
<html class="default no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Shape | GoJS API</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../../assets/css/bootstrap.min.css">
<link rel="stylesheet" href="../assets/css/main.css">
</head>
<body>
<header>
<!-- 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" target="api">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="tsd-page-header">
<div class="tsd-page-toolbar">
<div class="container-fluid plr15">
<div class="table-wrap">
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.js" data-base="..">
<div class="field">
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
<input id="tsd-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>
<a href="../index.html" class="title">GoJS API</a>
</div>
<div class="table-cell" id="tsd-widgets">
<div id="tsd-filter">
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
<div class="tsd-filter-group">
<div class="tsd-select" id="tsd-filter-visibility">
<span class="tsd-select-label">All</span>
<ul class="tsd-select-list">
<li data-value="public">Public</li>
<li data-value="protected">Public/Protected</li>
<li data-value="private" class="selected">All</li>
</ul>
</div>
</div>
</div>
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
</div>
</div>
</div>
</div>
<div class="tsd-page-title">
<div class="container-fluid plr15">
<div class="top-copyright">
<!--<b>GoJS</b>® Diagramming Components<br/>version <br/>version 2.1.18 for TypeScript/HTML<br/>by <a href="https://www.nwoods.com/">Northwoods Software®</a>-->
<b>GoJS</b>® Diagramming Components<br/>version 2.1.18<br/>by <a href="https://www.nwoods.com/">Northwoods Software®</a>
</div>
<div>
<h1>Class Shape</h1>
</div>
</div>
</div>
</div>
</header>
<div class="container-fluid container-main plr15">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<a href="GraphObject.html" class="tsd-signature-type">GraphObject</a>
<ul class="tsd-hierarchy">
<li>
<span class="target">Shape</span>
</li>
</ul>
</li>
</ul>
</section>
<section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography">
<p>A Shape is a <a href="GraphObject.html">GraphObject</a> that shows a geometric figure.
The <a href="Geometry.html">Geometry</a> determines what is drawn;
the properties <a href="Shape.html#fill">fill</a> and <a href="Shape.html#stroke">stroke</a>
(and other stroke properties) determine how it is drawn.</p>
<p>There are generally two types of shapes: Those that use a custom <a href="Geometry.html">Geometry</a> by setting
<a href="Shape.html#geometry">Shape.geometry</a>, and those that receive an automatically generated Geometry using the value of
<a href="Shape.html#figure">figure</a>, <a href="Shape.html#toArrow">toArrow</a>, or <a href="Shape.html#fromArrow">fromArrow</a>. An explicitly set Geometry always supersedes
the figure and arrowhead properties.</p>
<p>Some created Shapes:</p>
<pre><code class="hljs js"><span class="hljs-keyword">var</span> $ = go.GraphObject.make; <span class="hljs-comment">// for conciseness in defining GraphObjects</span>
<span class="hljs-comment">// A shape with the figure set to RoundedRectangle:</span>
$(go.Shape, { <span class="hljs-attr">figure</span>: <span class="hljs-string">"RoundedRectangle"</span>, <span class="hljs-attr">fill</span>: <span class="hljs-string">"lightgreen"</span> })
<span class="hljs-comment">// Alternatively:</span>
$(go.Shape, <span class="hljs-string">"RoundedRectangle"</span>, { <span class="hljs-attr">fill</span>: <span class="hljs-string">"lightgreen"</span> })
<span class="hljs-comment">// A shape with a custom geometry, using geometryString:</span>
$(go.Shape,
{ <span class="hljs-attr">geometry</span>: go.Geometry.parse(<span class="hljs-string">"M120 0 L80 80 0 50z"</span>) })
<span class="hljs-comment">// A shape with a custom geometry, using geometryString:</span>
$(go.Shape,
{ <span class="hljs-attr">geometryString</span>: <span class="hljs-string">"F M120 0 L80 80 0 50z"</span>,
<span class="hljs-attr">fill</span>: <span class="hljs-string">"lightgreen"</span> })
<span class="hljs-comment">// A common link template, using two shapes,</span>
<span class="hljs-comment">// the first for the link path and the second for the arrowhead</span>
myDiagram.linkTemplate =
$(go.Link,
<span class="hljs-comment">// The first shape in a link is special, its geometry is set by the Link's routing,</span>
<span class="hljs-comment">// so it does not need a geometry or figure set manually</span>
$(go.Shape,
{ <span class="hljs-attr">strokeWidth</span>: <span class="hljs-number">2</span>, <span class="hljs-attr">stroke</span>: <span class="hljs-string">'gray'</span> }),
$(go.Shape,
{ <span class="hljs-attr">toArrow</span>: <span class="hljs-string">"Standard"</span>, <span class="hljs-attr">fill</span>: <span class="hljs-string">'gray'</span>, <span class="hljs-attr">stroke</span>: <span class="hljs-literal">null</span> })
);</code></pre>
<p class="box">
You can see more custom geometry examples and read about geometryString
on the <a href="../../intro/geometry.html">Geometry Path Strings Introduction page.</a>
<p>When automatically generating a Shape <a href="Geometry.html">Geometry</a>, the value of <a href="Shape.html#toArrow">toArrow</a> takes precedence,
then <a href="Shape.html#fromArrow">fromArrow</a>, then <a href="Shape.html#figure">figure</a>. If the value of <a href="Shape.html#toArrow">toArrow</a> or <a href="Shape.html#fromArrow">fromArrow</a> is "None"
then it is ignored, and the "None" value of <a href="Shape.html#figure">figure</a> is identical to "Rectangle".</p>
<p>All of the predefined figures are shown in the <a href="../../samples/shapes.html">Shapes sample</a>.
You can define your own named figures by calling the static function <a href="Shape.html#static-defineFigureGenerator">Shape.defineFigureGenerator</a>.
Get a <a href="Map.html">Map</a> of named figures by calling the static function <a href="Shape.html#static-getFigureGenerators">Shape.getFigureGenerators</a>.</p>
<p>All of the predefined arrowheads are shown in the <a href="../../samples/arrowheads.html">Arrowheads sample</a>.
You can define your own named arrowheads by calling the static function <a href="Shape.html#static-defineArrowheadGeometry">Shape.defineArrowheadGeometry</a>.
Get a <a href="Map.html">Map</a> of named arrowheads by calling the static function <a href="Shape.html#static-getArrowheadGeometries">Shape.getArrowheadGeometries</a>.</p>
<p>You can see a copy of all of the built-in arrowhead definitions in this file: <a href="../../extensions/Arrowheads.js">Arrowheads.js</a>.</p>
<p>The Shape properties <a href="Shape.html#parameter1">parameter1</a>, and <a href="Shape.html#parameter2">parameter2</a> determine details of the
construction of some <a href="Shape.html#figure">figure</a> geometries.
Specifically, they often set the <a href="Shape.html#spot1">spot1</a>, <a href="Shape.html#spot2">spot2</a> for the Shape.
These spots determine the "inner area" of an Auto panel when a Shape is the main object.
See the <a href="../../intro/panels.html">Auto Panels section of the Panels Introduction page</a> for more details.</p>
<p>Shapes use their geometric bounds when determining hit testing,
but use rectangular bounds when participating in (panel) layouts.</p>
</div>
</section>
<section class="tsd-panel-group tsd-index-group">
<h2>Index</h2>
<section class="tsd-panel tsd-index-panel">
<div class="tsd-index-content">
<section class="tsd-index-section ">
<h3>Constructors</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-constructor tsd-parent-kind-class"><a href="Shape.html#constructor" class="tsd-kind-icon">constructor</a></li>
</ul>
</section>
<section class="tsd-index-section ">
<h3>Properties</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="Shape.html#figure" class="tsd-kind-icon">figure</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="Shape.html#fill" class="tsd-kind-icon">fill</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="Shape.html#fromArrow" class="tsd-kind-icon">from<wbr>Arrow</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="Shape.html#geometry" class="tsd-kind-icon">geometry</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="Shape.html#geometryStretch" class="tsd-kind-icon">geometry<wbr>Stretch</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="Shape.html#geometryString" class="tsd-kind-icon">geometry<wbr>String</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="Shape.html#graduatedEnd" class="tsd-kind-icon">graduated<wbr>End</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="Shape.html#graduatedSkip" class="tsd-kind-icon">graduated<wbr>Skip</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="Shape.html#graduatedStart" class="tsd-kind-icon">graduated<wbr>Start</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="Shape.html#interval" class="tsd-kind-icon">interval</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="Shape.html#isGeometryPositioned" class="tsd-kind-icon">is<wbr>Geometry<wbr>Positioned</a></li>
<li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="Shape.html#naturalBounds" class="tsd-kind-icon">natural<wbr>Bounds</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="Shape.html#parameter1" class="tsd-kind-icon">parameter1</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="Shape.html#parameter2" class="tsd-kind-icon">parameter2</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="Shape.html#pathPattern" class="tsd-kind-icon">path<wbr>Pattern</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="Shape.html#spot1" class="tsd-kind-icon">spot1</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="Shape.html#spot2" class="tsd-kind-icon">spot2</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="Shape.html#stroke" class="tsd-kind-icon">stroke</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="Shape.html#strokeCap" class="tsd-kind-icon">stroke<wbr>Cap</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="Shape.html#strokeDashArray" class="tsd-kind-icon">stroke<wbr>Dash<wbr>Array</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="Shape.html#strokeDashOffset" class="tsd-kind-icon">stroke<wbr>Dash<wbr>Offset</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="Shape.html#strokeJoin" class="tsd-kind-icon">stroke<wbr>Join</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="Shape.html#strokeMiterLimit" class="tsd-kind-icon">stroke<wbr>Miter<wbr>Limit</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="Shape.html#strokeWidth" class="tsd-kind-icon">stroke<wbr>Width</a></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><a href="Shape.html#toArrow" class="tsd-kind-icon">to<wbr>Arrow</a></li>
</ul>
</section>
<section class="tsd-index-section ">
<h3>Methods</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="Shape.html#static-defineArrowheadGeometry" class="tsd-kind-icon">define<wbr>Arrowhead<wbr>Geometry</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="Shape.html#static-defineFigureGenerator" class="tsd-kind-icon">define<wbr>Figure<wbr>Generator</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="Shape.html#static-getArrowheadGeometries" class="tsd-kind-icon">get<wbr>Arrowhead<wbr>Geometries</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="Shape.html#static-getFigureGenerators" class="tsd-kind-icon">get<wbr>Figure<wbr>Generators</a></li>
</ul>
</section>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Constructors</h2>
<section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class">
<a name="constructor" class="tsd-anchor"></a>
<h3>
constructor
</h3>
<ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">new <wbr>Shape<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="Shape.html" class="tsd-signature-type">Shape</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>A newly constructed <a href="Shape.html">Shape</a> has a default <a href="Shape.html#figure">figure</a> of "None",
which constructs a rectangular geometry, and is filled and stroked with a black brush.</p>
</div>
<h4 class="tsd-returns-title">Returns <a href="Shape.html" class="tsd-signature-type">Shape</a></h4>
</li>
</ul>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Properties</h2>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="figure" class="tsd-anchor"></a>
<h3>
figure
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the figure name, used to construct a <a href="Geometry.html">Geometry</a>.
The value must be a string. The default value is "None".</p>
<p>The name can be any case but will always be canonicalized when set. For instance,
setting "roundedrectangle" will set the value of figure to "RoundedRectangle".
All of the predefined figures are shown in the <a href="../../samples/shapes.html">Shapes sample</a>.</p>
<p>At most one of the following three properties may be set to a non-"None" value at the same time on the same shape:
<a href="Shape.html#figure">figure</a>, <a href="Shape.html#toArrow">toArrow</a>, <a href="Shape.html#fromArrow">fromArrow</a>.</p>
<p>You can define your own named figures by calling the static function <a href="Shape.html#static-defineFigureGenerator">Shape.defineFigureGenerator</a>.</p>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="fill" class="tsd-anchor"></a>
<h3>
fill
<span class="tsd-signature-symbol">: </span><a href="../index.html#BrushLike" class="tsd-signature-type">BrushLike</a> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the <a href="Brush.html">Brush</a> or string that describes how the geometry is filled when drawn.</p>
<p>The default value is "black", causing the shape to be filled with solid black.
Any valid CSS string can specify a solid color, and the <a href="Brush.html">Brush</a>
class can be used to specify a gradient or pattern.
A null fill will mean no fill is drawn and the filled portion
of the Shape will not be pickable.
A "transparent" fill is useful when wanting to allow a shape to be pickable
without obscuring any other objects behind it.
More information about the syntax of CSS color strings is available at:
<a href="https://developer.mozilla.org/en-US/docs/Web/CSS/color">CSS colors (mozilla.org)</a>.</p>
<p>The geometry is filled before the <a href="Shape.html#stroke">stroke</a> is drawn.</p>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="fromArrow" class="tsd-anchor"></a>
<h3>
from<wbr>Arrow
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the name of the kind of arrowhead that this shape should take
when this shape is an element of a <a href="Link.html">Link</a>.
Value must be a string.
For bi-directional links the arrowhead name often starts with "Backward...".</p>
<p>The default is "None", which means that this Shape is not an arrowhead, causing it to be the default Shape, a large filled Rectangle.
If you want to have an arrowhead Shape but sometimes not show an arrowhead, you can set or bind
the <a href="GraphObject.html#visible">GraphObject.visible</a> property, or you can set or bind this "toArrow" property to
be the empty string.
The arrowhead named "", an empty string, will display as nothing.</p>
<p>The name can be any case but will always be canonicalized when set. For instance,
setting "opentriangle" will set the value of the arrowhead to "OpenTriangle".
All of the predefined arrowheads are shown in the <a href="../../samples/arrowheads.html">Arrowheads sample</a>.</p>
<p>Setting this property may also set the <a href="GraphObject.html#segmentIndex">GraphObject.segmentIndex</a>,
<a href="GraphObject.html#segmentOrientation">GraphObject.segmentOrientation</a>, and <a href="GraphObject.html#alignmentFocus">GraphObject.alignmentFocus</a> properties.
This shape should be an element of a <a href="Link.html">Link</a>.</p>
<p>At most one of the following three properties may be set to a non-"None" value at the same time on the same shape:
<a href="Shape.html#figure">figure</a>, <a href="Shape.html#toArrow">toArrow</a>, <a href="Shape.html#fromArrow">fromArrow</a>.</p>
<p>You can define your own named arrowheads by calling the static function <a href="Shape.html#static-defineArrowheadGeometry">Shape.defineArrowheadGeometry</a>.</p>
<p>You can see a copy of all of the built-in arrowhead definitions in this file: <a href="../../extensions/Arrowheads.js">Arrowheads.js</a>.</p>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="geometry" class="tsd-anchor"></a>
<h3>
geometry
<span class="tsd-signature-symbol">: </span><a href="Geometry.html" class="tsd-signature-type">Geometry</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the Shape's <a href="Geometry.html">Geometry</a> that defines the Shape's figure.
Setting a geometry is not necessary if a <a href="Shape.html#figure">figure</a> is specified,
as that will construct a geometry instead.</p>
<p>Setting this geometry property will freeze the supplied Geometry.</p>
<p>Setting this geometry property always overrides any set figure.
The default value is null.</p>
<dl class="tsd-comment-tags">
<dt>see</dt>
<dd><p><a href="Shape.html#geometryString">geometryString</a></p>
</dd>
</dl>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="geometryStretch" class="tsd-anchor"></a>
<h3>
geometry<wbr>Stretch
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">EnumValue</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets how the shape's geometry is proportionally created given its computed size.
Possible values are <a href="GraphObject.html#static-None">GraphObject.None</a>, <a href="GraphObject.html#static-Fill">GraphObject.Fill</a>, <a href="GraphObject.html#static-Uniform">GraphObject.Uniform</a>, and <a href="GraphObject.html#static-Default">GraphObject.Default</a>.
The default is <a href="GraphObject.html#static-Default">GraphObject.Default</a>, which resolves to <a href="GraphObject.html#static-Fill">GraphObject.Fill</a> for most figures, though
some regular figures such as "Circle" and "Square" default to <a href="GraphObject.html#static-Uniform">GraphObject.Uniform</a>.</p>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="geometryString" class="tsd-anchor"></a>
<h3>
geometry<wbr>String
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>When set, creates a <a href="Geometry.html">Geometry</a> and normalizes it from a given path string,
then sets the <a href="Shape.html#geometry">geometry</a> property on this Shape and
set the <a href="GraphObject.html#position">GraphObject.position</a> to the amount computed by normalization.
The property getter simply returns the toString value of the <a href="Shape.html#geometry">geometry</a>,
or the empty string if there is no Geometry value.</p>
<p>See the <a href="../../intro/geometry.html">Geometry Path Strings Introduction page</a> for examples.</p>
<dl class="tsd-comment-tags">
<dt>since</dt>
<dd><p>1.1</p>
</dd>
</dl>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="graduatedEnd" class="tsd-anchor"></a>
<h3>
graduated<wbr>End
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the fractional distance along the main shape of a "Graduated" <a href="Panel.html">Panel</a> at which this kind of tick should end.
The default is 1. Any new value should range from 0 to 1.</p>
<dl class="tsd-comment-tags">
<dt>since</dt>
<dd><p>1.7</p>
</dd>
</dl>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="graduatedSkip" class="tsd-anchor"></a>
<h3>
graduated<wbr>Skip
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">val</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the function to determine which values along a "Graduated" <a href="Panel.html">Panel</a> will be skipped.
The default is null and doesn't skip any ticks.</p>
<p>The function takes a number argument, a value between <a href="Panel.html#graduatedMin">Panel.graduatedMin</a> and <a href="Panel.html#graduatedMax">Panel.graduatedMax</a>.
The function will return a boolean, whether the tick will be skipped at the value of the argument.</p>
<dl class="tsd-comment-tags">
<dt>since</dt>
<dd><p>2.0</p>
</dd>
</dl>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="graduatedStart" class="tsd-anchor"></a>
<h3>
graduated<wbr>Start
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the fractional distance along the main shape of a "Graduated" <a href="Panel.html">Panel</a> at which this kind of tick should start.
The default is 0. Any new value should range from 0 to 1.</p>
<dl class="tsd-comment-tags">
<dt>since</dt>
<dd><p>1.7</p>
</dd>
</dl>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="interval" class="tsd-anchor"></a>
<h3>
interval
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets how frequently this shape should be drawn within a "Grid" or "Graduated" <a href="Panel.html">Panel</a>,
in multiples of the <a href="Panel.html#gridCellSize">Panel.gridCellSize</a> or <a href="Panel.html#graduatedTickUnit">Panel.graduatedTickUnit</a>.
The default is 1. Any new value must be a positive integer.</p>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="isGeometryPositioned" class="tsd-anchor"></a>
<h3>
is<wbr>Geometry<wbr>Positioned
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the whether the <a href="GraphObject.html#position">GraphObject.position</a> of this shape denotes
the top-left corner of this shape in panel coordinates or the origin of this geometry's coordinate system.
Basically, this determines whether the <a href="Shape.html#strokeWidth">strokeWidth</a> affects the rendered location.
A true value allows multiple shapes to be positioned precisely in a "Position" Panel independent of the stroke width.
The default is false.</p>
<dl class="tsd-comment-tags">
<dt>since</dt>
<dd><p>1.1</p>
</dd>
</dl>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-get-signature tsd-parent-kind-class">
<a name="naturalBounds" class="tsd-anchor"></a>
<h3>
<span class="tsd-flag ts-flagOverride">Override</span>
<span class="tsd-flag ts-flagReadOnly">Read-only</span>
natural<wbr>Bounds
<span class="tsd-signature-symbol">: </span><a href="Rect.html" class="tsd-signature-type">Rect</a> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>This read-only property returns the natural bounds of this Shape as determined by its <a href="Shape.html#geometry">geometry</a>'s bounds.
The bounds will always include the (0,0) point.
If there is no geometry available, it returns a <a href="Rect.html">Rect</a> with the <a href="GraphObject.html#desiredSize">desiredSize</a>,
which may have NaN values for the width and height.</p>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="parameter1" class="tsd-anchor"></a>
<h3>
parameter1
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets a property for parameterizing the construction of a <a href="Geometry.html">Geometry</a> from a figure.
The meaning of this property depends on the particular figure.
The value must be a number; the default value is NaN.</p>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="parameter2" class="tsd-anchor"></a>
<h3>
parameter2
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets a property for parameterizing the construction of a <a href="Geometry.html">Geometry</a> from a figure.
The meaning of this property depends on the particular figure.
The value must be a number; the default value is NaN.</p>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="pathPattern" class="tsd-anchor"></a>
<h3>
path<wbr>Pattern
<span class="tsd-signature-symbol">: </span><a href="GraphObject.html" class="tsd-signature-type">GraphObject</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets a <a href="GraphObject.html">GraphObject</a> that is drawn repeatedly along the path of the stroke of this shape.
This property may be set to a shared GraphObject; the GraphObject should not belong to any Panel.
Note that data bindings do <em>not</em> work in such shared GraphObjects, because they are not part of the visual tree.
The default value is null, causing no object to be drawn repeatedly.</p>
<p>Typically the object is a small <a href="Shape.html">Shape</a> or a <a href="Picture.html">Picture</a>.
The larger the object is the worse the results will be, especially if the stroke has short segments or sharp curves.
The pathPattern object is not part of the measured bounds of the Shape, it is a cosmetic element only.</p>
<p>The stroke is always drawn normally -- having a value for this property will draw the value along the stroke as well,
so it is commonplace to set the <a href="Shape.html#stroke">stroke</a> to "transparent" and the <a href="Shape.html#strokeWidth">strokeWidth</a> to be as wide as
the height of the GraphObject being drawn along the stroke.</p>
<p>Examples of path patterns can be seen in the <a href="../../samples/relationships.html">Relationships sample</a>.</p>
<dl class="tsd-comment-tags">
<dt>since</dt>
<dd><p>1.6</p>
</dd>
</dl>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="spot1" class="tsd-anchor"></a>
<h3>
spot1
<span class="tsd-signature-symbol">: </span><a href="Spot.html" class="tsd-signature-type">Spot</a> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the top-left Spot used by some <a href="Panel.html">Panel</a>s for determining where in the shape other objects may be placed.
The value is normally <a href="Spot.html#static-Default">Spot.Default</a>, but you may want to set it to override the value that many <a href="Shape.html#figure">figure</a>s use.</p>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="spot2" class="tsd-anchor"></a>
<h3>
spot2
<span class="tsd-signature-symbol">: </span><a href="Spot.html" class="tsd-signature-type">Spot</a> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the bottom-right Spot used by some <a href="Panel.html">Panel</a>s for determining where in the shape other objects may be placed.
The value is normally <a href="Spot.html#static-Default">Spot.Default</a>, but you may want to set it to override the value that many <a href="Shape.html#figure">figure</a>s use.</p>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="stroke" class="tsd-anchor"></a>
<h3>
stroke
<span class="tsd-signature-symbol">: </span><a href="../index.html#BrushLike" class="tsd-signature-type">BrushLike</a> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the <a href="Brush.html">Brush</a> or string that describes how the geometry is drawn as if by a pen.</p>
<p>The default value is "black", causing the shape to be outlined in black.
Any valid CSS string can specify a solid color, and the <a href="Brush.html">Brush</a>
class can be used to specify a gradient or pattern.
A null stroke will mean no stroke is drawn.
A "transparent" stroke is useful when wanting to allow a shape to be pickable
without obscuring any other objects behind it.
More information about the syntax of CSS color strings is available at:
<a href="https://developer.mozilla.org/en-US/docs/Web/CSS/color">CSS colors (mozilla.org)</a>.</p>
<p>The stroke is drawn after the geometry is filled with the <a href="Shape.html#fill">fill</a> Brush.</p>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="strokeCap" class="tsd-anchor"></a>
<h3>
stroke<wbr>Cap
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">"butt"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"round"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"square"</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the style for how the ends of the stroke's line are drawn.
The value must be one of "butt", "round", or "square". The default is "butt".</p>
<p>For more information, see <a href="https://www.w3.org/TR/2dcontext/#dom-context-2d-linecap">Stroke Line Cap (w3.org)</a>.</p>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="strokeDashArray" class="tsd-anchor"></a>
<h3>
stroke<wbr>Dash<wbr>Array
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Array</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the dash array for creating dashed or dotted lines.
The value must be an array of positive numbers and zeroes,
or else null to indicate a solid line.
For example, the array [5, 10] would create dashes of 5 pixels and spaces of 10 pixels.
For more information, see <a href="https://www.w3.org/TR/2dcontext/#dom-context-2d-setlinedash">Stroke Line Dash Array (w3.org)</a>.</p>
<p>The default value is null, resulting in a line without dashes or dots.
Setting an array with all zeroes will set the value to null.</p>
<dl class="tsd-comment-tags">
<dt>since</dt>
<dd><p>1.1</p>
</dd>
</dl>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="strokeDashOffset" class="tsd-anchor"></a>
<h3>
stroke<wbr>Dash<wbr>Offset
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the offset for dashed lines, used to start the drawing of the dash pattern with some space.
The value must be a real non-negative number. The default is zero.</p>
<p>For more information, see <a href="https://www.w3.org/TR/2dcontext/#dom-context-2d-linedashoffset">Stroke Line Dash Offset (w3.org)</a>.</p>
<dl class="tsd-comment-tags">
<dt>since</dt>
<dd><p>1.1</p>
</dd>
</dl>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="strokeJoin" class="tsd-anchor"></a>
<h3>
stroke<wbr>Join
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">"round"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"bevel"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"miter"</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the type of corner that will be drawn for a stroke at the intersection of two straight segments of the geometry.
The value must be one of "miter", "bevel", or "round". The default is "miter".</p>
<p>For more information, see <a href="https://www.w3.org/TR/2dcontext/#dom-context-2d-linejoin">Stroke Line Join (w3.org)</a>.</p>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="strokeMiterLimit" class="tsd-anchor"></a>
<h3>
stroke<wbr>Miter<wbr>Limit
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the style for the stroke's mitre limit ratio.
The value must be a real number greater than or equal to one.
The default is 10.0.</p>
<p>For more information, see <a href="https://www.w3.org/TR/2dcontext/#dom-context-2d-miterlimit">Stroke Miter Limit (w3.org)</a>.</p>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="strokeWidth" class="tsd-anchor"></a>
<h3>
stroke<wbr>Width
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the thickness of the stroke's pen.</p>
<p>Value must be a real number greater than or equal to zero.
The default value is 1.0.
A value of zero will cause the stroke not to be drawn.</p>
<p>The stroke width will affect the <a href="GraphObject.html#measuredBounds">GraphObject.measuredBounds</a> and <a href="GraphObject.html#actualBounds">GraphObject.actualBounds</a> of this shape.
The stroke is drawn centered on the path of the geometry.</p>
</div>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-accessor tsd-parent-kind-class">
<a name="toArrow" class="tsd-anchor"></a>
<h3>
to<wbr>Arrow
<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span> </h3>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>Gets or sets the name of the kind of arrowhead that this shape should take
when this shape is an element of a <a href="Link.html">Link</a>.
Value must be a string.</p>
<p>The default is "None", which means that this Shape is not an arrowhead, causing it to be the default Shape, a large filled Rectangle.
If you want to have an arrowhead Shape but sometimes not show an arrowhead, you can set or bind
the <a href="GraphObject.html#visible">GraphObject.visible</a> property, or you can set or bind this "toArrow" property to
be the empty string.
The arrowhead named "", an empty string, will display as nothing.</p>
<p>The name can be any case but will always be canonicalized when set. For instance,
setting "opentriangle" will set the value of the arrowhead to "OpenTriangle".
All of the predefined arrowheads are shown in the <a href="../../samples/arrowheads.html">Arrowheads sample</a>.</p>
<p>Setting this property may also set the <a href="GraphObject.html#segmentIndex">GraphObject.segmentIndex</a>,
<a href="GraphObject.html#segmentOrientation">GraphObject.segmentOrientation</a>, and <a href="GraphObject.html#alignmentFocus">GraphObject.alignmentFocus</a> properties.
This shape should be an element of a <a href="Link.html">Link</a>.</p>
<p>At most one of the following three properties may be set to a non-"None" value at the same time on the same shape:
<a href="Shape.html#figure">figure</a>, <a href="Shape.html#toArrow">toArrow</a>, <a href="Shape.html#fromArrow">fromArrow</a>.</p>
<p>You can define your own named arrowheads by calling the static function <a href="Shape.html#static-defineArrowheadGeometry">Shape.defineArrowheadGeometry</a>.</p>
<p>You can see a copy of all of the built-in arrowhead definitions in this file: <a href="../../extensions/Arrowheads.js">Arrowheads.js</a>.</p>
</div>
</li>
</ul>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Methods</h2>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-static">
<a name="static-defineArrowheadGeometry" class="tsd-anchor"></a>
<h3>
<span class="tsd-flag ts-flagStatic">Static</span>
define<wbr>Arrowhead<wbr>Geometry
</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-static">
<li class="tsd-signature tsd-kind-icon">define<wbr>Arrowhead<wbr>Geometry<span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, pathstr<span class="tsd-signature-symbol">: </span><a href="Geometry.html" class="tsd-signature-type">Geometry</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<div class="tsd-comment tsd-typography">
<p>This static function defines a named arrowhead geometry.
Once this is called one can use the name as a value for <a href="Shape.html#toArrow">Shape.toArrow</a> or <a href="Shape.html#fromArrow">Shape.fromArrow</a>.</p>
<p>The first argument is the new arrowhead name and must be a non-empty string that starts with a capital letter and that is not "None".</p>
<p>If the second argument is a string, it is converted into a <a href="Geometry.html">Geometry</a> by calling
<code>go.Geometry.parse(pathstr, false)</code>,
which may throw an error if there are problems with the syntax of the string.</p>
<dl class="tsd-comment-tags">
<dt>since</dt>
<dd><p>1.5</p>
</dd>
</dl>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>name: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>a capitalized arrowhead name ("OpenTriangle"); must not be "" or "None"</p>
</div>
</li>
<li>
<h5>pathstr: <a href="Geometry.html" class="tsd-signature-type">Geometry</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>a <a href="Geometry.html">Geometry</a> or a Geometry path string, e.g. "m 0,0 l 8,4 -8,4"</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-static">
<a name="static-defineFigureGenerator" class="tsd-anchor"></a>
<h3>
<span class="tsd-flag ts-flagStatic">Static</span>
define<wbr>Figure<wbr>Generator
</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-static">
<li class="tsd-signature tsd-kind-icon">define<wbr>Figure<wbr>Generator<span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, func<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">function</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">shape</span><span class="tsd-signature-symbol">: </span><a href="Shape.html" class="tsd-signature-type">Shape</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">width</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symb