{"action":"created","comment":{"url":"https://api.github.com/repos/arose/ngl/pulls/comments/176949072","pull_request_review_id":106738682,"id":176949072,"diff_hunk":"@@ -1,42 +1,62 @@\n \n NGL.autoLoad('data://1crnFH-multi.kin').then(function (kinemage) {\n   for (let master in kinemage.masterDict) {\n-    var shape = new NGL.Shape(master, {\n-      pointSize: 3,\n-      sizeAttenuation: false,\n-      lineWidth: 3\n-    })\n+    var shape = new NGL.Shape(master)\n \n     kinemage.dotLists.forEach(function (dotList) {\n-      if (!dotList.master.includes(master)) return\n-      for (var i = 0, il = dotList.position.length / 3; i < il; ++i) {\n-        var i3 = i * 3\n-        var x = dotList.position[ i3 ]\n-        var y = dotList.position[ i3 + 1 ]\n-        var z = dotList.position[ i3 + 2 ]\n-        var r = dotList.color[ i3 ]\n-        var g = dotList.color[ i3 + 1 ]\n-        var b = dotList.color[ i3 + 2 ]\n-        shape.addPoint([ x, y, z ], [ r, g, b ], dotList.label[ i ])\n-      }\n+      if (!dotList.masterArray.includes(master)) return\n+      var pointBuffer = new NGL.PointBuffer({\n+        position: new Float32Array(dotList.positionArray),\n+        color: new Float32Array(dotList.colorArray)\n+      }, {\n+        pointSize: 2,\n+        sizeAttenuation: false,\n+        useTexture: true\n+      })\n+      shape.addBuffer(pointBuffer)\n     })\n \n     kinemage.vectorLists.forEach(function (vectorList) {\n-      if (!vectorList.master.includes(master)) return\n-      for (var i = 0, il = vectorList.position1.length / 3; i < il; ++i) {\n-        var i3 = i * 3\n-        var x1 = vectorList.position1[ i3 ]\n-        var y1 = vectorList.position1[ i3 + 1 ]\n-        var z1 = vectorList.position1[ i3 + 2 ]\n-        var x2 = vectorList.position2[ i3 ]\n-        var y2 = vectorList.position2[ i3 + 1 ]\n-        var z2 = vectorList.position2[ i3 + 2 ]\n-        var r = vectorList.color1[ i3 ]\n-        var g = vectorList.color1[ i3 + 1 ]\n-        var b = vectorList.color1[ i3 + 2 ]\n-        shape.addWideline([ x1, y1, z1 ], [ x2, y2, z2 ], [ r, g, b ], vectorList.label1[ i ])\n-      }\n+      if (!vectorList.masterArray.includes(master)) return\n+      var widelineBuffer = new NGL.WidelineBuffer({\n+        position1: new Float32Array(vectorList.position1Array),\n+        position2: new Float32Array(vectorList.position2Array),\n+        color: new Float32Array(vectorList.color1Array),\n+        color2: new Float32Array(vectorList.color2Array)\n+      }, {\n+        linewidth: vectorList.width[0]\n+      })\n+      shape.addBuffer(widelineBuffer)\n+    })\n+\n+    kinemage.ballLists.forEach(function (ballList) {\n+      if (!ballList.masterArray.includes(master)) return\n+      var sphereBuff = new NGL.SphereBuffer({\n+        position: new Float32Array(ballList.positionArray),\n+        radius: new Float32Array(ballList.radiusArray),\n+        color: new Float32Array(ballList.colorArray)\n+      }, {\n+        useTexture: true\n+      })\n+      shape.addBuffer(sphereBuff)\n+    })\n+\n+    var positionArray = []\n+    var colorArray = []\n+    kinemage.ribbonLists.forEach(function (ribbonList) {\n+      if (!ribbonList.masterArray.includes(master)) return\n+      positionArray.push(...ribbonList.positionArray)\n+      colorArray.push(...ribbonList.colorArray)\n     })\n+    if (positionArray.length > 0) {","path":"examples/scripts/parser/kin.js","position":81,"original_position":81,"commit_id":"2b4c6309d1673484b4e1c24b01d8c823e7990535","original_commit_id":"2b4c6309d1673484b4e1c24b01d8c823e7990535","user":{"login":"arose","id":272250,"avatar_url":"https://avatars0.githubusercontent.com/u/272250?v=4","gravatar_id":"","url":"https://api.github.com/users/arose","html_url":"https://github.com/arose","followers_url":"https://api.github.com/users/arose/followers","following_url":"https://api.github.com/users/arose/following{/other_user}","gists_url":"https://api.github.com/users/arose/gists{/gist_id}","starred_url":"https://api.github.com/users/arose/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arose/subscriptions","organizations_url":"https://api.github.com/users/arose/orgs","repos_url":"https://api.github.com/users/arose/repos","events_url":"https://api.github.com/users/arose/events{/privacy}","received_events_url":"https://api.github.com/users/arose/received_events","type":"User","site_admin":false},"body":"great, thanks!","created_at":"2018-03-25T18:24:41Z","updated_at":"2018-03-25T18:24:42Z","html_url":"https://github.com/arose/ngl/pull/501#discussion_r176949072","pull_request_url":"https://api.github.com/repos/arose/ngl/pulls/501","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/arose/ngl/pulls/comments/176949072"},"html":{"href":"https://github.com/arose/ngl/pull/501#discussion_r176949072"},"pull_request":{"href":"https://api.github.com/repos/arose/ngl/pulls/501"}},"in_reply_to_id":175926893},"pull_request":{"url":"https://api.github.com/repos/arose/ngl/pulls/501","id":176286679,"html_url":"https://github.com/arose/ngl/pull/501","diff_url":"https://github.com/arose/ngl/pull/501.diff","patch_url":"https://github.com/arose/ngl/pull/501.patch","issue_url":"https://api.github.com/repos/arose/ngl/issues/501","number":501,"state":"open","locked":false,"title":"updated kin.js example","user":{"login":"vbchen","id":12863278,"avatar_url":"https://avatars3.githubusercontent.com/u/12863278?v=4","gravatar_id":"","url":"https://api.github.com/users/vbchen","html_url":"https://github.com/vbchen","followers_url":"https://api.github.com/users/vbchen/followers","following_url":"https://api.github.com/users/vbchen/following{/other_user}","gists_url":"https://api.github.com/users/vbchen/gists{/gist_id}","starred_url":"https://api.github.com/users/vbchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vbchen/subscriptions","organizations_url":"https://api.github.com/users/vbchen/orgs","repos_url":"https://api.github.com/users/vbchen/repos","events_url":"https://api.github.com/users/vbchen/events{/privacy}","received_events_url":"https://api.github.com/users/vbchen/received_events","type":"User","site_admin":false},"body":"Updated the example kinemage.\r\nUpdated the kin.js code with the additions to kin-parser.","created_at":"2018-03-20T18:42:27Z","updated_at":"2018-03-25T18:24:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/arose/ngl/pulls/501/commits","review_comments_url":"https://api.github.com/repos/arose/ngl/pulls/501/comments","review_comment_url":"https://api.github.com/repos/arose/ngl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/arose/ngl/issues/501/comments","statuses_url":"https://api.github.com/repos/arose/ngl/statuses/2b4c6309d1673484b4e1c24b01d8c823e7990535","head":{"label":"vbchen:master","ref":"master","sha":"2b4c6309d1673484b4e1c24b01d8c823e7990535","user":{"login":"vbchen","id":12863278,"avatar_url":"https://avatars3.githubusercontent.com/u/12863278?v=4","gravatar_id":"","url":"https://api.github.com/users/vbchen","html_url":"https://github.com/vbchen","followers_url":"https://api.github.com/users/vbchen/followers","following_url":"https://api.github.com/users/vbchen/following{/other_user}","gists_url":"https://api.github.com/users/vbchen/gists{/gist_id}","starred_url":"https://api.github.com/users/vbchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vbchen/subscriptions","organizations_url":"https://api.github.com/users/vbchen/orgs","repos_url":"https://api.github.com/users/vbchen/repos","events_url":"https://api.github.com/users/vbchen/events{/privacy}","received_events_url":"https://api.github.com/users/vbchen/received_events","type":"User","site_admin":false},"repo":{"id":122996032,"name":"ngl","full_name":"vbchen/ngl","owner":{"login":"vbchen","id":12863278,"avatar_url":"https://avatars3.githubusercontent.com/u/12863278?v=4","gravatar_id":"","url":"https://api.github.com/users/vbchen","html_url":"https://github.com/vbchen","followers_url":"https://api.github.com/users/vbchen/followers","following_url":"https://api.github.com/users/vbchen/following{/other_user}","gists_url":"https://api.github.com/users/vbchen/gists{/gist_id}","starred_url":"https://api.github.com/users/vbchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vbchen/subscriptions","organizations_url":"https://api.github.com/users/vbchen/orgs","repos_url":"https://api.github.com/users/vbchen/repos","events_url":"https://api.github.com/users/vbchen/events{/privacy}","received_events_url":"https://api.github.com/users/vbchen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vbchen/ngl","description":"WebGL protein viewer","fork":true,"url":"https://api.github.com/repos/vbchen/ngl","forks_url":"https://api.github.com/repos/vbchen/ngl/forks","keys_url":"https://api.github.com/repos/vbchen/ngl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vbchen/ngl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vbchen/ngl/teams","hooks_url":"https://api.github.com/repos/vbchen/ngl/hooks","issue_events_url":"https://api.github.com/repos/vbchen/ngl/issues/events{/number}","events_url":"https://api.github.com/repos/vbchen/ngl/events","assignees_url":"https://api.github.com/repos/vbchen/ngl/assignees{/user}","branches_url":"https://api.github.com/repos/vbchen/ngl/branches{/branch}","tags_url":"https://api.github.com/repos/vbchen/ngl/tags","blobs_url":"https://api.github.com/repos/vbchen/ngl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vbchen/ngl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vbchen/ngl/git/refs{/sha}","trees_url":"https://api.github.com/repos/vbchen/ngl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vbchen/ngl/statuses/{sha}","languages_url":"https://api.github.com/repos/vbchen/ngl/languages","stargazers_url":"https://api.github.com/repos/vbchen/ngl/stargazers","contributors_url":"https://api.github.com/repos/vbchen/ngl/contributors","subscribers_url":"https://api.github.com/repos/vbchen/ngl/subscribers","subscription_url":"https://api.github.com/repos/vbchen/ngl/subscription","commits_url":"https://api.github.com/repos/vbchen/ngl/commits{/sha}","git_commits_url":"https://api.github.com/repos/vbchen/ngl/git/commits{/sha}","comments_url":"https://api.github.com/repos/vbchen/ngl/comments{/number}","issue_comment_url":"https://api.github.com/repos/vbchen/ngl/issues/comments{/number}","contents_url":"https://api.github.com/repos/vbchen/ngl/contents/{+path}","compare_url":"https://api.github.com/repos/vbchen/ngl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vbchen/ngl/merges","archive_url":"https://api.github.com/repos/vbchen/ngl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vbchen/ngl/downloads","issues_url":"https://api.github.com/repos/vbchen/ngl/issues{/number}","pulls_url":"https://api.github.com/repos/vbchen/ngl/pulls{/number}","milestones_url":"https://api.github.com/repos/vbchen/ngl/milestones{/number}","notifications_url":"https://api.github.com/repos/vbchen/ngl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vbchen/ngl/labels{/name}","releases_url":"https://api.github.com/repos/vbchen/ngl/releases{/id}","deployments_url":"https://api.github.com/repos/vbchen/ngl/deployments","created_at":"2018-02-26T16:20:27Z","updated_at":"2018-03-20T18:30:39Z","pushed_at":"2018-03-20T18:30:37Z","git_url":"git://github.com/vbchen/ngl.git","ssh_url":"git@github.com:vbchen/ngl.git","clone_url":"https://github.com/vbchen/ngl.git","svn_url":"https://github.com/vbchen/ngl","homepage":"http://nglviewer.org/ngl/","size":526006,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"arose:master","ref":"master","sha":"d5e01579be20a0d5c1dbdf883f9a2bd08edba579","user":{"login":"arose","id":272250,"avatar_url":"https://avatars0.githubusercontent.com/u/272250?v=4","gravatar_id":"","url":"https://api.github.com/users/arose","html_url":"https://github.com/arose","followers_url":"https://api.github.com/users/arose/followers","following_url":"https://api.github.com/users/arose/following{/other_user}","gists_url":"https://api.github.com/users/arose/gists{/gist_id}","starred_url":"https://api.github.com/users/arose/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arose/subscriptions","organizations_url":"https://api.github.com/users/arose/orgs","repos_url":"https://api.github.com/users/arose/repos","events_url":"https://api.github.com/users/arose/events{/privacy}","received_events_url":"https://api.github.com/users/arose/received_events","type":"User","site_admin":false},"repo":{"id":23541399,"name":"ngl","full_name":"arose/ngl","owner":{"login":"arose","id":272250,"avatar_url":"https://avatars0.githubusercontent.com/u/272250?v=4","gravatar_id":"","url":"https://api.github.com/users/arose","html_url":"https://github.com/arose","followers_url":"https://api.github.com/users/arose/followers","following_url":"https://api.github.com/users/arose/following{/other_user}","gists_url":"https://api.github.com/users/arose/gists{/gist_id}","starred_url":"https://api.github.com/users/arose/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arose/subscriptions","organizations_url":"https://api.github.com/users/arose/orgs","repos_url":"https://api.github.com/users/arose/repos","events_url":"https://api.github.com/users/arose/events{/privacy}","received_events_url":"https://api.github.com/users/arose/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/arose/ngl","description":"WebGL protein viewer","fork":false,"url":"https://api.github.com/repos/arose/ngl","forks_url":"https://api.github.com/repos/arose/ngl/forks","keys_url":"https://api.github.com/repos/arose/ngl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/arose/ngl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/arose/ngl/teams","hooks_url":"https://api.github.com/repos/arose/ngl/hooks","issue_events_url":"https://api.github.com/repos/arose/ngl/issues/events{/number}","events_url":"https://api.github.com/repos/arose/ngl/events","assignees_url":"https://api.github.com/repos/arose/ngl/assignees{/user}","branches_url":"https://api.github.com/repos/arose/ngl/branches{/branch}","tags_url":"https://api.github.com/repos/arose/ngl/tags","blobs_url":"https://api.github.com/repos/arose/ngl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/arose/ngl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/arose/ngl/git/refs{/sha}","trees_url":"https://api.github.com/repos/arose/ngl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/arose/ngl/statuses/{sha}","languages_url":"https://api.github.com/repos/arose/ngl/languages","stargazers_url":"https://api.github.com/repos/arose/ngl/stargazers","contributors_url":"https://api.github.com/repos/arose/ngl/contributors","subscribers_url":"https://api.github.com/repos/arose/ngl/subscribers","subscription_url":"https://api.github.com/repos/arose/ngl/subscription","commits_url":"https://api.github.com/repos/arose/ngl/commits{/sha}","git_commits_url":"https://api.github.com/repos/arose/ngl/git/commits{/sha}","comments_url":"https://api.github.com/repos/arose/ngl/comments{/number}","issue_comment_url":"https://api.github.com/repos/arose/ngl/issues/comments{/number}","contents_url":"https://api.github.com/repos/arose/ngl/contents/{+path}","compare_url":"https://api.github.com/repos/arose/ngl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/arose/ngl/merges","archive_url":"https://api.github.com/repos/arose/ngl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/arose/ngl/downloads","issues_url":"https://api.github.com/repos/arose/ngl/issues{/number}","pulls_url":"https://api.github.com/repos/arose/ngl/pulls{/number}","milestones_url":"https://api.github.com/repos/arose/ngl/milestones{/number}","notifications_url":"https://api.github.com/repos/arose/ngl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/arose/ngl/labels{/name}","releases_url":"https://api.github.com/repos/arose/ngl/releases{/id}","deployments_url":"https://api.github.com/repos/arose/ngl/deployments","created_at":"2014-09-01T12:18:28Z","updated_at":"2018-03-25T18:13:51Z","pushed_at":"2018-03-25T18:13:49Z","git_url":"git://github.com/arose/ngl.git","ssh_url":"git@github.com:arose/ngl.git","clone_url":"https://github.com/arose/ngl.git","svn_url":"https://github.com/arose/ngl","homepage":"http://nglviewer.org/ngl/","size":526083,"stargazers_count":220,"watchers_count":220,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":59,"mirror_url":null,"archived":false,"open_issues_count":83,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":59,"open_issues":83,"watchers":220,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/arose/ngl/pulls/501"},"html":{"href":"https://github.com/arose/ngl/pull/501"},"issue":{"href":"https://api.github.com/repos/arose/ngl/issues/501"},"comments":{"href":"https://api.github.com/repos/arose/ngl/issues/501/comments"},"review_comments":{"href":"https://api.github.com/repos/arose/ngl/pulls/501/comments"},"review_comment":{"href":"https://api.github.com/repos/arose/ngl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/arose/ngl/pulls/501/commits"},"statuses":{"href":"https://api.github.com/repos/arose/ngl/statuses/2b4c6309d1673484b4e1c24b01d8c823e7990535"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"arose"}}