{"action":"closed","issue":{"url":"https://api.github.com/repos/bokeh/bokeh/issues/561","labels_url":"https://api.github.com/repos/bokeh/bokeh/issues/561/labels{/name}","comments_url":"https://api.github.com/repos/bokeh/bokeh/issues/561/comments","events_url":"https://api.github.com/repos/bokeh/bokeh/issues/561/events","html_url":"https://github.com/bokeh/bokeh/issues/561","id":31989164,"number":561,"title":"Properties with defaults not considered \"changed\"","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},"labels":[{"url":"https://api.github.com/repos/bokeh/bokeh/labels/type:%20bug","name":"type: bug","color":"C02942"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/bokeh/bokeh/milestones/12","html_url":"https://github.com/bokeh/bokeh/milestones/long-term","labels_url":"https://api.github.com/repos/bokeh/bokeh/milestones/12/labels","id":811344,"number":12,"title":"long-term","description":"Collects issues that need to be resolved on a medium-to-long time frame.\r\nSuch issues may require extensive work, or possibly architectural changes. This milestone is always open and is populated from new (unmilestoned) issues.\r\n\r\nRef: https://github.com/ContinuumIO/bokeh/wiki/BEP-1:-Issues-and-PRs-management#issue-times\r\n\r\n","creator":{"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},"open_issues":88,"closed_issues":22,"state":"open","created_at":"2014-10-02T12:31:00Z","updated_at":"2015-12-15T21:24:47Z","due_on":null,"closed_at":null},"comments":14,"created_at":"2014-04-22T16:37:13Z","updated_at":"2015-12-15T21:24:47Z","closed_at":"2015-12-15T21:24:47Z","body":"Added:\r\n```\r\n    resize_plot = Bool(True)\r\n``` \r\nto `objects.Plot`, however the value does not make it to bokehjs without an explicit assignment to it in the `Plot` initializer. The reason is because:\r\n```\r\n    def vm_props(self):\r\n        \"\"\" Returns the ViewModel-related properties of this object. \"\"\"\r\n        props = self.changed_properties_with_values()\r\n        props.pop(\"session\", None)\r\n        return props\r\n``` \r\nis what happens in `PlotObject`. \r\n\r\nOne option is to always return all properties. This could be ok, but it increases the size of the generated json, and also clobbers all the bokehjs defaults. We would have to recreate the defaults we want entirely on the python side. This also breaks lots of `to_glyphspec` tests, naturally. \r\n\r\nAnother option might be to make properties with defaults always be considered \"changed\" I attempted this:\r\n```\r\ndiff --git a/bokeh/properties.py b/bokeh/properties.py\r\nindex 0492145..4326cef 100644\r\n--- a/bokeh/properties.py\r\n+++ b/bokeh/properties.py\r\n@@ -517,6 +517,14 @@ class HasProps(object):\r\n         self._changed_vars = set()\r\n \r\n         props = self.properties()\r\n+        for prop in props:\r\n+            if prop in self.__class__.__dict__:\r\n+                if self.__class__.__dict__[prop].default is not None:\r\n+                    setattr(self, prop, self.__class__.__dict__[prop].default)\r\n         for key, value in kwargs.items():\r\n             if key in props:\r\n                 setattr(self, key, value)\r\n```\r\nThis breaks fewer tests, but also breaks a some plots. Defaults for `LineProps` are now showing up as `undefined`. \r\n\r\nMaybe there are other solutions?\r\n\r\n@pzwang, @mattpap thoughts?"}}