{"id":2963,"date":"2013-07-24T11:36:38","date_gmt":"2013-07-24T02:36:38","guid":{"rendered":"https:\/\/gunmagisgeek.com\/wordpress\/?p=2963"},"modified":"2013-12-30T21:36:58","modified_gmt":"2013-12-30T12:36:58","slug":"post-2963","status":"publish","type":"post","link":"https:\/\/gunmagisgeek.com\/blog\/d3-js\/2963","title":{"rendered":"D3.js\u3068jQuery\u306e\u30bb\u30ec\u30af\u30b7\u30e7\u30f3\u30e1\u30bd\u30c3\u30c9\u306e\u9055\u3044"},"content":{"rendered":"<p>\u672c\u65e5\u306f\u5c0f\u30cd\u30bf\u3002<br \/>\nD3.js\u306e\u30bb\u30ec\u30af\u30b7\u30e7\u30f3\u306f\u3001\u307b\u307cjQuery\u306e\u30bb\u30ec\u30af\u30b7\u30e7\u30f3\u3068\u4f3c\u305f\u52d5\u4f5c\u3092\u3057\u307e\u3059\u304c\u4e00\u90e8\u9055\u3046\u90e8\u5206\u3082\u3042\u308a\u307e\u3059\u3002<br \/>\njQuery\u306e\u30bb\u30ec\u30af\u30b7\u30e7\u30f3\u30e1\u30bd\u30c3\u30c9\u306f\u57fa\u672cthis(\u9078\u629e\u3057\u305f\u8981\u7d20\u306ejQuery\u30aa\u30d6\u30b8\u30a7\u30af\u30c8)\u3092\u623b\u308a\u5024\u3068\u3057\u3066\u8fd4\u3057\u307e\u3059\u304c\u3001D3\u3067\u306fappend\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u305f\u5834\u5408\u3001\u8ffd\u52a0\u3055\u308c\u305f\u8981\u7d20\u306eD3\u30bb\u30ec\u30af\u30b7\u30e7\u30f3\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u623b\u308a\u5024\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"lang:js decode:true \" title=\"D3\u4f8b\" >d3.select('body').append('div').append('h1')\r\n<\/pre>\n<p>\u4e0a\u8a18\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u5b9f\u884c\u7d50\u679c\u306f\u4ee5\u4e0b\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"lang:xhtml decode:true \" title=\"D3\u5b9f\u884c\u4f8b\" >&lt;body&gt;\r\n\t&lt;div&gt;\r\n\t\t&lt;h1&gt;&lt;\/h1&gt;\r\n\t&lt;\/div&gt;\r\n&lt;\/body&gt;\r\n<\/pre>\n<p>jQuery\u3067\u7121\u7406\u3084\u308a\u4f3c\u305f\u69cb\u6587\u3092\u66f8\u3044\u305f\u5834\u5408\u306e\u5b9f\u884c\u7d50\u679c\u306f\u4ee5\u4e0b\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"lang:js decode:true \" title=\"jQuery\u4f8b1\" >$(&quot;body&quot;).append(&quot;&lt;div&gt;&lt;\/div&gt;&quot;).append('&lt;h1&gt;&lt;\/h1&gt;')\r\n<\/pre>\n<pre class=\"lang:xhtml decode:true \" title=\"jQuery\u5b9f\u884c\u7d50\u679c1\" >&lt;body&gt;\r\n\t&lt;div&gt;&lt;\/div&gt;\r\n\t&lt;h1&gt;&lt;\/h1&gt;\r\n&lt;\/body&gt;\r\n<\/pre>\n<p>jQuery\u3067\u306f\u30bb\u30ec\u30af\u30b7\u30e7\u30f3\u5f8c\u306e\u30e1\u30bd\u30c3\u30c9\u30c1\u30a7\u30fc\u30f3\u306f\u3001\u57fa\u672c\u30e1\u30bd\u30c3\u30c9\u306e\u623b\u308a\u5024\u304c\u5909\u308f\u308b\u3053\u3068\u306a\u304f\u30bb\u30ec\u30af\u30bf\u3067\u9078\u629e\u3057\u305f\u8981\u7d20\u306b\u5bfe\u3057\u3066\u9069\u7528\u3055\u308c\u308b(\u3053\u3053\u3067\u306fbody\u8981\u7d20)\u306e\u3067D3\u3068\u306f\u52d5\u4f5c\u304c\u7570\u306a\u308a\u307e\u3059\u3002<br \/>\nD3\u3068\u540c\u3058\u7d50\u679c\u3092\u6c42\u3081\u308b\u306b\u306f\u3001jQuery\u3067\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5165\u308c\u5b50\u306b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"lang:js decode:true \" title=\"jQuery\u4f8b2\" >$(&quot;body&quot;).append( $('&lt;div&gt;').append( $('&lt;h1&gt;') ) )\r\n<\/pre>\n<pre class=\"lang:xhtml decode:true \" title=\"jQuery\u5b9f\u884c\u7d50\u679c2\" >&lt;body&gt;\r\n\t&lt;div&gt;\r\n\t\t&lt;h1&gt;&lt;\/h1&gt;\r\n\t&lt;\/div&gt;\r\n&lt;\/body&gt;\r\n<\/pre>\n<p>&nbsp;<br \/>\n&nbsp;<\/p>\n<h2>\u8a73\u7d30<\/h2>\n<hr>\n<\/hr>\n<p>d3\u30bb\u30ec\u30af\u30b7\u30e7\u30f3\u306estyle\u30e1\u30bd\u30c3\u30c9\u3084attr\u30e1\u30bd\u30c3\u30c9\u3067\u8981\u7d20\u3092\u64cd\u4f5c\u3059\u308b\u5834\u5408\u3001\u30e1\u30bd\u30c3\u30c9\u30c1\u30a7\u30fc\u30f3\u306e\u9014\u4e2d\u3067\u8981\u7d20\u304c\u8ffd\u52a0(append)\u3055\u308c\u308b\u3068\u305d\u306e\u5f8c\u306b\u5b9f\u884c\u3055\u308c\u308bstyle\u30e1\u30bd\u30c3\u30c9\u7b49\u306e\u9069\u7528\u5148\u304c\u5909\u308f\u308b\u306e\u3067\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<pre class=\"lang:js decode:true \" >d3.select('body') \/\/body\u8981\u7d20\u3092\u9078\u629e\r\n\t.style('background-color', 'black') \/\/body\u8981\u7d20\u306b\u30b9\u30bf\u30a4\u30eb\u3092\u9069\u7528\r\n\t.append('div') \/\/div\u8981\u7d20\u3092\u8ffd\u52a0\u3001div\u30bb\u30ec\u30af\u30b7\u30e7\u30f3\u3092\u8fd4\u3059\u3002\r\n\t.style('background-color', 'blue') \/\/div\u8981\u7d20\u306b\u30b9\u30bf\u30a4\u30eb\u3092\u9069\u7528\r\n\t.append('h1') \/\/h1\u8981\u7d20\u3092\u8ffd\u52a0\u3001h1\u30bb\u30ec\u30af\u30b7\u30e7\u30f3\u3092\u8fd4\u3059\r\n\t.style('background-color', 'red') \/\/h1\u8981\u7d20\u306b\u30b9\u30bf\u30a4\u30eb\u3092\u9069\u7528\r\n<\/pre>\n<p>\u307e\u305f\u3001\u6700\u7d42\u7684\u306a\u623b\u308a\u5024\u3082\u6700\u5f8c\u306bappend\u3055\u308c\u305f\u8981\u7d20\u306e\u30bb\u30ec\u30af\u30b7\u30e7\u30f3\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u306a\u308b\u306e\u3067\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"lang:js decode:true \" >var elm = d3.select('body')\r\n\t.append('div')\r\n\t.append('h1');\r\n\r\nelm.style('color', 'white'); \/\/ h1\u8981\u7d20\u306bstyle\u304c\u9069\u7528\u3055\u308c\u308b\r\n<\/pre>\n<p><strong>D3\u3067\u306f\u30e1\u30bd\u30c3\u30c9\u30c1\u30a7\u30fc\u30f3\u3067\u5b9f\u884c\u3055\u308c\u308b\u30e1\u30bd\u30c3\u30c9\u306e\u9806\u756a\u304c\u304b\u306a\u308a\u91cd\u8981\u3067\u3059<\/strong>\u3002(jQuery\u3067\u306f\u3042\u307e\u308a\u6c17\u306b\u3057\u306a\u304f\u3066\u3082\u3088\u3044)<br \/>\n\u3061\u3083\u3093\u3068\u8aac\u660e\u3067\u304d\u305f\u6c17\u304c\u3057\u307e\u305b\u3093\u304c\u3001D3\u306e\u3053\u306e\u4ed5\u69d8\u306f\u975e\u5e38\u306b\u91cd\u8981\u306a\u306e\u3067\u899a\u3048\u3066\u304a\u304f\u3068D3\u3078\u306e\u7406\u89e3\u304c\u9032\u3080\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u65e5\u306f\u5c0f\u30cd\u30bf\u3002 D3.js\u306e\u30bb\u30ec\u30af\u30b7\u30e7\u30f3\u306f\u3001\u307b\u307cj&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-2963","post","type-post","status-publish","format-standard","hentry","category-d3-js"],"_links":{"self":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/2963","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=2963"}],"version-history":[{"count":1,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/2963\/revisions"}],"predecessor-version":[{"id":2966,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/2963\/revisions\/2966"}],"wp:attachment":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/media?parent=2963"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/categories?post=2963"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/tags?post=2963"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}