Sorry sorry sorry for the basic question but I've been stuck on this for a while and I am not sure what is up.
So I have a php file and a json file. When I run the php file on the terminal
php myFile.php
the output is identical to my json file.
the output looks like this:
[{"word":"now","score":"16","sentence":" Now, at the least calcu- lation,
this broken vase dates back two thousand five hundred years "}]
(the Json file also looks like the above)
When I pass in the json file to d3.json, I am able to see the visualization and all of it's data no-problem. But for some reason, when I replace the json file with the php file I am getting the error
Cannot read property 'length' of undefined
at Object.a [as extent]
so I am never getting or displaying the data. I've made sure that the php file is in the same directory, no typos etc. And I've checked the echo for any differences but there are none.
Thank you for your time!
my js looks like this:
//can replace myFile.php with json file and it works!
d3.json('myFile.php',
function (error,myData) {
// a bunch of stuff})
Thank you!