I have a json file
NAME:abcd.json
Its content starts like following(this looked pretty wierd to me as this was the first time i came across such json file)-->
["51b59c2081ecf", [["parties", 0.0793, 0.238], ["signature", 0.002, 0.006]]]
["51b59c2683e7d", [["parties", 0.0037, 0.011]]]
["51b59c255e1fb", [["parties", 0.0037, 0.011]]]
["51b59c2e95da5", [["parties", 0.0037, 0.011]]]
I came across another json file
NAME:color.json
{
"colorsArray":[{
"colorName":"red",
"hexValue":"#f00"
},
{
"colorName":"green",
"hexValue":"#0f0"
},
{
"colorName":"blue",
"hexValue":"#00f"
},
{
"colorName":"black",
"hexValue":"#000"
}
]
}
I am using D3js and I want to push the content of abcd.json in to an array so that I can use that data further.
MyQuestions:
- if both of them are json.files than why there exist some difference between their syntax.My entire d3 code depends on this data.
2.How do I push the json data to a variable say Var data.
currently I am providing var data some static value for some temporary testing,Like this->
var data= [
["51b59c2a019af", [["signature", 0.002, 0.006], ["parties", 0.0037, 0.011]]],
["51b59c2635997", [["fashion", 0.002, 0.006], ["parties", 0.0037, 0.011],["royal-challenge", 0.002, 0.6]]],
["51b59c29c39bf", [["parties", 0.0037, 0.1], ["signature", 0.002, 0.006]]]
];