Skip to content Skip to sidebar Skip to footer

D3.js Tsv To Javascript Variable

I'm working on a graph with d3.js library. The 3d.js tsv parser creates the 'd' variable as such: TSV: day Value 01-01 50 01-02 45 01-03 60 code: d3.tsv('data.tsv', function

Solution 1:

If you're not reading from a file, you can still use the JSON format (which is what you're talking about). The format for a json variable is as follows:

var myVariable = {
"indexA" : "valueA",
"indexB" : "valueB"
}

You can even have an array as the value (even though you didn't ask) and that would look very similar:

var myVariable = {
"indexA" : [ "indexA1": "valueA1", "indexA2": "valueA2", ...],
"indexB" : "valueB"
}

You can find out more information about the JSON format here: http://www.json.org/

Post a Comment for "D3.js Tsv To Javascript Variable"