user3046061
user3046061

Reputation: 353

How to embbed data in d3 script?

I'm looking at this: http://bl.ocks.org/mbostock/4063550

I want to embed the json data inside the script as opposed to using d3's internal function. I tried a variety of things like assigning the data to a var etc. but it doesn't seem to work.

How do you do this, for this example in particular?

Upvotes: 0

Views: 33

Answers (1)

Lars Kotthoff
Lars Kotthoff

Reputation: 109232

In general, you would assign the contents of the JSON to a variable, like so:

var json = {...};

In this case in particular, have a look here.

Upvotes: 1

Related Questions