{"action":"created","comment":{"url":"https://api.github.com/repos/jaegertracing/jaeger-ui/pulls/comments/242249812","pull_request_review_id":185717341,"id":242249812,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MjI0OTgxMg==","diff_hunk":"@@ -0,0 +1,329 @@\n+// @flow\n+\n+// Copyright (c) 2017 The Jaeger Authors.\n+//\n+// Licensed under the Apache License, Version 2.0 (the \"License\");\n+// you may not use this file except in compliance with the License.\n+// You may obtain a copy of the License at\n+//\n+// http://www.apache.org/licenses/LICENSE-2.0\n+//\n+// Unless required by applicable law or agreed to in writing, software\n+// distributed under the License is distributed on an \"AS IS\" BASIS,\n+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+// See the License for the specific language governing permissions and\n+// limitations under the License.\n+\n+import * as React from 'react';\n+import { Card, Icon, Button, Tooltip } from 'antd';\n+import { DirectedGraph, LayoutManager } from '@jaegertracing/plexus';\n+import DRange from 'drange';\n+\n+import OpNode, { getNodeDrawer, MODE_SERVICE, MODE_TIME, MODE_SELFTIME } from './OpNode';\n+import convPlexus from '../../../model/trace-dag/convPlexus';\n+import TraceDag from '../../../model/trace-dag/TraceDag';\n+\n+import type { Trace, Span, KeyValuePair } from '../../../types/trace';\n+\n+import './TraceGraph.css';\n+\n+type SumSpan = {\n+  count: number,\n+  errors: number,\n+  time: number,\n+  percent: number,\n+  selfTime: number,\n+  percentSelfTime: number,\n+};\n+\n+type Props = {\n+  headerHeight: number,\n+  trace: Trace,\n+};\n+type State = {\n+  showHelp: boolean,\n+  mode: string,\n+};\n+\n+const { classNameIsSmall } = DirectedGraph.propsFactories;\n+\n+export function setOnEdgePath(e: any) {\n+  return e.followsFrom ? { strokeDasharray: 4 } : {};\n+}\n+\n+function extendFollowsFrom(edges: any, nodes: any) {\n+  return edges.map(e => {\n+    let hasChildOf = true;\n+    if (typeof e.to === 'number') {\n+      const n = nodes[e.to];\n+      hasChildOf = n.members.some(\n+        m => m.span.references && m.span.references.some(r => r.refType === 'CHILD_OF')\n+      );\n+    }\n+    return { ...e, followsFrom: !hasChildOf };\n+  });\n+}\n+\n+export function isError(tags: Array<KeyValuePair>) {\n+  if (tags) {\n+    const errorTag = tags.find(t => t.key === 'error');\n+    if (errorTag) {\n+      return errorTag.value;\n+    }\n+  }\n+  return false;\n+}\n+\n+function helpContent() {\n+  return (\n+    <div className=\"TraceGraph--help-content\">\n+      {OpNode.helpTable()}\n+      <div>\n+        <table width=\"100%\">\n+          <tbody>\n+            <tr>\n+              <td>\n+                <Button shape=\"circle\" size=\"small\">\n+                  S\n+                </Button>\n+              </td>\n+              <td>Service</td>\n+              <td>Colored by service</td>\n+            </tr>\n+            <tr>\n+              <td>\n+                <Button shape=\"circle\" size=\"small\">\n+                  T\n+                </Button>\n+              </td>\n+              <td>Time</td>\n+              <td>Colored by total time</td>\n+            </tr>\n+            <tr>\n+              <td>\n+                <Button shape=\"circle\" size=\"small\">\n+                  ST\n+                </Button>\n+              </td>\n+              <td>Selftime</td>\n+              <td>Colored by self time</td>\n+            </tr>\n+          </tbody>\n+        </table>\n+      </div>\n+      <div>\n+        <svg width=\"100%\" height=\"40\">\n+          <line x1=\"0\" y1=\"10\" x2=\"90\" y2=\"10\" style={{ stroke: '#000', strokeWidth: 2 }} />\n+          <text alignmentBaseline=\"middle\" x=\"100\" y=\"10\">\n+            ChildOf\n+          </text>\n+          <line\n+            x1=\"0\"\n+            y1=\"30\"\n+            x2=\"90\"\n+            y2=\"30\"\n+            style={{ stroke: '#000', strokeWidth: 2, strokeDasharray: '4' }}\n+          />\n+          <text alignmentBaseline=\"middle\" x=\"100\" y=\"30\">\n+            FollowsFrom\n+          </text>\n+        </svg>\n+      </div>\n+    </div>\n+  );\n+}\n+\n+export default class TraceGraph extends React.PureComponent<Props, State> {\n+  props: Props;\n+  state: State;\n+\n+  parentChildOfMap: { [string]: Span[] };\n+  cache: any;\n+  modes: string[];\n+  modeIndex: number;\n+\n+  layoutManager: LayoutManager;\n+\n+  constructor(props: Props) {\n+    super(props);\n+    this.state = {\n+      showHelp: false,\n+      mode: MODE_SERVICE,\n+    };\n+    this.modes = [MODE_SERVICE, MODE_TIME, MODE_SELFTIME];","path":"packages/jaeger-ui/src/components/TracePage/TraceGraph/TraceGraph.js","position":null,"original_position":153,"commit_id":"982ef4a95614f77a2dbb4a28bb5fd169473f3192","original_commit_id":"6da9b78461e53617f8dda64bd567373dd829a060","user":{"login":"copa2","id":12240548,"node_id":"MDQ6VXNlcjEyMjQwNTQ4","avatar_url":"https://avatars3.githubusercontent.com/u/12240548?v=4","gravatar_id":"","url":"https://api.github.com/users/copa2","html_url":"https://github.com/copa2","followers_url":"https://api.github.com/users/copa2/followers","following_url":"https://api.github.com/users/copa2/following{/other_user}","gists_url":"https://api.github.com/users/copa2/gists{/gist_id}","starred_url":"https://api.github.com/users/copa2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/copa2/subscriptions","organizations_url":"https://api.github.com/users/copa2/orgs","repos_url":"https://api.github.com/users/copa2/repos","events_url":"https://api.github.com/users/copa2/events{/privacy}","received_events_url":"https://api.github.com/users/copa2/received_events","type":"User","site_admin":false},"body":"Thanks. Forgot to remove these.","created_at":"2018-12-17T17:49:14Z","updated_at":"2018-12-17T17:49:14Z","html_url":"https://github.com/jaegertracing/jaeger-ui/pull/276#discussion_r242249812","pull_request_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/pulls/276","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/jaegertracing/jaeger-ui/pulls/comments/242249812"},"html":{"href":"https://github.com/jaegertracing/jaeger-ui/pull/276#discussion_r242249812"},"pull_request":{"href":"https://api.github.com/repos/jaegertracing/jaeger-ui/pulls/276"}},"in_reply_to_id":242205014},"pull_request":{"url":"https://api.github.com/repos/jaegertracing/jaeger-ui/pulls/276","id":230665629,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMwNjY1NjI5","html_url":"https://github.com/jaegertracing/jaeger-ui/pull/276","diff_url":"https://github.com/jaegertracing/jaeger-ui/pull/276.diff","patch_url":"https://github.com/jaegertracing/jaeger-ui/pull/276.patch","issue_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/issues/276","number":276,"state":"open","locked":false,"title":"Add a TraceGraph to the TracePage","user":{"login":"copa2","id":12240548,"node_id":"MDQ6VXNlcjEyMjQwNTQ4","avatar_url":"https://avatars3.githubusercontent.com/u/12240548?v=4","gravatar_id":"","url":"https://api.github.com/users/copa2","html_url":"https://github.com/copa2","followers_url":"https://api.github.com/users/copa2/followers","following_url":"https://api.github.com/users/copa2/following{/other_user}","gists_url":"https://api.github.com/users/copa2/gists{/gist_id}","starred_url":"https://api.github.com/users/copa2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/copa2/subscriptions","organizations_url":"https://api.github.com/users/copa2/orgs","repos_url":"https://api.github.com/users/copa2/repos","events_url":"https://api.github.com/users/copa2/events{/privacy}","received_events_url":"https://api.github.com/users/copa2/received_events","type":"User","site_admin":false},"body":"Resolves #273 \r\n\r\nThis PR adds a TraceGraph view to the TracePage. This is an alternate view which summarize data of a trace: Count, TotalTime, % of time, in method time grouped by service and operation\r\n(https://github.com/jaegertracing/jaeger-ui/issues/273#issuecomment-437699454).\r\n\r\n![jaegeruitracegraph2](https://user-images.githubusercontent.com/12240548/48450617-39cb9c80-e7a7-11e8-95f9-160028323d9c.gif)\r\n","created_at":"2018-11-13T23:53:26Z","updated_at":"2018-12-17T17:49:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e0ca0b2b573bacce0fc82f9b502e677422d9e850","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/pulls/276/commits","review_comments_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/pulls/276/comments","review_comment_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/issues/276/comments","statuses_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/statuses/982ef4a95614f77a2dbb4a28bb5fd169473f3192","head":{"label":"copa2:tracegraph","ref":"tracegraph","sha":"982ef4a95614f77a2dbb4a28bb5fd169473f3192","user":{"login":"copa2","id":12240548,"node_id":"MDQ6VXNlcjEyMjQwNTQ4","avatar_url":"https://avatars3.githubusercontent.com/u/12240548?v=4","gravatar_id":"","url":"https://api.github.com/users/copa2","html_url":"https://github.com/copa2","followers_url":"https://api.github.com/users/copa2/followers","following_url":"https://api.github.com/users/copa2/following{/other_user}","gists_url":"https://api.github.com/users/copa2/gists{/gist_id}","starred_url":"https://api.github.com/users/copa2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/copa2/subscriptions","organizations_url":"https://api.github.com/users/copa2/orgs","repos_url":"https://api.github.com/users/copa2/repos","events_url":"https://api.github.com/users/copa2/events{/privacy}","received_events_url":"https://api.github.com/users/copa2/received_events","type":"User","site_admin":false},"repo":{"id":157106098,"node_id":"MDEwOlJlcG9zaXRvcnkxNTcxMDYwOTg=","name":"jaeger-ui","full_name":"copa2/jaeger-ui","private":false,"owner":{"login":"copa2","id":12240548,"node_id":"MDQ6VXNlcjEyMjQwNTQ4","avatar_url":"https://avatars3.githubusercontent.com/u/12240548?v=4","gravatar_id":"","url":"https://api.github.com/users/copa2","html_url":"https://github.com/copa2","followers_url":"https://api.github.com/users/copa2/followers","following_url":"https://api.github.com/users/copa2/following{/other_user}","gists_url":"https://api.github.com/users/copa2/gists{/gist_id}","starred_url":"https://api.github.com/users/copa2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/copa2/subscriptions","organizations_url":"https://api.github.com/users/copa2/orgs","repos_url":"https://api.github.com/users/copa2/repos","events_url":"https://api.github.com/users/copa2/events{/privacy}","received_events_url":"https://api.github.com/users/copa2/received_events","type":"User","site_admin":false},"html_url":"https://github.com/copa2/jaeger-ui","description":"Web UI for Jaeger","fork":true,"url":"https://api.github.com/repos/copa2/jaeger-ui","forks_url":"https://api.github.com/repos/copa2/jaeger-ui/forks","keys_url":"https://api.github.com/repos/copa2/jaeger-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/copa2/jaeger-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/copa2/jaeger-ui/teams","hooks_url":"https://api.github.com/repos/copa2/jaeger-ui/hooks","issue_events_url":"https://api.github.com/repos/copa2/jaeger-ui/issues/events{/number}","events_url":"https://api.github.com/repos/copa2/jaeger-ui/events","assignees_url":"https://api.github.com/repos/copa2/jaeger-ui/assignees{/user}","branches_url":"https://api.github.com/repos/copa2/jaeger-ui/branches{/branch}","tags_url":"https://api.github.com/repos/copa2/jaeger-ui/tags","blobs_url":"https://api.github.com/repos/copa2/jaeger-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/copa2/jaeger-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/copa2/jaeger-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/copa2/jaeger-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/copa2/jaeger-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/copa2/jaeger-ui/languages","stargazers_url":"https://api.github.com/repos/copa2/jaeger-ui/stargazers","contributors_url":"https://api.github.com/repos/copa2/jaeger-ui/contributors","subscribers_url":"https://api.github.com/repos/copa2/jaeger-ui/subscribers","subscription_url":"https://api.github.com/repos/copa2/jaeger-ui/subscription","commits_url":"https://api.github.com/repos/copa2/jaeger-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/copa2/jaeger-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/copa2/jaeger-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/copa2/jaeger-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/copa2/jaeger-ui/contents/{+path}","compare_url":"https://api.github.com/repos/copa2/jaeger-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/copa2/jaeger-ui/merges","archive_url":"https://api.github.com/repos/copa2/jaeger-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/copa2/jaeger-ui/downloads","issues_url":"https://api.github.com/repos/copa2/jaeger-ui/issues{/number}","pulls_url":"https://api.github.com/repos/copa2/jaeger-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/copa2/jaeger-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/copa2/jaeger-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/copa2/jaeger-ui/labels{/name}","releases_url":"https://api.github.com/repos/copa2/jaeger-ui/releases{/id}","deployments_url":"https://api.github.com/repos/copa2/jaeger-ui/deployments","created_at":"2018-11-11T18:01:38Z","updated_at":"2018-11-11T18:01:41Z","pushed_at":"2018-12-17T17:49:09Z","git_url":"git://github.com/copa2/jaeger-ui.git","ssh_url":"git@github.com:copa2/jaeger-ui.git","clone_url":"https://github.com/copa2/jaeger-ui.git","svn_url":"https://github.com/copa2/jaeger-ui","homepage":"http://jaegertracing.io/","size":4071,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jaegertracing:master","ref":"master","sha":"ae37289100ecc90523e6372ba8718fe43227f329","user":{"login":"jaegertracing","id":28545596,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4NTQ1NTk2","avatar_url":"https://avatars1.githubusercontent.com/u/28545596?v=4","gravatar_id":"","url":"https://api.github.com/users/jaegertracing","html_url":"https://github.com/jaegertracing","followers_url":"https://api.github.com/users/jaegertracing/followers","following_url":"https://api.github.com/users/jaegertracing/following{/other_user}","gists_url":"https://api.github.com/users/jaegertracing/gists{/gist_id}","starred_url":"https://api.github.com/users/jaegertracing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaegertracing/subscriptions","organizations_url":"https://api.github.com/users/jaegertracing/orgs","repos_url":"https://api.github.com/users/jaegertracing/repos","events_url":"https://api.github.com/users/jaegertracing/events{/privacy}","received_events_url":"https://api.github.com/users/jaegertracing/received_events","type":"Organization","site_admin":false},"repo":{"id":82920852,"node_id":"MDEwOlJlcG9zaXRvcnk4MjkyMDg1Mg==","name":"jaeger-ui","full_name":"jaegertracing/jaeger-ui","private":false,"owner":{"login":"jaegertracing","id":28545596,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4NTQ1NTk2","avatar_url":"https://avatars1.githubusercontent.com/u/28545596?v=4","gravatar_id":"","url":"https://api.github.com/users/jaegertracing","html_url":"https://github.com/jaegertracing","followers_url":"https://api.github.com/users/jaegertracing/followers","following_url":"https://api.github.com/users/jaegertracing/following{/other_user}","gists_url":"https://api.github.com/users/jaegertracing/gists{/gist_id}","starred_url":"https://api.github.com/users/jaegertracing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaegertracing/subscriptions","organizations_url":"https://api.github.com/users/jaegertracing/orgs","repos_url":"https://api.github.com/users/jaegertracing/repos","events_url":"https://api.github.com/users/jaegertracing/events{/privacy}","received_events_url":"https://api.github.com/users/jaegertracing/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/jaegertracing/jaeger-ui","description":"Web UI for Jaeger","fork":false,"url":"https://api.github.com/repos/jaegertracing/jaeger-ui","forks_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/forks","keys_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/teams","hooks_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/hooks","issue_events_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/issues/events{/number}","events_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/events","assignees_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/assignees{/user}","branches_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/branches{/branch}","tags_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/tags","blobs_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/languages","stargazers_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/stargazers","contributors_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/contributors","subscribers_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/subscribers","subscription_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/subscription","commits_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/contents/{+path}","compare_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/merges","archive_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/downloads","issues_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/issues{/number}","pulls_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/labels{/name}","releases_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/releases{/id}","deployments_url":"https://api.github.com/repos/jaegertracing/jaeger-ui/deployments","created_at":"2017-02-23T11:30:29Z","updated_at":"2018-12-13T03:19:56Z","pushed_at":"2018-12-17T17:49:10Z","git_url":"git://github.com/jaegertracing/jaeger-ui.git","ssh_url":"git@github.com:jaegertracing/jaeger-ui.git","clone_url":"https://github.com/jaegertracing/jaeger-ui.git","svn_url":"https://github.com/jaegertracing/jaeger-ui","homepage":"http://jaegertracing.io/","size":4246,"stargazers_count":234,"watchers_count":234,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":79,"mirror_url":null,"archived":false,"open_issues_count":73,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":79,"open_issues":73,"watchers":234,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jaegertracing/jaeger-ui/pulls/276"},"html":{"href":"https://github.com/jaegertracing/jaeger-ui/pull/276"},"issue":{"href":"https://api.github.com/repos/jaegertracing/jaeger-ui/issues/276"},"comments":{"href":"https://api.github.com/repos/jaegertracing/jaeger-ui/issues/276/comments"},"review_comments":{"href":"https://api.github.com/repos/jaegertracing/jaeger-ui/pulls/276/comments"},"review_comment":{"href":"https://api.github.com/repos/jaegertracing/jaeger-ui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jaegertracing/jaeger-ui/pulls/276/commits"},"statuses":{"href":"https://api.github.com/repos/jaegertracing/jaeger-ui/statuses/982ef4a95614f77a2dbb4a28bb5fd169473f3192"}},"author_association":"NONE"}}
{"actor":{"display_login":"copa2"}}