{"action":"created","issue":{"url":"https://api.github.com/repos/bokeh/bokeh/issues/3679","repository_url":"https://api.github.com/repos/bokeh/bokeh","labels_url":"https://api.github.com/repos/bokeh/bokeh/issues/3679/labels{/name}","comments_url":"https://api.github.com/repos/bokeh/bokeh/issues/3679/comments","events_url":"https://api.github.com/repos/bokeh/bokeh/issues/3679/events","html_url":"https://github.com/bokeh/bokeh/issues/3679","id":127486365,"number":3679,"title":"Adding Figure to document using add_root causes BokehJS error","user":{"login":"plubans580","id":1274698,"avatar_url":"https://avatars.githubusercontent.com/u/1274698?v=3","gravatar_id":"","url":"https://api.github.com/users/plubans580","html_url":"https://github.com/plubans580","followers_url":"https://api.github.com/users/plubans580/followers","following_url":"https://api.github.com/users/plubans580/following{/other_user}","gists_url":"https://api.github.com/users/plubans580/gists{/gist_id}","starred_url":"https://api.github.com/users/plubans580/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plubans580/subscriptions","organizations_url":"https://api.github.com/users/plubans580/orgs","repos_url":"https://api.github.com/users/plubans580/repos","events_url":"https://api.github.com/users/plubans580/events{/privacy}","received_events_url":"https://api.github.com/users/plubans580/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":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-01-19T16:37:10Z","updated_at":"2016-06-21T04:44:01Z","closed_at":"2016-06-21T04:43:39Z","body":"To reproduce, launch the server:\r\n\r\n`bokeh serve --host localhost:5006`\r\n\r\nOn the same machine, run the following python script:\r\n\r\n    import numpy    \r\n    import bokeh.client\r\n    import bokeh.plotting\r\n    import bokeh.models.widgets\r\n    \r\n    doc = bokeh.plotting.curdoc()\r\n    session = bokeh.client.push_session(doc)\r\n    \r\n    checkboxes = bokeh.models.widgets.CheckboxButtonGroup(labels = [\"one\"])\r\n    \r\n    layout = bokeh.models.widgets.VBoxForm(children = [checkboxes])\r\n    doc.add_root(layout)\r\n    \r\n    class Updater(object):\r\n        \r\n        def __init__(self):\r\n            self.__plot = None\r\n            \r\n        def __call__(self, *args, **kwargs):\r\n            if self.__plot is not None:\r\n                doc.remove_root(self.__plot)\r\n            self.__plot = bokeh.plotting.Figure()\r\n            self.__plot.line(x = range(4), y = numpy.random.randn(4))\r\n            doc.add_root(self.__plot)\r\n    \r\n    update = Updater()\r\n    checkboxes.on_click(update)\r\n    \r\n    session.loop_until_closed()\r\n\r\nOnce both are running, open a web browser on the same machine and go to http://localhost:5006/?bokeh-session-id=<session-id>, where <session-id> is the UID printed in the bokeh server log.  The browser will display a single button, and when you click on it, you'll get the following message in the browser console, where <ref-id> is the hex UID for the model:\r\n\r\n    \"Got an event for unknown model \" Object { subtype: \"Figure\", type: \"Plot\", id: \"<ref-id>\" }\r\n\r\nYou also get the error \"Bokeh: Error handling message\" with a stack trace (this is from firefox):\r\n\r\n    \"Bokeh: Error handling message \" bokeh.min.js:63:12556\r\n    Bokeh</<.jsnlog</</k</n.prototype.cerror() bokeh.min.js:63\r\n    Bokeh</<.jsnlog</</k</n.prototype.sendLogItemsConsole() bokeh.min.js:63\r\n    Bokeh</<.jsnlog</</w</i.prototype.sendBatch() bokeh.min.js:63\r\n    Bokeh</<.jsnlog</</w</i.prototype.log() bokeh.min.js:63\r\n    Bokeh</<.jsnlog</</j</t.prototype.log() bokeh.min.js:63\r\n    Bokeh</<.jsnlog</</j</t.prototype.error() bokeh.min.js:63\r\n    Bokeh</<[\"common/client\"]</r</t.prototype._on_message() bokeh.min.js:2\r\n    Bokeh</<[\"common/client\"]</r</t.prototype.connect/</</t.socket.onmessage() bokeh.min.js:1  \r\n\r\nIf you then reload the page, you will see the plot displayed correctly under the button.  If you click the button again, the same thing happens: the plot doesn't update, you get a similar log-message/stack-trace in the browser console, and once you reload a second time, you see the new plot.\r\n\r\nThis is on Bokeh 0.11.0.\r\n\r\nThanks,\r\n\r\nPeter\r\n"},"comment":{"url":"https://api.github.com/repos/bokeh/bokeh/issues/comments/227339228","html_url":"https://github.com/bokeh/bokeh/issues/3679#issuecomment-227339228","issue_url":"https://api.github.com/repos/bokeh/bokeh/issues/3679","id":227339228,"user":{"login":"bryevdv","id":1078448,"avatar_url":"https://avatars.githubusercontent.com/u/1078448?v=3","gravatar_id":"","url":"https://api.github.com/users/bryevdv","html_url":"https://github.com/bryevdv","followers_url":"https://api.github.com/users/bryevdv/followers","following_url":"https://api.github.com/users/bryevdv/following{/other_user}","gists_url":"https://api.github.com/users/bryevdv/gists{/gist_id}","starred_url":"https://api.github.com/users/bryevdv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bryevdv/subscriptions","organizations_url":"https://api.github.com/users/bryevdv/orgs","repos_url":"https://api.github.com/users/bryevdv/repos","events_url":"https://api.github.com/users/bryevdv/events{/privacy}","received_events_url":"https://api.github.com/users/bryevdv/received_events","type":"User","site_admin":false},"created_at":"2016-06-21T04:44:01Z","updated_at":"2016-06-21T04:44:01Z","body":"Also I think this was a dupe of #3546"}}
{"actor":{"display_login":"bryevdv"}}