{"action":"created","issue":{"url":"https://api.github.com/repos/plotly/plotly.js/issues/1016","repository_url":"https://api.github.com/repos/plotly/plotly.js","labels_url":"https://api.github.com/repos/plotly/plotly.js/issues/1016/labels{/name}","comments_url":"https://api.github.com/repos/plotly/plotly.js/issues/1016/comments","events_url":"https://api.github.com/repos/plotly/plotly.js/issues/1016/events","html_url":"https://github.com/plotly/plotly.js/pull/1016","id":181451359,"number":1016,"title":"Common interface to interpret and execute API methods [WIP]","user":{"login":"rreusser","id":572717,"avatar_url":"https://avatars.githubusercontent.com/u/572717?v=3","gravatar_id":"","url":"https://api.github.com/users/rreusser","html_url":"https://github.com/rreusser","followers_url":"https://api.github.com/users/rreusser/followers","following_url":"https://api.github.com/users/rreusser/following{/other_user}","gists_url":"https://api.github.com/users/rreusser/gists{/gist_id}","starred_url":"https://api.github.com/users/rreusser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rreusser/subscriptions","organizations_url":"https://api.github.com/users/rreusser/orgs","repos_url":"https://api.github.com/users/rreusser/repos","events_url":"https://api.github.com/users/rreusser/events{/privacy}","received_events_url":"https://api.github.com/users/rreusser/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/plotly/plotly.js/labels/status:%20in%20progress","name":"status: in progress","color":"b2df8a"},{"url":"https://api.github.com/repos/plotly/plotly.js/labels/type:%20feature","name":"type: feature","color":"1f78b4"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/plotly/plotly.js/milestones/12","html_url":"https://github.com/plotly/plotly.js/milestones/v1.19.0","labels_url":"https://api.github.com/repos/plotly/plotly.js/milestones/12/labels","id":2068037,"number":12,"title":"v1.19.0","description":"","creator":{"login":"etpinard","id":6675409,"avatar_url":"https://avatars.githubusercontent.com/u/6675409?v=3","gravatar_id":"","url":"https://api.github.com/users/etpinard","html_url":"https://github.com/etpinard","followers_url":"https://api.github.com/users/etpinard/followers","following_url":"https://api.github.com/users/etpinard/following{/other_user}","gists_url":"https://api.github.com/users/etpinard/gists{/gist_id}","starred_url":"https://api.github.com/users/etpinard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etpinard/subscriptions","organizations_url":"https://api.github.com/users/etpinard/orgs","repos_url":"https://api.github.com/users/etpinard/repos","events_url":"https://api.github.com/users/etpinard/events{/privacy}","received_events_url":"https://api.github.com/users/etpinard/received_events","type":"User","site_admin":false},"open_issues":11,"closed_issues":1,"state":"open","created_at":"2016-10-13T14:45:23Z","updated_at":"2016-10-18T14:04:54Z","due_on":"2016-10-27T00:00:00Z","closed_at":null},"comments":0,"created_at":"2016-10-06T15:40:38Z","updated_at":"2016-10-18T15:48:42Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/plotly/plotly.js/pulls/1016","html_url":"https://github.com/plotly/plotly.js/pull/1016","diff_url":"https://github.com/plotly/plotly.js/pull/1016.diff","patch_url":"https://github.com/plotly/plotly.js/pull/1016.patch"},"body":"This PR works toward a common interface for executing commands. This includes:\r\n\r\n- [x] `Plots.executeAPICommand(gd, method, args)` which executes a command (i.e. from components)\r\n- [x] `Plots.computeAPICommandBindings(gd, method, args)` which interprets the intent of a command and returns a list of properties which affect the value of the component.\r\n- [ ] `.updateBindings` method for components\r\n\r\nCompletion of this feature will complete the implementation of sliders (#986) with two-way binding and will be applicable to other components."},"comment":{"url":"https://api.github.com/repos/plotly/plotly.js/issues/comments/254550873","html_url":"https://github.com/plotly/plotly.js/pull/1016#issuecomment-254550873","issue_url":"https://api.github.com/repos/plotly/plotly.js/issues/1016","id":254550873,"user":{"login":"rreusser","id":572717,"avatar_url":"https://avatars.githubusercontent.com/u/572717?v=3","gravatar_id":"","url":"https://api.github.com/users/rreusser","html_url":"https://github.com/rreusser","followers_url":"https://api.github.com/users/rreusser/followers","following_url":"https://api.github.com/users/rreusser/following{/other_user}","gists_url":"https://api.github.com/users/rreusser/gists{/gist_id}","starred_url":"https://api.github.com/users/rreusser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rreusser/subscriptions","organizations_url":"https://api.github.com/users/rreusser/orgs","repos_url":"https://api.github.com/users/rreusser/repos","events_url":"https://api.github.com/users/rreusser/events{/privacy}","received_events_url":"https://api.github.com/users/rreusser/received_events","type":"User","site_admin":false},"created_at":"2016-10-18T15:48:42Z","updated_at":"2016-10-18T15:48:42Z","body":"@etpinard @alexcjohnson The code isn't ready for review yet, but the internal usage is:\r\n\r\nTo hook this up, you provide it the gd, an array of commands, and a callback to make an update. If the commands are straightforward, it will create lookup table by value so that when a restyle or relayout comes through, it can easily check to see if the value has changed (via _fullLayout or _fullData) and execute the callback if there appears to be a matching component state.\r\n\r\nFrom `sliders`:\r\n\r\n```javascript\r\n        if(!sliderOpts._commandObserver) {\r\n            sliderOpts._commandObserver = Plots.createCommandObserver(gd, sliderOpts.steps, function(data) {\r\n                setActive(gd, d3.select(this), sliderOpts, data.index, false, true);\r\n            }.bind(this));\r\n        }  \r\n```"}}
{"actor":{"display_login":"rreusser"}}