Skip to content

Commit

Permalink
Correct errors in docs for node.layoutDimensions() #2080
Browse files Browse the repository at this point in the history
  • Loading branch information
maxkfranz committed Mar 22, 2018
1 parent 84f2965 commit d2691ef
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions documentation/md/collection/layoutDimensions.md
@@ -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 );
```

0 comments on commit d2691ef

Please sign in to comment.