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

d3VoronoiMap.voronoiMap is not a function #9

Closed
JBatUN opened this issue Jul 18, 2019 · 2 comments
Closed

d3VoronoiMap.voronoiMap is not a function #9

JBatUN opened this issue Jul 18, 2019 · 2 comments

Comments

@JBatUN
Copy link

JBatUN commented Jul 18, 2019

Greetings,

Receiving the subject error from the below code:

var stratify = d3.stratify()
            .id(function(d) { return d.id_field; })
            .parentId(function(d) { return d.parent_field; });

let tree = stratify(data);

function weightAccessor(d) {
            return d.value_field;
}

var rootNode = d3.hierarchy(tree, d => d.values); 

rootNode.sum(weightAccessor);

var voronoiTreemap = d3.voronoiTreemap().clip([[0, 0], [0, h], [w, h], [w, 0]]);
voronoiTreemap(rootNode);

Using all the latest versions of the libs and loading in the correct order:

<script type="text/javascript" src="../libs/vendor/d3-weighted-voronoi.js"></script> <script type="text/javascript" src="../libs/vendor/d3-voronoi-map.js"></script> <script type="text/javascript" src="../libs/vendor/d3-voronoi-treemap.js"></script>

FYI - using d3 v5

Any advice for correcting the error?

Thanks and Great Work!

@Kcnarf
Copy link
Owner

Kcnarf commented Jul 23, 2019

Hi,
as stated in readme/installing, the latest d3-voronoi-treemap (v1.1.0 when writing this message) requires d3-voronoi-map v.1.2.0, which is NOT the latest one.

If you use NPM, this is not the problem. In vanilla JS, if you import script on your own via <script> tags (as it seems to be), then it may explain the issue your facing.

@Kcnarf Kcnarf closed this as completed Feb 24, 2020
@Kcnarf
Copy link
Owner

Kcnarf commented Feb 24, 2020

6 months without further interactions ...

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

No branches or pull requests

2 participants