{"id":7143,"date":"2021-03-03T17:42:58","date_gmt":"2021-03-03T08:42:58","guid":{"rendered":"https:\/\/gunmagisgeek.com\/blog\/?p=7143"},"modified":"2023-11-14T12:14:48","modified_gmt":"2023-11-14T03:14:48","slug":"d3%e3%81%ae%e6%8a%95%e5%bd%b1%e6%b3%95%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6deck-gl%e3%81%ab%e5%9c%b0%e5%9b%b3%e3%82%92%e8%a1%a8%e7%a4%ba%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/gunmagisgeek.com\/blog\/deck-gl\/7143","title":{"rendered":"D3\u306e\u6295\u5f71\u6cd5\u3092\u4f7f\u3063\u3066Deck.gl\u306b\u5730\u56f3\u3092\u8868\u793a\u3059\u308b"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u6982\u8981<\/h2>\n\n\n\n<p>Deck.gl\u3067\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u308b\u5730\u56f3\u306e\u6295\u5f71\u6cd5\u306f\u3001\u57fa\u672cweb\u30e1\u30eb\u30ab\u30c8\u30eb\u306b\u306a\u308b\u306e\u3067\u3059\u304c\u3001<a class=\"\" href=\"https:\/\/github.com\/d3\/d3-geo-projection\">d3-geo-projection<\/a>\u3092\u4f7f\u3063\u3066web\u30e1\u30eb\u30ab\u30c8\u30eb\u4ee5\u5916\u306e\u6295\u5f71\u6cd5\u3067\u5730\u56f3\u3092\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9<\/h2>\n\n\n\n<iframe src=\"https:\/\/codesandbox.io\/embed\/deckgl-d3-projection-r44jrf?fontsize=14&amp;hidenavigation=1&amp;theme=dark\" style=\"width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;\" title=\"deck.gl - using d3 projection\" allow=\"accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking\" sandbox=\"allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts\"><\/iframe>\n\n\n\n<p>\u30a6\u30a4\u30f3\u30c9\u304c\u5c0f\u3055\u3044\u3068\u4f55\u3084\u3063\u3066\u3044\u308b\u304b\u5206\u304b\u308a\u3065\u3089\u3044\u306e\u3067\u3001<a href=\"https:\/\/codesandbox.io\/s\/deckgl-d3-projection-r44jrf\" data-type=\"link\" data-id=\"https:\/\/codesandbox.io\/s\/deckgl-d3-projection-r44jrf\">\u3053\u3061\u3089<\/a>\u3067\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u6982\u8981<\/h2>\n\n\n\n<p>\u3084\u3063\u3066\u3044\u308b\u3053\u3068\u306f\u5358\u7d14\u3067\u3001\u8aad\u307f\u8fbc\u3093\u3060geojson\u306egeometry.coordinates(\u7def\u5ea6\u7d4c\u5ea6)\u306e\u5024\u3092\u5024\u3092d3\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30b7\u30e7\u30f3\u95a2\u6570\u3092\u4f7f\u3063\u3066\u30b9\u30af\u30ea\u30fc\u30f3\u4e0a\u306e\u5ea7\u8868\u306b\u5909\u63db\u3057\u3001\u305d\u308c\u3092Deck.gl\u306ePolygonLayer\u3067\u30dd\u30ea\u30b4\u30f3\u3068\u3057\u3066\u8868\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:js mark:9,10,11,12,13,14 decode:true \">const layer = new PolygonLayer({\n    id: 'polygon-layer',\n    coordinateSystem: COORDINATE_SYSTEM.CARTESIAN,\n    data: data.features,\n    stroked: true,\n    filled: true,\n    wireframe: true,\n    lineWidthMinPixels: 1,\n    getPolygon: d =&gt; {\n        if (!d.geometry.coordinates || !d.geometry.coordinates[0]) return [[0, 0], [0, 0]];\n        return d.geometry.coordinates[0].map(function (xy) {\n            return proj(xy); \/\/d3\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30b7\u30e7\u30f3\u95a2\u6570\u3092\u4f7f\u3063\u3066\u5909\u63db\n        })\n    },\n    getElevation: 10,\n    getFillColor: [80, 80, 80],\n    getLineColor: [80, 0, 0],\n    getLineWidth: 0.1,\n});<\/pre><\/div>\n\n\n\n<p>\u5b9f\u8cea\u4e00\u679a\u7d75\u3092\u8868\u793a\u3057\u3066\u3044\u308b\u306e\u3068\u5909\u308f\u3089\u306a\u3044\u306e\u3067\u3001\u6b8b\u5ff5\u306a\u304c\u3089\u6771\u897f\u3067\u30eb\u30fc\u30d7\u3057\u305f\u308a\u3057\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p>\u4f7f\u3044\u6240\u304c\u96e3\u3057\u3044\u3067\u3059\u304c\u3001<a href=\"https:\/\/bl.ocks.org\/rveciana\/ee2119324e835e1bad42d0e4c1b9ab0d\" data-type=\"URL\" data-id=\"https:\/\/bl.ocks.org\/rveciana\/ee2119324e835e1bad42d0e4c1b9ab0d\">geoAlbersUsa<\/a>\u306a\u3069\u3092Deck.gl\u3067\u4f7f\u3044\u305f\u3044\u3068\u304d\u306b\u6d3b\u7528\u3067\u304d\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981 Deck.gl\u3067\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u308b\u5730\u56f3\u306e\u6295\u5f71&hellip;<\/p>\n","protected":false},"author":1,"featured_media":7144,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[73],"tags":[],"class_list":["post-7143","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-deck-gl","has-post-thumbnail-archive"],"_links":{"self":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/7143","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=7143"}],"version-history":[{"count":7,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/7143\/revisions"}],"predecessor-version":[{"id":8321,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/7143\/revisions\/8321"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/media\/7144"}],"wp:attachment":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/media?parent=7143"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/categories?post=7143"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/tags?post=7143"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}