Skip to content

Instantly share code, notes, and snippets.

@dogrunjp
Last active April 24, 2017 01:25
Show Gist options
  • Save dogrunjp/c1fc0294e1d6fae45fabbda4929914b1 to your computer and use it in GitHub Desktop.
Save dogrunjp/c1fc0294e1d6fae45fabbda4929914b1 to your computer and use it in GitHub Desktop.
D3 v4のd3-requestモジュールで、request headerを指定して(この例ではAcceptを指定して)SPARQL endpointを利用する場合の記述例。
d3.request(endpoint + query)
  .header('Accept', 'application/sparql-results+json')
  .response(function(xhr){return JSON.parse(xhr.responseText)})
  .get(callback);

d3/d3-request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment