Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add bokeh to spark-notebook. Had to change responses to html instead …
…of xhtml, because bokeh contains some non-xhtml code
- Loading branch information
8b6debd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea! I didn't knew about bokeh.
It sounds like by writing the right
Codec
on the server side to publish data to the Browser world with the right shape, the notebook would leverage great visu capabilities!Would you mind creating a PR out of this fork? The changes are simple and clean but you did them.
And that's cool!
cheers
8b6debd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Glad you like it!
I think it's not quite ready for prime time yet. Unfortunately I am quite busy at the moment, but I will keep working on it.
I chose bokeh, because there is also an API in scala for it (and I find it less awkward to use then JFreeChart..): [https://github.com/bokeh/bokeh-scala]
The whole thing is a bit of a hack right now. I prepared this for demo. The cool thing is, it allows users to create plots without any knowledge of Javascript, as bokeh by default creates HTML documents. I added bokeh.js (tried to get it working in XHTML, but the minification step of the build removes the tag, AFAIK) and bokeh.css (changed the z-index of the gmap plot styles, such that they are showing in the cells)
^^ puts some dots in the ocean (there's nothing interesting at 0/0..)
What I plan to do:
Also, for common plots (Histogram, Scatter, ...) a factory method would be helpful (think python's histogram()), as even creating a simple scatter plot is still quite tedious.
The changes you made the past few days look interesting. WIll have to try it out.
Cheers
8b6debd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your ideas are pretty coll, I must say.
I had a look at bokeh-scala, it has a very good quality (code wise). The interesting thing being that it's maintained by the bokeh team itself!
Looking at the code, in orther to have reactive pattern (see JSBus) with the current architecture, some tweaks will have to be done: bokeh uses play-json, the notebook json4s.
Note: in the core lib there are some macro magics, where play json is used within strings... (hopefully they are macro so it'll complain at compile time, however it's always hard to debug macro :-D)/
I already thought migrating to play-json, but didn't had the real incentive doing it. It might be worth considering it.
For the css, yeah, that happened several time, we can manage that.
For the inclusion of the bokehjs, I see that bokeh-scala is itself wrapping a bokeh-js version, so it would be more sustainable (I guess) to stick this one.
And finally,
require.js
. It would be great to use it, bu,sadly, the initial architecture is using curljs with which I stick for the moment. But again, I wouldn't mind change that (curljs is a bit tedious to use -- lack of doc f.i.).I'd be glad if you'd consider some help from me, only even if it's discussion on "how tos".
Cheers
8b6debd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, I found you guys, because I had similar ideas as you do and integrated bokeh into the spark-notebook. I used parts of bbossys solution 👍
8b6debd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@uberwach cool ! Did you already had a chance to start a branch on that? I'd love to start one actually, based on the awesome work @bbossy already provided here!
8b6debd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andypetrella Well, look in my repository on the forked project. Actually, I merged the changes of @bbossy in there. I still have to cleanup some stuff (did it as a project in a hackathon, but I am definitely interested to work further on it).
8b6debd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool!