{"id":3053,"date":"2013-09-19T09:43:09","date_gmt":"2013-09-19T00:43:09","guid":{"rendered":"https:\/\/gunmagisgeek.com\/wordpress\/?p=3053"},"modified":"2013-12-30T18:18:13","modified_gmt":"2013-12-30T09:18:13","slug":"post-3053","status":"publish","type":"post","link":"https:\/\/gunmagisgeek.com\/blog\/d3-js\/3053","title":{"rendered":"\u3010D3.js\u3011\u30c7\u30fc\u30bf\u3092\u7d5e\u308a\u8fbc\u3080\u30e6\u30fc\u30b6\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u3068\u3057\u3066\u3082\u4f7f\u3048\u308b\u3001\u30d1\u30e9\u30ec\u30eb\u30b3\u30fc\u30c7\u30a3\u30cd\u30fc\u30c8\u56f3\u3092\u4f5c\u6210\u3059\u308b"},"content":{"rendered":"<p><a href=\"http:\/\/shimz.me\/example\/d3js\/parallel_coordinates\/01\/\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2013\/09\/Parallel_Coordinates1.jpg\" alt=\"Parallel_Coordinates1\" width=\"590\" height=\"224\" class=\"aligncenter size-full wp-image-3054\" srcset=\"https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2013\/09\/Parallel_Coordinates1.jpg 590w, https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2013\/09\/Parallel_Coordinates1-300x114.jpg 300w\" sizes=\"auto, (max-width: 590px) 100vw, 590px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/shimz.me\/example\/d3js\/parallel_coordinates\/01\/\">example<\/a><\/p>\n<p>\u6628\u65e5\u306e\u300c<a href=\"http:\/\/atnd.org\/events\/43356\">\u30aa\u30f3\u30e9\u30a4\u30f3\u5b66\u7fd2\u90e8 #0<\/a>\u300d\u3067\u4f5c\u6210\u3057\u305f\u30b0\u30e9\u30d5\u3067\u3059\u3002<br \/>\n\u4e0b\u8a18<a href=\"http:\/\/enjalot.github.io\/dot-append\/\">dot append<\/a>\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u30d3\u30c7\u30aa\u3092\u307f\u3066\u4f5c\u308a\u307e\u3057\u305f\u3002<\/p>\n<p><iframe loading=\"lazy\" src=\"\/\/player.vimeo.com\/video\/55190008\" width=\"500\" height=\"313\" frameborder=\"0\" webkitallowfullscreen mozallowfullscreen allowfullscreen><\/iframe> <\/p>\n<p><a href=\"http:\/\/vimeo.com\/55190008\">[dot append: 11] parallel coordinates<\/a> from <a href=\"http:\/\/vimeo.com\/user4640702\">Ian Johnson<\/a> on <a href=\"https:\/\/vimeo.com\">Vimeo<\/a>.<\/p>\n<p>\u30d5\u30a1\u30f3\u30ad\u30fc\u306a\u97f3\u697d\u3068\u3068\u3082\u306b\u30a4\u30b1\u30e1\u30f3\u306a\u304a\u5144\u3055\u3093\u304c\u30e9\u30a4\u30d6\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3057\u306a\u304c\u3089D3.js\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u6559\u3048\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n<p>\u30d1\u30e9\u30ec\u30eb\u30b3\u30fc\u30c7\u30a3\u30cd\u30fc\u30c8\u306f\u3001\u9805\u76ee\u6570(\u6b21\u5143)\u306e\u591a\u3044\u30c7\u30fc\u30bf\u306e\u6982\u89b3\u628a\u63e1\u306b\u9069\u3057\u305f\u30b0\u30e9\u30d5\u3067\u3059\u304c\u3001D3.js\u3092\u4f7f\u3063\u3066\u30a4\u30f3\u30bf\u30e9\u30af\u30c6\u30a3\u30d6\u306b\u64cd\u4f5c\u3067\u304d\u308b\u30b0\u30e9\u30d5\u3068\u3057\u3066\u4f5c\u6210\u3059\u308b\u3053\u3068\u3067\u3001\u5358\u306b\u30c7\u30fc\u30bf\u3092\u53ef\u8996\u5316\u3059\u308b\u3060\u3051\u3067\u306a\u304f\u3001\u591a\u6b21\u5143\u30c7\u30fc\u30bf\u306e\u7d5e\u308a\u8fbc\u307f\u304c\u884c\u3048\u308b\u30e6\u30fc\u30b6\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u3068\u3057\u3066\u5229\u7528\u3067\u304d\u308b\u3068\u3053\u308d\u304c\u9762\u767d\u3044\u3067\u3059\u306d\u3002<br \/>\n\u4eca\u56de\u4f5c\u6210\u3057\u305f\u56f3\u3067\u306f\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306b\u300c\u5e74\u9f62\u306f20\u4ee3\u3067\u8eab\u9577\u306f180cm\u4ee5\u4e0a\u3067\u3047\u3001\u5e74\u53ce\u304c800\u4e07\u4ee5\u4e0a\u306e\u4eba\u266a\u300d\u307f\u305f\u3044\u306a\u3061\u3087\u3063\u3068\u30a4\u30e9\u3063\u3068\u3059\u308b(?)\u7d5e\u308a\u8fbc\u307f\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u307e\u3059\uff57<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2013\/09\/Parallel_Coordinates2.jpg\" alt=\"Parallel_Coordinates2\" width=\"590\" height=\"222\" class=\"alignnone size-full wp-image-3055\" srcset=\"https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2013\/09\/Parallel_Coordinates2.jpg 590w, https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2013\/09\/Parallel_Coordinates2-300x113.jpg 300w\" sizes=\"auto, (max-width: 590px) 100vw, 590px\" \/><\/p>\n<p>\u6642\u9593\u306b\u4f59\u88d5\u304c\u3042\u3063\u305f\u306e\u3067\u3001\u30d1\u30e9\u30ec\u30eb\u30b3\u30fc\u30c7\u30a3\u30cd\u30fc\u30c8\u4e0a\u3067\u306e\u7d5e\u308a\u8fbc\u307f\u306b\u9023\u52d5\u3057\u3066\u3001\u5b9f\u969b\u306e\u30c7\u30fc\u30bf\u3092\u8868\u793a\u3059\u308b\u30c7\u30fc\u30bf\u30c6\u30fc\u30d6\u30eb\u3082\u4f5c\u6210\u3057\u3066\u307f\u307e\u3057\u305f\u3002<br \/>\n\u3044\u308d\u3044\u308d\u3068\u5fdc\u7528\u306e\u5229\u304d\u305d\u3046\u3059\u3002<\/p>\n<h2>\u30b5\u30f3\u30d7\u30eb<\/h2>\n<pre class=\"lang:xhtml decode:true \" >&lt;script src=&quot;http:\/\/d3js.org\/d3.v3.min.js&quot;&gt;&lt;\/script&gt;\n&lt;script src=&quot;..\/divgrid.js&quot;&gt;&lt;\/script&gt;\n&lt;script src=&quot;..\/d3.parcoords.js&quot;&gt;&lt;\/script&gt;\n&lt;link rel=&quot;stylesheet&quot; type=&quot;text\/css&quot; href=&quot;..\/d3.parcoords.css&quot;&gt;\n&lt;div id=&quot;example&quot; class=&quot;parcoords&quot; style=&quot;width:360px;height:150px&quot;&gt;&lt;\/div&gt;\n&lt;br&gt;\n&lt;div id=&quot;grid&quot;&gt;&lt;\/div&gt;\n<\/pre>\n<p>d3\u4ee5\u5916\u306b\u3001<a href=\"https:\/\/gist.github.com\/syntagmatic\/3687826\">d3.divgrid.js<\/a>\u30d7\u30e9\u30b0\u30a4\u30f3\u3068<a href=\"http:\/\/syntagmatic.github.io\/parallel-coordinates\/\">d3.parcoords.js<\/a>\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002<br \/>\n\u307e\u305f\u3001\u30d1\u30e9\u30ec\u30eb\u30b3\u30fc\u30c7\u30a3\u30cd\u30fc\u30c8\u56f3\u3092\u8868\u793a\u3059\u308bdiv#example\u8981\u7d20\u3068\u3001\u30c7\u30fc\u30bf\u30c6\u30fc\u30d6\u30eb\u3092\u8868\u793a\u3059\u308bdiv#grid\u8981\u7d20\u3092\u8a2d\u7f6e\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"lang:js decode:true \" >\/\/\u30e9\u30f3\u30c0\u30e0\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u751f\u6210\nvar dataSet = d3.range(180).map(function() {\n    return {\n\t  '\u5e74\u9f62': 19 + ~~(Math.random() * 30),\n\t  '\u5bb6\u65cf':  ~~(Math.random() * 2) + ~~(Math.random() * 2)+ ~~(Math.random() * 3),\n\t  '\u8eab\u9577':160 +  ~~(Math.random() * 30),\n\t  '\u4f53\u91cd':40 + ~~(Math.random() * 50),\n\t  'BMI(\uff05)': 7 + ~~(Math.random() * 10) + ~~(Math.random() * 10)+ ~~(Math.random() * 10)+ ~~(Math.random() * 10),\n\t  '\u5e74\u53ce(\u4e07\u5186)':300 +  ~~(Math.random() * 600)\n      };\n});\n\n\n\/\/\u30d1\u30e9\u30ec\u30eb\u30b3\u30fc\u30c7\u30a3\u30cd\u30fc\u30c8\u7528\u30b9\u30c6\u30fc\u30b8\nvar example = d3.select('#example')\n    .style({\n\twidth:1200,\n\theight:400\n    });\n\n\/\/ \u30ab\u30e9\u30fc\u30b9\u30b1\u30fc\u30eb\nvar blue_to_brown = d3.scale.linear()\n    .domain([300, 799,800, 900])\n    .range(['blue', 'blue', 'red', 'red'])\n    .interpolate(d3.interpolateLab);\n\n\/\/\u30d1\u30e9\u30ec\u30eb\u30b3\u30fc\u30c7\u30a3\u30cd\u30fc\u30c8\u751f\u6210\nvar pc = d3.parcoords()('#example')\n    .data(dataSet)\n    .color(function(d) { return blue_to_brown(d['\u5e74\u53ce(\u4e07\u5186)']); })\n    .alpha(0.4)\n    .composite('lighter')\n    .render()\n    .ticks(3) \n    .createAxes()\n    .brushable(); \/\/\u7d5e\u308a\u8fbc\u307f\u53ef\u80fd\u306b\u3059\u308b\n\n\/\/\u30c7\u30fc\u30bf\u30c6\u30fc\u30d6\u30eb\u4f5c\u6210\nvar grid = d3.divgrid();\nd3.select('#grid')\n  .datum(dataSet.slice(0,10)) \/\/\u8868\u793a\u4ef6\u6570\u306e\u6307\u5b9a\n  .call(grid)\n  .selectAll('.row')\n  .on({\n      'mouseover': function(d) { pc.highlight([d]) },\n      'mouseout': pc.unhighlight\n  });\n    \n\/\/ \u30c7\u30fc\u30bf\u30c6\u30fc\u30d6\u30eb\u306e\u66f4\u65b0\npc.on('brush', function(d) {\n  d3.select('#grid')\n    .datum(d.slice(0,10))\n    .call(grid)\n    .selectAll('.row')\n    .on({\n\t'mouseover': function(d) { pc.highlight([d]) },\n\t'mouseout': pc.unhighlight\n    });\n});    \n<\/pre>\n<p>d3.parcoords.js\u3067\u4f5c\u6210\u3057\u305f\u56f3\u306f\u3001\u76ee\u76db\u308a\u4ee5\u5916\u306eline\u3092canvas\u4e0a\u306b\u63cf\u753b\u3059\u308b\u4ed5\u69d8\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\ncanvas\u3092\u4f7f\u3046\u3053\u3068\u306b\u3088\u3063\u3066\u30c7\u30fc\u30bf\u6570\u304c\u591a\u304f\u306a\u3063\u3066\u3082\u6bd4\u8f03\u7684\u91cd\u304f\u306a\u3089\u306a\u3044\u3088\u3046\u306b\u4f5c\u3089\u308c\u3066\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>example \u6628\u65e5\u306e\u300c\u30aa\u30f3\u30e9\u30a4\u30f3\u5b66\u7fd2\u90e8 #0\u300d\u3067&hellip;<\/p>\n","protected":false},"author":1,"featured_media":3054,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-3053","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\/3053","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=3053"}],"version-history":[{"count":0,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/3053\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/media\/3054"}],"wp:attachment":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/media?parent=3053"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/categories?post=3053"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/tags?post=3053"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}