Also, I see this code repeated in a few places. In future we should add more structure here, so that we don't repeat our selves and currently there is, in general, a lot of duplication in Bokeh. Unfortunately, CoffeeScript doesn't allow mixins, due to the underlying behavior of JavaScript, so I'm not sure what's the best design here, besides using deep, Java-like inheritance tree.