-
Notifications
You must be signed in to change notification settings - Fork 857
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dia.Cell)!: add mergeArrays options to constructor
- Loading branch information
1 parent
88c2221
commit e0cf97a
Showing
4 changed files
with
50 additions
and
2 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
packages/joint-core/docs/src/joint/api/dia/Cell/constructor.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<pre class="docs-method-signature"><code>new Cell([attributes], [options])</code></pre> | ||
|
||
<p>When creating an instance of a cell, you can pass in the initial values of the attributes, which will be set on the model.</p> | ||
|
||
<p>If you pass a <code>{ mergeArrays: true }</code> as the options, all the arrays defined as class defaults will be merged instead of overridden.</p> | ||
|
||
<pre><code>const MyRect = joint.shapes.standard.Rectangle.define('Rect', { array: [1,2] }); | ||
|
||
const rect1 = new MyRect({ array: [3] }); | ||
console.log(rect1.get('array')); // [3] array was overridden | ||
|
||
const rect2 = new MyRect({ array: [3] }, { mergeArrays: true }); | ||
console.log(rect2.get('array')); // [3,2] array was merged </code></pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters