UNPKG

create-gojs-kit

Version:

A CLI for downloading GoJS samples, extensions, and docs

286 lines 64.9 kB
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><link rel="stylesheet" href="../../assets/css/style.css"/><link rel="preconnect" href="https://rsms.me/"/><link rel="stylesheet" href="https://rsms.me/inter/inter.css"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Picture | GoJS API</title><meta name="description" content="Documentation for GoJS API"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><link rel="stylesheet" href="../assets/custom.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script type="text/javascript">// formerly in api.js
  var hash = null;
  function changeHash() {
      var panels = document.getElementsByClassName("tsd-panel");
      for (let i = 0; i < panels.length; i++) {
          var p = panels[i];
          p.classList.remove("targeted");
      }
      hash = window.location.hash.slice(1);
      if (hash) {
          var elt = document.getElementById(hash);
          if (elt) elt.parentNode.classList.add("targeted");
      }
  }
  document.addEventListener("DOMContentLoaded", changeHash);
  window.addEventListener("hashchange", changeHash);</script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header><nav id="navTop" class="w-full h-[var(--topnav-h)] z-30 bg-[var(--color-background-secondary)] border-b border-b-[var(--color-accent)]"><div class="max-w-screen-xl mx-auto flex flex-wrap items-start justify-between px-4"><a class="!text-white bg-nwoods-primary font-bold !leading-[calc(var(--topnav-h)_-_1px)] my-0 px-2 text-4xl lg:text-5xl logo" href="../../index.html">GoJS</a><div class="relative"><button id="topnavButton" class="h-[calc(var(--topnav-h)_-_1px)] px-2 m-0 text-[var(--color-text)] bg-inherit shadow-none md:hidden hover:!bg-inherit hover:!text-nwoods-accent hover:!shadow-none" aria-label="Navigation"><svg class="h-7 w-7 block" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5" stroke-linecap="round" stroke-linejoin="round"></path></svg></button><div id="topnavList" class="hidden md:block"><div class="absolute right-0 z-30 flex flex-col items-end rounded border border-[var(--color-accent)] p-4 pl-12 shadow bg-[var(--color-background-secondary)] text-[var(--color-text)] font-semibold
                        md:flex-row md:space-x-4 md:items-start md:border-0 md:p-0 md:shadow-none md:!bg-inherit"><a href="../../learn/index.html">Learn</a><a href="../../samples/index.html">Samples</a><a href="../../intro/index.html">Intro</a><a class="active" href="../../api/index.html">API</a><a href="../../download.html">Download</a><a href="https://forum.nwoods.com/c/gojs/11" target="_blank" rel="noopener">Forum</a><a href="https://nwoods.com/contact.html" target="_blank" rel="noopener" id="contactBtn">Contact</a><a href="https://nwoods.com/sales/index.html" target="_blank" rel="noopener" id="buyBtn">Buy</a></div></div></div></div></nav><script>window.addEventListener("DOMContentLoaded", function () {
    // topnav
    var topButton = document.getElementById("topnavButton");
    var topnavList = document.getElementById("topnavList");
    if (topButton && topnavList) {
      topButton.addEventListener("click", function (e) {
        topnavList
          .classList
          .toggle("hidden");
        e.stopPropagation();
      });
      document.addEventListener("click", function (e) {
        // if the clicked element isn't the list, close the list
        if (!topnavList.classList.contains("hidden") && !e.target.closest("#topnavList")) {
          topButton.click();
        }
      });

      // set active <a> element
      // done via active tag below, always API
    }
  });</script><div class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><div id="tsd-search-help"><code class="!text-lg">/</code> to search</div><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></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"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><div class="flex w-full max-w-screen-xl mx-auto px-2 items-center justify-between"><div><ul class="tsd-breadcrumb"><li><a href="../index.html">GoJS API</a></li><li><a href="Picture.html">Picture</a></li></ul><h1 class="flex items-center">Class Picture</h1></div><div class="text-xs"><b>GoJS</b>® Diagramming Components<br/>version 3.1.0<br/>by <a href="https://nwoods.com/">Northwoods Software®</a></div></div></div><section class="tsd-panel tsd-hierarchy"><h4>Hierarchy (<a class="link" href="../hierarchy.html#Picture">view full</a>)</h4><ul class="tsd-hierarchy"><li><a href="GraphObject.html" class="tsd-signature-type tsd-kind-class">GraphObject</a><ul class="tsd-hierarchy"><li><span class="target">Picture</span></li></ul></li></ul></section><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>A Picture is a <a href="GraphObject.html" class="tsd-kind-class">GraphObject</a> that shows an image, video-frame, or Canvas element.</p>
