Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependencies #50

Closed
SteveOW opened this issue Aug 14, 2020 · 3 comments
Closed

Dependencies #50

SteveOW opened this issue Aug 14, 2020 · 3 comments

Comments

@SteveOW
Copy link

SteveOW commented Aug 14, 2020

Hi,

I am trying to use your library (with THREE.js).

I tried to run the example javascript code inside an HTML file with the line:

<script src="https://d3js.org/d3-contour.v1.min.js"></script>

At the line:
var contours = d3.contours()
.size([n, m])
.thresholds(d3.range(2, 21).map(p => Math.pow(2, p)))
(values);

I got the error message: "TypeError: d3.range is not a function".

I guess I need to link another library?

@Fil
Copy link
Member

Fil commented Aug 14, 2020

Yes in that case you would need to add <script src="https://d3js.org/d3-array.v2.min.js"></script>

We should edit the README and replace d3.range by native JS:
Array.from({ length: 19 }, (_, i) => Math.pow(2, i + 2))

@SteveOW
Copy link
Author

SteveOW commented Aug 15, 2020

@Fil

Thanks very much.

It works now when I link in the d3-array.v2.min.js file.

@Fil Fil closed this as completed in 854d2af Aug 15, 2020
@Fil
Copy link
Member

Fil commented Aug 15, 2020

I managed to make a mistake when updating README: 8b837a9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants