Accepted answer

site is a Jekyll global variable. is a Ruby hash containing the data loaded from the YAML files located in the _data directory. is a Ruby hash or array, I assume.

d3.json is a D3 function that fetches JSON. It does not convert a Ruby hash or array to a JavaScript object.

In Ruby, you convert a hash or array to JSON by calling to_json on it.

In JavaScript, you convert a JSON string to an object by calling JSON.parse.

Related Query

More Query from same tag