{"action":"created","comment":{"url":"https://api.github.com/repos/bokeh/bokeh/pulls/comments/22535975","id":22535975,"diff_hunk":"@@ -144,17 +147,44 @@ def start_plot(self, xgrid, ygrid):\n         if ygrid:\n             self.make_grid(1, yaxis.ticker)\n \n-        # Add tools\n+        # Add tools if supposed to\n         if self.tools:\n+            # need to add tool to all underlying plots\n             for plot in self._plots:\n+                removed_tools = []\n+                # only add tools if the underlying plot hasn't been customized\n+                # by some user injection\n                 if not plot.tools:\n-                    if not self.categorical:\n-                        pan = PanTool()\n-                        wheelzoom = WheelZoomTool()\n-                        reset = ResetTool()\n-                        plot.add_tools(pan, wheelzoom, reset)\n-                    previewsave = PreviewSaveTool()\n-                    plot.add_tools(previewsave)\n+                    tools = []\n+                    # if tools have been specified as string let's reuse\n+                    # plotting machinery to create the related tools\n+                    if isinstance(self.tools, string_types):\n+                        for tool in re.split(r\"\\s*,\\s*\", self.tools.strip()):\n+                            # re.split will return empty strings; ignore them.\n+                            if tool == \"\":\n+                                continue","path":"bokeh/charts/_charts.py","position":null,"original_position":47,"commit_id":"02a7c9c6e365a97cab002bdb44c4025e69ac1cde","original_commit_id":"76a2261f6d7d12d1b19026eb3c17387540be473f","user":{"login":"damianavila","id":1640669,"avatar_url":"https://avatars.githubusercontent.com/u/1640669?v=3","gravatar_id":"","url":"https://api.github.com/users/damianavila","html_url":"https://github.com/damianavila","followers_url":"https://api.github.com/users/damianavila/followers","following_url":"https://api.github.com/users/damianavila/following{/other_user}","gists_url":"https://api.github.com/users/damianavila/gists{/gist_id}","starred_url":"https://api.github.com/users/damianavila/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/damianavila/subscriptions","organizations_url":"https://api.github.com/users/damianavila/orgs","repos_url":"https://api.github.com/users/damianavila/repos","events_url":"https://api.github.com/users/damianavila/events{/privacy}","received_events_url":"https://api.github.com/users/damianavila/received_events","type":"User","site_admin":false},"body":">I mean that the logic provided by the new method in plotting_helpers could be held inside Plot.add_tools or a another new method\r\n\r\nmmm... not sure... I guess I like to have it separated... because the new logic is a subset (or specialization) of the add_plot machinery... but not very strong feelings...","created_at":"2015-01-06T17:21:51Z","updated_at":"2015-01-06T17:21:51Z","html_url":"https://github.com/bokeh/bokeh/pull/1624#discussion_r22535975","pull_request_url":"https://api.github.com/repos/bokeh/bokeh/pulls/1624","_links":{"self":{"href":"https://api.github.com/repos/bokeh/bokeh/pulls/comments/22535975"},"html":{"href":"https://github.com/bokeh/bokeh/pull/1624#discussion_r22535975"},"pull_request":{"href":"https://api.github.com/repos/bokeh/bokeh/pulls/1624"}}},"pull_request":{"url":"https://api.github.com/repos/bokeh/bokeh/pulls/1624","id":26852230,"html_url":"https://github.com/bokeh/bokeh/pull/1624","diff_url":"https://github.com/bokeh/bokeh/pull/1624.diff","patch_url":"https://github.com/bokeh/bokeh/pull/1624.patch","issue_url":"https://api.github.com/repos/bokeh/bokeh/issues/1624","number":1624,"state":"open","locked":false,"title":"Add real support for custom tools on charts","user":{"login":"fpliger","id":1084690,"avatar_url":"https://avatars.githubusercontent.com/u/1084690?v=3","gravatar_id":"","url":"https://api.github.com/users/fpliger","html_url":"https://github.com/fpliger","followers_url":"https://api.github.com/users/fpliger/followers","following_url":"https://api.github.com/users/fpliger/following{/other_user}","gists_url":"https://api.github.com/users/fpliger/gists{/gist_id}","starred_url":"https://api.github.com/users/fpliger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fpliger/subscriptions","organizations_url":"https://api.github.com/users/fpliger/orgs","repos_url":"https://api.github.com/users/fpliger/repos","events_url":"https://api.github.com/users/fpliger/events{/privacy}","received_events_url":"https://api.github.com/users/fpliger/received_events","type":"User","site_admin":false},"body":"Issues: fixes #1459 \r\n\r\nAdd support for custom tools on charts using strings like plotting interface. It is also possible to disable tools specifying `tools=False` or to use charts standard tools specifying `tools=True`.\r\n\r\nPan and Zoom are automatically removed if chart scale is categorical (i.e.: HeatMap)","created_at":"2015-01-05T21:27:09Z","updated_at":"2015-01-06T17:21:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e926b979bdd1e2ddb9b5b11f58a62cecdd1f0b94","assignee":{"login":"fpliger","id":1084690,"avatar_url":"https://avatars.githubusercontent.com/u/1084690?v=3","gravatar_id":"","url":"https://api.github.com/users/fpliger","html_url":"https://github.com/fpliger","followers_url":"https://api.github.com/users/fpliger/followers","following_url":"https://api.github.com/users/fpliger/following{/other_user}","gists_url":"https://api.github.com/users/fpliger/gists{/gist_id}","starred_url":"https://api.github.com/users/fpliger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fpliger/subscriptions","organizations_url":"https://api.github.com/users/fpliger/orgs","repos_url":"https://api.github.com/users/fpliger/repos","events_url":"https://api.github.com/users/fpliger/events{/privacy}","received_events_url":"https://api.github.com/users/fpliger/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/bokeh/bokeh/milestones/14","labels_url":"https://api.github.com/repos/bokeh/bokeh/milestones/14/labels","id":895618,"number":14,"title":"0.7.1","description":"","creator":{"login":"mattpap","id":27475,"avatar_url":"https://avatars.githubusercontent.com/u/27475?v=3","gravatar_id":"","url":"https://api.github.com/users/mattpap","html_url":"https://github.com/mattpap","followers_url":"https://api.github.com/users/mattpap/followers","following_url":"https://api.github.com/users/mattpap/following{/other_user}","gists_url":"https://api.github.com/users/mattpap/gists{/gist_id}","starred_url":"https://api.github.com/users/mattpap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattpap/subscriptions","organizations_url":"https://api.github.com/users/mattpap/orgs","repos_url":"https://api.github.com/users/mattpap/repos","events_url":"https://api.github.com/users/mattpap/events{/privacy}","received_events_url":"https://api.github.com/users/mattpap/received_events","type":"User","site_admin":false},"open_issues":37,"closed_issues":63,"state":"open","created_at":"2014-12-08T12:27:33Z","updated_at":"2015-01-06T17:09:03Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/bokeh/bokeh/pulls/1624/commits","review_comments_url":"https://api.github.com/repos/bokeh/bokeh/pulls/1624/comments","review_comment_url":"https://api.github.com/repos/bokeh/bokeh/pulls/comments/{number}","comments_url":"https://api.github.com/repos/bokeh/bokeh/issues/1624/comments","statuses_url":"https://api.github.com/repos/bokeh/bokeh/statuses/02a7c9c6e365a97cab002bdb44c4025e69ac1cde","head":{"label":"bokeh:feature/configurable_charts_tools","ref":"feature/configurable_charts_tools","sha":"02a7c9c6e365a97cab002bdb44c4025e69ac1cde","user":{"login":"bokeh","id":8440965,"avatar_url":"https://avatars.githubusercontent.com/u/8440965?v=3","gravatar_id":"","url":"https://api.github.com/users/bokeh","html_url":"https://github.com/bokeh","followers_url":"https://api.github.com/users/bokeh/followers","following_url":"https://api.github.com/users/bokeh/following{/other_user}","gists_url":"https://api.github.com/users/bokeh/gists{/gist_id}","starred_url":"https://api.github.com/users/bokeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bokeh/subscriptions","organizations_url":"https://api.github.com/users/bokeh/orgs","repos_url":"https://api.github.com/users/bokeh/repos","events_url":"https://api.github.com/users/bokeh/events{/privacy}","received_events_url":"https://api.github.com/users/bokeh/received_events","type":"Organization","site_admin":false},"repo":{"id":3834332,"name":"bokeh","full_name":"bokeh/bokeh","owner":{"login":"bokeh","id":8440965,"avatar_url":"https://avatars.githubusercontent.com/u/8440965?v=3","gravatar_id":"","url":"https://api.github.com/users/bokeh","html_url":"https://github.com/bokeh","followers_url":"https://api.github.com/users/bokeh/followers","following_url":"https://api.github.com/users/bokeh/following{/other_user}","gists_url":"https://api.github.com/users/bokeh/gists{/gist_id}","starred_url":"https://api.github.com/users/bokeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bokeh/subscriptions","organizations_url":"https://api.github.com/users/bokeh/orgs","repos_url":"https://api.github.com/users/bokeh/repos","events_url":"https://api.github.com/users/bokeh/events{/privacy}","received_events_url":"https://api.github.com/users/bokeh/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bokeh/bokeh","description":"Interactive Web Plotting for Python","fork":false,"url":"https://api.github.com/repos/bokeh/bokeh","forks_url":"https://api.github.com/repos/bokeh/bokeh/forks","keys_url":"https://api.github.com/repos/bokeh/bokeh/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bokeh/bokeh/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bokeh/bokeh/teams","hooks_url":"https://api.github.com/repos/bokeh/bokeh/hooks","issue_events_url":"https://api.github.com/repos/bokeh/bokeh/issues/events{/number}","events_url":"https://api.github.com/repos/bokeh/bokeh/events","assignees_url":"https://api.github.com/repos/bokeh/bokeh/assignees{/user}","branches_url":"https://api.github.com/repos/bokeh/bokeh/branches{/branch}","tags_url":"https://api.github.com/repos/bokeh/bokeh/tags","blobs_url":"https://api.github.com/repos/bokeh/bokeh/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bokeh/bokeh/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bokeh/bokeh/git/refs{/sha}","trees_url":"https://api.github.com/repos/bokeh/bokeh/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bokeh/bokeh/statuses/{sha}","languages_url":"https://api.github.com/repos/bokeh/bokeh/languages","stargazers_url":"https://api.github.com/repos/bokeh/bokeh/stargazers","contributors_url":"https://api.github.com/repos/bokeh/bokeh/contributors","subscribers_url":"https://api.github.com/repos/bokeh/bokeh/subscribers","subscription_url":"https://api.github.com/repos/bokeh/bokeh/subscription","commits_url":"https://api.github.com/repos/bokeh/bokeh/commits{/sha}","git_commits_url":"https://api.github.com/repos/bokeh/bokeh/git/commits{/sha}","comments_url":"https://api.github.com/repos/bokeh/bokeh/comments{/number}","issue_comment_url":"https://api.github.com/repos/bokeh/bokeh/issues/comments/{number}","contents_url":"https://api.github.com/repos/bokeh/bokeh/contents/{+path}","compare_url":"https://api.github.com/repos/bokeh/bokeh/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bokeh/bokeh/merges","archive_url":"https://api.github.com/repos/bokeh/bokeh/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bokeh/bokeh/downloads","issues_url":"https://api.github.com/repos/bokeh/bokeh/issues{/number}","pulls_url":"https://api.github.com/repos/bokeh/bokeh/pulls{/number}","milestones_url":"https://api.github.com/repos/bokeh/bokeh/milestones{/number}","notifications_url":"https://api.github.com/repos/bokeh/bokeh/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bokeh/bokeh/labels{/name}","releases_url":"https://api.github.com/repos/bokeh/bokeh/releases{/id}","created_at":"2012-03-26T15:40:01Z","updated_at":"2015-01-06T16:19:00Z","pushed_at":"2015-01-06T17:15:28Z","git_url":"git://github.com/bokeh/bokeh.git","ssh_url":"git@github.com:bokeh/bokeh.git","clone_url":"https://github.com/bokeh/bokeh.git","svn_url":"https://github.com/bokeh/bokeh","homepage":"","size":136144,"stargazers_count":2309,"watchers_count":2309,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":330,"mirror_url":null,"open_issues_count":334,"forks":330,"open_issues":334,"watchers":2309,"default_branch":"master"}},"base":{"label":"bokeh:master","ref":"master","sha":"6cecb7211277b9d838039d0eb15e50a10f9ac3d1","user":{"login":"bokeh","id":8440965,"avatar_url":"https://avatars.githubusercontent.com/u/8440965?v=3","gravatar_id":"","url":"https://api.github.com/users/bokeh","html_url":"https://github.com/bokeh","followers_url":"https://api.github.com/users/bokeh/followers","following_url":"https://api.github.com/users/bokeh/following{/other_user}","gists_url":"https://api.github.com/users/bokeh/gists{/gist_id}","starred_url":"https://api.github.com/users/bokeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bokeh/subscriptions","organizations_url":"https://api.github.com/users/bokeh/orgs","repos_url":"https://api.github.com/users/bokeh/repos","events_url":"https://api.github.com/users/bokeh/events{/privacy}","received_events_url":"https://api.github.com/users/bokeh/received_events","type":"Organization","site_admin":false},"repo":{"id":3834332,"name":"bokeh","full_name":"bokeh/bokeh","owner":{"login":"bokeh","id":8440965,"avatar_url":"https://avatars.githubusercontent.com/u/8440965?v=3","gravatar_id":"","url":"https://api.github.com/users/bokeh","html_url":"https://github.com/bokeh","followers_url":"https://api.github.com/users/bokeh/followers","following_url":"https://api.github.com/users/bokeh/following{/other_user}","gists_url":"https://api.github.com/users/bokeh/gists{/gist_id}","starred_url":"https://api.github.com/users/bokeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bokeh/subscriptions","organizations_url":"https://api.github.com/users/bokeh/orgs","repos_url":"https://api.github.com/users/bokeh/repos","events_url":"https://api.github.com/users/bokeh/events{/privacy}","received_events_url":"https://api.github.com/users/bokeh/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bokeh/bokeh","description":"Interactive Web Plotting for Python","fork":false,"url":"https://api.github.com/repos/bokeh/bokeh","forks_url":"https://api.github.com/repos/bokeh/bokeh/forks","keys_url":"https://api.github.com/repos/bokeh/bokeh/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bokeh/bokeh/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bokeh/bokeh/teams","hooks_url":"https://api.github.com/repos/bokeh/bokeh/hooks","issue_events_url":"https://api.github.com/repos/bokeh/bokeh/issues/events{/number}","events_url":"https://api.github.com/repos/bokeh/bokeh/events","assignees_url":"https://api.github.com/repos/bokeh/bokeh/assignees{/user}","branches_url":"https://api.github.com/repos/bokeh/bokeh/branches{/branch}","tags_url":"https://api.github.com/repos/bokeh/bokeh/tags","blobs_url":"https://api.github.com/repos/bokeh/bokeh/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bokeh/bokeh/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bokeh/bokeh/git/refs{/sha}","trees_url":"https://api.github.com/repos/bokeh/bokeh/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bokeh/bokeh/statuses/{sha}","languages_url":"https://api.github.com/repos/bokeh/bokeh/languages","stargazers_url":"https://api.github.com/repos/bokeh/bokeh/stargazers","contributors_url":"https://api.github.com/repos/bokeh/bokeh/contributors","subscribers_url":"https://api.github.com/repos/bokeh/bokeh/subscribers","subscription_url":"https://api.github.com/repos/bokeh/bokeh/subscription","commits_url":"https://api.github.com/repos/bokeh/bokeh/commits{/sha}","git_commits_url":"https://api.github.com/repos/bokeh/bokeh/git/commits{/sha}","comments_url":"https://api.github.com/repos/bokeh/bokeh/comments{/number}","issue_comment_url":"https://api.github.com/repos/bokeh/bokeh/issues/comments/{number}","contents_url":"https://api.github.com/repos/bokeh/bokeh/contents/{+path}","compare_url":"https://api.github.com/repos/bokeh/bokeh/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bokeh/bokeh/merges","archive_url":"https://api.github.com/repos/bokeh/bokeh/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bokeh/bokeh/downloads","issues_url":"https://api.github.com/repos/bokeh/bokeh/issues{/number}","pulls_url":"https://api.github.com/repos/bokeh/bokeh/pulls{/number}","milestones_url":"https://api.github.com/repos/bokeh/bokeh/milestones{/number}","notifications_url":"https://api.github.com/repos/bokeh/bokeh/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bokeh/bokeh/labels{/name}","releases_url":"https://api.github.com/repos/bokeh/bokeh/releases{/id}","created_at":"2012-03-26T15:40:01Z","updated_at":"2015-01-06T16:19:00Z","pushed_at":"2015-01-06T17:15:28Z","git_url":"git://github.com/bokeh/bokeh.git","ssh_url":"git@github.com:bokeh/bokeh.git","clone_url":"https://github.com/bokeh/bokeh.git","svn_url":"https://github.com/bokeh/bokeh","homepage":"","size":136144,"stargazers_count":2309,"watchers_count":2309,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":330,"mirror_url":null,"open_issues_count":334,"forks":330,"open_issues":334,"watchers":2309,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bokeh/bokeh/pulls/1624"},"html":{"href":"https://github.com/bokeh/bokeh/pull/1624"},"issue":{"href":"https://api.github.com/repos/bokeh/bokeh/issues/1624"},"comments":{"href":"https://api.github.com/repos/bokeh/bokeh/issues/1624/comments"},"review_comments":{"href":"https://api.github.com/repos/bokeh/bokeh/pulls/1624/comments"},"review_comment":{"href":"https://api.github.com/repos/bokeh/bokeh/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/bokeh/bokeh/pulls/1624/commits"},"statuses":{"href":"https://api.github.com/repos/bokeh/bokeh/statuses/02a7c9c6e365a97cab002bdb44c4025e69ac1cde"}}}}