Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correct errors in docs for
node.layoutDimensions()
#2080
- Loading branch information
Showing
1 changed file
with
5 additions
and
3 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,9 +1,11 @@ | ||
This function is used to retrieve the width and height of the bounding box of a node. The way the width and height are calculated is affected by the options object which is passed in. | ||
|
||
It returns an object containing the width and height of the calculated bounding box under the `x` and `y` keys respectively. It can be used as a direct replacement for the `boundingBox()` function assuming only `x` and `y` values are needed. | ||
It returns an object containing the width and height of the calculated bounding box under the `w` and `h` keys respectively. It can be used as a direct replacement for the `boundingBox()` function assuming only `w` and `h` values are needed. | ||
|
||
```js | ||
var options = { | ||
nodeDimensionsIncludeLabels: false, // Boolean which changes whether label dimensions are included when calculating node dimensions | ||
} | ||
nodeDimensionsIncludeLabels: true, // Boolean which changes whether label dimensions are included when calculating node dimensions, default true | ||
}; | ||
|
||
var dims = cy.nodes().first().layoutDimensions( options ); | ||
``` |