{"id":3939,"date":"2014-12-17T14:54:34","date_gmt":"2014-12-17T05:54:34","guid":{"rendered":"https:\/\/gunmagisgeek.com\/wordpress\/?p=3939"},"modified":"2014-12-19T13:38:33","modified_gmt":"2014-12-19T04:38:33","slug":"post-3939","status":"publish","type":"post","link":"https:\/\/gunmagisgeek.com\/blog\/d3-js\/3939","title":{"rendered":"Webix\u3068D3.js\u3092\u4f7f\u3063\u3066\u30ec\u30b9\u30dd\u30f3\u30b7\u30d6\u306a\u5730\u56f3\u3092\u4f5c\u6210\u3059\u308b"},"content":{"rendered":"<p><a href=\"http:\/\/qiita.com\/advent-calendar\/2014\/webix\">Webix Advent Calendar 2014<\/a> \uff11\uff17\u65e5\u76ee\u306e\u8a18\u4e8b\u3067\u3059\u3002<\/p>\n<p><a href=\"https:\/\/gunmagisgeek.com\/blog\/d3-js\/3935\">\u30b0\u30e9\u30d5<\/a>\u306b\u5f15\u304d\u7d9a\u304d\u3001Webix\u3068D3\u3092\u4f7f\u3063\u3066\u30ec\u30b9\u30dd\u30f3\u30b7\u30d6\u306a\u5730\u56f3\u3092\u63cf\u753b\u3057\u307e\u3059\u3002<br \/>\n\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3068\u3057\u3066\u8868\u793a\u3057\u305f\u5730\u56f3\u306f\u30a6\u30a4\u30f3\u30c9\u30a6\u3084\u5883\u754c\u7dda\u3092\u79fb\u52d5\u3057\u305f\u969b\u306b\u3001\u81ea\u52d5\u7684\u306b\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u30b5\u30a4\u30ba\u306b\u30b0\u30e9\u30d5\u304c\u30ea\u30b5\u30a4\u30ba\u3055\u308c\u307e\u3059\u3002<\/p>\n<h2>\u30b5\u30f3\u30d7\u30eb<\/h2>\n<p><a href=\"http:\/\/shimz.me\/example\/webix\/d3\/map\/\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2014\/12\/webix1412171.jpg\" alt=\"webix + D3 Responsive Map\" width=\"590\" height=\"286\" class=\"aligncenter size-full wp-image-3940 border\" srcset=\"https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2014\/12\/webix1412171.jpg 590w, https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2014\/12\/webix1412171-300x145.jpg 300w\" sizes=\"auto, (max-width: 590px) 100vw, 590px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/shimz.me\/example\/webix\/d3\/map\/index.html\">example<\/a><\/p>\n<p><a href=\"https:\/\/gunmagisgeek.com\/blog\/d3-js\/3935\">\u524d\u56de<\/a>\u4f5c\u6210\u3057\u305f\u30ab\u30b9\u30bf\u30e0\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>\u25a0 \u5730\u56f3\u3092\u63cf\u753b\u3059\u308b<\/p>\n<pre class=\"lang:js mark:6,7,10 decode:true \" >var japan_map = {\r\n\tview:\"d3-chart\", \r\n\tresize:true,\r\n\turl:\"http:\/\/shimz.me\/example\/d3js\/_geodata\/ken.geojson\",\r\n\tready:function(){\r\n\t\tvar scale = Math.floor( (this.$width + this.$height) \/2) ;\/\/\u5730\u56f3\u304c\u53ce\u307e\u308b\u30b9\u30b1\u30fc\u30eb\u3092\u53d6\u5f97\r\n\t\tvar regulate = 1.8; \/\/\u30b9\u30b1\u30fc\u30eb\u3092\u8abf\u6574\r\n\t\tvar projection = d3.geo\r\n\t\t\t.mercator()\t\t\/\/\u6295\u5f71\u6cd5\u306e\u6307\u5b9a\r\n\t\t\t.scale(scale * regulate)\t\/\/\u30b9\u30b1\u30fc\u30eb\uff08\u30ba\u30fc\u30e0\uff09\u306e\u6307\u5b9a\r\n\t\t\t.translate([scale\/2, scale\/2]) \/\/\u8868\u793a\u4f4d\u7f6e\u306e\u6307\u5b9a\r\n\t\t\t.center([139.0032936, 36.3219088]); \/\/\u4e2d\u5fc3\u306e\u5ea7\u6a19\u3092\u6307\u5b9a\r\n\r\n\t\t\/\/\u30d1\u30b9\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u30fc\u751f\u6210\r\n\t\tvar path = d3.geo.path().projection(projection);\u3000\r\n\t\t\r\n\t\t\/\/\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u5185\u306bsvg\u3092\u57cb\u3081\u8fbc\u3080\r\n\t\tvar svg = d3.select(this.$view)\r\n\t\t\t.append(\"svg\")\r\n\t\t\t.attr({\r\n\t\t\t\t\"width\": this.$width,\r\n\t\t\t\t\"height\": this.$height\r\n\t\t\t});\r\n\r\n\t\t\/\/\u5730\u56f3\u3092\u63cf\u753b\u3059\u308b\t\r\n\t\tvar map =  svg.append(\"svg:g\")\r\n\t\t\t.selectAll(\"path\")\r\n\t\t\t.data(this.data.features)\r\n\t\t\t.enter()\r\n\t\t\t.append(\"svg:path\")\r\n\t\t\t.attr({\r\n\t\t\t\t\"d\": path,\r\n\t\t\t\t\"fill\": \"green\",\r\n\t\t\t\t\"fill-opacity\": 0.5,\r\n\t\t\t\t\"stroke\": \"black\"\r\n\t\t\t})\r\n\r\n\t}\r\n}\t\t\r\n<\/pre>\n<p>\u30dd\u30a4\u30f3\u30c8\u306f\uff16\u30fb\uff17\u884c\u76ee\u3067\u306e\u30b9\u30b1\u30fc\u30eb\u306e\u8a2d\u5b9a\u3050\u3089\u3044\u3067\u3059\u3002<br \/>\n\u5730\u5f62\u306b\u5408\u308f\u305b\u3066regulate\u306e\u5024\u3092\u8abf\u6574\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u65e5\u672c\u306e\u3088\u3046\u306b\u7e26\u306b\u7d30\u9577\u3044\u5730\u5f62\u3060\u3068\u3001\u3069\u3046\u3057\u3066\u3082\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u5185\u306b\u4f59\u767d\u304c\u3067\u304d\u3066\u3057\u307e\u3044\u307e\u3059\u3002\u3053\u306e\u8fba\u306f\u3001\u6c96\u7e04\u3092\u79fb\u52d5\u3057\u3066\u8868\u793a\u3059\u308b\u306a\u3069\u8a66\u884c\u932f\u8aa4\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Webix Advent Calendar 201&hellip;<\/p>\n","protected":false},"author":1,"featured_media":3940,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18,58],"tags":[],"class_list":["post-3939","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-d3-js","category-webix","has-post-thumbnail-archive"],"_links":{"self":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/3939","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=3939"}],"version-history":[{"count":0,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/3939\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/media\/3940"}],"wp:attachment":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/media?parent=3939"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/categories?post=3939"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/tags?post=3939"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}