Skip to content

Commit

Permalink
Replace var with const
Browse files Browse the repository at this point in the history
  • Loading branch information
Niekes committed Dec 18, 2023
1 parent a5bd371 commit 9837e72
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,22 @@ import { _3d } from 'd3-3d';
With **d3-3d** you can easily visualize your 3d data.

```js
var data3D = [
const data3D = [
[
[0, -1, 0],
[-1, 1, 0],
[1, 1, 0]
]
];

var triangles3D = d3._3d().scale(100).origin([480, 250]).shape('TRIANGLE');
const triangles3D = d3._3d().scale(100).origin([480, 250]).shape('TRIANGLE');

var projectedData = triangles3D(data3D);
const projectedData = triangles3D(data3D);

init(projectedData);

function init(data) {
var triangles = svg.selectAll('path').data(data);
const triangles = svg.selectAll('path').data(data);

// add your logic here...
}
Expand Down Expand Up @@ -118,7 +118,7 @@ Sets the shape to _shape_. If _shape_ is not specified the current shape will be
If _shape_ is specified, sets the shape to the specified shape and returns the **d3-3d** function object. If _shape_ is not specified, returns the current shape.

```js
var triangles3D = d3._3d().shape('TRIANGLE');
const triangles3D = d3._3d().shape('TRIANGLE');
```

<a name="x" href="#x">#</a> \_3d.<b>x</b>([x]) [<>](https://github.com/Niekes/d3-3d/blob/master/src/point.js#L1 'Source')
Expand Down

0 comments on commit 9837e72

Please sign in to comment.