{"id":3399,"date":"2014-02-18T09:39:26","date_gmt":"2014-02-18T00:39:26","guid":{"rendered":"https:\/\/gunmagisgeek.com\/wordpress\/?p=3399"},"modified":"2017-03-09T10:16:17","modified_gmt":"2017-03-09T01:16:17","slug":"post-3399","status":"publish","type":"post","link":"https:\/\/gunmagisgeek.com\/blog\/d3-js\/3399","title":{"rendered":"\u3010D3\u30d7\u30e9\u30b0\u30a4\u30f3\u3011 D3\u3067\u4f5c\u6210\u3057\u305f\u30b0\u30e9\u30d5\u3092WebGL\u3067\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3059\u308b\u30d7\u30e9\u30b0\u30a4\u30f3\u300cPathGL\u300d"},"content":{"rendered":"<p><a href=\"http:\/\/shimz.me\/example\/d3js\/PathGL\/01\/\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2014\/02\/deabo000011-300x300.jpg\" alt=\"pathGL\" width=\"300\" height=\"300\" class=\"aligncenter border size-medium wp-image-3400\" \/><\/a><\/p>\n<p>\u5148\u9031\u672b\u304b\u3089\u305a\u3063\u3068\u96ea\u304b\u304d\u3067\u3059\u3002<br \/>\n\u751f\u307e\u308c\u3066\u521d\u3081\u3066\u300c\u96ea\u306e\u305b\u3044\u3067\u5bb6\u304b\u3089\u51fa\u3089\u308c\u306a\u3044\uff01\u300d\u3068\u3044\u3046\u306e\u3092\u30ea\u30a2\u30eb\u306b\u4f53\u9a13\u3057\u307e\u3057\u305f\u3002\u96ea\u6016\u3044\u3002\uff08\u3061\u306a\u307f\u306b\u3001<a href=\"http:\/\/www.asahi.com\/articles\/photo\/AS20140215001965.html\">\u3053\u3093\u306a\u611f<\/a>\u3058\u3067\u3057\u305f\uff09<\/p>\n<p>\u305d\u3093\u306a\u308f\u3051\u3067\u624b\u629c\u304d\u66f4\u65b0\u3067\u3059\u3002<\/p>\n<p>\u300c<span class=\"removed_link\" title=\"http:\/\/pathgl.com\/\">pathGL<\/span>\u300d\u306f\u3001D3.js\u3068DOM\u306e\u9593\u306b\u5165\u3063\u3066SVG\u306e\u4ee3\u308f\u308a\u306bWebGL\u306b\u63cf\u753b\u3092\u884c\u3046\u30d7\u30e9\u30b0\u30a4\u30f3\u3067\u3059\u3002<br \/>\nSVG\u306f\u30c7\u30d0\u30c3\u30b0\u304c\u3057\u3084\u3059\u304f\u3001\u89e3\u50cf\u5ea6\u306e\u7570\u306a\u308b\u30b9\u30af\u30ea\u30fc\u30f3\u306b\u5bfe\u3057\u3066\u3082\u7dba\u9e97\u306b\u63cf\u753b\u3055\u308c\u308b\u305f\u3081\u975e\u5e38\u306b\u4fbf\u5229\u306a\u306e\u3067\u3059\u304c\u3001\u8981\u7d20\u6570\u304c\u591a\u304f\u306a\u308b\u3068\u3069\u3046\u3057\u3066\u3082\u63cf\u753b\u304c\u91cd\u304f\u306a\u308a\u307e\u3059\u3002\u53ef\u8996\u5316\u306e\u5185\u5bb9\u306b\u3088\u3063\u3066\u306f\u3001canvas\u3084WebGL\u306b\u8868\u793a\u3057\u305f\u3044\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u304cD3.js\u306e\u307f\u3067\u884c\u3046\u306e\u306f\u5c11\u3005\u30e1\u30f3\u30c9\u30a6\u306a\u3068\u3053\u308d\u304c\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>PathGL\u306f\u3001D3\u306e\u66f8\u5f0f\u304b\u3089\u5916\u308c\u308b\u3053\u3068\u306a\u304f\u7c21\u5358\u306a\u8a18\u8ff0\u3067D3\u306e\u51fa\u529b\u7d50\u679c\u3092WebGL\u4e0a\u306b\u8868\u793a\u3057\u3066\u304f\u308c\u308b\u30d7\u30e9\u30b0\u30a4\u30f3\u3067\u3059\u3002<\/p>\n<p>\u3068\u3066\u3082\u4fbf\u5229\u305d\u3046\u306a\u306e\u3067\u3059\u304c\u2026\u2026\u307e\u3060\u3001\u4e00\u90e8\u30a8\u30e9\u30fc\u304c\u3042\u308b\u306e\u304b\u4f7f\u3044\u3053\u306a\u305b\u3066\u3044\u306a\u3044\u306e\u304b\u2026\u2026\u52d5\u304d\u307e\u305b\u3093\u3002<\/p>\n<p>Github\u306b\u63b2\u8f09\u3055\u308c\u3066\u3044\u308b\u4e0b\u8a18\u30b5\u30f3\u30d7\u30eb\u304c\u79c1\u306e\u74b0\u5883\u3067\u306f\u52d5\u304d\u307e\u305b\u3093 orz<\/p>\n<pre class=\"lang:js decode:true \" >d3.select ( 'canvas' ).call ( pathgl ) \r\n\t.append ( 'circle' ) \r\n\t.attr ( 'r' ,  100 ) \r\n\t.attr ( 'cx' ,  50 ) \r\n\t.attr ( 'cy' ,  50 )\r\n <\/pre>\n<p>\u914d\u4fe1\u3055\u308c\u3066\u3044\u308b\u30d5\u30a1\u30a4\u30eb\u306b\u542b\u307e\u308c\u3066\u3044\u308bexample\u306f\u5b9f\u884c\u3067\u304d\u308b\u306e\u3067\u3059\u304c\u3001\u305d\u3053\u304b\u3089\u3061\u3087\u3063\u3068\u5916\u308c\u3066\u9055\u3046\u3053\u3068\u3092\u3084\u308d\u3046\u3068\u3059\u308b\u3068\u3001\u52d5\u304b\u305b\u307e\u305b\u3093\u3002<\/p>\n<p>\u30d0\u30b0\u306a\u306e\u304b\u3001\u4f55\u304b\u3092\u9593\u9055\u3063\u3066\u3044\u308b\u306e\u304b\u2026\u2026\u307e\u3060\u308f\u304b\u308a\u307e\u305b\u3093\u304c\u3001\u4f7f\u3044\u3053\u306a\u305b\u308c\u3070D3\u3092\u4f7f\u3063\u305f\u30c7\u30fc\u30bf\u30d3\u30e5\u30b8\u30e5\u30a2\u30e9\u30a4\u30bc\u30fc\u30b7\u30e7\u30f3\u306e\u8868\u73fe\u529b\u3092\u5927\u5e45\u306b\u9ad8\u3081\u3066\u304f\u308c\u308b\u30d7\u30e9\u30b0\u30a4\u30f3\u306a\u306e\u3067\u3001\u4eca\u5f8c\u306b\u671f\u5f85\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h2>\u30b5\u30f3\u30d7\u30eb<\/h2>\n<p>\u3053\u3061\u3089\u306f\u3001\u52d5\u4f5c\u3057\u305f\u30b5\u30f3\u30d7\u30eb\u3067\u3059\u3002<\/p>\n<pre class=\"lang:xhtml decode:true \" title=\"200k Circles\">&lt;!DOCTYPE html&gt;\r\n&lt;html lang=\"ja\"&gt;\r\n&lt;head&gt;\r\n&lt;meta charset=\"utf-8\" \/&gt;\r\n&lt;meta http-equiv=\"content-language\" content=\"ja\"&gt;\r\n&lt;title&gt;Hello PathGL&lt;\/title&gt;\r\n&lt;script src=\"http:\/\/d3js.org\/d3.v3.min.js\"&gt;&lt;\/script&gt;\r\n&lt;script src=\"http:\/\/adnanwahab.com\/pathgl\/dist\/pathgl.js\" charset=\"utf-8\"&gt;&lt;\/script&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;canvas width=\"600\" height=\"600\"&gt;&lt;\/vanvas&gt;\r\n\r\n&lt;script&gt;\r\nd3.select('canvas').call(pathgl)\r\n\t.selectAll(\"circle\")\r\n\t.data(d3.range(2e5))\r\n\t.enter()\r\n\t.append(\"circle\")\r\n\t.attr('fill', function () { return \"hsl(\" + Math.random() * 360 + \",100%, 50%)\" })\r\n\t.attr('cx', function (d, i) { return d \/ 1e8 })\r\n\t.attr('cy', function (d, i) { return (2e5  -  d) \/ 20000 })\r\n\t.attr('r', function (d, i) { return d  % 1000 })\r\n\t.shader({ cx: 'resolution.x \/ 2. + cos(pos.z + clock * pos.x) * pos.z * 10.;'\r\n\t\t\t, cy: 'resolution.y \/ 2. + sin(pos.z + clock * pos.x) * pos.z * 10.;'\r\n\t\t\t, stroke: 'vec4(unpack_color(stroke) * .5 + vec3(mouse.x \/ resolution.x, mouse.y \/ resolution.y, 1.), 1.);'\r\n\t\t\t, radius: 'pos.y + pos.y * max(distance(x, mouse.x) \/ resolution.x, distance(y, mouse.y) \/ resolution.y)'\r\n\t\t\t});\r\n&lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p><a href=\"http:\/\/shimz.me\/example\/d3js\/PathGL\/01\/\">example<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5148\u9031\u672b\u304b\u3089\u305a\u3063\u3068\u96ea\u304b\u304d\u3067\u3059\u3002 \u751f\u307e\u308c\u3066\u521d\u3081\u3066\u300c\u96ea\u306e&hellip;<\/p>\n","protected":false},"author":1,"featured_media":3400,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-3399","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\/3399","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=3399"}],"version-history":[{"count":0,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/3399\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/media\/3400"}],"wp:attachment":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/media?parent=3399"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/categories?post=3399"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/tags?post=3399"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}