maxGraph/docs/api/index.html

98 lines
67 KiB
HTML
Raw Normal View History

Finish converting core to ts, JSDoc conversion, consistency+convention changes, example bugfixes (#70) * reorganised directories; removed mx prefix * reduced directory hierarchies; removed mx prefix; type fixes * convert remaining javascript to ts * fix/add types * add type defs * type updates; moved codecs to where they're used * reorganise constants into enums+type additions * removed "Function:" and "Variable:" prefixes from comments, as they aren't needed in JSDoc * removed "Function:", "Variable:" and "Class:" prefixes from comments, as they aren't needed in JSDoc * removed "Function:" prefixes from comments, as they aren't needed in JSDoc * minor changes * convert code example blocks to markdown * module casing updates * converted parameter function documentation to JSDoc * documentation+type updates * removed react subdir (for now) * reorganised various `utils` functions into different files * type updates/bugfixes/workarounds * rename Rubberband and CellEditor to be *Handler to match the other plugins * move codec classes to where they're used to reduce cyclic dependencies * move codec classes to where they're used to reduce cyclic dependencies * type updates/reorganize layout file structure * renamed various files for consistency * import fixes * renamed GraphHandler SelectionHander and various fixes * convert EventObject parameters to objects * add basic better-docs config * update better-docs config * bugfix for shared variables in Graph persisting across instances * fixed accessing handlers in examples; renamed Model to GraphModel * fixed accessing handlers in examples; renamed Model to GraphModel * restored selection model * bugfix * renamed getModel to getDataModel * changed to use graph.batchUpdate() to reduce lines of code * changed to use graph.batchUpdate() to reduce lines of code * finished annotations+added TypeDoc * convert remaining Cell[] instances to CellArray * convert NaturalDocs links to JSDoc
2022-01-08 01:49:35 +00:00
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>@maxgraph/core</title><meta name="description" content="Documentation for @maxgraph/core"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><script async src="assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base="."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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">@maxgraph/core</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> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label></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"><h1>@maxgraph/core</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><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>Namespaces</h3><ul class="tsd-index-list"><li class="tsd-kind-namespace"><a href="modules/DomHelpers.html" class="tsd-kind-icon">Dom<wbr/>Helpers</a></li><li class="tsd-kind-namespace"><a href="modules/cloneUtils.html" class="tsd-kind-icon">clone<wbr/>Utils</a></li><li class="tsd-kind-namespace"><a href="modules/constants.html" class="tsd-kind-icon">constants</a></li><li class="tsd-kind-namespace"><a href="modules/domUtils.html" class="tsd-kind-icon">dom<wbr/>Utils</a></li><li class="tsd-kind-namespace"><a href="modules/eventUtils.html" class="tsd-kind-icon">event<wbr/>Utils</a></li><li class="tsd-kind-namespace"><a href="modules/gestureUtils.html" class="tsd-kind-icon">gesture<wbr/>Utils</a></li><li class="tsd-kind-namespace"><a href="modules/mathUtils.html" class="tsd-kind-icon">math<wbr/>Utils</a></li><li class="tsd-kind-namespace"><a href="modules/stringUtils.html" class="tsd-kind-icon">string<wbr/>Utils</a></li><li class="tsd-kind-namespace"><a href="modules/styleUtils.html" class="tsd-kind-icon">style<wbr/>Utils</a></li><li class="tsd-kind-namespace"><a href="modules/utils.html" class="tsd-kind-icon">utils</a></li><li class="tsd-kind-namespace"><a href="modules/xmlUtils.html" class="tsd-kind-icon">xml<wbr/>Utils</a></li></ul></section><section class="tsd-index-section "><h3>Classes</h3><ul class="tsd-index-list"><li class="tsd-kind-class"><a href="classes/AbstractCanvas2D.html" class="tsd-kind-icon">Abstract<wbr/>Canvas2D</a></li><li class="tsd-kind-class"><a href="classes/ActorShape.html" class="tsd-kind-icon">Actor<wbr/>Shape</a></li><li class="tsd-kind-class"><a href="classes/Animation.html" class="tsd-kind-icon">Animation</a></li><li class="tsd-kind-class"><a href="classes/ArrowConnectorShape.html" class="tsd-kind-icon">Arrow<wbr/>Connector<wbr/>Shape</a></li><li class="tsd-kind-class"><a href="classes/ArrowShape.html" class="tsd-kind-icon">Arrow<wbr/>Shape</a></li><li class="tsd-kind-class"><a href="classes/AutoSaveManager.html" class="tsd-kind-icon">Auto<wbr/>Save<wbr/>
<p>Displays the given error message in a new <MaxWindow> of the given width.
If close is true then an additional close button is added to the window.
The optional icon specifies the icon to be used for the window. Default
is {@link Utils#errorImage}.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>message: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>String specifying the message to be displayed.</p>
</div></div></li><li><h5>width: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Integer specifying the width of the window.</p>
</div></div></li><li><h5>close: <span class="tsd-signature-type">boolean</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Optional boolean indicating whether to add a close button.</p>
</div></div></li><li><h5>icon: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = null</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Optional icon for the window decoration.</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <a href="classes/MaxWindow.html" class="tsd-signature-type" data-tsd-kind="Class">MaxWindow</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-function"><a id="get" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagConst">Const</span> get</h3><ul class="tsd-signatures tsd-kind-function"><li class="tsd-signature tsd-kind-icon">get<span class="tsd-signature-symbol">(</span>url<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, onload<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Function</span>, onerror<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Function</span>, binary<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span>, timeout<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span>, ontimeout<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Function</span>, headers<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">{}</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="classes/MaxXmlRequest.html" class="tsd-signature-type" data-tsd-kind="Class">MaxXmlRequest</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/util/MaxXmlRequest.ts#L444">util/MaxXmlRequest.ts:444</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Loads the specified URL <em>asynchronously</em> and invokes the given functions
depending on the request status. Returns the <MaxXmlRequest> in use. Both
functions take the <MaxXmlRequest> as the only parameter. See
{@link Utils#load} for a synchronous implementation.</p>
</div><div><p>Example:</p>
<pre><code class="language-javascript"><span class="hl-0">mxUtils</span><span class="hl-1">.</span><span class="hl-2">get</span><span class="hl-1">(</span><span class="hl-0">url</span><span class="hl-1">, (</span><span class="hl-0">req</span><span class="hl-1">)</span><span class="hl-3">=&gt;</span><br/><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-3">let</span><span class="hl-1"> </span><span class="hl-0">node</span><span class="hl-1"> = </span><span class="hl-0">req</span><span class="hl-1">.</span><span class="hl-2">getDocumentElement</span><span class="hl-1">();</span><br/><span class="hl-1"> </span><span class="hl-4">// Process XML DOM...</span><br/><span class="hl-1">});</span>
</code></pre>
<p>So for example, to load a diagram into an existing graph model, the
following code is used.</p>
<pre><code class="language-javascript"><span class="hl-0">mxUtils</span><span class="hl-1">.</span><span class="hl-2">get</span><span class="hl-1">(</span><span class="hl-0">url</span><span class="hl-1">, (</span><span class="hl-0">req</span><span class="hl-1">)</span><span class="hl-3">=&gt;</span><br/><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-3">let</span><span class="hl-1"> </span><span class="hl-0">node</span><span class="hl-1"> = </span><span class="hl-0">req</span><span class="hl-1">.</span><span class="hl-2">getDocumentElement</span><span class="hl-1">();</span><br/><span class="hl-1"> </span><span class="hl-3">let</span><span class="hl-1"> </span><span class="hl-0">dec</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-2">Codec</span><span class="hl-1">(</span><span class="hl-0">node</span><span class="hl-1">.</span><span class="hl-0">ownerDocument</span><span class="hl-1">);</span><br/><span class="hl-1"> </span><span class="hl-0">dec</span><span class="hl-1">.</span><span class="hl-2">decode</span><span class="hl-1">(</span><span class="hl-0">node</span><span class="hl-1">, </span><span class="hl-0">graph</span><span class="hl-1">.</span><span class="hl-2">getDataModel</span><span class="hl-1">());</span><br/><span class="hl-1">});</span>
</code></pre>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>url: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>URL to get the data from.</p>
</div></div></li><li><h5>onload: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Function</span><span class="tsd-signature-symbol"> = null</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Optional function to execute for a successful response.</p>
</div></div></li><li><h5>onerror: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Function</span><span class="tsd-signature-symbol"> = null</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Optional function to execute on error.</p>
</div></div></li><li><h5>binary: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = false</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Optional boolean parameter that specifies if the request is
binary.</p>
</div></div></li><li><h5>timeout: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> = null</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Optional timeout in ms before calling ontimeout.</p>
</div></div></li><li><h5>ontimeout: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Function</span><span class="tsd-signature-symbol"> = null</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Optional function to execute on timeout.</p>
</div></div></li><li><h5>headers: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">{}</span><span class="tsd-signature-symbol"> = null</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Optional with headers, eg. {&#39;Authorization&#39;: &#39;token xyz&#39;}</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <a href="classes/MaxXmlRequest.html" class="tsd-signature-type" data-tsd-kind="Class">MaxXmlRequest</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-function"><a id="getAll" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagConst">Const</span> get<wbr/>All</h3><ul class="tsd-signatures tsd-kind-function"><li class="tsd-signature tsd-kind-icon">get<wbr/>All<span class="tsd-signature-symbol">(</span>urls<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span>, onload<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>arg0<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span>, onerror<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</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><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/util/MaxXmlRequest.ts#L482">util/MaxXmlRequest.ts:482</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Loads the URLs in the given array <em>asynchronously</em> and invokes the given function
if all requests returned with a valid 2xx status. The error handler is invoked
once on the first error or invalid response.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>urls: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Array of URLs to be loaded.</p>
</div></div></li><li><h5>onload: <span class="tsd-signature-symbol">(</span>arg0<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Callback with array of {@link XmlRequests}.</p>
</div></div><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-kind-type-literal"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>arg0<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</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"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>arg0: <span class="tsd-signature-type">any</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li><li><h5>onerror: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Optional function to execute on error.</p>
</div></div><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-kind-type-literal"><li class="tsd-signature tsd-kind-icon"><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></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></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-function"><a id="load" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagConst">Const</span> load</h3><ul class="tsd-signatures tsd-kind-function"><li class="tsd-signature tsd-kind-icon">load<span class="tsd-signature-symbol">(</span>url<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><a href="classes/MaxXmlRequest.html" class="tsd-signature-type" data-tsd-kind="Class">MaxXmlRequest</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/util/MaxXmlRequest.ts#L401">util/MaxXmlRequest.ts:401</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Loads the specified URL <em>synchronously</em> and returns the <MaxXmlRequest>.
Throws an exception if the file cannot be loaded. See {@link Utils#get} for
an asynchronous implementation.</p>
</div><div><p>Example:</p>
<pre><code class="language-javascript"><span class="hl-5">try</span><br/><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-3">let</span><span class="hl-1"> </span><span class="hl-0">req</span><span class="hl-1"> = </span><span class="hl-0">mxUtils</span><span class="hl-1">.</span><span class="hl-2">load</span><span class="hl-1">(</span><span class="hl-0">filename</span><span class="hl-1">);</span><br/><span class="hl-1"> </span><span class="hl-3">let</span><span class="hl-1"> </span><span class="hl-0">root</span><span class="hl-1"> = </span><span class="hl-0">req</span><span class="hl-1">.</span><span class="hl-2">getDocumentElement</span><span class="hl-1">();</span><br/><span class="hl-1"> </span><span class="hl-4">// Process XML DOM...</span><br/><span class="hl-1">}</span><br/><span class="hl-5">catch</span><span class="hl-1"> (</span><span class="hl-0">ex</span><span class="hl-1">)</span><br/><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-0">mxUtils</span><span class="hl-1">.</span><span class="hl-2">alert</span><span class="hl-1">(</span><span class="hl-6">&#39;Cannot load &#39;</span><span class="hl-1">+</span><span class="hl-0">filename</span><span class="hl-1">+</span><span class="hl-6">&#39;: &#39;</span><span class="hl-1">+</span><span class="hl-0">ex</span><span class="hl-1">);</span><br/><span class="hl-1">}</span>
</code></pre>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>url: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>URL to get the data from.</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <a href="classes/MaxXmlRequest.html" class="tsd-signature-type" data-tsd-kind="Class">MaxXmlRequest</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-function"><a id="popup" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagConst">Const</span> popup</h3><ul class="tsd-signatures tsd-kind-function"><li class="tsd-signature tsd-kind-icon">popup<span class="tsd-signature-symbol">(</span>content<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, isInternalWindow<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</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"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/gui/MaxWindow.ts#L956">gui/MaxWindow.ts:956</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Shows the specified text content in a new <MaxWindow> or a new browser
window if isInternalWindow is false.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>content: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>String that specifies the text to be displayed.</p>
</div></div></li><li><h5>isInternalWindow: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = false</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Optional boolean indicating if an MaxWindow should be
used instead of a new browser window. Default is false.</p>
</div></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-function"><a id="post" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagConst">Const</span> post</h3><ul class="tsd-signatures tsd-kind-function"><li class="tsd-signature tsd-kind-icon">post<span class="tsd-signature-symbol">(</span>url<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, params<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span>, onload<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Function</span>, onerror<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">null</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">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/util/MaxXmlRequest.ts#L547">util/MaxXmlRequest.ts:547</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Posts the specified params to the given URL <em>asynchronously</em> and invokes
the given functions depending on the request status. Returns the
<MaxXmlRequest> in use. Both functions take the <MaxXmlRequest> as the
only parameter. Make sure to use encodeURIComponent for the parameter
values.</p>
</div><div><p>Example:</p>
<pre><code class="language-javascript"><span class="hl-0">mxUtils</span><span class="hl-1">.</span><span class="hl-2">post</span><span class="hl-1">(</span><span class="hl-0">url</span><span class="hl-1">, </span><span class="hl-6">&#39;key=value&#39;</span><span class="hl-1">, (</span><span class="hl-0">req</span><span class="hl-1">)</span><span class="hl-3">=&gt;</span><br/><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-0">mxUtils</span><span class="hl-1">.</span><span class="hl-2">alert</span><span class="hl-1">(</span><span class="hl-6">&#39;Ready: &#39;</span><span class="hl-1">+</span><span class="hl-0">req</span><span class="hl-1">.</span><span class="hl-2">isReady</span><span class="hl-1">()+</span><span class="hl-6">&#39; Status: &#39;</span><span class="hl-1">+</span><span class="hl-0">req</span><span class="hl-1">.</span><span class="hl-2">getStatus</span><span class="hl-1">());</span><br/><span class="hl-1"> </span><span class="hl-4">// Process req.getDocumentElement() using DOM API if OK...</span><br/><span class="hl-1">});</span>
</code></pre>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>url: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>URL to get the data from.</p>
</div></div></li><li><h5>params: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = null</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Parameters for the post request.</p>
</div></div></li><li><h5>onload: <span class="tsd-signature-type">Function</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Optional function to execute for a successful response.</p>
</div></div></li><li><h5>onerror: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Function</span><span class="tsd-signature-symbol"> = null</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Optional function to execute on error.</p>
</div></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-function"><a id="submit" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagConst">Const</span> submit</h3><ul class="tsd-signatures tsd-kind-function"><li class="tsd-signature tsd-kind-icon">submit<span class="tsd-signature-symbol">(</span>url<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, params<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, doc<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">XMLDocument</span>, target<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"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/util/MaxXmlRequest.ts#L567">util/MaxXmlRequest.ts:567</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Submits the given parameters to the specified URL using
&lt;MaxXmlRequest.simulate&gt; and returns the <MaxXmlRequest>.
Make sure to use encodeURIComponent for the parameter
values.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>url: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>URL to get the data from.</p>
</div></div></li><li><h5>params: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Parameters for the form.</p>
</div></div></li><li><h5>doc: <span class="tsd-signature-type">XMLDocument</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Document to create the form in.</p>
</div></div></li><li><h5>target: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Target to send the form result to.</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class="current"><a href="index.html">Exports</a></li><li class=" tsd-kind-namespace"><a href="modules/DomHelpers.html">Dom<wbr/>Helpers</a></li><li class=" tsd-kind-namespace"><a href="modules/cloneUtils.html">clone<wbr/>Utils</a></li><li class=" tsd-kind-namespace"><a href="modules/constants.html">constants</a></li><li class=" tsd-kind-namespace"><a href="modules/domUtils.html">dom<wbr/>Utils</a></li><li class=" tsd-kind-namespace"><a href="modules/eventUtils.html">event<wbr/>Utils</a></li><li class=" tsd-kind-namespace"><a href="modules/gestureUtils.html">gesture<wbr/>Utils</a></li><li class=" tsd-kind-namespace"><a href="modules/mathUtils.html">math<wbr/>Utils</a></li><li class=" tsd-kind-namespace"><a href="modules/stringUtils.html">string<wbr/>Utils</a></li><li class=" tsd-kind-namespace"><a href="modules/styleUtils.html">style<wbr/>Utils</a></li><li class=" tsd-kind-namespace"><a href="modules/utils.html">utils</a></li><li class=" tsd-kind-namespace"><a href="modules/xmlUtils.html">xml<wbr/>Utils</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="tsd-kind-class"><a href="classes/AbstractCanvas2D.html" class="tsd-kind-icon">Abstract<wbr/>Canvas2D</a></li><li class="tsd-kind-class"><a href="classes/ActorShape.html" class="tsd-kind-icon">Actor<wbr/>Shape</a></li><li class="tsd-kind-class"><a href="classes/Animation.html" class="tsd-kind-icon">Animation</a></li><li class="tsd-kind-class"><a href="classes/ArrowConnectorShape.html" class="tsd-kind-icon">Arrow<wbr/>Connector<wbr/>Shape</a></li><li class="tsd-kind-class"><a href="classes/ArrowShape.html" class="tsd-kind-icon">Arrow<wbr/>Shape</a></li><li class="tsd-kind-class"><a href="classes/AutoSaveManager.html" class="tsd-kind-icon">Auto<wbr/>Save<wbr/>Manager</a></li><li class="tsd-kind-class"><a href="classes/Cell.html" class="tsd-kind-icon">Cell</a></li><li class="tsd-kind-class"><a href="classes/CellArray.html" class="tsd-kind-icon">Cell<wbr/>Array</a></li><li class="tsd-kind-class"><a href="classes/CellAttributeChange.html" class="tsd-kind-icon">Cell<wbr/>Attribute<wbr/>Change</a></li><li class="tsd-kind-class"><a href="classes/CellCodec.html" class="tsd-kind-icon">Cell<wbr/>Codec</a></li><li class="tsd-kind-class"><a href="classes/CellEditorHandler.html" class="tsd-kind-icon">Cell<wbr/>Editor<wbr/>Handler</a></li><li class="tsd-kind-class"><a href="classes/CellHighlight.html" class="tsd-kind-icon">Cell<wbr/>Highlight</a></li><li class="tsd-kind-class"><a href="classes/CellMarker.html" class="tsd-kind-icon">Cell<wbr/>Marker</a></li><li class="tsd-kind-class"><a href="classes/CellOverlay.html" class="tsd-kind-icon">Cell<wbr/>Overlay</a></li><li class="tsd-kind-class"><a href="classes/CellPath.html" class="tsd-kind-icon">Cell<wbr/>Path</a></li><li class="tsd-kind-class"><a href="classes/CellRenderer.html" class="tsd-kind-icon">Cell<wbr/>Renderer</a></li><li class="tsd-kind-class"><a href="classes/CellState.html" class="tsd-kind-icon">Cell<wbr/>State</a></li><li class="tsd-kind-class"><a href="classes/CellStatePreview.html" class="tsd-kind-icon">Cell<wbr/>State<wbr/>Preview</a></li><li class="tsd-kind-class"><a href="classes/CellTracker.html" class="tsd-kind-icon">Cell<wbr/>Tracker</a></li><li class="tsd-kind-class"><a href="classes/ChildChange.html" class="tsd-kind-icon">Child<wbr/>Change</a></li><li class="tsd-kind-class"><a href="classes/ChildChangeCodec.html" class="tsd-kind-icon">Child<wbr/>Change<wbr/>Codec</a></li><li class="tsd-kind-class"><a href="classes/CircleLayout.html" class="tsd-kind-icon">Circle<wbr/>Layout</a></li><li class="tsd-kind-class"><a href="classes/Client.html" class="tsd-kind-icon">Client</a></li><li class="tsd-kind-class"><a href="classes/Clipboard.html" class="tsd-kind-icon">Clipboard</a></li><li class="tsd-kind-class"><a href="classes/CloudShape.html" class="t