In short, there isn't an easy way. You could get it to work, but it will involve monkey patching bokeh on runtime or extending jupyters functionality. I guess sticking with the show command will be more efficient time wise. But it seems like a nice weekend hack to try, if you want to learn more about the inner working of your tools. :)
EDIT : or ease the pain, show(Bar(..)), also works. An if you really want, set s=show, to save 3 more characters.
Isn't repr_html() meant for this case? I just couldn't get it work, even though it would make sense that it should... :/ Chart even has this function, but somehow it still doesn't show.
The repr methods are based on the particular encoding you are trying to display. Additionally, you need to send the information you are trying to show as text. For example if you are displaying a png image you need to reading in the binary file and return the value (see examples). If you can get the html code that would be generated by the show function, then you could create a class that could automatically generate using the repr_html method.
That's the point. Chart already provides a repr_html function which - I assume - returns the HTML code that should be displayed. It still doesn't quite work :/
4
u/Arthaigo Mar 03 '17
In short, there isn't an easy way. You could get it to work, but it will involve monkey patching bokeh on runtime or extending jupyters functionality. I guess sticking with the show command will be more efficient time wise. But it seems like a nice weekend hack to try, if you want to learn more about the inner working of your tools. :)
EDIT : or ease the pain, show(Bar(..)), also works. An if you really want, set s=show, to save 3 more characters.
3
u/__andrei__ Mar 03 '17
... but why?