0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

resasの研究

Posted at

概要

官製オープンデータ基盤のresasを、研究してみる。

方針

sdgsの視点、社会起業家の視点で、研究してみる。

サンプルコード

d3でapiを、叩いてみた。


d3.request("https://opendata.resas-portal.go.jp/api/v1/prefectures").header("X-API-KEY", "***").mimeType("application/json").response(function(xhr) { 
  return JSON.parse(xhr.responseText) 
}).get(function(data) {
  console.log(data)
  var items = data.result;
  var keys = ["prefCode", "prefName"];
  var table = d3.select("body").append("table").attr("border", "1")
  table.append("thead").append("tr").selectAll("th").data(keys).enter().append("th").text(function(d) {
    return d;
  });
  for (var i = 0; i < items.length; i++)
  {
    var rows = [];  
    keys.map(function(c) {
      rows.push(items[i][c])
    });
    table.append("tbody").append("tr").selectAll("td").data(rows).enter().append("td").text(function(d) {
      return d;
    });
  }
});


以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?