{"id":3612,"date":"2014-07-04T09:25:49","date_gmt":"2014-07-04T00:25:49","guid":{"rendered":"https:\/\/gunmagisgeek.com\/wordpress\/?p=3612"},"modified":"2017-02-03T01:19:54","modified_gmt":"2017-02-02T16:19:54","slug":"post-3612","status":"publish","type":"post","link":"https:\/\/gunmagisgeek.com\/blog\/d3-js\/3612","title":{"rendered":"\u3010D3.js\u3011Cartograms\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f7f\u3063\u3066\u307f\u305f\u3002"},"content":{"rendered":"<p>D3.js\u306e\u30ab\u30eb\u30c8\u30b0\u30e9\u30e0\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f7f\u3063\u3066\u3001\u30c7\u30fc\u30bf\u3092\u5143\u306b\u5909\u5f62\u3055\u305b\u305f\u65e5\u672c\u5730\u56f3\u3092\u63cf\u753b\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<h2>\u30ab\u30eb\u30c8\u30b0\u30e9\u30e0\u3068\u306f\uff1f<\/h2>\n<blockquote><p>\u5730\u57df\u306e\u7d71\u8a08\u30c7\u30fc\u30bf\u306b\u57fa\u3065\u3044\u3066\u5730\u56f3\u3092\u6b6a\u3081\u305f\u5909\u5f62\u5730\u56f3\u306e\u3053\u3068\uff0e \u5730\u57df\u306e\u7279\u5fb4\u3092\u8996\u899a\u7684\u306b\u8868\u73fe\u3059\u308b\u305f\u3081\u306b\u7528\u3044\u3089\u308c\u308b\uff0e \u7d71\u8a08\u91cf\u3092\u5730\u56f3\u4e0a\u306e\u8ddd\u96e2\u3067\u8868\u3059\u30c7\u30a3\u30b9\u30bf\u30f3\u30b9\u30ab\u30eb\u30c8\u30b0\u30e9\u30e0\uff0c \u5730\u56f3\u4e0a\u306e\u9762\u7a4d\u3067\u8868\u3059\u30a8\u30ea\u30a2\u30ab\u30eb\u30c8\u30b0\u30e9\u30e0\u306a\u3069\u304c\u3042\u308b\uff0e \u5730\u70b9\u9593\u306e\u6240\u8981\u6642\u9593\u3092\u5730\u56f3\u4e0a\u306e\u8ddd\u96e2\u3067\u8868\u3059\u6642\u9593\u5730\u56f3\u3082\u4ee3\u8868\u7684\u306a\u30ab\u30eb\u30c8\u30b0\u30e9\u30e0\u3067\u3042\u308b\uff0e<\/p><\/blockquote>\n<p>\u4eca\u56de\u5229\u7528\u3057\u305f\u30d7\u30e9\u30b0\u30a4\u30f3\u306f\u3001\u30a8\u30ea\u30a2\u30ab\u30eb\u30c8\u30b0\u30e9\u30e0\u3092\u63cf\u753b\u3057\u307e\u3059\u3002<\/p>\n<h2>Cartograms\u30d7\u30e9\u30b0\u30a4\u30f3<\/h2>\n<p><span class=\"removed_link\" title=\"http:\/\/prag.ma\/code\/d3-cartogram\/#popest\/2010\">Cartograms with d3 &#038; TopoJSON<\/span><\/p>\n<p>D3.js\u306e\u30ab\u30eb\u30c8\u30b0\u30e9\u30e0\u63cf\u753b\u30d7\u30e9\u30b0\u30a4\u30f3\u3002<\/p>\n<h3>\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9<\/h3>\n<pre class=\"lang:js decode:true \" >\r\n\/\/\u30ab\u30eb\u30c8\u30b0\u30e9\u30e0\u521d\u671f\u8a2d\u5b9a\r\nvar cartogram = d3.cartogram()\r\n\t.projection(d3.geo.albersUsa()) \/\/d3.projection\u3092\u30e9\u30c3\u30d7\r\n\t.value(function(d) {\r\n\t\treturn Math.random() * 100; \/\/\u30e9\u30f3\u30c0\u30e0\u306b\u5909\u5f62\r\n\t});\r\n\t \r\n \/\/topoJSON\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u8fbc\u307f\r\nd3.json(\"path\/to\/hoge.topojson\", function(topology) {\r\n\t\r\n\t\/\/\u30ab\u30eb\u30c8\u30b0\u30e9\u30e0\u5909\u63db\r\n\tvar features = cartogram(topology);\r\n\t\r\n\t\/\/\u5730\u5f62\u63cf\u753b\r\n\td3.select(\"svg\").selectAll(\"path\")\r\n\t\t.data(features)\r\n\t\t.enter()\r\n\t\t.append(\"path\")\r\n\t\t.attr(\"d\", cartogram.path);\r\n});<\/pre>\n<h2>\u4f5c\u3063\u3066\u307f\u305f\u7269<\/h2>\n<p><a href=\"http:\/\/shimz.me\/example\/d3js\/geo_template\/cartograms\/01\/\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2014\/07\/cartograms20140704.jpg\" alt=\"cartograms\" width=\"590\" height=\"580\" class=\"aligncenter border size-full wp-image-3611\" srcset=\"https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2014\/07\/cartograms20140704.jpg 590w, https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2014\/07\/cartograms20140704-153x150.jpg 153w\" sizes=\"auto, (max-width: 590px) 100vw, 590px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/shimz.me\/example\/d3js\/geo_template\/cartograms\/01\/\">example<\/a><\/p>\n<p>\u300cclick here to run\u300d\u306e\u6587\u5b57\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u3001\u7fa4\u99ac\u770c\u304c\u5927\u304d\u304f\u7206\u767a(?)\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>D3.js\u306e\u30ab\u30eb\u30c8\u30b0\u30e9\u30e0\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f7f\u3063\u3066\u3001\u30c7\u30fc\u30bf&hellip;<\/p>\n","protected":false},"author":1,"featured_media":3611,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-3612","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-d3-js","has-post-thumbnail-archive"],"_links":{"self":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/3612","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/comments?post=3612"}],"version-history":[{"count":0,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/3612\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/media\/3611"}],"wp:attachment":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/media?parent=3612"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/categories?post=3612"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/tags?post=3612"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}