quantumpotato quantumpotato - 4 months ago 362
HTML Question

d3 layout is undefined

Trying to use d3.js and not sure how to reference it properly:

```

!DOCTYPE html>
<head>
<link rel="stylesheet" href="bootstrap.min.css">
<script src="jquery-1.7.1.js"></script>
<<<<other scripts>>>
<script src="topbar.js"></script>
<script>
$(function() {
var n = 4, // number of layers
m = 64, // number of samples per layer
data = d3.layout.stack()(stream_layers(n, m, .1)),
color = d3.interpolateRgb("#aad", "#556");
```

Answer

Ad following line in your page.

<script type="text/javascript" src="your respective directory/d3.js"></script>

Now you can use any property or function in your page from d3.js

Comments