Skip to content

Commit

Permalink
Add documentation for removed collections
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexithemia authored Aug 15, 2022
1 parent 62e7fef commit 71f065c
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion documentation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1664,7 +1664,7 @@ <h3 id="examples">Examples</h3>



<div class="descr"><p>Return a new, empty collection.</p>
<div class="descr"><p>Return a new collection, empty or with new elements in a removed state.</p>
</div>

<div class="formats">
Expand All @@ -1673,6 +1673,15 @@ <h3 id="examples">Examples</h3>


<div class="descr"><p>Get an empty collection.</p>
</div>
<ul class="args">
</ul>
</div>
<div class="format">
<div class="name">cy.collection(eleObjs, { removed: true })</div>


<div class="descr"><p>Create a collection with new elements in a removed state</p>
</div>
<ul class="args">
</ul>
Expand All @@ -1691,6 +1700,14 @@ <h3 id="examples">Examples</h3>
collection = collection.union(clickedNode);
});
</code></pre>

<p>Create a collection of new nodes that have not been added to the graph:</p>
<pre><code class="language-js">
<span class="hljs-keyword">var</span> removedCollection = cy.collection([{ data: { id: 'a' } }, { data: { id: 'b' } }], { removed: true });
removedCollection.forEach(element => {
console.log(element.removed()); // true
};
</code></pre>
<button class="run run-inline-code"><span class="fa fa-play"></span></button>
</div>
</div>
Expand Down

0 comments on commit 71f065c

Please # to comment.