<p>You can specify what to show by either setting the <a href="Picture.html#source" class="tsd-kind-accessor">source</a> URL property
to a URL string or the <a href="Picture.html#element" class="tsd-kind-accessor">element</a> property to an HTMLImageElement,
HTMLCanvasElement, or HTMLVideoElement.</p>
<p>If a <a href="Picture.html#source" class="tsd-kind-accessor">source</a> URL is set, the Picture will automatically create a corresponding
HTMLImageElement and retain a reference to it in memory. If multiple Pictures specify
the same <a href="Picture.html#source" class="tsd-kind-accessor">source</a> URL then they will all refer to the same HTMLImageElement.</p>
<p>An example Picture, within a Node template:</p>
<pre><code class="language-js"><span class="hl-0">// A picture with the source set to &quot;example.png&quot;. It will show a gray area until the image is loaded:</span><br/><span class="hl-1">new</span><span class="hl-2"> </span><span class="hl-4">go</span><span class="hl-2">.</span><span class="hl-5">Picture</span><span class="hl-2">(</span><span class="hl-6">&quot;example.png&quot;</span><span class="hl-2">, { </span><span class="hl-4">background:</span><span class="hl-2"> </span><span class="hl-6">&quot;gray&quot;</span><span class="hl-2">, </span><span class="hl-4">width:</span><span class="hl-2"> </span><span class="hl-7">50</span><span class="hl-2">, </span><span class="hl-4">height:</span><span class="hl-2"> </span><span class="hl-7">50</span><span class="hl-2"> })</span>
</code><button>Copy</button></pre>
<p>If an element is not completely loaded during Diagram initialization, a redraw may occur,
and if an image&#39;s size is not known before loading, the containing Part of this Picture
may be resized, causing side effects such as layouts.
This can be avoided by knowing the size of the image beforehand,
and setting the Picture&#39;s <a href="GraphObject.html#desiredSize" class="tsd-kind-accessor">GraphObject.desiredSize</a>.</p>
<p>With some images (notably sprite sheets) only a portion of the image is expected to be drawn.
The <a href="Picture.html#sourceRect" class="tsd-kind-accessor">sourceRect</a> property allows the programmer to specify a rectangular area of
the source image that the Picture should display.</p>
<p>The <a href="Picture.html#imageStretch" class="tsd-kind-accessor">imageStretch</a> property allows an image to be resized inside of its bounding box.
This property does not change the size of the Picture element, it only resizes or re-scales
the image to fit (or not) in its bounds.</p>
<p class="boxread">
For examples of sizing and <a href="Picture.html#imageStretch" class="tsd-kind-accessor">imageStretch</a>,
see the <a href="../../intro/pictures.html">Introduction page on Pictures</a>.

