{"action":"created","issue":{"url":"https://api.github.com/repos/bokeh/bokeh/issues/1851","labels_url":"https://api.github.com/repos/bokeh/bokeh/issues/1851/labels{/name}","comments_url":"https://api.github.com/repos/bokeh/bokeh/issues/1851/comments","events_url":"https://api.github.com/repos/bokeh/bokeh/issues/1851/events","html_url":"https://github.com/bokeh/bokeh/issues/1851","id":57104983,"number":1851,"title":"Centered bar chart","user":{"login":"birdsarah","id":1796208,"avatar_url":"https://avatars.githubusercontent.com/u/1796208?v=3","gravatar_id":"","url":"https://api.github.com/users/birdsarah","html_url":"https://github.com/birdsarah","followers_url":"https://api.github.com/users/birdsarah/followers","following_url":"https://api.github.com/users/birdsarah/following{/other_user}","gists_url":"https://api.github.com/users/birdsarah/gists{/gist_id}","starred_url":"https://api.github.com/users/birdsarah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/birdsarah/subscriptions","organizations_url":"https://api.github.com/users/birdsarah/orgs","repos_url":"https://api.github.com/users/birdsarah/repos","events_url":"https://api.github.com/users/birdsarah/events{/privacy}","received_events_url":"https://api.github.com/users/birdsarah/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bokeh/bokeh/labels/type:%20discussion","name":"type: discussion","color":"2659A0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-02-09T23:10:58Z","updated_at":"2015-02-10T09:27:42Z","closed_at":null,"body":"Following discussion on #1836, was thinking of implementing a symmetric range. My proposed approach would be:\r\n* subclass Range1d\r\n* add two properties: `center` and `delta`\r\n* use these to set the `start` and `end`, which will result in `end - start == 2 * delta` \r\n\r\nOnce this is implemented, some charts e.g. `Bar` may want to have it as an option. But thought I would isolate this first.\r\n\r\nI'll wait for a :+1: before pushing ahead."},"comment":{"url":"https://api.github.com/repos/bokeh/bokeh/issues/comments/73668750","html_url":"https://github.com/bokeh/bokeh/issues/1851#issuecomment-73668750","issue_url":"https://api.github.com/repos/bokeh/bokeh/issues/1851","id":73668750,"user":{"login":"pzwang","id":543576,"avatar_url":"https://avatars.githubusercontent.com/u/543576?v=3","gravatar_id":"","url":"https://api.github.com/users/pzwang","html_url":"https://github.com/pzwang","followers_url":"https://api.github.com/users/pzwang/followers","following_url":"https://api.github.com/users/pzwang/following{/other_user}","gists_url":"https://api.github.com/users/pzwang/gists{/gist_id}","starred_url":"https://api.github.com/users/pzwang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pzwang/subscriptions","organizations_url":"https://api.github.com/users/pzwang/orgs","repos_url":"https://api.github.com/users/pzwang/repos","events_url":"https://api.github.com/users/pzwang/events{/privacy}","received_events_url":"https://api.github.com/users/pzwang/received_events","type":"User","site_admin":false},"created_at":"2015-02-10T09:27:42Z","updated_at":"2015-02-10T09:27:42Z","body":"Ha, OK - I completely misunderstood.  In cases like this when an API might have two different sets of inputs (start+end or center+width), I generally lean towards picking one or the other as the internal representation, and converting from/into the other form via a method or property.  In the case of the charting interface, we would need to do some basic error checking in the bar() function itself to make sure that the user hasn't specified both sets of parameters, but otherwise I think this approach should work for numerical ranges.\r\n\r\nIt's worth pointing out that the same does not apply to categorical ranges, since if there is an ordering of the categories, then there is a well defined \"start\" and \"end\", but there is not a concept of distance so \"width\" is ambiguous.  One might choose for it to indicate how many categories, but if the categories themselves are numerical (e.g. age groups, year of manufacture, etc.), then this can be a little confusing."}}