This gist just call the MediaWiki API in order to retrieve resources from Wikidata. Textual researches can be perfomerd using the search box.
At the time this gist has been built, Wikidata does not allow to perform requests from client-side (e.g, ajax calls). A api.php script has been used in order to retrieve data. Unfortunately, since bl.ocks.org can not be run server-side code, it is possible to look at a working version here.
Modified http://d3js.org/d3.v3.min.js to a secure url
https://d3js.org/d3.v3.min.js