<p>The <a href="Picture.html#errorFunction" class="tsd-kind-accessor">errorFunction</a> property allows one to set a function to call when a source fails to load.
This is useful in instances where images cannot be guaranteed to work, such as with
user specified input. The error function can set the <a href="Picture.html#source" class="tsd-kind-accessor">source</a> to a known good value,
but care should be taken to avoid error infinite loops when doing so.</p>
</div></section><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="true" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="Picture.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Accessors</h3><div class="tsd-index-list"><a href="Picture.html#element" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>element</span></a>
<a href="Picture.html#errorFunction" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>error<wbr/>Function</span></a>
<a href="Picture.html#flip" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>flip</span></a>
<a href="Picture.html#imageAlignment" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>image<wbr/>Alignment</span></a>
<a href="Picture.html#imageStretch" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>image<wbr/>Stretch</span></a>
<a href="Picture.html#naturalBounds" class="tsd-index-link"><svg class="readonly tsd-subicon" viewBox="0 0 28 28"><g id="subicon-R,#FF4D4D"><rect fill="var(--color-icon-background)" width="28" height="28" rx="14"></rect><path transform="translate(2, 2)" fill="none" stroke-width="1.5" stroke="var(--color-text)" d="M16.5 10.5V6.75a4.5 4.5 0 1 0-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 0 0 2.25-2.25v-6.75a2.25 2.25 0 0 0-2.25-2.25H6.75a2.25 2.25 0 0 0-2.25 2.25v6.75a2.25 2.25 0 0 0 2.25 2.25Z" stroke-linecap="round" stroke-linejoin="round"></path></g></svg><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>natural<wbr/>Bounds</span></a>
<a href="Picture.html#source" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>source</span></a>
<a href="Picture.html#sourceCrossOrigin" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>source<wbr/>Cross<wbr/>Origin</span></a>
<a href="Picture.html#sourceRect" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>source<wbr/>Rect</span></a>
<a href="Picture.html#successFunction" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>success<wbr/>Function</span></a>
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="Picture.html#redraw" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>redraw</span></a>
<a href="Picture.html#reloadSource" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>reload<wbr/>Source</span></a>
</div></section></div></details></section></section><section class="tsd-panel-group tsd-index-group tsd-is-inherited"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-index-accordion"><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Inherited Index</h5></summary><div class="tsd-accordion-details"><div class="tsd-index-content"><section class="tsd-index-section"><h3 class="tsd-index-heading">Accessors</h3><div class="tsd-index-list"><a href="GraphObject.html#actionCancel" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.action<wbr/>Cancel</span></a>
<a href="GraphObject.html#actionDown" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.action<wbr/>Down</span></a>
<a href="GraphObject.html#actionMove" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.action<wbr/>Move</span></a>
<a href="GraphObject.html#actionUp" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.action<wbr/>Up</span></a>
<a href="GraphObject.html#actualBounds" class="tsd-index-link"><svg class="readonly tsd-subicon" viewBox="0 0 28 28"><use href="#subicon-R,#FF4D4D"></use></svg><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.actual<wbr/>Bounds</span></a>
<a href="GraphObject.html#alignment" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.alignment</span></a>
<a href="GraphObject.html#alignmentFocus" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.alignment<wbr/>Focus</span></a>
<a href="GraphObject.html#angle" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.angle</span></a>
<a href="GraphObject.html#background" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.background</span></a>
<a href="GraphObject.html#click" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.click</span></a>
<a href="GraphObject.html#column" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.column</span></a>
<a href="GraphObject.html#columnSpan" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.column<wbr/>Span</span></a>
<a href="GraphObject.html#contextClick" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.context<wbr/>Click</span></a>
<a href="GraphObject.html#contextMenu" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.context<wbr/>Menu</span></a>
<a href="GraphObject.html#cursor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.cursor</span></a>
<a href="GraphObject.html#desiredSize" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.desired<wbr/>Size</span></a>
<a href="GraphObject.html#diagram" class="tsd-index-link"><svg class="readonly tsd-subicon" viewBox="0 0 28 28"><use href="#subicon-R,#FF4D4D"></use></svg><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.diagram</span></a>
<a href="GraphObject.html#doubleClick" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.double<wbr/>Click</span></a>
<a href="GraphObject.html#enabledChanged" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.enabled<wbr/>Changed</span></a>
<a href="GraphObject.html#fromEndSegmentLength" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.from<wbr/>End<wbr/>Segment<wbr/>Length</span></a>
<a href="GraphObject.html#fromLinkable" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.from<wbr/>Linkable</span></a>
<a href="GraphObject.html#fromLinkableDuplicates" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.from<wbr/>Linkable<wbr/>Duplicates</span></a>
<a href="GraphObject.html#fromLinkableSelfNode" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.from<wbr/>Linkable<wbr/>Self<wbr/>Node</span></a>
<a href="GraphObject.html#fromMaxLinks" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.from<wbr/>Max<wbr/>Links</span></a>
<a href="GraphObject.html#fromShortLength" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.from<wbr/>Short<wbr/>Length</span></a>
<a href="GraphObject.html#fromSpot" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.from<wbr/>Spot</span></a>
<a href="GraphObject.html#height" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.height</span></a>
<a href="GraphObject.html#isActionable" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.is<wbr/>Actionable</span></a>
<a href="GraphObject.html#isPanelMain" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.is<wbr/>Panel<wbr/>Main</span></a>
<a href="GraphObject.html#layer" class="tsd-index-link"><svg class="readonly tsd-subicon" viewBox="0 0 28 28"><use href="#subicon-R,#FF4D4D"></use></svg><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.layer</span></a>
<a href="GraphObject.html#margin" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.margin</span></a>
<a href="GraphObject.html#maxSize" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.max<wbr/>Size</span></a>
<a href="GraphObject.html#measuredBounds" class="tsd-index-link"><svg class="readonly tsd-subicon" viewBox="0 0 28 28"><use href="#subicon-R,#FF4D4D"></use></svg><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.measured<wbr/>Bounds</span></a>
<a href="GraphObject.html#minSize" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.min<wbr/>Size</span></a>
<a href="GraphObject.html#mouseDragEnter" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.mouse<wbr/>Drag<wbr/>Enter</span></a>
<a href="GraphObject.html#mouseDragLeave" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.mouse<wbr/>Drag<wbr/>Leave</span></a>
<a href="GraphObject.html#mouseDrop" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.mouse<wbr/>Drop</span></a>
<a href="GraphObject.html#mouseEnter" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.mouse<wbr/>Enter</span></a>
<a href="GraphObject.html#mouseHold" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.mouse<wbr/>Hold</span></a>
<a href="GraphObject.html#mouseHover" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.mouse<wbr/>Hover</span></a>
<a href="GraphObject.html#mouseLeave" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.mouse<wbr/>Leave</span></a>
<a href="GraphObject.html#mouseOver" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.mouse<wbr/>Over</span></a>
<a href="GraphObject.html#name" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.name</span></a>
<a href="GraphObject.html#opacity" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.opacity</span></a>
<a href="GraphObject.html#panel" class="tsd-index-link"><svg class="readonly tsd-subicon" viewBox="0 0 28 28"><use href="#subicon-R,#FF4D4D"></use></svg><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.panel</span></a>
<a href="GraphObject.html#part" class="tsd-index-link"><svg class="readonly tsd-subicon" viewBox="0 0 28 28"><use href="#subicon-R,#FF4D4D"></use></svg><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.part</span></a>
<a href="GraphObject.html#pickable" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.pickable</span></a>
<a href="GraphObject.html#portId" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.port<wbr/>Id</span></a>
<a href="GraphObject.html#position" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.position</span></a>
<a href="GraphObject.html#row" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.row</span></a>
<a href="GraphObject.html#rowSpan" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.row<wbr/>Span</span></a>
<a href="GraphObject.html#scale" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.scale</span></a>
<a href="GraphObject.html#segmentFraction" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.segment<wbr/>Fraction</span></a>
<a href="GraphObject.html#segmentIndex" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.segment<wbr/>Index</span></a>
<a href="GraphObject.html#segmentOffset" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.segment<wbr/>Offset</span></a>
<a href="GraphObject.html#segmentOrientation" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.segment<wbr/>Orientation</span></a>
<a href="GraphObject.html#shadowVisible" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.shadow<wbr/>Visible</span></a>
<a href="GraphObject.html#stretch" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.stretch</span></a>
<a href="GraphObject.html#toEndSegmentLength" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.to<wbr/>End<wbr/>Segment<wbr/>Length</span></a>
<a href="GraphObject.html#toLinkable" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.to<wbr/>Linkable</span></a>
<a href="GraphObject.html#toLinkableDuplicates" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.to<wbr/>Linkable<wbr/>Duplicates</span></a>
<a href="GraphObject.html#toLinkableSelfNode" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.to<wbr/>Linkable<wbr/>Self<wbr/>Node</span></a>
<a href="GraphObject.html#toMaxLinks" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.to<wbr/>Max<wbr/>Links</span></a>
<a href="GraphObject.html#toShortLength" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.to<wbr/>Short<wbr/>Length</span></a>
<a href="GraphObject.html#toSpot" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.to<wbr/>Spot</span></a>
<a href="GraphObject.html#toolTip" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.tool<wbr/>Tip</span></a>
<a href="GraphObject.html#visible" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.visible</span></a>
<a href="GraphObject.html#width" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>Graph<wbr/>Object.width</span></a>
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="GraphObject.html#apply" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Graph<wbr/>Object.apply</span></a>
<a href="GraphObject.html#attach" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Graph<wbr/>Object.attach</span></a>
<a href="GraphObject.html#bind" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Graph<wbr/>Object.bind</span></a>
<a href="GraphObject.html#bindModel" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Graph<wbr/>Object.bind<wbr/>Model</span></a>
<a href="GraphObject.html#bindObject" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Graph<wbr/>Object.bind<wbr/>Object</span></a>
<a href="GraphObject.html#bindTwoWay" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Graph<wbr/>Object.bind<wbr/>Two<wbr/>Way</span></a>
<a href="GraphObject.html#copy" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Graph<wbr/>Object.copy</span></a>
<a href="GraphObject.html#findBindingPanel" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Graph<wbr/>Object.find<wbr/>Binding<wbr/>Panel</span></a>
<a href="GraphObject.html#getDocumentAngle" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Graph<wbr/>Object.get<wbr/>Document<wbr/>Angle</span></a>
<a href="GraphObject.html#getDocumentBounds" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Graph<wbr/>Object.get<wbr/>Document<wbr/>Bounds</span></a>
<a href="GraphObject.html#getDocumentPoint" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Graph<wbr/>Object.get<wbr/>Document<wbr/>Point</span></a>
<a href="GraphObject.html#getDocumentScale" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Graph<wbr/>Object.get<wbr/>Document<wbr/>Scale</span></a>
<a href="GraphObject.html#getLocalPoint" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Graph<wbr/>Object.get<wbr/>Local<wbr/>Point</span></a>
<a href="GraphObject.html#isContainedBy" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Graph<wbr/>Object.is<wbr/>Contained<wbr/>By</span></a>
<a href="GraphObject.html#isEnabledObject" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Graph<wbr/>Object.is<wbr/>Enabled<wbr/>Object</span></a>
<a href="GraphObject.html#isVisibleObject" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Graph<wbr/>Object.is<wbr/>Visible<wbr/>Object</span></a>
<a href="GraphObject.html#set" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Graph<wbr/>Object.set</span></a>
<a href="GraphObject.html#setProperties" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Graph<wbr/>Object.set<wbr/>Properties</span></a>
<a href="GraphObject.html#theme" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Graph<wbr/>Object.theme</span></a>
<a href="GraphObject.html#themeData" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Graph<wbr/>Object.theme<wbr/>Data</span></a>
<a href="GraphObject.html#themeModel" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Graph<wbr/>Object.theme<wbr/>Model</span></a>
<a href="GraphObject.html#themeObject" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Graph<wbr/>Object.theme<wbr/>Object</span></a>
<a href="GraphObject.html#trigger" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>Graph<wbr/>Object.trigger</span></a>
</div></section></div></div></details></section></section><section class="tsd-panel-group tsd-member-group"><h2>Constructors</h2><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="constructor.new_Picture" class="tsd-anchor"></a><span class="tsd-kind-constructor-signature">new <wbr/>Picture</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">source</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span>, <span class="tsd-kind-parameter">init</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol">&lt;</span><a href="Picture.html" class="tsd-signature-type tsd-kind-class">Picture</a><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="Picture.html" class="tsd-signature-type tsd-kind-class">Picture</a><a href="#constructor.new_Picture" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>The constructor creates a Picture that shows nothing until the
source or <a href="Picture.html#element" class="tsd-kind-accessor">element</a> is specified. It is also common to specify the
<a href="GraphObject.html#desiredSize" class="tsd-kind-accessor">GraphObject.desiredSize</a> to make sure that the picture&#39;s size is known
before the image is loaded asynchronously, so that layouts do not need to be recomputed.</p>
<p>Common usage:</p>
<pre><code class="language-js"><span class="hl-1">new</span><span class="hl-2"> </span><span class="hl-4">go</span><span class="hl-2">.</span><span class="hl-5">Picture</span><span class="hl-2">(</span><span class="hl-6">&quot;example_image_url.png&quot;</span><span class="hl-2">, {</span><br/><span class="hl-2">  </span><span class="hl-4">width:</span><span class="hl-2"> </span><span class="hl-7">100</span><span class="hl-2">,</span><br/><span class="hl-2">  </span><span class="hl-4">height:</span><span class="hl-2"> </span><span class="hl-7">50</span><br/><span class="hl-2">})</span>
</code><button>Copy</button></pre>
<p>Or:</p>
<pre><code class="language-js"><span class="hl-0">// specify a different source for each node in the node data</span><br/><span class="hl-1">new</span><span class="hl-2"> </span><span class="hl-4">go</span><span class="hl-2">.</span><span class="hl-5">Picture</span><span class="hl-2">({</span><br/><span class="hl-2">  </span><span class="hl-4">width:</span><span class="hl-2"> </span><span class="hl-7">100</span><span class="hl-2">,</span><br/><span class="hl-2">  </span><span class="hl-4">height:</span><span class="hl-2"> </span><span class="hl-7">50</span><br/><span class="hl-2">}).</span><span class="hl-5">bind</span><span class="hl-2">(</span><span class="hl-6">&quot;source&quot;</span><span class="hl-2">)</span>
</code><button>Copy</button></pre>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">source</span>: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>Optionally set the Pictures&#39;s source.</p>
</div></li><li><h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">init</span>: <span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol">&lt;</span><a href="Picture.html" class="tsd-signature-type tsd-kind-class">Picture</a><span class="tsd-signature-symbol">&gt;</span></h5><div class="tsd-comment tsd-typography"><p>Optional properties to initialize.</p>
</div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="Picture.html" class="tsd-signature-type tsd-kind-class">Picture</a></h4></li><li class="tsd-signature tsd-anchor-link"><a id="constructor.new_Picture-1" class="tsd-anchor"></a><span class="tsd-kind-constructor-signature">new <wbr/>Picture</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">init</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol">&lt;</span><a href="Picture.html" class="tsd-signature-type tsd-kind-class">Picture</a><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="Picture.html" class="tsd-signature-type tsd-kind-class">Picture</a><a href="#constructor.new_Picture-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>The constructor creates a Picture that shows nothing until the
<a href="Picture.html#source" class="tsd-kind-accessor">source</a> or <a href="Picture.html#element" class="tsd-kind-accessor">element</a> is specified. It is also common to specify the
<a href="GraphObject.html#desiredSize" class="tsd-kind-accessor">GraphObject.desiredSize</a> to make sure that the picture&#39;s size is known
before the image is loaded asynchronously, so that layouts do not need to be recomputed.
 *</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">init</span>: <span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol">&lt;</span><a href="Picture.html" class="tsd-signature-type tsd-kind-class">Picture</a><span class="tsd-signature-symbol">&gt;</span></h5><div class="tsd-comment tsd-typography"><p>Optional properties to initialize.</p>
