{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/kibana/issues/26034","repository_url":"https://api.github.com/repos/elastic/kibana","labels_url":"https://api.github.com/repos/elastic/kibana/issues/26034/labels{/name}","comments_url":"https://api.github.com/repos/elastic/kibana/issues/26034/comments","events_url":"https://api.github.com/repos/elastic/kibana/issues/26034/events","html_url":"https://github.com/elastic/kibana/pull/26034","id":383217537,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMyNzQxMDk2","number":26034,"title":"[WIP] [ML] User Annotations","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},"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":1062169267,"node_id":"MDU6TGFiZWwxMDYyMTY5MjY3","url":"https://api.github.com/repos/elastic/kibana/labels/v6.6.0","name":"v6.6.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}],"state":"open","locked":false,"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}],"milestone":null,"comments":20,"created_at":"2018-11-21T17:12:02Z","updated_at":"2018-12-12T10:33:33Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/elastic/kibana/pulls/26034","html_url":"https://github.com/elastic/kibana/pull/26034","diff_url":"https://github.com/elastic/kibana/pull/26034.diff","patch_url":"https://github.com/elastic/kibana/pull/26034.patch"},"body":"## Summary\r\n\r\nAllows users to add/edit/delete annotations in the Single Series Viewer.\r\n\r\n![2018-11-21_annotations-simple-workflow](https://user-images.githubusercontent.com/230104/48849187-19eb3880-eda6-11e8-86b5-1f1c78369b78.gif)\r\n\r\n### UI Features\r\n\r\n- The extended jobs list row has a new tab \"Annotations\" which hosts a table with annotations applicable to the job. Each annotation features a button to directly drill-down to Single Metric Viewer ![image](https://user-images.githubusercontent.com/230104/49821686-5c87ab80-fd7b-11e8-8c7e-e22a93a8ead0.png)\r\n\r\n- Single Metric Viewer allows create/update/delete of annotations. You create an annotation by drag-selecting (\"brushing\") in the Focus-Chart area. After finishing the \"brush\", a flyout is opened where you can add an annotation text and finish creating the annotation. To edit an existing annotation, clicking on it in the Focus-Chart area opens the flyout again. The editing flyout also has an option to delete the annotation as well.\r\n  - The annotations table in Single Metric Viewer acts as a legend for the annotations visible in the chart. The annotations are labelled like A/B/C..., this label is visible both in the chart and table. Hovering a row in the annotations table highlights the corresponding annotation in the chart.\r\n  - To avoid overlap in the chart, the annotation's top margin is increased. Additionally, the charts Y axis domain is adapted to avoid overlap of anomalies and annotation labels.\r\n\r\n![image](https://user-images.githubusercontent.com/230104/49822307-0ae02080-fd7d-11e8-8128-7f752c26c277.png)\r\n\r\n## Notes on features, limitations\r\n\r\n- This PR actually deletes an annotation when hitting the delete button. This will change in a follow-up: We don't want to actually delete annotations but just flag them as deleted/archived and keep them around for auditing purposes.\r\n- This PR hard-codes the `create_username` and `modified_username` attributes with `<user unknown>`. A follow-up will make use of the actual username when available.\r\n\r\n### Notes on the code\r\n\r\n- Introduces the use of some TypeScript! Most stand-alone code related to the annotations is done in TS. Because `timeseries_chart.js` itself isn't ported to TS in this PR, a `timeseries_chart.d.ts` file is added with the minimum required definitions to get it to work with annotations.\r\n- On startup, the ML plugin checks if the required indices/aliases are present and based on that the feature is available. The indices/aliases are created by the Elasticsearch ML plugin. As this is not yet in `master`, to make the feature available you'll have to run the commands from the [comments here](https://github.com/elastic/kibana/pull/26034/files#diff-c5c6ac3dbb0e7c91b6d127aa06121b2c).\r\n- The PR includes a first version of a TypeScript `interface` to describe the structure of the `jobs` object [here](https://github.com/elastic/kibana/pull/26034/files#diff-e21f08a1eeb5d783b8c79066e4426745). This will not be fully fleshed out in this PR but should be considered a starting point and can be adapted should we move further parts of the codebase to TypeScript.\r\n- `annotations_table.js` isn't TypeScript yet because its mostly a copy of the forecasts table. It can be used as a stand-alone React Component (jobs list) as well as a directive (Anomaly Explorer and Single Metric Viewer).\r\n- The constant `DEFAULT_QUERY_SIZE` was taken from the Anomaly Table code to `common` and is now a constant used both by Anomaly Table and Annotations Table.\r\n- The PR features already some code to display the Annotations Table in Anomaly Explorer, but it's disabled for now until this is more fleshed out.\r\n\r\n### Todos\r\n\r\n- [ ] Unit tests\r\n\r\n### Checklist\r\n\r\nUse ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR.\r\n\r\n- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)\r\n- [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)\r\n- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials\r\n- [ ] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios\r\n- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)\r\n\r\n### For maintainers\r\n\r\n- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)\r\n- [ ] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)\r\n\r\n----\r\n\r\nPart of https://github.com/elastic/elasticsearch/issues/33376 and https://github.com/elastic/kibana/issues/25856.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/elastic/kibana/issues/comments/446540089","html_url":"https://github.com/elastic/kibana/pull/26034#issuecomment-446540089","issue_url":"https://api.github.com/repos/elastic/kibana/issues/26034","id":446540089,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NjU0MDA4OQ==","user":{"login":"elasticmachine","id":15837671,"node_id":"MDQ6VXNlcjE1ODM3Njcx","avatar_url":"https://avatars3.githubusercontent.com/u/15837671?v=4","gravatar_id":"","url":"https://api.github.com/users/elasticmachine","html_url":"https://github.com/elasticmachine","followers_url":"https://api.github.com/users/elasticmachine/followers","following_url":"https://api.github.com/users/elasticmachine/following{/other_user}","gists_url":"https://api.github.com/users/elasticmachine/gists{/gist_id}","starred_url":"https://api.github.com/users/elasticmachine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elasticmachine/subscriptions","organizations_url":"https://api.github.com/users/elasticmachine/orgs","repos_url":"https://api.github.com/users/elasticmachine/repos","events_url":"https://api.github.com/users/elasticmachine/events{/privacy}","received_events_url":"https://api.github.com/users/elasticmachine/received_events","type":"User","site_admin":false},"created_at":"2018-12-12T10:33:33Z","updated_at":"2018-12-12T10:33:33Z","author_association":"NONE","body":"## :green_heart: Build Succeeded\n* [continuous-integration/kibana-ci/pull-request](https://kibana-ci.elastic.co/job/elastic+kibana+pull-request/3334/)\n\n"}}
{"actor":{"display_login":"elasticmachine"}}