{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/kibana/pulls/comments/220631755","pull_request_review_id":159083655,"id":220631755,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMDYzMTc1NQ==","diff_hunk":"@@ -0,0 +1,69 @@\n+/*\n+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n+ * or more contributor license agreements. Licensed under the Elastic License;\n+ * you may not use this file except in compliance with the Elastic License.\n+ */\n+\n+import './styles/explorer_chart_label.less';\n+\n+import PropTypes from 'prop-types';\n+import React from 'react';\n+\n+import {\n+  EuiIconTip\n+} from '@elastic/eui';\n+\n+import { ExplorerChartLabelBadge } from './explorer_chart_label_badge';\n+import { ExplorerChartTooltip } from '../../explorer_chart_tooltip';\n+\n+export function ExplorerChartLabel({ detectorLabel, entityFields, infoTooltip, wrapLabel }) {\n+  /*\n+    Depending on whether we wrap the entityField badges to a new line, we render this differently:\n+\n+    1. All in one line:\n+        <detectorLabel> - <entityBadge1> <entityBadge2> ... <infoIcon>\n+\n+    2. Multiple lines:\n+        <detectorLabel> <infoIcon> <br />\n+        <entityBadge1> <entityBadge2> ...\n+  */\n+\n+  const labelSeparator = (wrapLabel === true) ? <br /> : ' - ';\n+\n+  const entityFieldBadges = entityFields.map((entity, j) => {\n+    return <span key={j}><ExplorerChartLabelBadge entity={entity} /> </span>;\n+  });\n+","path":"x-pack/plugins/ml/public/explorer/explorer_charts/components/explorer_chart_label/explorer_chart_label.js","position":36,"original_position":36,"commit_id":"aee9e06a9b7e3b1869cda586017476ef0ba7e809","original_commit_id":"aee9e06a9b7e3b1869cda586017476ef0ba7e809","user":{"login":"walterra","id":230104,"node_id":"MDQ6VXNlcjIzMDEwNA==","avatar_url":"https://avatars3.githubusercontent.com/u/230104?v=4","gravatar_id":"","url":"https://api.github.com/users/walterra","html_url":"https://github.com/walterra","followers_url":"https://api.github.com/users/walterra/followers","following_url":"https://api.github.com/users/walterra/following{/other_user}","gists_url":"https://api.github.com/users/walterra/gists{/gist_id}","starred_url":"https://api.github.com/users/walterra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/walterra/subscriptions","organizations_url":"https://api.github.com/users/walterra/orgs","repos_url":"https://api.github.com/users/walterra/repos","events_url":"https://api.github.com/users/walterra/events{/privacy}","received_events_url":"https://api.github.com/users/walterra/received_events","type":"User","site_admin":false},"body":"Nice find, I built a custom key for the outer `.map()` part in the same file but let hat slip through here :)","created_at":"2018-09-26T16:19:46Z","updated_at":"2018-09-26T16:19:46Z","html_url":"https://github.com/elastic/kibana/pull/23494#discussion_r220631755","pull_request_url":"https://api.github.com/repos/elastic/kibana/pulls/23494","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/elastic/kibana/pulls/comments/220631755"},"html":{"href":"https://github.com/elastic/kibana/pull/23494#discussion_r220631755"},"pull_request":{"href":"https://api.github.com/repos/elastic/kibana/pulls/23494"}},"in_reply_to_id":220626811},"pull_request":{"url":"https://api.github.com/repos/elastic/kibana/pulls/23494","id":218028672,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE4MDI4Njcy","html_url":"https://github.com/elastic/kibana/pull/23494","diff_url":"https://github.com/elastic/kibana/pull/23494.diff","patch_url":"https://github.com/elastic/kibana/pull/23494.patch","issue_url":"https://api.github.com/repos/elastic/kibana/issues/23494","number":23494,"state":"open","locked":false,"title":"[ML] Tweak Explorer Chart labels.","user":{"login":"walterra","id":230104,"node_id":"MDQ6VXNlcjIzMDEwNA==","avatar_url":"https://avatars3.githubusercontent.com/u/230104?v=4","gravatar_id":"","url":"https://api.github.com/users/walterra","html_url":"https://github.com/walterra","followers_url":"https://api.github.com/users/walterra/followers","following_url":"https://api.github.com/users/walterra/following{/other_user}","gists_url":"https://api.github.com/users/walterra/gists{/gist_id}","starred_url":"https://api.github.com/users/walterra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/walterra/subscriptions","organizations_url":"https://api.github.com/users/walterra/orgs","repos_url":"https://api.github.com/users/walterra/repos","events_url":"https://api.github.com/users/walterra/events{/privacy}","received_events_url":"https://api.github.com/users/walterra/received_events","type":"User","site_admin":false},"body":"Tweaks the display of the Explorer Chart labels to fix the following issues:\r\n\r\n- Long chart labels could be cut off, so it's not possible to tell what entity fields a chart is referring to. A workaround is to hover the info icon tooltip but that's really slow and cumbersome if you have to do it for every chart.\r\n\r\n![image](https://user-images.githubusercontent.com/230104/46024220-9afbbb80-c0e6-11e8-9de5-792102000f41.png)\r\n\r\n- The list of entity fields and its values is an unformatted text blob which makes it hard to read and tell which values refer to which field\r\n\r\n![image](https://user-images.githubusercontent.com/230104/46024419-0c3b6e80-c0e7-11e8-9d98-35b2d21128e2.png)\r\n\r\nProposed solution:\r\n\r\n- If any of the chart labels is longer than 60 chars, the entity fields will wrap to a new line (for all charts to a achieve a consistent look).\r\n- Entity fields use `EuiBadge` and some custom formatting to make it easier to see field/value pairs.\r\n\r\n![image](https://user-images.githubusercontent.com/230104/46024633-866bf300-c0e7-11e8-91bc-fa1b2b07a557.png)\r\n\r\n- If the detector description is too long, it still uses `ellipsis` for `text-overflow`:\r\n\r\n![image](https://user-images.githubusercontent.com/230104/46081829-c68dad00-c19d-11e8-9a63-6083f75311ff.png)\r\n\r\n- If the entity badges are too long, they will be just cut off to the right. There's no simple CSS fix for that, we cannot use `ellipsis` and we don't want to wrap those badges again because then multiple charts could have different heights. I experimented with gradients but that turned out to be somewhat unreliable. I still consider this a good enough improvement compare to the previous version and would like to leave a tweak for that to a follow up PR. \r\n\r\n![image](https://user-images.githubusercontent.com/230104/46081999-39972380-c19e-11e8-8eaa-4428e54ef0cc.png)\r\n\r\n- Additionally, this changes the link to the single series viewer from custom code using a Font Awesome icon to use `EuiButtonEmpty` with the same EUI based icon and a tooltip.\r\n\r\n![image](https://user-images.githubusercontent.com/230104/46081054-d0aeac00-c19b-11e8-889e-fe58e21920e0.png)\r\n\r\nNote: The threshold of 60 chars was chosen after testing the responsive layout and how we determine how many charts to show per row. I tried to do this without completely revamping/rethinking how this chart header is done, but after migrating the view-link to EUI and adding tests, well, here's what we got :). How this header is done could be further improved but I'd consider this a good enough solution for now. The main reason I did this is to make the entityFields information more readable and not being hidden easily. Let me know what you think.","created_at":"2018-09-25T15:41:13Z","updated_at":"2018-09-26T16:19:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1029fbbd081fdead847864e619e9833298e7907a","assignee":{"login":"walterra","id":230104,"node_id":"MDQ6VXNlcjIzMDEwNA==","avatar_url":"https://avatars3.githubusercontent.com/u/230104?v=4","gravatar_id":"","url":"https://api.github.com/users/walterra","html_url":"https://github.com/walterra","followers_url":"https://api.github.com/users/walterra/followers","following_url":"https://api.github.com/users/walterra/following{/other_user}","gists_url":"https://api.github.com/users/walterra/gists{/gist_id}","starred_url":"https://api.github.com/users/walterra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/walterra/subscriptions","organizations_url":"https://api.github.com/users/walterra/orgs","repos_url":"https://api.github.com/users/walterra/repos","events_url":"https://api.github.com/users/walterra/events{/privacy}","received_events_url":"https://api.github.com/users/walterra/received_events","type":"User","site_admin":false},"assignees":[{"login":"walterra","id":230104,"node_id":"MDQ6VXNlcjIzMDEwNA==","avatar_url":"https://avatars3.githubusercontent.com/u/230104?v=4","gravatar_id":"","url":"https://api.github.com/users/walterra","html_url":"https://github.com/walterra","followers_url":"https://api.github.com/users/walterra/followers","following_url":"https://api.github.com/users/walterra/following{/other_user}","gists_url":"https://api.github.com/users/walterra/gists{/gist_id}","starred_url":"https://api.github.com/users/walterra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/walterra/subscriptions","organizations_url":"https://api.github.com/users/walterra/orgs","repos_url":"https://api.github.com/users/walterra/repos","events_url":"https://api.github.com/users/walterra/events{/privacy}","received_events_url":"https://api.github.com/users/walterra/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":912943303,"node_id":"MDU6TGFiZWw5MTI5NDMzMDM=","url":"https://api.github.com/repos/elastic/kibana/labels/:ml","name":":ml","color":"0e8a16","default":false},{"id":912944483,"node_id":"MDU6TGFiZWw5MTI5NDQ0ODM=","url":"https://api.github.com/repos/elastic/kibana/labels/:ml-results","name":":ml-results","color":"0e8a16","default":false},{"id":912944841,"node_id":"MDU6TGFiZWw5MTI5NDQ4NDE=","url":"https://api.github.com/repos/elastic/kibana/labels/cosmetic","name":"cosmetic","color":"bfd4f2","default":false},{"id":135307740,"node_id":"MDU6TGFiZWwxMzUzMDc3NDA=","url":"https://api.github.com/repos/elastic/kibana/labels/review","name":"review","color":"0052cc","default":false},{"id":912973198,"node_id":"MDU6TGFiZWw5MTI5NzMxOTg=","url":"https://api.github.com/repos/elastic/kibana/labels/v6.5.0","name":"v6.5.0","color":"ffffff","default":false},{"id":654061976,"node_id":"MDU6TGFiZWw2NTQwNjE5NzY=","url":"https://api.github.com/repos/elastic/kibana/labels/v7.0.0","name":"v7.0.0","color":"ffffff","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/elastic/kibana/pulls/23494/commits","review_comments_url":"https://api.github.com/repos/elastic/kibana/pulls/23494/comments","review_comment_url":"https://api.github.com/repos/elastic/kibana/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/kibana/issues/23494/comments","statuses_url":"https://api.github.com/repos/elastic/kibana/statuses/aee9e06a9b7e3b1869cda586017476ef0ba7e809","head":{"label":"walterra:ml-anomaly-explorer-chart-labels","ref":"ml-anomaly-explorer-chart-labels","sha":"aee9e06a9b7e3b1869cda586017476ef0ba7e809","user":{"login":"walterra","id":230104,"node_id":"MDQ6VXNlcjIzMDEwNA==","avatar_url":"https://avatars3.githubusercontent.com/u/230104?v=4","gravatar_id":"","url":"https://api.github.com/users/walterra","html_url":"https://github.com/walterra","followers_url":"https://api.github.com/users/walterra/followers","following_url":"https://api.github.com/users/walterra/following{/other_user}","gists_url":"https://api.github.com/users/walterra/gists{/gist_id}","starred_url":"https://api.github.com/users/walterra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/walterra/subscriptions","organizations_url":"https://api.github.com/users/walterra/orgs","repos_url":"https://api.github.com/users/walterra/repos","events_url":"https://api.github.com/users/walterra/events{/privacy}","received_events_url":"https://api.github.com/users/walterra/received_events","type":"User","site_admin":false},"repo":{"id":99786588,"node_id":"MDEwOlJlcG9zaXRvcnk5OTc4NjU4OA==","name":"kibana","full_name":"walterra/kibana","private":false,"owner":{"login":"walterra","id":230104,"node_id":"MDQ6VXNlcjIzMDEwNA==","avatar_url":"https://avatars3.githubusercontent.com/u/230104?v=4","gravatar_id":"","url":"https://api.github.com/users/walterra","html_url":"https://github.com/walterra","followers_url":"https://api.github.com/users/walterra/followers","following_url":"https://api.github.com/users/walterra/following{/other_user}","gists_url":"https://api.github.com/users/walterra/gists{/gist_id}","starred_url":"https://api.github.com/users/walterra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/walterra/subscriptions","organizations_url":"https://api.github.com/users/walterra/orgs","repos_url":"https://api.github.com/users/walterra/repos","events_url":"https://api.github.com/users/walterra/events{/privacy}","received_events_url":"https://api.github.com/users/walterra/received_events","type":"User","site_admin":false},"html_url":"https://github.com/walterra/kibana","description":":bar_chart: Kibana analytics and search dashboard for Elasticsearch","fork":true,"url":"https://api.github.com/repos/walterra/kibana","forks_url":"https://api.github.com/repos/walterra/kibana/forks","keys_url":"https://api.github.com/repos/walterra/kibana/keys{/key_id}","collaborators_url":"https://api.github.com/repos/walterra/kibana/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/walterra/kibana/teams","hooks_url":"https://api.github.com/repos/walterra/kibana/hooks","issue_events_url":"https://api.github.com/repos/walterra/kibana/issues/events{/number}","events_url":"https://api.github.com/repos/walterra/kibana/events","assignees_url":"https://api.github.com/repos/walterra/kibana/assignees{/user}","branches_url":"https://api.github.com/repos/walterra/kibana/branches{/branch}","tags_url":"https://api.github.com/repos/walterra/kibana/tags","blobs_url":"https://api.github.com/repos/walterra/kibana/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/walterra/kibana/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/walterra/kibana/git/refs{/sha}","trees_url":"https://api.github.com/repos/walterra/kibana/git/trees{/sha}","statuses_url":"https://api.github.com/repos/walterra/kibana/statuses/{sha}","languages_url":"https://api.github.com/repos/walterra/kibana/languages","stargazers_url":"https://api.github.com/repos/walterra/kibana/stargazers","contributors_url":"https://api.github.com/repos/walterra/kibana/contributors","subscribers_url":"https://api.github.com/repos/walterra/kibana/subscribers","subscription_url":"https://api.github.com/repos/walterra/kibana/subscription","commits_url":"https://api.github.com/repos/walterra/kibana/commits{/sha}","git_commits_url":"https://api.github.com/repos/walterra/kibana/git/commits{/sha}","comments_url":"https://api.github.com/repos/walterra/kibana/comments{/number}","issue_comment_url":"https://api.github.com/repos/walterra/kibana/issues/comments{/number}","contents_url":"https://api.github.com/repos/walterra/kibana/contents/{+path}","compare_url":"https://api.github.com/repos/walterra/kibana/compare/{base}...{head}","merges_url":"https://api.github.com/repos/walterra/kibana/merges","archive_url":"https://api.github.com/repos/walterra/kibana/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/walterra/kibana/downloads","issues_url":"https://api.github.com/repos/walterra/kibana/issues{/number}","pulls_url":"https://api.github.com/repos/walterra/kibana/pulls{/number}","milestones_url":"https://api.github.com/repos/walterra/kibana/milestones{/number}","notifications_url":"https://api.github.com/repos/walterra/kibana/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/walterra/kibana/labels{/name}","releases_url":"https://api.github.com/repos/walterra/kibana/releases{/id}","deployments_url":"https://api.github.com/repos/walterra/kibana/deployments","created_at":"2017-08-09T08:54:30Z","updated_at":"2018-09-07T08:05:27Z","pushed_at":"2018-09-26T13:38:17Z","git_url":"git://github.com/walterra/kibana.git","ssh_url":"git@github.com:walterra/kibana.git","clone_url":"https://github.com/walterra/kibana.git","svn_url":"https://github.com/walterra/kibana","homepage":"https://www.elastic.co/products/kibana","size":460981,"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":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"elastic:master","ref":"master","sha":"8a4088fd80bce6ca868df455478a542adb215c17","user":{"login":"elastic","id":6764390,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY3NjQzOTA=","avatar_url":"https://avatars0.githubusercontent.com/u/6764390?v=4","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"repo":{"id":7833168,"node_id":"MDEwOlJlcG9zaXRvcnk3ODMzMTY4","name":"kibana","full_name":"elastic/kibana","private":false,"owner":{"login":"elastic","id":6764390,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY3NjQzOTA=","avatar_url":"https://avatars0.githubusercontent.com/u/6764390?v=4","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/elastic/kibana","description":":bar_chart: Kibana analytics and search dashboard for Elasticsearch","fork":false,"url":"https://api.github.com/repos/elastic/kibana","forks_url":"https://api.github.com/repos/elastic/kibana/forks","keys_url":"https://api.github.com/repos/elastic/kibana/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elastic/kibana/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elastic/kibana/teams","hooks_url":"https://api.github.com/repos/elastic/kibana/hooks","issue_events_url":"https://api.github.com/repos/elastic/kibana/issues/events{/number}","events_url":"https://api.github.com/repos/elastic/kibana/events","assignees_url":"https://api.github.com/repos/elastic/kibana/assignees{/user}","branches_url":"https://api.github.com/repos/elastic/kibana/branches{/branch}","tags_url":"https://api.github.com/repos/elastic/kibana/tags","blobs_url":"https://api.github.com/repos/elastic/kibana/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elastic/kibana/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elastic/kibana/git/refs{/sha}","trees_url":"https://api.github.com/repos/elastic/kibana/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elastic/kibana/statuses/{sha}","languages_url":"https://api.github.com/repos/elastic/kibana/languages","stargazers_url":"https://api.github.com/repos/elastic/kibana/stargazers","contributors_url":"https://api.github.com/repos/elastic/kibana/contributors","subscribers_url":"https://api.github.com/repos/elastic/kibana/subscribers","subscription_url":"https://api.github.com/repos/elastic/kibana/subscription","commits_url":"https://api.github.com/repos/elastic/kibana/commits{/sha}","git_commits_url":"https://api.github.com/repos/elastic/kibana/git/commits{/sha}","comments_url":"https://api.github.com/repos/elastic/kibana/comments{/number}","issue_comment_url":"https://api.github.com/repos/elastic/kibana/issues/comments{/number}","contents_url":"https://api.github.com/repos/elastic/kibana/contents/{+path}","compare_url":"https://api.github.com/repos/elastic/kibana/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elastic/kibana/merges","archive_url":"https://api.github.com/repos/elastic/kibana/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elastic/kibana/downloads","issues_url":"https://api.github.com/repos/elastic/kibana/issues{/number}","pulls_url":"https://api.github.com/repos/elastic/kibana/pulls{/number}","milestones_url":"https://api.github.com/repos/elastic/kibana/milestones{/number}","notifications_url":"https://api.github.com/repos/elastic/kibana/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elastic/kibana/labels{/name}","releases_url":"https://api.github.com/repos/elastic/kibana/releases{/id}","deployments_url":"https://api.github.com/repos/elastic/kibana/deployments","created_at":"2013-01-26T04:00:59Z","updated_at":"2018-09-26T16:05:06Z","pushed_at":"2018-09-26T16:04:33Z","git_url":"git://github.com/elastic/kibana.git","ssh_url":"git@github.com:elastic/kibana.git","clone_url":"https://github.com/elastic/kibana.git","svn_url":"https://github.com/elastic/kibana","homepage":"https://www.elastic.co/products/kibana","size":473934,"stargazers_count":10150,"watchers_count":10150,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3945,"mirror_url":null,"archived":false,"open_issues_count":3601,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":3945,"open_issues":3601,"watchers":10150,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/kibana/pulls/23494"},"html":{"href":"https://github.com/elastic/kibana/pull/23494"},"issue":{"href":"https://api.github.com/repos/elastic/kibana/issues/23494"},"comments":{"href":"https://api.github.com/repos/elastic/kibana/issues/23494/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/kibana/pulls/23494/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/kibana/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/kibana/pulls/23494/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/kibana/statuses/aee9e06a9b7e3b1869cda586017476ef0ba7e809"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"walterra"}}