{"action":"created","issue":{"url":"https://api.github.com/repos/danvk/dygraphs/issues/696","labels_url":"https://api.github.com/repos/danvk/dygraphs/issues/696/labels{/name}","comments_url":"https://api.github.com/repos/danvk/dygraphs/issues/696/comments","events_url":"https://api.github.com/repos/danvk/dygraphs/issues/696/events","html_url":"https://github.com/danvk/dygraphs/pull/696","id":118409491,"number":696,"title":"Feature: Selection Modes","user":{"login":"musicist288","id":368976,"avatar_url":"https://avatars.githubusercontent.com/u/368976?v=3","gravatar_id":"","url":"https://api.github.com/users/musicist288","html_url":"https://github.com/musicist288","followers_url":"https://api.github.com/users/musicist288/followers","following_url":"https://api.github.com/users/musicist288/following{/other_user}","gists_url":"https://api.github.com/users/musicist288/gists{/gist_id}","starred_url":"https://api.github.com/users/musicist288/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/musicist288/subscriptions","organizations_url":"https://api.github.com/users/musicist288/orgs","repos_url":"https://api.github.com/users/musicist288/repos","events_url":"https://api.github.com/users/musicist288/events{/privacy}","received_events_url":"https://api.github.com/users/musicist288/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-23T15:48:40Z","updated_at":"2015-11-30T20:40:34Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/danvk/dygraphs/pulls/696","html_url":"https://github.com/danvk/dygraphs/pull/696","diff_url":"https://github.com/danvk/dygraphs/pull/696.diff","patch_url":"https://github.com/danvk/dygraphs/pull/696.patch"},"body":"This is a proposed implementation for https://github.com/danvk/dygraphs/issues/371.\r\n\r\nSelection modes are defined in `src/dygraph-selection-modes.js` with the\r\nability to override them on a per graph basis with the option\r\n`selectionMode` when instantiating the Dygraph.\r\n\r\n>This is a generalized approach of the changes I needed to make for my company's use case. These changes represent the bare minimum; I wasn't sure if I should go as far as to define a whole selection model implementation (similar to the plug-in system). Our use case revolves exclusively around time series data so there may be some decisions made that are influenced by that case and may not fit the general approach.\n\n<!-- Reviewable:start -->\n[<img src=\"https://reviewable.io/review_button.png\" height=40 alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/danvk/dygraphs/696)\n<!-- Reviewable:end -->\n"},"comment":{"url":"https://api.github.com/repos/danvk/dygraphs/issues/comments/160755242","html_url":"https://github.com/danvk/dygraphs/pull/696#issuecomment-160755242","issue_url":"https://api.github.com/repos/danvk/dygraphs/issues/696","id":160755242,"user":{"login":"musicist288","id":368976,"avatar_url":"https://avatars.githubusercontent.com/u/368976?v=3","gravatar_id":"","url":"https://api.github.com/users/musicist288","html_url":"https://github.com/musicist288","followers_url":"https://api.github.com/users/musicist288/followers","following_url":"https://api.github.com/users/musicist288/following{/other_user}","gists_url":"https://api.github.com/users/musicist288/gists{/gist_id}","starred_url":"https://api.github.com/users/musicist288/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/musicist288/subscriptions","organizations_url":"https://api.github.com/users/musicist288/orgs","repos_url":"https://api.github.com/users/musicist288/repos","events_url":"https://api.github.com/users/musicist288/events{/privacy}","received_events_url":"https://api.github.com/users/musicist288/received_events","type":"User","site_admin":false},"created_at":"2015-11-30T20:40:34Z","updated_at":"2015-11-30T20:40:34Z","body":"The difference is that with selectByRow, if the selected row does not have a value for a series, the selection will not include a value for that series. selectByClosestX starts at the current row, but if no value is found for a series, it looks for the last defined value for that series in row numbers less than the selected row. Perhaps a more appropriate name would be something like \"selectByLatestDefinedValue\"?\n\nPerhaps I let my needs dilute my understanding of the original feature request  I'm exclusively visualizing time-series data. One chart type in particular has data where a single row would almost never have defined values for every series. My goal was to get the highlight dots and the legend reporting the last value reported for the series up until the current time, but never after, and have the legend report the time value of the latest data point.\n\nHere's a [GIF](https://drive.google.com/file/d/0B0ijexLSVGAFcThNamw1MUo4MDg/view?usp=sharing) of the interaction I needed.  This is the most extreme case, but I have other examples if needed.\n\nI'm not too concerned about this specific selection model making it into the library if we can't agree about the semantics of the selection mode. I'm mostly concerned about the callback option being exposed.\n\n---\n\nReview status: 0 of 5 files reviewed at latest revision, 3 unresolved discussions.\n\n---\n\n*[src/dygraph-options-reference.js, line 855 \\[r1\\]](https://reviewable.io:443/reviews/danvk/dygraphs/696#-K4OkvarRdE5UUpRCEux:-K4P5nnvqysyf3PFrdGy:918055650) ([raw file](https://github.com/danvk/dygraphs/blob/cc5be8851bf1c49bff79d17ae32a443dc438389d/src/dygraph-options-reference.js#L855)):*\nOk. I wasn't sure about that. I'll change it.\n\n---\n\n*[src/dygraph-selection-modes.js, line 17 \\[r1\\]](https://reviewable.io:443/reviews/danvk/dygraphs/696#-K4OlH9jAoKDeM8P8TOo:-K4OzrqV7QZa57BsQ7p4:1259265844) ([raw file](https://github.com/danvk/dygraphs/blob/cc5be8851bf1c49bff79d17ae32a443dc438389d/src/dygraph-selection-modes.js#L17)):*\nNot dropped, but I was editing that block a lot. I'll re-word it.\n\n---\n\n*[src/dygraph.js, line 3578 \\[r1\\]](https://reviewable.io:443/reviews/danvk/dygraphs/696#-K4Om0TeA8DGi3vAD1wk:-K4P-77hgGGLzNdAP-fg:-2118186699) ([raw file](https://github.com/danvk/dygraphs/blob/cc5be8851bf1c49bff79d17ae32a443dc438389d/src/dygraph.js#L3578)):*\nNope, not sure why I originally had this. I'll change it to an assignment.\n\n---\n\n\n*Comments from the [review on Reviewable.io](https://reviewable.io:443/reviews/danvk/dygraphs/696#-:-K4P0D81eyBbQ_lPtZdm:1694094202)*\n<!-- Sent from Reviewable.io -->\n"}}