</div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="Picture.html" class="tsd-signature-type tsd-kind-class">Picture</a></h4></li></ul></section></section><section class="tsd-panel-group tsd-member-group"><h2>Accessors</h2><section class="tsd-panel tsd-member"><a id="element" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>element</span><div class="membertype"><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HTMLCanvasElement</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">HTMLImageElement</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">HTMLVideoElement</span></div><a href="#element" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Gets or sets the Picture&#39;s HTML element that provides some kind of visual image.</p>
<p>The default value is null.
This can be a HTMLImageElement, HTMLVideoElement, or HTMLCanvasElement.
If an image, this element must have its source (src) attribute defined.
Setting this does not set the <a href="Picture.html#source" class="tsd-kind-accessor">Picture.source</a> attribute and that attribute may be unknowable.</p>
<p>If this property is set to an HTMLImageElement, and that element is not yet loaded before it is used,
the Diagrams using that Element will not redraw on their own.
You must call <a href="Picture.html#redraw" class="tsd-kind-method">redraw</a> after the image is finished loading if you wish for the Diagram to be updated immediately.</p>
</div></li></ul></section><section class="tsd-panel tsd-member"><a id="errorFunction" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>error<wbr/>Function</span><div class="membertype"><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">a</span><span class="tsd-signature-symbol">: </span><a href="Picture.html" class="tsd-signature-type tsd-kind-class">Picture</a>, <span class="tsd-kind-parameter">b</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Event</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></div><a href="#errorFunction" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Gets or sets the function to call if an image set by <a href="Picture.html#source" class="tsd-kind-accessor">source</a> fails to load.
The arguments to this function are this Picture and the HTMLImageElement&#39;s &quot;error&quot; Event.</p>
<p>This is called once per Picture, for every Picture that is using the same <a href="Picture.html#source" class="tsd-kind-accessor">source</a> that failed to load.
This will never be called if the <a href="Picture.html#source" class="tsd-kind-accessor">source</a> is never set, and is not called with Pictures that use <a href="Picture.html#element" class="tsd-kind-accessor">element</a> instead.</p>
<p>The default value is null, meaning that no specific action occurs when there is an error loading an image.</p>
</div><div class="tsd-comment-tags tsd-typography"><div class="flex items-center"><code class="tsd-tag">see</code><p><a href="Picture.html#successFunction" class="tsd-kind-accessor">successFunction</a></p>
</div></div></li></ul></section><section class="tsd-panel tsd-member"><a id="flip" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>flip</span><div class="membertype"><span class="tsd-signature-symbol">: </span><a href="Flip.html" class="tsd-signature-type tsd-kind-enum">Flip</a></div><a href="#flip" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Gets or sets how the Picture is displayed: Either normally or with a Horizontal or Vertical flip or both.</p>
<p>Possible values are <a href="Flip.html#None" class="tsd-kind-enum-member">Flip.None</a>, <a href="Flip.html#Horizontal" class="tsd-kind-enum-member">Flip.Horizontal</a>, <a href="Flip.html#Vertical" class="tsd-kind-enum-member">Flip.Vertical</a>, or <a href="Flip.html#Both" class="tsd-kind-enum-member">Flip.Both</a>.
The default is <a href="Flip.html#None" class="tsd-kind-enum-member">Flip.None</a>.</p>
</div><div class="tsd-comment-tags tsd-typography"><div class="flex items-center"><code class="tsd-tag">since</code><p>2.0</p>
</div></div></li></ul></section><section class="tsd-panel tsd-member"><a id="imageAlignment" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>image<wbr/>Alignment</span><div class="membertype"><span class="tsd-signature-symbol">: </span><a href="Spot.html" class="tsd-signature-type tsd-kind-class">Spot</a></div><a href="#imageAlignment" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Gets or sets the Spot to align the source image to, when the source image
is smaller than the Picture. This is only relevant when
the <a href="Picture.html#imageStretch" class="tsd-kind-accessor">imageStretch</a> property value is not go.ImageStretch.Fill.</p>
<p>This does not affect Picture coordinates or bounds, it only affects what is drawn within the given area.
The default value is <a href="Spot.html#Center" class="tsd-kind-property">Spot.Center</a>.</p>
</div><div class="tsd-comment-tags tsd-typography"><div class="flex items-center"><code class="tsd-tag">see</code><p><a href="Picture.html#imageStretch" class="tsd-kind-accessor">imageStretch</a></p>
</div></div></li></ul></section><section class="tsd-panel tsd-member"><a id="imageStretch" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>image<wbr/>Stretch</span><div class="membertype"><span class="tsd-signature-symbol">: </span><a href="ImageStretch.html" class="tsd-signature-type tsd-kind-enum">ImageStretch</a></div><a href="#imageStretch" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Gets or sets how the Picture&#39;s image is stretched within its bounding box.
Some images will be a different aspect ratio than their given size or desiredSize.
This property will never change the size of the Picture itself,
only the size of the image that is drawn in the Picture&#39;s <a href="GraphObject.html#actualBounds" class="tsd-kind-accessor">actualBounds</a>.</p>
<p>Possible values are <a href="ImageStretch.html#Fill" class="tsd-kind-enum-member">ImageStretch.Fill</a>, <a href="ImageStretch.html#Uniform" class="tsd-kind-enum-member">ImageStretch.Uniform</a>,
<a href="ImageStretch.html#UniformToFill" class="tsd-kind-enum-member">ImageStretch.UniformToFill</a>, and <a href="ImageStretch.html#None" class="tsd-kind-enum-member">ImageStretch.None</a>.
The default is <a href="ImageStretch.html#Fill" class="tsd-kind-enum-member">ImageStretch.Fill</a>.</p>
</div><div class="tsd-comment-tags tsd-typography"><div class="flex items-center"><code class="tsd-tag">see</code><p><a href="Picture.html#imageAlignment" class="tsd-kind-accessor">imageAlignment</a></p>
</div></div></li></ul></section><section class="tsd-panel tsd-member"><a id="naturalBounds" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagReadOnly">Readonly</code><span>natural<wbr/>Bounds</span><div class="membertype"><span class="tsd-signature-symbol">: </span><a href="Rect.html" class="tsd-signature-type tsd-kind-class">Rect</a></div><a href="#naturalBounds" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>This read-only property returns the natural size of this picture as determined by its source&#39;s width and height.
The value is initially NaN x NaN until the picture has been measured.
It will use the <a href="Picture.html#element" class="tsd-kind-accessor">element</a>&#39;s <code>naturalWidth</code> and <code>naturalHeight</code> if available.</p>
</div></li></ul></section><section class="tsd-panel tsd-member"><a id="source" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>source</span><div class="membertype"><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></div><a href="#source" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Gets or sets the Picture&#39;s source URL, which can be any valid image (png, jpg, gif, etc) URL.</p>
<p>The default value is the empty string, which specifies no image source.
Setting this attribute creates an HTMLImageElement and sets the <a href="Picture.html#element" class="tsd-kind-accessor">Picture.element</a>
attribute to that element. When the element loads, this Picture may remeasure if no <a href="GraphObject.html#desiredSize" class="tsd-kind-accessor">GraphObject.desiredSize</a> was set,
and Diagrams using the picture will redraw.</p>
<p>To avoid remeasuring and rearranging Parts as images load asynchronously,
be sure to set the <a href="GraphObject.html#desiredSize" class="tsd-kind-accessor">GraphObject.desiredSize</a>
(or <a href="GraphObject.html#width" class="tsd-kind-accessor">GraphObject.width</a> and <a href="GraphObject.html#height" class="tsd-kind-accessor">GraphObject.height</a>) to fixed values.</p>
<p>Setting the source of multiple Pictures to the same URL will cause only one HTMLImageElement
to be created and shared. Setting the source to the empty string will set <a href="Picture.html#element" class="tsd-kind-accessor">Picture.element</a> to null.
It is commonplace to either specify a constant URL or to data bind this property to some data property,
perhaps using a conversion function in order to produce a proper URL.</p>
<p>For cross-browser support of SVG sources additional care is needed.
See the final section of the <a href="../../intro/pictures.html">Introduction page on Pictures</a>.</p>
</div></li></ul></section><section class="tsd-panel tsd-member"><a id="sourceCrossOrigin" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>source<wbr/>Cross<wbr/>Origin</span><div class="membertype"><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">a</span><span class="tsd-signature-symbol">: </span><a href="Picture.html" class="tsd-signature-type tsd-kind-class">Picture</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span></div><a href="#sourceCrossOrigin" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Gets or sets a function that returns a value for image.crossOrigin.</p>
<p>The default value is null, which will not set a value for image.crossOrigin.
Set this property to a function that returns &quot;anonymous&quot; or &quot;use-credentials&quot;
if you want images to complete a cross-origin request.
Example:</p>
<pre><code class="language-js"><span class="hl-1">new</span><span class="hl-2"> </span><span class="hl-4">go</span><span class="hl-2">.</span><span class="hl-5">Picture</span><span class="hl-2">({</span><br/><span class="hl-2">  </span><span class="hl-4">width:</span><span class="hl-2"> </span><span class="hl-7">64</span><span class="hl-2">,</span><br/><span class="hl-2">  </span><span class="hl-4">height:</span><span class="hl-2"> </span><span class="hl-7">64</span><span class="hl-2">,</span><br/><span class="hl-2">  </span><span class="hl-5">sourceCrossOrigin</span><span class="hl-4">:</span><span class="hl-2"> </span><span class="hl-4">pict</span><span class="hl-2"> </span><span class="hl-1">=&gt;</span><span class="hl-2"> </span><span class="hl-6">&#39;anonymous&#39;</span><br/><span class="hl-2">})</span><br/><span class="hl-2">  .</span><span class="hl-5">bind</span><span class="hl-2">(</span><span class="hl-6">&#39;source&#39;</span><span class="hl-2">, </span><span class="hl-6">&#39;path&#39;</span><span class="hl-2">)</span>
</code><button>Copy</button></pre>
</div></li></ul></section><section class="tsd-panel tsd-member"><a id="sourceRect" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>source<wbr/>Rect</span><div class="membertype"><span class="tsd-signature-symbol">: </span><a href="Rect.html" class="tsd-signature-type tsd-kind-class">Rect</a></div><a href="#sourceRect" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Gets or sets the rectangular area of the source image that this picture should display.
This is only common with sprite maps and image tables.</p>
<p>The value must be of type <a href="Rect.html" class="tsd-kind-class">Rect</a>.
The default value is Rect(NaN, NaN, NaN, NaN), which means the whole source image should be used.</p>
</div></li></ul></section><section class="tsd-panel tsd-member"><a id="successFunction" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>success<wbr/>Function</span><div class="membertype"><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">a</span><span class="tsd-signature-symbol">: </span><a href="Picture.html" class="tsd-signature-type tsd-kind-class">Picture</a>, <span class="tsd-kind-parameter">b</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Event</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></div><a href="#successFunction" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Gets or sets the function to call when an image set by <a href="Picture.html#source" class="tsd-kind-accessor">source</a> loads successfully.
The arguments to this function are this Picture and the HTMLImageElement&#39;s &quot;load&quot; Event.</p>
<p>This is called once per Picture, for every Picture that is using the same <a href="Picture.html#source" class="tsd-kind-accessor">source</a> that loaded successfully.
This will never be called if the <a href="Picture.html#source" class="tsd-kind-accessor">source</a> is never set, and is not called with Pictures that use <a href="Picture.html#element" class="tsd-kind-accessor">element</a> instead.
It is even called for a Picture source that has already loaded, so that creating copies of a Picture with this property set will
call it once for each newly created Picture.</p>
<p>The default value is null, meaning that no specific action occurs when an image finishes loading.</p>
</div><div class="tsd-comment-tags tsd-typography"><div class="flex items-center"><code class="tsd-tag">see</code><p><a href="Picture.html#errorFunction" class="tsd-kind-accessor">errorFunction</a></p>
</div></div></li></ul></section></section><section class="tsd-panel-group tsd-member-group"><h2>Methods</h2><section class="tsd-panel tsd-member"><a id="redraw" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>redraw</span><a href="#redraw" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="redraw.redraw-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">redraw</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#redraw.redraw-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Redraws a Picture, which can be useful if the backing <a href="Picture.html#element" class="tsd-kind-accessor">element</a> is an HTML Canvas or HTML Video that has changed.
This will not attempt to <em>reload</em> any image. If you need to do that, call <a href="Picture.html#reloadSource" class="tsd-kind-method">reloadSource</a>.</p>
<p>This does not need to be called within a transaction, and will not re-measure anything.</p>
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment-tags tsd-typography"><div class="flex items-center"><code class="tsd-tag">since</code><p>2.1</p>
</div></div></li></ul></section><section class="tsd-panel tsd-member"><a id="reloadSource" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>reload<wbr/>Source</span><a href="#reloadSource" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="reloadSource.reloadSource-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">reload<wbr/>Source</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#reloadSource.reloadSource-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Attempts to reload a <a href="Picture.html#source" class="tsd-kind-accessor">Picture.source</a> image. This can be useful if the content on a server has changed, or was missing before.
If a new image is loaded, this Picture may remeasure and/or redraw.</p>
<p>Because of browsers caching assets, you may additionally need to force a re-fetch of the Picture&#39;s source URL
with a <code>fetch</code> call such as:</p>
<pre><code class="language-js"><span class="hl-5">fetch</span><span class="hl-2">(</span><span class="hl-4">thisPicture</span><span class="hl-2">.</span><span class="hl-4">source</span><span class="hl-2">, { </span><span class="hl-4">cache:</span><span class="hl-2"> </span><span class="hl-6">&#39;reload&#39;</span><span class="hl-2">, </span><span class="hl-4">mode:</span><span class="hl-2"> </span><span class="hl-6">&#39;no-cors&#39;</span><span class="hl-2"> });</span>
</code><button>Copy</button></pre>
<p>This should normally be called within a transaction.</p>
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment-tags tsd-typography"><div class="flex items-center"><code class="tsd-tag">since</code><p>2.1</p>
</div></div></li></ul></section></section></div><div class="col-sidebar"><div class="page-menu"><details open class="tsd-index-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><ul><li><a href="#constructor"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></li><li><a href="#element"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>element</span></a></li><li><a href="#errorFunction"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>error<wbr/>Function</span></a></li><li><a href="#flip"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>flip</span></a></li><li><a href="#imageAlignment"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>image<wbr/>Alignment</span></a></li><li><a href="#imageStretch"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>image<wbr/>Stretch</span></a></li><li><a href="#naturalBounds"><svg class="readonly tsd-subicon" viewBox="0 0 28 28"><use href="#subicon-R,#FF4D4D"></use></svg><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>natural<wbr/>Bounds</span></a></li><li><a href="#source"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>source</span></a></li><li><a href="#sourceCrossOrigin"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>source<wbr/>Cross<wbr/>Origin</span></a></li><li><a href="#sourceRect"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>source<wbr/>Rect</span></a></li><li><a href="#successFunction"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>success<wbr/>Function</span></a></li><li><a href="#redraw"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>redraw</span></a></li><li><a href="#reloadSource"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>reload<wbr/>Source</span></a></li></ul></div></details><div class="tsd-navigation settings"><div class="tsd-theme-toggle"><h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">System</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>GoJS API</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><div class="tsd w-full max-w-screen-xl mx-auto px-2"><div class="bottom-copyright">Copyright © 1998-2025 by Northwoods Software Corporation.</div></div><div class="overlay"></div><script async src="https://www.googletagmanager.com/gtag/js?id=G-S5QK8VSK84"></script><script>window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-S5QK8VSK84');
var getOutboundLink = function(url, label) {
  gtag('event', 'click', {
  'event_category': 'outbound',
  'event_label': label,
  'transport_type': 'beacon'
  });
}

document.getElementById("contactBtn").addEventListener("click", function() {
  getOutboundLink('https://nwoods.com/contact.html', 'contact');
});
document.getElementById("buyBtn").addEventListener("click", function() {
  getOutboundLink('https://nwoods.com/sales/index.html', 'buy');
});</script></body></html>