maxGraph/docs/api/classes/CellOverlay.html

102 lines
43 KiB
HTML

<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>CellOverlay | @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"><ul class="tsd-breadcrumb"><li><a href="../index.html">@maxgraph/core</a></li><li><a href="CellOverlay.html">CellOverlay</a></li></ul><h1>Class CellOverlay</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
<p>Extends <a href="EventSource.html">EventSource</a> to implement a graph overlay, represented by an icon
and a tooltip. Overlays can handle and fire <click> events and are added to
the graph using {@link Graph#addCellOverlay}, and removed using
{@link Graph#removeCellOverlay}, or {@link Graph#removeCellOverlays} to remove all overlays.
The {@link Graph#getCellOverlays} function returns the array of overlays for a given
cell in a graph. If multiple overlays exist for the same cell, then
<getBounds> should be overridden in at least one of the overlays.</p>
</div><div><p>Overlays appear on top of all cells in a special layer. If this is not
desirable, then the image must be rendered as part of the shape or label of
the cell instead.</p>
<p>Example:</p>
<p>The following adds a new overlays for a given vertex and selects the cell
if the overlay is clicked.</p>
<pre><code class="language-javascript"><span class="hl-3">let</span><span class="hl-1"> </span><span class="hl-0">overlay</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-2">CellOverlay</span><span class="hl-1">(</span><span class="hl-0">img</span><span class="hl-1">, </span><span class="hl-0">html</span><span class="hl-1">);</span><br/><span class="hl-0">graph</span><span class="hl-1">.</span><span class="hl-2">addCellOverlay</span><span class="hl-1">(</span><span class="hl-0">vertex</span><span class="hl-1">, </span><span class="hl-0">overlay</span><span class="hl-1">);</span><br/><span class="hl-0">overlay</span><span class="hl-1">.</span><span class="hl-2">addListener</span><span class="hl-1">(</span><span class="hl-0">mxEvent</span><span class="hl-1">.</span><span class="hl-7">CLICK</span><span class="hl-1">, (</span><span class="hl-0">sender</span><span class="hl-1">, </span><span class="hl-0">evt</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">cell</span><span class="hl-1"> = </span><span class="hl-0">evt</span><span class="hl-1">.</span><span class="hl-2">getProperty</span><span class="hl-1">(</span><span class="hl-6">&#39;cell&#39;</span><span class="hl-1">);</span><br/><span class="hl-1"> </span><span class="hl-0">graph</span><span class="hl-1">.</span><span class="hl-2">setSelectionCell</span><span class="hl-1">(</span><span class="hl-0">cell</span><span class="hl-1">);</span><br/><span class="hl-1">});</span>
</code></pre>
<p>For cell overlays to be printed use {@link PrintPreview#printOverlays}.</p>
<p>Event: mxEvent.CLICK</p>
<p>Fires when the user clicks on the overlay. The <code>event</code> property
contains the corresponding mouse event and the <code>cell</code> property
contains the cell. For touch devices this is fired if the element receives
a touchend event.</p>
<p>Constructor: CellOverlay</p>
<p>Constructs a new overlay using the given image and tooltip.</p>
</div><dl class="tsd-comment-tags"><dt>param image</dt><dd><p>{@link Image} that represents the icon to be displayed.</p>
</dd><dt>param tooltip</dt><dd><p>Optional string that specifies the tooltip.</p>
</dd><dt>param align</dt><dd><p>Optional horizontal alignment for the overlay. Possible
values are <ALIGN_LEFT>, <ALIGN_CENTER> and <ALIGN_RIGHT>
(default).</p>
</dd><dt>param verticalAlign</dt><dd><p>Vertical alignment for the overlay. Possible
values are <ALIGN_TOP>, <ALIGN_MIDDLE> and <ALIGN_BOTTOM>
(default).</p>
</dd></dl></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><a href="EventSource.html" class="tsd-signature-type" data-tsd-kind="Class">EventSource</a><ul class="tsd-hierarchy"><li><span class="target">CellOverlay</span></li></ul></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Constructors</h3><ul class="tsd-index-list"><li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-overwrite"><a href="CellOverlay.html#constructor" class="tsd-kind-icon">constructor</a></li></ul></section><section class="tsd-index-section "><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-class"><a href="CellOverlay.html#align" class="tsd-kind-icon">align</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="CellOverlay.html#cursor" class="tsd-kind-icon">cursor</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="CellOverlay.html#defaultOverlap" class="tsd-kind-icon">default<wbr/>Overlap</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="CellOverlay.html#eventListeners" class="tsd-kind-icon">event<wbr/>Listeners</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="CellOverlay.html#eventSource" class="tsd-kind-icon">event<wbr/>Source</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="CellOverlay.html#eventsEnabled" class="tsd-kind-icon">events<wbr/>Enabled</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="CellOverlay.html#image" class="tsd-kind-icon">image</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="CellOverlay.html#offset" class="tsd-kind-icon">offset</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="CellOverlay.html#tooltip" class="tsd-kind-icon">tooltip</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="CellOverlay.html#verticalAlign" class="tsd-kind-icon">vertical<wbr/>Align</a></li></ul></section><section class="tsd-index-section "><h3>Methods</h3><ul class="tsd-index-list"><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="CellOverlay.html#addListener" class="tsd-kind-icon">add<wbr/>Listener</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="CellOverlay.html#fireEvent" class="tsd-kind-icon">fire<wbr/>Event</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="CellOverlay.html#getBounds" class="tsd-kind-icon">get<wbr/>Bounds</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="CellOverlay.html#getEventSource" class="tsd-kind-icon">get<wbr/>Event<wbr/>Source</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="CellOverlay.html#isEventsEnabled" class="tsd-kind-icon">is<wbr/>Events<wbr/>Enabled</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="CellOverlay.html#removeListener" class="tsd-kind-icon">remove<wbr/>Listener</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="CellOverlay.html#setEventSource" class="tsd-kind-icon">set<wbr/>Event<wbr/>Source</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="CellOverlay.html#setEventsEnabled" class="tsd-kind-icon">set<wbr/>Events<wbr/>Enabled</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="CellOverlay.html#toString" class="tsd-kind-icon">to<wbr/>String</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Constructors</h2><section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class tsd-is-overwrite"><a id="constructor" class="tsd-anchor"></a><h3>constructor</h3><ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class tsd-is-overwrite"><li class="tsd-signature tsd-kind-icon">new <wbr/>Cell<wbr/>Overlay<span class="tsd-signature-symbol">(</span>image<span class="tsd-signature-symbol">: </span><a href="ImageBox.html" class="tsd-signature-type" data-tsd-kind="Class">ImageBox</a>, tooltip<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>, align<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span>, verticalAlign<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span>, offset<span class="tsd-signature-symbol">?: </span><a href="Point.html" class="tsd-signature-type" data-tsd-kind="Class">Point</a>, cursor<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="CellOverlay.html" class="tsd-signature-type" data-tsd-kind="Class">CellOverlay</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Overrides <a href="EventSource.html">EventSource</a>.<a href="EventSource.html#constructor">constructor</a></p><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/cell/CellOverlay.ts#L65">view/cell/CellOverlay.ts:65</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>image: <a href="ImageBox.html" class="tsd-signature-type" data-tsd-kind="Class">ImageBox</a></h5></li><li><h5>tooltip: <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></li><li><h5>align: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = &#39;right&#39;</span></h5></li><li><h5>verticalAlign: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = &#39;bottom&#39;</span></h5></li><li><h5>offset: <a href="Point.html" class="tsd-signature-type" data-tsd-kind="Class">Point</a><span class="tsd-signature-symbol"> = ...</span></h5></li><li><h5>cursor: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = &#39;help&#39;</span></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="CellOverlay.html" class="tsd-signature-type" data-tsd-kind="Class">CellOverlay</a></h4></li></ul></section></section><section class="tsd-panel-group tsd-member-group "><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="align" class="tsd-anchor"></a><h3>align</h3><div class="tsd-signature tsd-kind-icon">align<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">&quot;left&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;center&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;right&quot;</span><span class="tsd-signature-symbol"> = &#39;right&#39;</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/cell/CellOverlay.ts#L96">view/cell/CellOverlay.ts:96</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Holds the horizontal alignment for the overlay. Default is
{@link Constants#ALIGN_RIGHT}. For edges, the overlay always appears in the
center of the edge.</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="cursor" class="tsd-anchor"></a><h3>cursor</h3><div class="tsd-signature tsd-kind-icon">cursor<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = &#39;help&#39;</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/cell/CellOverlay.ts#L114">view/cell/CellOverlay.ts:114</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Holds the cursor for the overlay. Default is &#39;help&#39;.</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="defaultOverlap" class="tsd-anchor"></a><h3>default<wbr/>Overlap</h3><div class="tsd-signature tsd-kind-icon">default<wbr/>Overlap<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> = 0.5</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/cell/CellOverlay.ts#L120">view/cell/CellOverlay.ts:120</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Defines the overlapping for the overlay, that is, the proportional distance
from the origin to the point defined by the alignment. Default is 0.5.</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a id="eventListeners" class="tsd-anchor"></a><h3>event<wbr/>Listeners</h3><div class="tsd-signature tsd-kind-icon">event<wbr/>Listeners<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">EventListenerObject</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> = []</span></div><aside class="tsd-sources"><p>Inherited from <a href="EventSource.html">EventSource</a>.<a href="EventSource.html#eventListeners">eventListeners</a></p><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/event/EventSource.ts#L45">view/event/EventSource.ts:45</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Holds the event names and associated listeners in an array. The array
contains the event name followed by the respective listener for each
registered listener.</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a id="eventSource" class="tsd-anchor"></a><h3>event<wbr/>Source</h3><div class="tsd-signature tsd-kind-icon">event<wbr/>Source<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">EventTarget</span><span class="tsd-signature-symbol"> = null</span></div><aside class="tsd-sources"><p>Inherited from <a href="EventSource.html">EventSource</a>.<a href="EventSource.html#eventSource">eventSource</a></p><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/event/EventSource.ts#L55">view/event/EventSource.ts:55</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Optional source for events. Default is null.</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a id="eventsEnabled" class="tsd-anchor"></a><h3>events<wbr/>Enabled</h3><div class="tsd-signature tsd-kind-icon">events<wbr/>Enabled<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = true</span></div><aside class="tsd-sources"><p>Inherited from <a href="EventSource.html">EventSource</a>.<a href="EventSource.html#eventsEnabled">eventsEnabled</a></p><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/event/EventSource.ts#L50">view/event/EventSource.ts:50</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Specifies if events can be fired. Default is true.</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="image" class="tsd-anchor"></a><h3>image</h3><div class="tsd-signature tsd-kind-icon">image<span class="tsd-signature-symbol">:</span> <a href="ImageBox.html" class="tsd-signature-type" data-tsd-kind="Class">ImageBox</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/cell/CellOverlay.ts#L84">view/cell/CellOverlay.ts:84</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Holds the {@link Image} to be used as the icon.</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="offset" class="tsd-anchor"></a><h3>offset</h3><div class="tsd-signature tsd-kind-icon">offset<span class="tsd-signature-symbol">:</span> <a href="Point.html" class="tsd-signature-type" data-tsd-kind="Class">Point</a><span class="tsd-signature-symbol"> = ...</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/cell/CellOverlay.ts#L109">view/cell/CellOverlay.ts:109</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Holds the offset as an <a href="Point.html">Point</a>. The offset will be scaled according to the
current scale.</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="tooltip" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> tooltip</h3><div class="tsd-signature tsd-kind-icon">tooltip<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></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/cell/CellOverlay.ts#L89">view/cell/CellOverlay.ts:89</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Holds the optional string to be used as the tooltip.</p>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a id="verticalAlign" class="tsd-anchor"></a><h3>vertical<wbr/>Align</h3><div class="tsd-signature tsd-kind-icon">vertical<wbr/>Align<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">&quot;top&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;middle&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;bottom&quot;</span><span class="tsd-signature-symbol"> = &#39;bottom&#39;</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/cell/CellOverlay.ts#L103">view/cell/CellOverlay.ts:103</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Holds the vertical alignment for the overlay. Default is
{@link Constants#ALIGN_BOTTOM}. For edges, the overlay always appears in the
center of the edge.</p>
</div></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Methods</h2><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a id="addListener" class="tsd-anchor"></a><h3>add<wbr/>Listener</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><li class="tsd-signature tsd-kind-icon">add<wbr/>Listener<span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, funct<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"><p>Inherited from <a href="EventSource.html">EventSource</a>.<a href="EventSource.html#addListener">addListener</a></p><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/event/EventSource.ts#L91">view/event/EventSource.ts:91</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Binds the specified function to the given event name. If no event name
is given, then the listener is registered for all events.</p>
</div><div><p>The parameters of the listener are the sender and an <a href="EventObject.html">EventObject</a>.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>name: <span class="tsd-signature-type">string</span></h5></li><li><h5>funct: <span class="tsd-signature-type">Function</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a id="fireEvent" class="tsd-anchor"></a><h3>fire<wbr/>Event</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><li class="tsd-signature tsd-kind-icon">fire<wbr/>Event<span class="tsd-signature-symbol">(</span>evt<span class="tsd-signature-symbol">: </span><a href="EventObject.html" class="tsd-signature-type" data-tsd-kind="Class">EventObject</a>, sender<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">EventTarget</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"><p>Inherited from <a href="EventSource.html">EventSource</a>.<a href="EventSource.html#fireEvent">fireEvent</a></p><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/event/EventSource.ts#L125">view/event/EventSource.ts:125</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Dispatches the given event to the listeners which are registered for
the event. The sender argument is optional. The current execution scope
(&quot;this&quot;) is used for the listener invocation (see {@link Utils#bind}).</p>
</div><div><p>Example:</p>
<pre><code class="language-javascript"><span class="hl-2">fireEvent</span><span class="hl-1">(</span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-2">mxEventObject</span><span class="hl-1">(</span><span class="hl-6">&quot;eventName&quot;</span><span class="hl-1">, </span><span class="hl-0">key1</span><span class="hl-1">, </span><span class="hl-0">val1</span><span class="hl-1">, .., </span><span class="hl-0">keyN</span><span class="hl-1">, </span><span class="hl-0">valN</span><span class="hl-1">))</span>
</code></pre>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>evt: <a href="EventObject.html" class="tsd-signature-type" data-tsd-kind="Class">EventObject</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p><a href="EventObject.html">EventObject</a> that represents the event.</p>
</div></div></li><li><h5>sender: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">EventTarget</span><span class="tsd-signature-symbol"> = null</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Optional sender to be passed to the listener. Default value is
the return value of <getEventSource>.</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-method tsd-parent-kind-class"><a id="getBounds" class="tsd-anchor"></a><h3>get<wbr/>Bounds</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">get<wbr/>Bounds<span class="tsd-signature-symbol">(</span>state<span class="tsd-signature-symbol">: </span><a href="CellState.html" class="tsd-signature-type" data-tsd-kind="Class">CellState</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="Rectangle.html" class="tsd-signature-type" data-tsd-kind="Class">Rectangle</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/view/cell/CellOverlay.ts#L151">view/cell/CellOverlay.ts:151</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Returns the bounds of the overlay for the given <CellState> as an
<a href="Rectangle.html">Rectangle</a>. This should be overridden when using multiple overlays
per cell so that the overlays do not overlap.</p>
</div><div><p>The following example will place the overlay along an edge (where
x=[-1..1] from the start to the end of the edge and y is the
orthogonal offset in px).</p>
<pre><code class="language-javascript"><span class="hl-0">overlay</span><span class="hl-1">.</span><span class="hl-2">getBounds</span><span class="hl-1"> = </span><span class="hl-3">function</span><span class="hl-1">(</span><span class="hl-0">state</span><span class="hl-1">)</span><br/><span class="hl-1">{</span><br/><span class="hl-1"> </span><span class="hl-3">var</span><span class="hl-1"> </span><span class="hl-0">bounds</span><span class="hl-1"> = </span><span class="hl-0">getBounds</span><span class="hl-1">.</span><span class="hl-2">apply</span><span class="hl-1">(</span><span class="hl-3">this</span><span class="hl-1">, </span><span class="hl-3">arguments</span><span class="hl-1">);</span><br/><br/><span class="hl-1"> </span><span class="hl-5">if</span><span class="hl-1"> (</span><span class="hl-0">state</span><span class="hl-1">.</span><span class="hl-0">view</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><span class="hl-2">isEdge</span><span class="hl-1">(</span><span class="hl-0">state</span><span class="hl-1">.</span><span class="hl-0">cell</span><span class="hl-1">))</span><br/><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-3">var</span><span class="hl-1"> </span><span class="hl-0">pt</span><span class="hl-1"> = </span><span class="hl-0">state</span><span class="hl-1">.</span><span class="hl-0">view</span><span class="hl-1">.</span><span class="hl-2">getPoint</span><span class="hl-1">(</span><span class="hl-0">state</span><span class="hl-1">, {</span><span class="hl-0">x:</span><span class="hl-1"> </span><span class="hl-8">0</span><span class="hl-1">, </span><span class="hl-0">y:</span><span class="hl-1"> </span><span class="hl-8">0</span><span class="hl-1">, </span><span class="hl-0">relative:</span><span class="hl-1"> </span><span class="hl-3">true</span><span class="hl-1">});</span><br/><br/><span class="hl-1"> </span><span class="hl-0">bounds</span><span class="hl-1">.</span><span class="hl-0">x</span><span class="hl-1"> = </span><span class="hl-0">pt</span><span class="hl-1">.</span><span class="hl-0">x</span><span class="hl-1"> - </span><span class="hl-0">bounds</span><span class="hl-1">.</span><span class="hl-0">width</span><span class="hl-1"> / </span><span class="hl-8">2</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-0">bounds</span><span class="hl-1">.</span><span class="hl-0">y</span><span class="hl-1"> = </span><span class="hl-0">pt</span><span class="hl-1">.</span><span class="hl-0">y</span><span class="hl-1"> - </span><span class="hl-0">bounds</span><span class="hl-1">.</span><span class="hl-0">height</span><span class="hl-1"> / </span><span class="hl-8">2</span><span class="hl-1">;</span><br/><span class="hl-1"> }</span><br/><br/><span class="hl-1"> </span><span class="hl-5">return</span><span class="hl-1"> </span><span class="hl-0">bounds</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>state: <a href="CellState.html" class="tsd-signature-type" data-tsd-kind="Class">CellState</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p><CellState> that represents the current state of the
associated cell.</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <a href="Rectangle.html" class="tsd-signature-type" data-tsd-kind="Class">Rectangle</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a id="getEventSource" class="tsd-anchor"></a><h3>get<wbr/>Event<wbr/>Source</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><li class="tsd-signature tsd-kind-icon">get<wbr/>Event<wbr/>Source<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">EventTarget</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="EventSource.html">EventSource</a>.<a href="EventSource.html#getEventSource">getEventSource</a></p><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/event/EventSource.ts#L74">view/event/EventSource.ts:74</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Returns <eventSource>.</p>
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">EventTarget</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a id="isEventsEnabled" class="tsd-anchor"></a><h3>is<wbr/>Events<wbr/>Enabled</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><li class="tsd-signature tsd-kind-icon">is<wbr/>Events<wbr/>Enabled<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="EventSource.html">EventSource</a>.<a href="EventSource.html#isEventsEnabled">isEventsEnabled</a></p><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/event/EventSource.ts#L60">view/event/EventSource.ts:60</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Returns <eventsEnabled>.</p>
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a id="removeListener" class="tsd-anchor"></a><h3>remove<wbr/>Listener</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><li class="tsd-signature tsd-kind-icon">remove<wbr/>Listener<span class="tsd-signature-symbol">(</span>funct<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"><p>Inherited from <a href="EventSource.html">EventSource</a>.<a href="EventSource.html#removeListener">removeListener</a></p><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/event/EventSource.ts#L98">view/event/EventSource.ts:98</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Removes all occurrences of the given listener from <eventListeners>.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>funct: <span class="tsd-signature-type">Function</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a id="setEventSource" class="tsd-anchor"></a><h3>set<wbr/>Event<wbr/>Source</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><li class="tsd-signature tsd-kind-icon">set<wbr/>Event<wbr/>Source<span class="tsd-signature-symbol">(</span>value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">EventTarget</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"><p>Inherited from <a href="EventSource.html">EventSource</a>.<a href="EventSource.html#setEventSource">setEventSource</a></p><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/event/EventSource.ts#L81">view/event/EventSource.ts:81</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Sets <eventSource>.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>value: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">EventTarget</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a id="setEventsEnabled" class="tsd-anchor"></a><h3>set<wbr/>Events<wbr/>Enabled</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><li class="tsd-signature tsd-kind-icon">set<wbr/>Events<wbr/>Enabled<span class="tsd-signature-symbol">(</span>value<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"><p>Inherited from <a href="EventSource.html">EventSource</a>.<a href="EventSource.html#setEventsEnabled">setEventsEnabled</a></p><ul><li>Defined in <a href="https://github.com/maxgraph/maxgraph/blob/598b60e2f/packages/core/src/view/event/EventSource.ts#L67">view/event/EventSource.ts:67</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Sets <eventsEnabled>.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>value: <span class="tsd-signature-type">boolean</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="toString" class="tsd-anchor"></a><h3>to<wbr/>String</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">to<wbr/>String<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><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></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/view/cell/CellOverlay.ts#L207">view/cell/CellOverlay.ts:207</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Returns the textual representation of the overlay to be used as the
tooltip. This implementation returns <tooltip>.</p>
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">undefined</span><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></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=""><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="current tsd-kind-class"><a href="CellOverlay.html" class="tsd-kind-icon">Cell<wbr/>Overlay</a><ul><li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-overwrite"><a href="CellOverlay.html#constructor" class="tsd-kind-icon">constructor</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="CellOverlay.html#align" class="tsd-kind-icon">align</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="CellOverlay.html#cursor" class="tsd-kind-icon">cursor</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="CellOverlay.html#defaultOverlap" class="tsd-kind-icon">default<wbr/>Overlap</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="CellOverlay.html#eventListeners" class="tsd-kind-icon">event<wbr/>Listeners</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="CellOverlay.html#eventSource" class="tsd-kind-icon">event<wbr/>Source</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="CellOverlay.html#eventsEnabled" class="tsd-kind-icon">events<wbr/>Enabled</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="CellOverlay.html#image" class="tsd-kind-icon">image</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="CellOverlay.html#offset" class="tsd-kind-icon">offset</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="CellOverlay.html#tooltip" class="tsd-kind-icon">tooltip</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="CellOverlay.html#verticalAlign" class="tsd-kind-icon">vertical<wbr/>Align</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="CellOverlay.html#addListener" class="tsd-kind-icon">add<wbr/>Listener</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="CellOverlay.html#fireEvent" class="tsd-kind-icon">fire<wbr/>Event</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="CellOverlay.html#getBounds" class="tsd-kind-icon">get<wbr/>Bounds</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="CellOverlay.html#getEventSource" class="tsd-kind-icon">get<wbr/>Event<wbr/>Source</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="CellOverlay.html#isEventsEnabled" class="tsd-kind-icon">is<wbr/>Events<wbr/>Enabled</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="CellOverlay.html#removeListener" class="tsd-kind-icon">remove<wbr/>Listener</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="CellOverlay.html#setEventSource" class="tsd-kind-icon">set<wbr/>Event<wbr/>Source</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="CellOverlay.html#setEventsEnabled" class="tsd-kind-icon">set<wbr/>Events<wbr/>Enabled</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="CellOverlay.html#toString" class="tsd-kind-icon">to<wbr/>String</a></li></ul></li></ul></nav></div></div></div><footer class="with-border-bottom"><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li><li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li><li class="tsd-kind-accessor tsd-parent-kind-class"><span class="tsd-kind-icon">Accessor</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li><li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited accessor</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="container tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="../assets/main.js"></script></body></html>